WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH] xen/e820: Don't mark balloon memory as E820_UNUS

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] xen/e820: Don't mark balloon memory as E820_UNUSABLE when running as guest.
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Fri, 11 Mar 2011 15:23:36 +0000
Cc: Konrad Rzeszutek Wilk <konrad@xxxxxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Fri, 11 Mar 2011 07:24:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1299789405-30802-2-git-send-email-konrad.wilk@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <1299789405-30802-1-git-send-email-konrad.wilk@xxxxxxxxxx> <1299789405-30802-2-git-send-email-konrad.wilk@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2011-03-10 at 20:36 +0000, Konrad Rzeszutek Wilk wrote:
> If we have a guest that asked for:
> 
> memory=1024
> maxmem=20448
> 
> Which means we want 1GB now, and create pagetables so that we can expand
> up to 2GB, we would have this E820 layout:
> 
> [    0.000000] BIOS-provided physical RAM map:
> [    0.000000]  Xen: 0000000000000000 - 00000000000a0000 (usable)
> [    0.000000]  Xen: 00000000000a0000 - 0000000000100000 (reserved)
> [    0.000000]  Xen: 0000000000100000 - 0000000080800000 (usable)
> 
> Due to patch: "xen/setup: Inhibit resource API from using System RAM E820 
> gaps as PCI mem gaps."
> we would mark the memory past the 1GB mark as unusuable resulting in:
> 
> [    0.000000] BIOS-provided physical RAM map:
> [    0.000000]  Xen: 0000000000000000 - 00000000000a0000 (usable)
> [    0.000000]  Xen: 00000000000a0000 - 0000000000100000 (reserved)
> [    0.000000]  Xen: 0000000000100000 - 0000000040000000 (usable)
> [    0.000000]  Xen: 0000000040000000 - 0000000080800000 (unusable)
> 
> which meant that we could not balloon up anymore. We could
> balloon the guest down. The fix is to run the code introduced
> by the above mentioned patch only for the initial domain.
> 
> We will have to revisit this once we start introducing a modified
> E820 for PCI passthrough so that we can utilize the P2M identity code.
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> ---
>  arch/x86/xen/setup.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index 2a4add9..6e676fa 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -200,7 +200,8 @@ char * __init xen_memory_setup(void)
>                        * used as potential resource for I/O address (happens
>                        * when 'allocate_resource' is called).
>                        */
> -                     if (delta && end < 0x100000000UL)
> +                     if (delta &&
> +                             (xen_initial_domain() && end < 0x100000000UL))

Not a new problem but 0x100000000 will overflow an unsigned long on 32
bit:
  CC      arch/x86/xen/setup.o
arch/x86/xen/setup.c: In function 'xen_memory_setup':
arch/x86/xen/setup.c:254: warning: integer constant is too large for 'unsigned 
long' type

I think you want ULL? (end is "unsigned long long").

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>