lhype on 2.6.20-rc2: Guest didn't handle trap 6 at c071b594 (cr2=00000000, err=0)
Subsystems (2)
Hi everybody,
Attracted by the puppies, I'm trying to run lhype. The patch applies cleanly to 2.6.20-rc2, my .config is in accord with lhype.txt, but when I try to launch an instance, I get this:
$ sudo drivers/lhype/lhype_add 64m 0 vmlinux --tunnet=192.168.19.1 --block=linux.img root=/dev/lhba lhype_add: Failed to get DMA buffer from 0xb7fff008: No such file or directory lhype_add: network: no dma buffer!: No such file or directory lhype_add: Running guest failed: No such file or directory
When I subsequently retry, I get the same, but third and following tries only give:
lhype_add: Running guest failed: No such file or directory
$ dmesg | tail lhype: mapped hypervisor at ffc00000 (...) Guest didn't handle trap 6 at c071b594 (cr2=00000000,err=0) Guest 0 dead drivers/lhype/init.c:424
$ file linux.img linux.img: x86 boot sector, LInux i386 boot LOader
$ file vmlinux vmlinux: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
Any clues? I think I've followed lhype.txt to the letter.
Thanks!
Signature · 2 lines
http://www.PowerDNS.com Open source, database driven DNS Software http://netherlabs.nl Open and Closed source services
Quoted 22 lines · bert hubert
Hi everybody,
Attracted by the puppies, I'm trying to run lhype. The patch applies cleanly to 2.6.20-rc2, my .config is in accord with lhype.txt, but when I try to launch an instance, I get this:
$ sudo drivers/lhype/lhype_add 64m 0 vmlinux --tunnet=192.168.19.1 --block=linux.img root=/dev/lhba lhype_add: Failed to get DMA buffer from 0xb7fff008: No such file or directory lhype_add: network: no dma buffer!: No such file or directory lhype_add: Running guest failed: No such file or directoryWhen I subsequently retry, I get the same, but third and following tries only give:
lhype_add: Running guest failed: No such file or directory$ dmesg | tail lhype: mapped hypervisor at ffc00000 (...) Guest didn't handle trap 6 at c071b594 (cr2=00000000,err=0) Guest 0 dead drivers/lhype/init.c:424
Quoted 8 lines
$ file linux.img linux.img: x86 boot sector, LInux i386 boot LOader$ file vmlinux vmlinux: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not strippedAny clues? I think I've followed lhype.txt to the letter.
Well, I'm not an lhype expert, but the messages indicate a #UD, likely a BUG_ON assertion firing somewhere. I'd try tracking down what function was at c071b594 in your kernel and look for assertions there and also at drivers/lhype/init.c to see what might have gone wrong.
Zach
Re: lhype on 2.6.20-rc2: Guest didn't handle trap 6 at c071b594 (cr2=00000000,err=0)
In reply to bert hubertQuoted 14 lines · bert hubert
Hi everybody,
Attracted by the puppies, I'm trying to run lhype. The patch applies cleanly to 2.6.20-rc2, my .config is in accord with lhype.txt, but when I try to launch an instance, I get this:
$ sudo drivers/lhype/lhype_add 64m 0 vmlinux --tunnet=192.168.19.1 --block=linux.img root=/dev/lhba lhype_add: Failed to get DMA buffer from 0xb7fff008: No such file or directory lhype_add: network: no dma buffer!: No such file or directory lhype_add: Running guest failed: No such file or directoryWhen I subsequently retry, I get the same, but third and following tries only give:
Quoted 7 lines
lhype_add: Running guest failed: No such file or directory$ dmesg | tail lhype: mapped hypervisor at ffc00000 (...) Guest didn't handle trap 6 at c071b594 (cr2=00000000,err=0) Guest 0 dead drivers/lhype/init.c:424
Hi Bert!
Ah, this is your clue, here: looks like the kernel ran BUG() or
otherwise failed at address 0xc071b594... can you send your .config and I can see if I can reproduce? Your System.map should indicate what's at that address, to...
I should really try to read out the BUG info in this case; I'll patch
something up today (I'm chasing James Morris' initrd bug at the moment).
Thanks!
Rusty.
Quoted 4 lines · Rusty Russell
Ah, this is your clue, here: looks like the kernel ran
BUG()or
otherwise failed at address0xc071b594... can you send your .config and I can see if I can reproduce? Your System.map should indicate what's at that address, to...
c071b562 T bootmem_bootmap_pagesc071b571 t get_mapsizec071b588 t reserve_bootmem_corec071b5e2 t free_bootmem_core
With some gdb trickery, this appears to be line 124 of mm/bootmem.c:
114 static void __init reserve_bootmem_core(bootmem_data_t *bdata, unsigned long addr,
115 unsigned long size)
116 {
117 unsigned long sidx, eidx;
118 unsigned long i;
119
120 /*
121 * round up, partially reserved pages are considered 122 * fully reserved. 123 */
124 BUG_ON(!size);
Attached is config.gz. Thanks Rusty!
Signature · 2 lines
http://www.PowerDNS.com Open source, database driven DNS Software http://netherlabs.nl Open and Closed source services
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/virtualization
Re: lhype on 2.6.20-rc2: Guest didn't handle trap 6 at c071b594 (cr2=00000000,err=0)
Quoted 7 lines · bert hubert
Quoted 4 lines · Rusty Russell
Ah, this is your clue, here: looks like the kernel ran
BUG()or
otherwise failed at address0xc071b594... can you send your .config and I can see if I can reproduce? Your System.map should indicate what's at that address, to...
Quoted 6 lines
c071b562Tbootmem_bootmap_pagesc071b571tget_mapsizec071b588treserve_bootmem_corec071b5e2tfree_bootmem_coreWith some gdb trickery, this appears to be line 124 of
mm/bootmem.c:
Yep, my bad... As a bonus, your config also found a paravirt problem in the raid code (patch sent upstream, and attached below).
Here's the two-liner patch (already rolled into the lhype.patch, so you can simply update).
Thanks very much for the bug report!
Rusty.
arch/i386/kernel/lhype.c +10 -8
@@ -446,14 +446,16 @@ static __attribute_used__ __init void lh acpi_disabled =1 ; acpi_ht =0 ;#endif - -INITRD_START = init_pg_tables_end; -INITRD_SIZE = lhype_page.initrd_size; -LOADER_TYPE = (LHYPE_LOADER_TYPE <<4 ) |LHYPE_LOADER_VERSION ; - -/* Bootmem puts allocator bitmap immediately after boot page tables, -so tell it pagetables cover this, too. */ - init_pg_tables_end += lhype_page.initrd_size; +if (lhype_page.initrd_size) { +INITRD_START = init_pg_tables_end; +INITRD_SIZE = lhype_page.initrd_size; +LOADER_TYPE = (LHYPE_LOADER_TYPE <<4 ) |LHYPE_LOADER_VERSION ; + +/* Bootmem puts allocator bitmap immediately after +boot page tables, so tell it pagetables cover this, too. */ + init_pg_tables_end += lhype_page.initrd_size; + } +start_kernel (); }
Use correct macros in raid code, not raw asm.
This make sure it's paravirtualized correctly when CONFIG_PARAVIRT=y.
drivers/md/raid6x86.h +3 -2
@@ -75,13 +75,14 @@ static inline unsigned long raid6_get_fpunsigned long cr0;preempt_disable (); - asmvolatile ("mov %%cr0,%0 ; clts" :"=r" (cr0)); + cr0 =read_cr0 (); +clts ();return cr0; }static inline void raid6_put_fpu (unsigned long cr0) { - asmvolatile ("mov %0,%%cr0" : :"r" (cr0)); +write_cr0 (cr0);preempt_enable (); }
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/virtualization
Quoted 2 lines · Rusty Russell
Here's the two-liner patch (already rolled into the lhype.patch, so you can simply update).
We're getting further, but no cigar yet!
I now get this:
[ 0.760000] PCI: System does not support PCI [ 0.760000] PCI: System does not support PCI lhype_add: Failed to get DMA buffer from 0xb7fff008: No such file or directory lhype_add: network: no dma buffer!: No such file or directory [ 0.820000] NET: Registered protocol family 2 [ 0.820000] invalid opcode: 0000 [#1] [ 0.820000] Modules linked in: [ 0.820000] CPU: 0 [ 0.820000] EIP: 0061:[<c0101223>] Not tainted VLI [ 0.820000] EFLAGS: 00010246 (2.6.20-rc2 #0) [ 0.820000] EIP is at mwait_idle_with_hints+0x1e/0x3a [ 0.820000] eax: c0704008 ebx: 00000000 ecx: 00000000 edx: 00000000 [ 0.820000] esi: 00000000 edi: c0704008 ebp: 4c687970 esp: c0705f74 [ 0.820000] ds: 007b es: 007b ss: 0069 [ 0.820000] Process swapper (pid: 0, ti=c0704000 task=c066c420 task.ti=c0704000) [ 0.820000] Stack: 00000000 c075502c c074a120 c0101333 c07066e1 c05d6677 c07061b8 c074a120 [ 0.820000] c074b320 c0715522 00000000 00000000 00755000 00000001 00000000 00000000 [ 0.820000] c074a120 c075502c 00000100 c075501c c074a020 92000000 0000000f c0670120 [ 0.820000] Call Trace: [ 0.820000] [<c0101333>] cpu_idle+0x39/0x4e [ 0.820000] [<c07066e1>] start_kernel+0x327/0x32b [ 0.820000] [<c07061b8>] unknown_bootoption+0x0/0x202 [ 0.820000] [<c0715522>] lhype_init+0x37d/0x384 [ 0.820000] [<c0715529>] lhype_maybe_init+0x0/0x1a [ 0.820000] ======================= [ 0.820000] Code: 11 00 00 00 e8 e3 8c 01 00 83 c4 0c c3 57 56 53 89 c6 89 d3 89 e0 25 00 e0 ff ff 8d 78 08 8b 40 08 a8 08 75 1e 31 c9 89 f8 89 ca <0f> 01 c8 89 e0 25 00 e0 ff ff 8b 40 08 a8 08 75 07 89 f0 89 d9 [ 0.820000] EIP: [<c0101223>] mwait_idle_with_hints+0x1e/0x3a SS:ESP 0069:c0705f74 [ 0.820000] <0>Kernel panic - not syncing: Attempted to kill the idle task! [ 0.820000] lhype_add: CRASH: Attempted to kill the idle task!
This appears to be this line:
/* "monitor %eax,%ecx,%edx;" */
asm volatile(
c010121d: 31 c9 xor %ecx,%ecx
c010121f: 89 f8 mov %edi,%eax
c0101221: 89 ca mov %ecx,%edx
c0101223: 0f 01 c8 monitor %eax,%ecx,%edxMy *host* CPU certainly claims to have 'PNI', and thus I suspect 'monitor'.
I'll try to get this skipped so I can continue testing. Let me know if there is anything I can do to help!
$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 4 model name : Intel(R) Pentium(R) 4 CPU 3.00GHz stepping : 1 cpu MHz : 3000.174 cache size : 1024 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 5 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc pni monitor ds_cpl cid xtpr bogomips : 6003.91 clflush size : 64
Signature · 2 lines
http://www.PowerDNS.com Open source, database driven DNS Software http://netherlabs.nl Open and Closed source services
Quoted 4 lines · bert hubert
We're getting further, but no cigar yet!
I now get this:[ 0.820000] EIP is at mwait_idle_with_hints+0x1e/0x3a
idle=halt did the trick!
[ 0.290000] Booting paravirtualized kernel on lhype
Now to get me a decent root image.. but things are looking good!
Some errors about 'IRQ handler type mismatches', and the rtc appears to be
off: [ 10.070000] rtc-test rtc-test.0: setting the system clock to
1970-01-05 22:03:49 (425029)
Thanks Rusty! If there is anything specific that needs testing, let me know.
Bert
Signature · 2 lines
http://www.PowerDNS.com Open source, database driven DNS Software http://netherlabs.nl Open and Closed source services