All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Tripathy <jonnyt@abpni.co.uk>
To: xen-devel@lists.xen.org
Subject: Re: Can't see more than 3.5GB of RAM / UEFI / no e820 memory map detected
Date: Tue, 28 Aug 2012 23:05:54 +0100	[thread overview]
Message-ID: <503D40C2.6040407@abpni.co.uk> (raw)
In-Reply-To: <503D3DA8.3070002@abpni.co.uk>

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@abpni.co.uk> wrote:
>>>
>>>> Keir Fraser wrote:
>>>>> On 28/08/2012 20:36, "Jonathan Tripathy" <jonnyt@abpni.co.uk> 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@lists.xen.org
> 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.

  reply	other threads:[~2012-08-28 22:05 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <50356E43.3030208@abpni.co.uk>
2012-08-22 23:48 ` Can't see more than 3.5GB of RAM Jonathan Tripathy
2012-08-23  0:11   ` Jonathan Tripathy
2012-08-23  6:06   ` Can't see more than 3.5GB of RAM / UEFI / no e820 memory map detected Pasi Kärkkäinen
2012-08-23  7:22     ` Pasi Kärkkäinen
2012-08-23  7:27       ` Jonathan Tripathy
2012-08-23  7:39         ` Jan Beulich
2012-08-23  8:07           ` Jonathan Tripathy
2012-08-24 15:35             ` Jan Beulich
2012-08-24 17:39               ` Jonathan Tripathy
2012-08-24 20:05                 ` Keir Fraser
2012-08-28 19:36                   ` Jonathan Tripathy
2012-08-28 21:10                     ` Keir Fraser
2012-08-28 21:13                       ` Jonathan Tripathy
2012-08-28 21:37                         ` Keir Fraser
2012-08-28 21:41                         ` Keir Fraser
2012-08-28 21:50                           ` Jonathan Tripathy
2012-08-28 21:52                             ` Jonathan Tripathy
2012-08-28 22:05                               ` Jonathan Tripathy [this message]
2012-08-28 22:31                             ` Keir Fraser
2012-08-28 22:33                               ` Jonathan Tripathy
2012-08-23  8:12         ` Keir Fraser
2012-08-23  8:28           ` Jonathan Tripathy
2012-08-23  8:43             ` Keir Fraser
2012-08-23  8:49               ` Ian Campbell
2012-08-23  8:58               ` Jonathan Tripathy
2012-08-23  9:43                 ` Keir Fraser
2012-08-23  9:13             ` Pasi Kärkkäinen
2012-08-23  9:50 Jonathan Tripathy
2012-08-23 11:17 ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=503D40C2.6040407@abpni.co.uk \
    --to=jonnyt@abpni.co.uk \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.