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

Re: [Xen-devel] Can't see more than 3.5GB of RAM / UEFI / no e820 memory map detected


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Jonathan Tripathy <jonnyt@xxxxxxxxxxx>
  • Date: Tue, 28 Aug 2012 23:05:54 +0100
  • Delivery-date: Tue, 28 Aug 2012 22:06:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 28/08/2012 22:52, Jonathan Tripathy wrote:
On 28/08/2012 22:50, Jonathan Tripathy wrote:


On 28/08/2012 22:41, Keir Fraser wrote:
On 28/08/2012 22:13, "Jonathan Tripathy" <jonnyt@xxxxxxxxxxx> wrote:

Keir Fraser wrote:
On 28/08/2012 20:36, "Jonathan Tripathy" <jonnyt@xxxxxxxxxxx> wrote:

Thanks for the clarification.

So from a security/reliability standpoint, nothing will be affected by
flipping the if block?
It should simply make it more likely that Xen sees all your RAM. ;)

    -- Keir


Hi Everyone,

I reversed the if block in setup.c and now my server can see the full 32GB of RAM. I haven't submitted a patch yet as we have run into another
(possibly unrelated to xen) issue with this server build that we are
working on. Once we complete our full testing, a patch will be submitted :)
In this case, I will re-make the patch myself and check it in. Since it is a
trivial one.

    Thanks,
   Keir
Thanks Keir
Now done. xen-unstable:25786

  -- Keir
Hi Keir,

Thanks for doing that. However, the ordering of the if block in my code that I used was slightly different from your commit. Perhaps this doesn't make too much of a difference?

Thanks

Ooops, typo'd the code (I had to recreate the changes as I deleted my source tree). Here is the version I used:

if ( mbi->flags & MBI_MEMMAP )
    {
        memmap_type = "Multiboot-e820";
        while ( (bytes < mbi->mmap_length) && (e820_raw_nr < E820MAX) )
        {
            memory_map_t *map = __va(mbi->mmap_addr + bytes);

            /*
* This is a gross workaround for a BIOS bug. Some bootloaders do
             * not write e820 map entries into pre-zeroed memory. This is
             * okay if the BIOS fills in all fields of the map entry, but
             * some broken BIOSes do not bother to write the high word of
             * the length field if the length is smaller than 4GB. We
             * detect and fix this by flagging sections below 4GB that
             * appear to be larger than 4GB in size.
             */
            if ( (map->base_addr_high == 0) && (map->length_high != 0) )
            {
                if ( !e820_warn )
                {
                    printk("WARNING: Buggy e820 map detected and fixed "
                           "(truncated length fields).\n");
                    e820_warn = 1;
                }
                map->length_high = 0;
            }

            e820_raw[e820_raw_nr].addr =
((u64)map->base_addr_high << 32) | (u64)map->base_addr_low;
            e820_raw[e820_raw_nr].size =
                ((u64)map->length_high << 32) | (u64)map->length_low;
            e820_raw[e820_raw_nr].type = map->type;
            e820_raw_nr++;

            bytes += map->size + 4;
        }
    }
    else if ( mbi->flags & MBI_MEMLIMITS )
    {
        memmap_type = "Multiboot-e801";
        e820_raw[0].addr = 0;
        e820_raw[0].size = mbi->mem_lower << 10;
        e820_raw[0].type = E820_RAM;
        e820_raw[1].addr = 0x100000;
        e820_raw[1].size = mbi->mem_upper << 10;
        e820_raw[1].type = E820_RAM;
        e820_raw_nr = 2;
    }
    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;
    }
    else
    {
        EARLY_FAIL("Bootloader provided no memory information.\n");
    }


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
Anyway, question is moot. I rebuilt my code using your ordering of the if block and it works just fine. All 32GB is detected. I actually agree with your order because as you as, 801 is outdated.


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


 


Rackspace

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