xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Andy Burns <xen.lists@burns.me.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: Re: [Xen-users] Continuing BUG:-iness booting Fedora Rawhide 3.1.0-rc's (was Summary: Experiences setting up a debug serial port)
Date: Wed, 21 Sep 2011 14:03:13 -0400	[thread overview]
Message-ID: <20110921180313.GB17357@phenom.oracle.com> (raw)
In-Reply-To: <CAE1-PRdQ37dg6BX+1JGA2mvviNu8t-iAZHVoDKrvg53H_jyztw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4040 bytes --]

> [    0.615589] usbcore: registered new interface driver hub
> [    0.615589] usbcore: registered new device driver usb
> [    0.615948] PCI: Using ACPI for IRQ routing
> (XEN) mm.c:4976:d0 Global bit is set to kernel page fffff81b8e
> (XEN) mm.c:4976:d0 Global bit is set to kernel page fffff81b8e
> (XEN) mm.c:4976:d0 Global bit is set to kernel page fffff81118
> (XEN) mm.c:4976:d0 Global bit is set to kernel page fffff81117
> (XEN) domain_crash_sync called from entry.S
> (XEN) Domain 0 (vcpu#0) crashed on cpu#0:
> (XEN) ----[ Xen-4.1.1  x86_64  debug=n  Not tainted ]----
> (XEN) CPU:    0
> (XEN) RIP:    e033:[<ffffffff81118d96>]
> (XEN) RFLAGS: 0000000000010282   EM: 0   CONTEXT: pv guest
> (XEN) rax: 0000000000000080   rbx: ffff880163985480   rcx: 0000000000000040
> (XEN) rdx: 0040000000000080   rsi: ffff880163985480   rdi: ffff880163985480
> (XEN) rbp: ffff880163dfaff0   rsp: ffff880163dfafd0   r8:  0000001373ffffff
> (XEN) r9:  ffffffff81b8e7fd   r10: 0000ffff00066c0a   r11: 0000000080000000
> (XEN) r12: ffffffff81a1cbd0   r13: ffffffff81b8e7fd   r14: 0000001000000000
> (XEN) r15: ffffffff81a1cbd0   cr0: 000000008005003b   cr4: 00000000000026f0
> (XEN) cr3: 0000000221a05000   cr2: 000000137400002f
> (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: e02b   cs: e033

That is fixed in the latest Linus tree. You might need this patch as well:
(also attached)

commit e3b73c4a25e9a5705b4ef28b91676caf01f9bc9f
Author: David Vrabel <david.vrabel@citrix.com>
Date:   Tue Sep 13 10:17:32 2011 -0400

    xen/e820: if there is no dom0_mem=, don't tweak extra_pages.
    
    The patch "xen: use maximum reservation to limit amount of usable RAM"
    (d312ae878b6aed3912e1acaaf5d0b2a9d08a4f11) breaks machines that
    do not use 'dom0_mem=' argument with:
    
    reserve RAM buffer: 000000133f2e2000 - 000000133fffffff
    (XEN) mm.c:4976:d0 Global bit is set to kernel page fffff8117e
    (XEN) domain_crash_sync called from entry.S
    (XEN) Domain 0 (vcpu#0) crashed on cpu#0:
    ...
    
    The reason being that the last E820 entry is created using the
    'extra_pages' (which is based on how many pages have been freed).
    The mentioned git commit sets the initial value of 'extra_pages'
    using a hypercall which returns the number of pages (if dom0_mem
    has been used) or -1 otherwise. If the later we return with
    MAX_DOMAIN_PAGES as basis for calculation:
    
        return min(max_pages, MAX_DOMAIN_PAGES);
    
    and use it:
    
         extra_limit = xen_get_max_pages();
         if (extra_limit >= max_pfn)
                 extra_pages = extra_limit - max_pfn;
         else
                 extra_pages = 0;
    
    which means we end up with extra_pages = 128GB in PFNs (33554432)
    - 8GB in PFNs (2097152, on this specific box, can be larger or smaller),
    and then we add that value to the E820 making it:
    
      Xen: 00000000ff000000 - 0000000100000000 (reserved)
      Xen: 0000000100000000 - 000000133f2e2000 (usable)
    
    which is clearly wrong. It should look as so:
    
      Xen: 00000000ff000000 - 0000000100000000 (reserved)
      Xen: 0000000100000000 - 000000027fbda000 (usable)
    
    Naturally this problem does not present itself if dom0_mem=max:X
    is used.
    
    CC: stable@kernel.org
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index ff3dfa1..09688eb 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -305,10 +305,12 @@ char * __init xen_memory_setup(void)
 	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
 
 	extra_limit = xen_get_max_pages();
-	if (extra_limit >= max_pfn)
-		extra_pages = extra_limit - max_pfn;
-	else
-		extra_pages = 0;
+	if (max_pfn + extra_pages > extra_limit) {
+		if (extra_limit > max_pfn)
+			extra_pages = extra_limit - max_pfn;
+		else
+			extra_pages = 0;
+	}
 
 	extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820);
 

[-- Attachment #2: e3b73c4a25e9a5705b4ef28b91676caf01f9bc9f.patch --]
[-- Type: text/x-diff, Size: 2652 bytes --]

commit e3b73c4a25e9a5705b4ef28b91676caf01f9bc9f
Author: David Vrabel <david.vrabel@citrix.com>
Date:   Tue Sep 13 10:17:32 2011 -0400

    xen/e820: if there is no dom0_mem=, don't tweak extra_pages.
    
    The patch "xen: use maximum reservation to limit amount of usable RAM"
    (d312ae878b6aed3912e1acaaf5d0b2a9d08a4f11) breaks machines that
    do not use 'dom0_mem=' argument with:
    
    reserve RAM buffer: 000000133f2e2000 - 000000133fffffff
    (XEN) mm.c:4976:d0 Global bit is set to kernel page fffff8117e
    (XEN) domain_crash_sync called from entry.S
    (XEN) Domain 0 (vcpu#0) crashed on cpu#0:
    ...
    
    The reason being that the last E820 entry is created using the
    'extra_pages' (which is based on how many pages have been freed).
    The mentioned git commit sets the initial value of 'extra_pages'
    using a hypercall which returns the number of pages (if dom0_mem
    has been used) or -1 otherwise. If the later we return with
    MAX_DOMAIN_PAGES as basis for calculation:
    
        return min(max_pages, MAX_DOMAIN_PAGES);
    
    and use it:
    
         extra_limit = xen_get_max_pages();
         if (extra_limit >= max_pfn)
                 extra_pages = extra_limit - max_pfn;
         else
                 extra_pages = 0;
    
    which means we end up with extra_pages = 128GB in PFNs (33554432)
    - 8GB in PFNs (2097152, on this specific box, can be larger or smaller),
    and then we add that value to the E820 making it:
    
      Xen: 00000000ff000000 - 0000000100000000 (reserved)
      Xen: 0000000100000000 - 000000133f2e2000 (usable)
    
    which is clearly wrong. It should look as so:
    
      Xen: 00000000ff000000 - 0000000100000000 (reserved)
      Xen: 0000000100000000 - 000000027fbda000 (usable)
    
    Naturally this problem does not present itself if dom0_mem=max:X
    is used.
    
    CC: stable@kernel.org
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index ff3dfa1..09688eb 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -305,10 +305,12 @@ char * __init xen_memory_setup(void)
 	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
 
 	extra_limit = xen_get_max_pages();
-	if (extra_limit >= max_pfn)
-		extra_pages = extra_limit - max_pfn;
-	else
-		extra_pages = 0;
+	if (max_pfn + extra_pages > extra_limit) {
+		if (extra_limit > max_pfn)
+			extra_pages = extra_limit - max_pfn;
+		else
+			extra_pages = 0;
+	}
 
 	extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

  parent reply	other threads:[~2011-09-21 18:03 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201107231426.56811.jim_burn@bellsouth.net>
     [not found] ` <201107251548.19324.jim_burn@bellsouth.net>
     [not found]   ` <20110725195723.GM32373@reaktio.net>
     [not found]     ` <201107251639.17471.jim_burn@bellsouth.net>
2011-07-25 21:05       ` Updating Xen 4.1.x xmexamples files (vfb line required for HVM guests) Pasi Kärkkäinen
2011-07-26 15:39         ` Ian Campbell
2011-07-26 17:00           ` Pasi Kärkkäinen
2011-07-26 22:20             ` [Xen-devel] " jim burns
2011-08-01 21:12               ` Pasi Kärkkäinen
2011-08-01 23:06                 ` Re: [Xen-devel] " jim burns
2011-08-02  5:04                   ` [Xen-users] Re: " Boris Derzhavets
2011-08-02  9:38                     ` Re: [Xen-devel] " jim burns
2011-08-02 13:07                       ` [Xen-users] " Boris Derzhavets
2011-08-02 17:13                         ` Pasi Kärkkäinen
2011-08-02 17:17                         ` Konrad Rzeszutek Wilk
2011-08-02 17:37                           ` M A Young
2011-08-02 21:57                             ` Re: Re: [Xen-devel] " jim burns
2011-08-03  1:05                               ` Re: [Xen-users] " Boris Derzhavets
2011-08-03  1:33                                 ` Re: Re: Re: [Xen-devel] " jim burns
2011-08-02 17:42                           ` [Xen-users] " M A Young
2011-08-02 18:34                             ` Re: [Xen-devel] " Boris Derzhavets
2011-08-02 18:39                               ` [Xen-users] " Boris Derzhavets
2011-08-02 19:03                                 ` Konrad Rzeszutek Wilk
2011-08-02 19:37                                   ` Attempt to load kernel 2.6.40-4.fc15.x86_64 under Xen 4.1.1 on Fedora 15 Boris Derzhavets
2011-08-02 19:55                                     ` Pasi Kärkkäinen
2011-08-03  0:55                                       ` [Xen-devel] " Boris Derzhavets
2011-08-02 17:13                       ` [Xen-users] Re: Updating Xen 4.1.x xmexamples files (vfb line required for HVM guests) Pasi Kärkkäinen
2011-09-26 14:42           ` Konrad Rzeszutek Wilk
     [not found] ` <1816797.G1BumNNXCy@dell4550>
     [not found]   ` <CAMrPLWKoenO5p3BJDU9KMb4y1qcMR3hcAgtss2bdbX_wKnfwZg@mail.gmail.com>
     [not found]     ` <3588908.GoxUj34Eqr@dell4550>
2011-09-09 13:14       ` [Fedora-xen] Continuing BUG:-iness booting Fedora Rawhide 3.1.0-rc's (was Summary: Experiences setting up a debug serial port) Pasi Kärkkäinen
2011-09-09 13:52         ` jim burns
2011-09-12  7:36           ` Pasi Kärkkäinen
2011-09-12 20:07             ` jim burns
2011-09-13  8:55               ` [Fedora-xen] [Xen-users] " Pasi Kärkkäinen
2011-09-13 23:50                 ` [Xen-users] " jim burns
2011-09-14  1:44                   ` jim burns
2011-09-14  9:08                   ` [Fedora-xen] [Xen-devel] " Konrad Rzeszutek Wilk
2011-09-14 10:57                     ` Konrad Rzeszutek Wilk
2011-09-14 20:18                       ` Andy Burns
2011-09-18  8:08                         ` Andy Burns
2011-09-18 10:33                           ` Andy Burns
2011-09-18 10:46                             ` Andy Burns
2011-09-18 14:03                               ` Andy Burns
2011-09-18 14:54                                 ` Andy Burns
2011-09-21 18:03                           ` Konrad Rzeszutek Wilk [this message]
2011-09-21 19:43                             ` Andy Burns
2011-09-22 20:15                               ` Andy Burns
2011-09-22 20:21                                 ` Konrad Rzeszutek Wilk
2011-09-14 21:07                       ` jim burns
2011-09-14 22:12                         ` [Fedora-xen] [Xen-devel] " Konrad Rzeszutek Wilk
2011-09-14 23:05                           ` [Xen-devel] " jim burns
2011-09-14 23:38                           ` [Fedora-xen] [Xen-devel] Re: [Xen-users] " M A Young
2011-09-15  1:18                             ` [Fedora-xen] " jim burns
2011-09-15 15:20                               ` [Fedora-xen] [Xen-devel] " Konrad Rzeszutek Wilk
2011-09-15  7:53                             ` [Fedora-xen] " Konrad Rzeszutek Wilk
2011-09-16 14:55                               ` [Fedora-xen] [Xen-devel] " jim burns
2011-09-16 17:38                                 ` [Fedora-xen] [Xen-devel] Re: [Xen-users] " Konrad Rzeszutek Wilk
2011-09-16 20:06                                   ` [Fedora-xen] [Xen-devel] " jim burns
2011-09-16 22:42                                     ` [Fedora-xen] Re: [Xen-users] " jim burns
2011-09-23 17:33                                       ` jim burns
2011-09-26  7:22                                         ` Andy Burns

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=20110921180313.GB17357@phenom.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen.lists@burns.me.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).