Skip to contentSkip to conversation

Debian Wheezy installer crashes guest when EPT is enabled

DISCUSSION Wei Liu 3 participants 9 messages Apr 18, 2014 – Apr 22, 2014

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

Hi Jan

I see in the master tree that there are many changes to EPT lately. With the current master tree (as of c82fbfe), I cannot install Debian Wheezy in HVM mode when EPT is enabled. It used to work at d2b4c27.

One particular interesting changeset is aa9114ed ("x86/EPT: force re-evaluation of memory type as necessary"), because I saw the faulting VMEXIT reason to be EXIT_REASON_EPT_MISCONFIG. But I cannot see immediate connection.

The step to reproduce is easy:
0. get an Intel EPT capable machine (I have Xeon X3450)
1. grab Xen master tree and install
2. download debian-7.2.0-amd64-CD-1.iso from any Debian mirror and install it in HVM mode, with HAP enabled
3. guest crashes soon after installer runs

If I disable HAP, then it works fine. I also tested AMD machine, it worked fine.

Not sure if this is a bug in Debian installer or Xen. Do you have any thought?

If you need more information, please let me know.

Wei.

---log--
(d2) HVM Loader
(d2) Detected Xen v4.5-unstable
(d2) Xenbus rings @0xfeffc000, event channel 4
(d2) System requested SeaBIOS
(d2) CPU speed is 2660 MHz
(d2) Relocating guest memory for lowmem MMIO space disabled (XEN) irq.c:270: Dom2 PCI link 0 changed 0 -> 5
(d2) PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:270: Dom2 PCI link 1 changed 0 -> 10
(d2) PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:270: Dom2 PCI link 2 changed 0 -> 11
(d2) PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:270: Dom2 PCI link 3 changed 0 -> 5
(d2) PCI-ISA link 3 routed to IRQ5
(d2) pci dev 01:2 INTD->IRQ5
(d2) pci dev 01:3 INTA->IRQ10
(d2) pci dev 02:0 INTA->IRQ11
(d2) pci dev 04:0 INTA->IRQ5
(d2) RAM in high memory; setting high_mem resource base to 148000000 (d2) pci dev 03:0 bar 10 size 002000000: 0f0000008
(d2) pci dev 02:0 bar 14 size 001000000: 0f2000008
(d2) pci dev 04:0 bar 30 size 000040000: 0f3000000
(d2) pci dev 03:0 bar 30 size 000010000: 0f3040000
(d2) pci dev 03:0 bar 14 size 000001000: 0f3050000
(d2) pci dev 02:0 bar 10 size 000000100: 00000c001
(d2) pci dev 04:0 bar 10 size 000000100: 00000c101
(d2) pci dev 04:0 bar 14 size 000000100: 0f3051000
(d2) pci dev 01:2 bar 20 size 000000020: 00000c201
(d2) pci dev 01:1 bar 20 size 000000010: 00000c221
(d2) Multiprocessor initialisation:
(d2) - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done. (d2) - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [2/8] ... done. (d2) Testing HVM environment:
(d2) - REP INSB across page boundaries ... passed
(d2) - GS base MSRs and SWAPGS ... passed
(d2) Passed 2 of 2 tests
(d2) Writing SMBIOS tables ...
(d2) Loading SeaBIOS ...
(d2) Creating MP tables ...
(d2) Loading ACPI ...
(d2) vm86 TSS at fc00a080
(d2) BIOS map:
(d2) 10000-100d3: Scratch space
(d2) e0000-fffff: Main BIOS
(d2) E820 table:

(d2)  [00]: 00000000:00000000 - 00000000:000a0000: RAM
(d2)  HOLE: 00000000:000a0000 - 00000000:000e0000
(d2)  [01]: 00000000:000e0000 - 00000000:00100000: RESERVED
(d2)  [02]: 00000000:00100000 - 00000000:f0000000: RAM
(d2)  HOLE: 00000000:f0000000 - 00000000:fc000000
(d2)  [03]: 00000000:fc000000 - 00000001:00000000: RESERVED
(d2)  [04]: 00000001:00000000 - 00000001:48000000: RAM

(d2) Invoking SeaBIOS ...
(d2) SeaBIOS (version rel-1.7.3.1-0-g7d9cbe6-20140214_182553-dt47) (d2)
(d2) Found Xen hypervisor signature at 40000000
(d2) xen: copy e820...
(d2) Relocating init from 0x000e3eb1 to 0xeffe2580 (size 55735)
(d2) CPU Mhz=2661
(d2) Found 8 PCI devices (max PCI bus is 00)
(d2) Allocated Xen hypercall page at effff000
(d2) Detected Xen v4.5-unstable
(d2) xen: copy BIOS tables...
(d2) Copying SMBIOS entry point from 0x00010010 to 0x000f1850
(d2) Copying MPTABLE from 0xfc001170/fc001180 to 0x000f1750
(d2) Copying PIR from 0x00010030 to 0x000f16d0
(d2) Copying ACPI RSDP from 0x000100b0 to 0x000f16a0
(d2) Using pmtimer, ioport 0xb008, freq 3579 kHz
(d2) Scan for VGA option rom
(d2) WARNING! Found unaligned PCI rom (vd=1013:00b8)
(d2) Running option rom at c000:0003
(XEN) stdvga.c:147:d2v0 entering stdvga and caching modes
(d2) Turning on vga text mode console
(d2) SeaBIOS (version rel-1.7.3.1-0-g7d9cbe6-20140214_182553-dt47) (d2) Machine UUID 2ad8c013-1a3d-4bd1-8b52-ad8954c38598
(d2) UHCI init on dev 00:01.2 (io=c200)
(d2) Found 0 lpt ports
(d2) Found 1 serial ports
(d2) ATA controller 1 at 1f0/3f4/c220 (irq 14 dev 9)
(d2) ATA controller 2 at 170/374/c228 (irq 15 dev 9)
(d2) ata0-0: QEMU HARDDISK ATA-7 Hard-Disk (10240 MiBytes)
(d2) Searching bootorder for: /pci@i0cf8/*@1,1/drive@0/disk@0
(d2) DVD/CD [ata1-0: QEMU DVD-ROM ATAPI-4 DVD/CD]
(d2) Searching bootorder for: /pci@i0cf8/*@1,1/drive@1/disk@0
(d2) PS2 keyboard initialized
(d2) All threads complete.
(d2) Scan for option roms
(d2) Running option rom at c900:0003
(d2) pmm call arg1=1
(d2) pmm call arg1=0
(d2) pmm call arg1=1
(d2) pmm call arg1=0
(d2) Searching bootorder for: /pci@i0cf8/*@4
(d2)
(d2) Press F12 for boot menu.
(d2)
(d2) Searching bootorder for: HALT
(d2) drive 0x000f1650: PCHS=16383/16/63 translation=lba LCHS=1024/255/63 s=20971520 (d2) Space available for UMB: ca000-ee800, f0000-f15f0
(d2) Returned 61440 bytes of ZoneHigh
(d2) e820 map has 7 items:

(d2)   0: 0000000000000000 - 000000000009fc00 = 1 RAM
(d2)   1: 000000000009fc00 - 00000000000a0000 = 2 RESERVED
(d2)   2: 00000000000f0000 - 0000000000100000 = 2 RESERVED
(d2)   3: 0000000000100000 - 00000000effff000 = 1 RAM
(d2)   4: 00000000effff000 - 00000000f0000000 = 2 RESERVED
(d2)   5: 00000000fc000000 - 0000000100000000 = 2 RESERVED
(d2)   6: 0000000100000000 - 0000000148000000 = 1 RAM

(d2) enter handle_19:
(d2) NULL
(d2) Booting from DVD/CD...
(d2) Booting from 0000:7c00
(XEN) stdvga.c:151:d2v0 leaving stdvga

[  261.416031] xenbr0: port 3(vif2.0-emu) entered forwarding state

(XEN) hap.c:273: d2 failed to allocate from HAP pool<G><0>vmx.c:3063:d2v0 Bad vmexit (reason 0x31) (XEN) domain_crash called from vmx.c:3064
(XEN) Domain 2 (vcpu#0) crashed on cpu#7:
(XEN) ----[ Xen-4.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 7
(XEN) RIP: 0010:[<ffffffff811b2ab2>]
(XEN) RFLAGS: 0000000000010016 CONTEXT: hvm guest

(XEN) rax: 0000000000000000   rbx: ffffffff81601d30   rcx: 000000000000003f
(XEN) rdx: 8000000000000163   rsi: ffffffff81732ba0   rdi: ffffffffff4b8000
(XEN) rbp: 00000000efffc000   rsp: ffffffff81601cd0   r8:  8000000000000163
(XEN) r9:  0000000000000000   r10: 0000000000000000   r11: 0000000000000000
(XEN) r12: ffffffffff4b8000   r13: 0000000148000000   r14: 0000000000000000
(XEN) r15: 0000000148000000   cr0: 0000000080050033   cr4: 00000000000000b0
(XEN) cr3: 0000000001605000   cr2: 0000000000000000

(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: 0010

author
#1 lore raw
Quoted 11 lines · Wei Liu

Hi Jan

I see in the master tree that there are many changes to EPT lately. With the current master tree (as of c82fbfe), I cannot install Debian Wheezy in HVM mode when EPT is enabled. It used to work at d2b4c27.

One particular interesting changeset is aa9114ed ("x86/EPT: force re-evaluation of memory type as necessary"), because I saw the faulting VMEXIT reason to be EXIT_REASON_EPT_MISCONFIG. But I cannot see immediate connection.

Quoted 7 lines

The step to reproduce is easy:
0. get an Intel EPT capable machine (I have Xeon X3450)
1. grab Xen master tree and install
2. download debian-7.2.0-amd64-CD-1.iso from any Debian mirror and install it in HVM mode, with HAP enabled
3. guest crashes soon after installer runs

... and this guest has 5000MB RAM. If RAM is set to 768MB guest doesn't crash.

Wei.

author Reviewed-by Tim Deegan Acked-by Kevin Tian
#2 lore raw
Quoted 20 lines · Wei Liu
Quoted 11 lines · Wei Liu

Hi Jan

I see in the master tree that there are many changes to EPT lately. With the current master tree (as of c82fbfe), I cannot install Debian Wheezy in HVM mode when EPT is enabled. It used to work at d2b4c27.

One particular interesting changeset is aa9114ed ("x86/EPT: force re-evaluation of memory type as necessary"), because I saw the faulting VMEXIT reason to be EXIT_REASON_EPT_MISCONFIG. But I cannot see immediate connection.

Quoted 7 lines

The step to reproduce is easy:
0. get an Intel EPT capable machine (I have Xeon X3450)
1. grab Xen master tree and install
2. download debian-7.2.0-amd64-CD-1.iso from any Debian mirror and install it in HVM mode, with HAP enabled
3. guest crashes soon after installer runs

Quoted 3 lines

... and this guest has 5000MB RAM. If RAM is set to 768MB guest doesn't crash.

FWIW I manually bisected the tree. First bad commit:

commit 4d66f069d6abacd392f1301714fdfc64dc92917b

Author: Jan Beulich <[email protected]>
Date:   Thu Apr 10 16:07:17 2014 +0200

x86: fix pinned cache attribute handling

- make sure UC- is only used for PAT purposes (MTRRs and hence EPT don't have this type)
- add order input to "get", and properly handle conflict case (forcing an EPT page split)
- properly detect (and refuse) overlaps during "set"
- properly use RCU constructs
- support deleting ranges through a special type input to "set"
- set ignore-PAT flag in epte_get_entry_emt() when "get" succeeds
- set "get" output to ~0 (invalid) rather than 0 (UC) on error (the caller shouldn't be looking at it anyway)
- move struct hvm_mem_pinned_cacheattr_range from header to C file (used only there)

Note that the code (before and after this change) implies the GFN ranges passed to the hypercall to be inclusive, which is in contrast to the sole current user in qemu (all variants). It is not clear to me at which layer (qemu, libxc, hypervisor) this would best be fixed.

Quoted 1 line

Wei.

#3 lore raw
Quoted 19 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

Wei Liu <[email protected]> 04/18/14 7:19 PM >>>

Quoted 17 lines · Wei Liu
Quoted 15 lines · Wei Liu

I see in the master tree that there are many changes to EPT lately. With the current master tree (as of c82fbfe), I cannot install Debian Wheezy in HVM mode when EPT is enabled. It used to work at d2b4c27.

One particular interesting changeset is aa9114ed ("x86/EPT: force re-evaluation of memory type as necessary"), because I saw the faulting VMEXIT reason to be EXIT_REASON_EPT_MISCONFIG. But I cannot see immediate connection.

The step to reproduce is easy:
0. get an Intel EPT capable machine (I have Xeon X3450)
1. grab Xen master tree and install
2. download debian-7.2.0-amd64-CD-1.iso from any Debian mirror and install it in HVM mode, with HAP enabled
3. guest crashes soon after installer runs

Quoted 2 lines
Quoted 2 lines

... and this guest has 5000MB RAM. If RAM is set to 768MB guest doesn't crash.

Interesting. I don't think I ever tried a guest this big, and I may have some difficulty finding a suitable box (without pushing Dom0 below 1G). Would be interesting to see whether other guests also have a problem when they're being given enough memory.

Quoted 7 lines

FWIW I manually bisected the tree. First bad commit:

commit 4d66f069d6abacd392f1301714fdfc64dc92917b

Author: Jan Beulich <[email protected]>
Date:   Thu Apr 10 16:07:17 2014 +0200

x86: fix pinned cache attribute handling

Now that's pretty surprising, I would have thought other changes are much more likely to cause problems. But wait, what your log says is that memory allocation failed - that's not as surprising in this context, since the number of page splits certainly went up with all the recent changes (and what the change here did may just have pushed it over the boundary).

Tim - any thought on the pool size and an eventual need to bump it?

Anyway, I'm going to be able to look at this in closer detail on Tuesday the earliest.

Jan

#5 lore raw
In reply to Wei Liu
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 18.04.14 at 16:08, <[email protected]> wrote:

(d2) Booting from DVD/CD...
(d2) Booting from 0000:7c00
(XEN) stdvga.c:151:d2v0 leaving stdvga

[  261.416031] xenbr0: port 3(vif2.0-emu) entered forwarding state

(XEN) hap.c:273: d2 failed to allocate from HAP pool<G><0>vmx.c:3063:d2v0 Bad vmexit (reason 0x31)
(XEN) domain_crash called from vmx.c:3064
(XEN) Domain 2 (vcpu#0) crashed on cpu#7:
(XEN) ----[ Xen-4.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 7
(XEN) RIP: 0010:[<ffffffff811b2ab2>]
(XEN) RFLAGS: 0000000000010016 CONTEXT: hvm guest

Quoted 8 lines
(XEN) rax: 0000000000000000   rbx: ffffffff81601d30   rcx: 000000000000003f
(XEN) rdx: 8000000000000163   rsi: ffffffff81732ba0   rdi: ffffffffff4b8000
(XEN) rbp: 00000000efffc000   rsp: ffffffff81601cd0   r8:  8000000000000163
(XEN) r9:  0000000000000000   r10: 0000000000000000   r11: 0000000000000000
(XEN) r12: ffffffffff4b8000   r13: 0000000148000000   r14: 0000000000000000
(XEN) r15: 0000000148000000   cr0: 0000000080050033   cr4: 00000000000000b0
(XEN) cr3: 0000000001605000   cr2: 0000000000000000

(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: 0010

Are you (or the tools you use) perhaps setting a particularly small shadow allocation size (which is what gets interpreted as the HAP pool one)? When I run a 2-vCPU guest (SLES, not Wheezy), I see
- for memory=2048 0x46 P2M pages out of a HAP pool of 0x1200
- for memory=4096 0x4d P2M pages out of a HAP pool of 0x2200
- for memory=4864 0x76 P2M pages out of a HAP pool of 0x2800 And I have no reason to believe that the numbers would dramatically change if I bumped the domain size to 5G (the system has got only 6G, and I don't want to trouble Dom0 too much). The almost doubling of the P2M page count is presumably attributed to the fact that there are not enough contiguous 2Mb pages left anymore, i.e. 4k pages (and hence more page tables) are being used.

If that's not it, or if you're not certain, would you mind giving the attached debugging patch a try?

Jan

xen/arch/x86/mm/hap/hap.c +17 -2
@@ -273,16 +273,21 @@ static struct page_info *hap_alloc_p2m_p
 
     if ( likely(pg != NULL) )
     {
+static unsigned thr;//temp
         d->arch.paging.hap.total_pages--;
         d->arch.paging.hap.p2m_pages++;
+if(d->arch.paging.hap.p2m_pages > thr) {//temp
+ thr |= d->arch.paging.hap.p2m_pages;
+ printk("d%d: p2m=%x (%x/%x)\n", d->domain_id, d->arch.paging.hap.p2m_pages, d->arch.paging.hap.free_pages, d->arch.paging.hap.total_pages);
+}
         page_set_owner(pg, d);
         pg->count_info |= 1;
     }
     else if ( !d->arch.paging.p2m_alloc_failed )
     {
         d->arch.paging.p2m_alloc_failed = 1;
-        dprintk(XENLOG_ERR, "d%i failed to allocate from HAP pool",
-                d->domain_id);
+        dprintk(XENLOG_ERR, "d%i failed to allocate from HAP pool (free=%x tot=%x p2m=%x)\n",
+                d->domain_id, d->arch.paging.hap.free_pages, d->arch.paging.hap.total_pages, d->arch.paging.hap.p2m_pages);
     }
 
     paging_unlock(d);
@@ -330,9 +335,17 @@ static unsigned int
 hap_set_allocation(struct domain *d, unsigned int pages, int *preempted)
 {
     struct page_info *pg;
+static domid_t logdom;//temp
+static unsigned logpg;//temp
 
     ASSERT(paging_locked_by_me(d));
 
+if(d->domain_id != logdom || pages != logpg) {//temp
+ logdom = d->domain_id;
+ logpg = pages;
+ printk("hsa(d%d,%x) tot=%x p2m=%x free=%x [%pS]\n", d->domain_id, pages, d->arch.paging.hap.total_pages,
+        d->arch.paging.hap.p2m_pages, d->arch.paging.hap.free_pages, __builtin_return_address(0));
+}
     if ( pages < d->arch.paging.hap.p2m_pages )
         pages = 0;
     else
@@ -378,6 +391,8 @@ hap_set_allocation(struct domain *d, uns
         }
     }
 
+printk("hsa(d%d,%x) tot=%x p2m=%x free=%x\n", d->domain_id, pages, d->arch.paging.hap.total_pages,//temp
+       d->arch.paging.hap.p2m_pages, d->arch.paging.hap.free_pages);
     return 0;
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Jan Beulich

Jan Beulich writes ("Re: Debian Wheezy installer crashes guest when EPT is enabled"):

Quoted 4 lines

Interesting. I don't think I ever tried a guest this big, and I may have some difficulty finding a suitable box (without pushing Dom0 below 1G). Would be interesting to see whether other guests also have a problem when they're being given enough memory.

FWIW you can probably push a headless Debian dom0 down to around 256Mb without trouble. All of osstest's dom0s are 512.

Ian.

author
#6 lore raw
In reply to Jan Beulich
Quoted 22 lines · Jan Beulich
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 18.04.14 at 16:08, <[email protected]> wrote:

(d2) Booting from DVD/CD...
(d2) Booting from 0000:7c00
(XEN) stdvga.c:151:d2v0 leaving stdvga

[  261.416031] xenbr0: port 3(vif2.0-emu) entered forwarding state

(XEN) hap.c:273: d2 failed to allocate from HAP pool<G><0>vmx.c:3063:d2v0 Bad vmexit (reason 0x31)
(XEN) domain_crash called from vmx.c:3064
(XEN) Domain 2 (vcpu#0) crashed on cpu#7:
(XEN) ----[ Xen-4.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 7
(XEN) RIP: 0010:[<ffffffff811b2ab2>]
(XEN) RFLAGS: 0000000000010016 CONTEXT: hvm guest

Quoted 8 lines
(XEN) rax: 0000000000000000   rbx: ffffffff81601d30   rcx: 000000000000003f
(XEN) rdx: 8000000000000163   rsi: ffffffff81732ba0   rdi: ffffffffff4b8000
(XEN) rbp: 00000000efffc000   rsp: ffffffff81601cd0   r8:  8000000000000163
(XEN) r9:  0000000000000000   r10: 0000000000000000   r11: 0000000000000000
(XEN) r12: ffffffffff4b8000   r13: 0000000148000000   r14: 0000000000000000
(XEN) r15: 0000000148000000   cr0: 0000000080050033   cr4: 00000000000000b0
(XEN) cr3: 0000000001605000   cr2: 0000000000000000

(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: 0010

Quoted 3 lines

Are you (or the tools you use) perhaps setting a particularly small shadow allocation size (which is what gets interpreted as the HAP pool one)? When I run a 2-vCPU guest (SLES, not Wheezy), I see

It should be using value calculated by toolstack. I didn't have shadow= in my config file.

Quoted 10 lines

- for memory=2048 0x46 P2M pages out of a HAP pool of 0x1200
- for memory=4096 0x4d P2M pages out of a HAP pool of 0x2200
- for memory=4864 0x76 P2M pages out of a HAP pool of 0x2800 And I have no reason to believe that the numbers would dramatically change if I bumped the domain size to 5G (the system has got only 6G, and I don't want to trouble Dom0 too much). The almost doubling of the P2M page count is presumably attributed to the fact that there are not enough contiguous 2Mb pages left anymore, i.e. 4k pages (and hence more page tables) are being used.

Quoted 2 lines

If that's not it, or if you're not certain, would you mind giving the attached debugging patch a try?

Here's the output.

(d1) NULL
(d1) Booting from DVD/CD...
(d1) Booting from 0000:7c00
(XEN) stdvga.c:151:d1v0 leaving stdvga
(XEN) d1: p2m=40 (29be/29c0)
(XEN) d1: p2m=80 (297e/2980)
(XEN) d1: p2m=100 (28fe/2900)
(XEN) d1: p2m=200 (27fe/2800)
(XEN) d1: p2m=400 (25fe/2600)
(XEN) d1: p2m=800 (21fe/2200)
(XEN) d1: p2m=1000 (19fe/1a00)
(XEN) d1: p2m=2000 (9fe/a00)
(XEN) hap.c:278: d1 failed to allocate from HAP pool (free=0 tot=2 p2m=29fe) (XEN) vmx.c:3063:d1v0 Bad vmexit (reason 0x31)
(XEN) domain_crash called from vmx.c:3064
(XEN) Domain 1 (vcpu#0) crashed on cpu#3:
(XEN) ----[ Xen-4.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 3
(XEN) RIP: 0010:[<ffffffff811b2ab2>]
(XEN) RFLAGS: 0000000000010016 CONTEXT: hvm guest

(XEN) rax: 0000000000000000   rbx: ffffffff81601d30   rcx: 000000000000003f
(XEN) rdx: 8000000000000163   rsi: ffffffff81732ba0   rdi: ffffffffff4b8000
(XEN) rbp: 00000000efffc000   rsp: ffffffff81601cd0   r8:  8000000000000163
(XEN) r9:  0000000000000000   r10: 0000000000000000   r11: 0000000000000000
(XEN) r12: ffffffffff4b8000   r13: 0000000148000000   r14: 0000000000000000
(XEN) r15: 0000000148000000   cr0: 0000000080050033   cr4: 00000000000000b0
(XEN) cr3: 0000000001605000   cr2: 0000000000000000

(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: 0010

author
#7 lore raw
Quoted 23 lines · Wei Liu
Quoted 22 lines · Jan Beulich
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 18.04.14 at 16:08, <[email protected]> wrote:

(d2) Booting from DVD/CD...
(d2) Booting from 0000:7c00
(XEN) stdvga.c:151:d2v0 leaving stdvga

[  261.416031] xenbr0: port 3(vif2.0-emu) entered forwarding state

(XEN) hap.c:273: d2 failed to allocate from HAP pool<G><0>vmx.c:3063:d2v0 Bad vmexit (reason 0x31)
(XEN) domain_crash called from vmx.c:3064
(XEN) Domain 2 (vcpu#0) crashed on cpu#7:
(XEN) ----[ Xen-4.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 7
(XEN) RIP: 0010:[<ffffffff811b2ab2>]
(XEN) RFLAGS: 0000000000010016 CONTEXT: hvm guest

(XEN) rax: 0000000000000000   rbx: ffffffff81601d30   rcx: 000000000000003f
(XEN) rdx: 8000000000000163   rsi: ffffffff81732ba0   rdi: ffffffffff4b8000
(XEN) rbp: 00000000efffc000   rsp: ffffffff81601cd0   r8:  8000000000000163
(XEN) r9:  0000000000000000   r10: 0000000000000000   r11: 0000000000000000
(XEN) r12: ffffffffff4b8000   r13: 0000000148000000   r14: 0000000000000000
(XEN) r15: 0000000148000000   cr0: 0000000080050033   cr4: 00000000000000b0
(XEN) cr3: 0000000001605000   cr2: 0000000000000000

(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: 0010

Quoted 10 lines
Quoted 3 lines

Are you (or the tools you use) perhaps setting a particularly small shadow allocation size (which is what gets interpreted as the HAP pool one)? When I run a 2-vCPU guest (SLES, not Wheezy), I see

It should be using value calculated by toolstack. I didn't have shadow= in my config file.

Quoted 3 lines

- for memory=2048 0x46 P2M pages out of a HAP pool of 0x1200
- for memory=4096 0x4d P2M pages out of a HAP pool of 0x2200
- for memory=4864 0x76 P2M pages out of a HAP pool of 0x2800

And for memory=4864

(XEN) stdvga.c:151:d1v0 leaving stdvga
(XEN) d1: p2m=40 (27be/27c0)
(XEN) d1: p2m=80 (277e/2780)
(XEN) d1: p2m=100 (26fe/2700)
(XEN) d1: p2m=200 (25fe/2600)
(XEN) d1: p2m=400 (23fe/2400)
(XEN) d1: p2m=800 (1ffe/2000)
(XEN) d1: p2m=1000 (17fe/1800)
(XEN) d1: p2m=2000 (7fe/800)
(XEN) hap.c:278: d1 failed to allocate from HAP pool (free=0 tot=2 p2m=27fe) (XEN) vmx.c:3063:d1v0 Bad vmexit (reason 0x31)
(XEN) domain_crash called from vmx.c:3064
(XEN) Domain 1 (vcpu#0) crashed on cpu#3:
(XEN) ----[ Xen-4.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 3
(XEN) RIP: 0010:[<ffffffff811b2ab2>]
(XEN) RFLAGS: 0000000000010016 CONTEXT: hvm guest

(XEN) rax: 0000000000000000   rbx: ffffffff81601d30   rcx: 000000000000003f
(XEN) rdx: 8000000000000163   rsi: ffffffff81732ba0   rdi: ffffffffff4b8000
(XEN) rbp: 00000000efffd000   rsp: ffffffff81601cd0   r8:  8000000000000163
(XEN) r9:  0000000000000000   r10: 0000000000000000   r11: 0000000000000000
(XEN) r12: ffffffffff4b8000   r13: 000000013f800000   r14: 0000000000000000
(XEN) r15: 000000013f800000   cr0: 0000000080050033   cr4: 00000000000000b0
(XEN) cr3: 0000000001605000   cr2: 0000000000000000

(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: 0010

#8 lore raw
In reply to Wei Liu
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 22.04.14 at 15:04, <[email protected]> wrote:
Quoted 2 lines · Jan Beulich

If that's not it, or if you're not certain, would you mind giving the attached debugging patch a try?

Here's the output.

Quoted 13 lines

(d1) NULL
(d1) Booting from DVD/CD...
(d1) Booting from 0000:7c00
(XEN) stdvga.c:151:d1v0 leaving stdvga
(XEN) d1: p2m=40 (29be/29c0)
(XEN) d1: p2m=80 (297e/2980)
(XEN) d1: p2m=100 (28fe/2900)
(XEN) d1: p2m=200 (27fe/2800)
(XEN) d1: p2m=400 (25fe/2600)
(XEN) d1: p2m=800 (21fe/2200)
(XEN) d1: p2m=1000 (19fe/1a00)
(XEN) d1: p2m=2000 (9fe/a00)
(XEN) hap.c:278: d1 failed to allocate from HAP pool (free=0 tot=2 p2m=29fe)

Hmm, so it's really eating up all the memory. Looks very much like a leak, just that so far I haven't been able to spot it. I'm downloading the 7.4 image right now in the hope that it exposes the issue as much as the 7.2 one does for you. If that doesn't work out, I'll have to ask for your help again with a further extended debugging patch.

Jan