[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Xen EFI boot how to?



I have experienced the same memory issue where it uses some some default e820 map giving me access to only 511MB of my 12GB.  I have implemented the above patch by modifying the source at "xen/arch/x86/setup.c", and this has resolved my memory mapping problems.  I am using consumer hardware, but I thought I should share my experience since it is relative.

Something similar to this (may have changed with more recent revisions of the code):
#if 0
    else if ( e820_raw_nr != 0 )
    {
        memmap_type = "Xen-e820";
    }
    else if ( bootsym(lowmem_kb) )
    {
        memmap_type = "Xen-e801";
        e820_raw[0].addr = 0;
        e820_raw[0].size = bootsym(lowmem_kb) << 10;
        e820_raw[0].type = E820_RAM;
        e820_raw[1].addr = 0x100000;
        e820_raw[1].size = bootsym(highmem_kb) << 10;
        e820_raw[1].type = E820_RAM;
        e820_raw_nr = 2;
    }
#endif
I have applied this change successfully to over 20 revisions of Xen 4.2, I don't know what the repercussions might be to systems that actually use that code however.


On Mon, Jul 2, 2012 at 10:52 AM, Shriram Rajagopalan <rshriram@xxxxxxxxx> wrote:
On Mon, Jul 2, 2012 at 9:23 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
On Mon, 2012-07-02 at 14:09 +0100, Shriram Rajagopalan wrote:
> I have a IBM System x3600 series server with UEFI.
>  I managed to compile the xen EFI (xen-4.2-unstable.efi).
> The machine is currently running Ubuntu with grub2.
> I can see a grubx64.efi in /boot/efi/EFI/ubuntu/grubx64.efi
> Where should I put the xen efi ?
> I tried creating a efi/EFI/xen/xen-4.2-unstable.efi and added it as a boot option using efibootmgr.
> All I get in that case is a blank screen.
> I had to go into the UEFI bios menu to delete that option in order to boot
> the system via the usual grub.

Not sure if you've seen this but some EFI docs were committed last week,
maybe they help?

http://xenbits.xen.org/docs/unstable/misc/efi.html



Thanks for the pointer Ian!. That answers a bunch of questions.

I still have a couple of questions:

1. EFI_VENDOR 

On my machine, I have /boot/efi/EFI/ubuntu/grubx64.efi
Does this mean I should set the EFI_VENDOR to 'EFI/xen' ?

I once tried to simply (dumb!) create the EFI/xen directory and
dropped the xen-4.2-unstable.efi on that folder, added that folder
as one of the EFI boot options, via the efibootmgr program.

2. Config file

 The doc says that the binary requires a config file. Should this
config file be placed in the same target folder (i.e. /boot/efi/EFI/xen/xen-4.2-unstable.cfg) ?

"One can override this with a command line option (-cfg=<filename>" 
 What command is this referring to ?

3. Location of Kernel files
 
Can they be in their usual /boot/vmlinuz.. location or should they also be placed
in the same folder as the efi ?

 

Errata:
@jacek:
  I have tried booting xen with the usual grub option. I get 
"Not enough memory to relocate dom0 kernel". When I searched online, this seemed
to be a bug with RHEL/IBM SystemX machines. However, the fixes pointed to changing
some boot orders, etc which dont apply to my machine IMO.

so, on a limb, I applied a patch  from a serverfault.com post (modded to xen-4.2):
Patch below for reference.


This one allowed me to boot into xen finally, via the grub option. Unfortunately, xen only sees 1 CPU
on a 16-core machine (dual socket). What a bummer. It just says
(XEN) Multiboot-e820 RAM map:
(XEN)  0000000000000000 - 000000000006c000 (usable)
(XEN)  000000000006c000 - 000000000006d000 (ACPI NVS)
(XEN)  000000000006d000 - 000000000009f000 (usable)
(XEN)  000000000009f000 - 00000000000a0000 (ACPI NVS)
(XEN)  0000000000100000 - 000000007c11d000 (usable)
(XEN)  000000007c11d000 - 000000007ec92000 (reserved)
(XEN)  000000007ec92000 - 000000007f7bf000 (ACPI NVS)
(XEN)  000000007f7bf000 - 000000007f7ff000 (ACPI data)
(XEN)  000000007f7ff000 - 000000007f800000 (usable)
(XEN)  0000000080000000 - 0000000090000000 (reserved)
(XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
(XEN)  00000000ff800000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 0000001080000000 (usable)
(XEN) ACPI Error (tbxfroot-0218): A valid RSDP was not found [20070126]

===

diff -r c6c9d20963d7 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Tue Jun 26 17:00:20 2012 +0100
+++ b/xen/arch/x86/setup.c      Mon Jul 02 02:06:30 2012 -0400
@@ -667,6 +667,7 @@
     if ( ((unsigned long)cpu0_stack & (STACK_SIZE-1)) != 0 )
         EARLY_FAIL("Misaligned CPU0 stack.\n");
 
+#if 0
     if ( efi_enabled )
     {
         set_pdx_range(xen_phys_start >> PAGE_SHIFT,
@@ -684,6 +685,7 @@
 
         memmap_type = loader;
     }
+    /* disable raw e801 and e820 for now in favor of multiboot provided maps */
     else if ( e820_raw_nr != 0 )
     {
         memmap_type = "Xen-e820";
@@ -699,7 +701,10 @@
         e820_raw[1].type = E820_RAM;
         e820_raw_nr = 2;
     }
-    else if ( mbi->flags & MBI_MEMMAP )
+    else
+#endif
+
+    if ( mbi->flags & MBI_MEMMAP )
     {
         memmap_type = "Multiboot-e820";
         while ( (bytes < mbi->mmap_length) && (e820_raw_nr < E820MAX) )



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.