Woller, Thomas
2006-Apr-20 15:58 UTC
[Xen-devel] [PATCH][SVM] fix pae for guests on 32bit HV
SVM patch to ensure that PAE bit is set for 32bit guests on 32bit PAE, by using paging levels>=3 rather than ifdef i386. This patch fixes the "black screen" hang issue when building w/ XEN_TARGET_X86_PAE=y on 32bit. Tested linux debian and win2003EE guests with pae=1. The linux guest boots without error, while the windows guest sometimes hits a bug() in shadow.c. Both VT and SVM encounter the same bug below. Applies cleanly to 9638. Please apply to xenbits. Please apply to 3.0.2 testing. Signed-off-by: Tom Woller <thomas.woller@amd.com> ------------------------------------------------------------- Here are the stack traces from the crashes on VT and SVM boxes. (XEN) BUG at shadow.c:3183 (XEN) ----[ Xen-3.0-unstable Not tainted ]---- (XEN) CPU: 0 (XEN) EIP: e008:[<ff12e891>] gva_to_gpa_pae+0x21/0x30 (XEN) EFLAGS: 00010292 CONTEXT: hypervisor (XEN) eax: 00000000 ebx: 00430e25 ecx: 00002550 edx: 00000000 (XEN) esi: ff183fb4 edi: ffbd3280 ebp: ff183fb4 esp: ff183f34 (XEN) cr0: 8005003b cr3: 00ffe000 (XEN) ds: e010 es: e010 fs: e010 gs: e010 ss: e010 cs: e008 (XEN) Xen stack trace from esp=ff183f34: (XEN) ff167dbc ff16ab61 00000c6f ff135815 00430e25 00000005 ffbbe500 ff1524cf (XEN) 00430e25 ff18e110 ffbd3280 ff1504df 00430e25 00000301 ffbd3280 ff154c1c (XEN) ffbd3280 00000000 4c69cfbc 000000a8 c0496000 00000000 c0496000 00000000 (XEN) ff183fb4 000000a8 00000000 00001000 80087000 80087008 0005ffd8 ff1554e2 (XEN) 00001000 80050033 00645000 80087000 80087008 0005ffd8 00000671 00050010 (XEN) 00414e85 00b90008 00000000 0005fc50 00000202 00000010 00000010 00000030 (XEN) 00000000 00000000 ffbd3280 (XEN) Xen call trace: (XEN) [<ff12e891>] gva_to_gpa_pae+0x21/0x30 (XEN) [<ff135815>] gva_to_gpa+0x25/0x30 (XEN) [<ff1524cf>] vmx_do_page_fault+0x9f/0x170 (XEN) [<ff1504df>] cpu_has_pending_irq+0x3f/0x60 (XEN) [<ff154c1c>] vmx_vmexit_handler+0x85c/0x940 (XEN) [<ff1554e2>] vmx_asm_vmexit_handler+0x22/0x30 (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) CPU0 FATAL TRAP: vector = 6 (invalid opcode) (XEN) **************************************** (XEN) (XEN) BUG at shadow.c:3183 (XEN) ----[ Xen-3.0-unstable Not tainted ]---- (XEN) CPU: 0 (XEN) EIP: e008:[<ff12e891>] gva_to_gpa_pae+0x21/0x30 (XEN) EFLAGS: 00010296 CONTEXT: hypervisor (XEN) eax: 00000000 ebx: ff22d000 ecx: 000021e3 edx: 00000000 (XEN) esi: ff22e080 edi: ff22e080 ebp: 00430e25 esp: ff183ea4 (XEN) cr0: 80050033 cr3: 00f21000 (XEN) ds: e010 es: e010 fs: 0000 gs: 0000 ss: e010 cs: e008 (XEN) Xen stack trace from esp=ff183ea4: (XEN) ff167dbc ff16ab61 00000c6f ff135815 00430e25 00000010 0005ffd8 ff14e669 (XEN) 00430e25 ff183fb4 00000007 ff22e080 ffbe3718 ffbe2080 ff22e080 ff14f8f8 (XEN) ffbe3718 ff18e110 ff190684 00000000 ff183fb4 ff22e080 00000030 ff14d608 (XEN) ff22e080 0007a120 00000000 ff22d000 42a17620 ff22e080 4299d500 ff1181c0 (XEN) 4299d707 00000030 ff22e080 00000030 42a17620 00000030 ff22e080 ff115467 (XEN) 12a1d083 00000006 ff22d000 00000000 00000030 ff18e110 ffbfee80 ff1118ba (XEN) 42a17620 00000030 00000000 ff22e080 ff22e080 00000000 4299d6f1 00000030 (XEN) ff183f88 00000000 80000011 00000000 ff22e080 00000000 00000007 00001000 (XEN) 80087000 80087008 0005ffd8 ff150271 00001000 80000011 00645000 80087000 (XEN) 80087008 0005ffd8 00000020 00000000 00430e25 00000008 00000086 0005ffbc (XEN) 00000010 00000010 00000010 00000030 00000000 00000000 ff22e080 (XEN) Xen call trace: (XEN) [<ff12e891>] gva_to_gpa_pae+0x21/0x30 (XEN) [<ff135815>] gva_to_gpa+0x25/0x30 (XEN) [<ff14e669>] svm_vmexit_handler+0xd09/0x1a60 (XEN) [<ff14f8f8>] svm_do_resume+0x48/0xe0 (XEN) [<ff14d608>] arch_svm_do_resume+0x78/0x90 (XEN) [<ff1181c0>] continue_running+0x10/0x40 (XEN) [<ff115467>] reprogram_timer+0x27/0xe0 (XEN) [<ff1118ba>] timer_softirq_action+0x12a/0x150 (XEN) [<ff150271>] svm_asm_do_launch+0x71/0x80 (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) CPU0 FATAL TRAP: vector = 6 (invalid opcode) (XEN) **************************************** _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Nakajima, Jun
2006-Apr-20 21:05 UTC
RE: [Xen-devel] [PATCH][SVM] fix pae for guests on 32bit HV
Woller, Thomas wrote:> SVM patch to ensure that PAE bit is set for 32bit guests on 32bit PAE, > by using paging levels>=3 rather than ifdef i386. This patch fixes > the "black screen" hang issue when building w/ XEN_TARGET_X86_PAE=y on > 32bit. > > Tested linux debian and win2003EE guests with pae=1. The linux guest > boots without error, while the windows guest sometimes hits a bug() in > shadow.c. Both VT and SVM encounter the same bug below.The current shadow code does not support PAE guests on the PAE Xen. It''s much harder given (compared with x64-64) the limited bits in page_info. Should work on the 64-bit Xen. Anyway, we need to cleanly kill such guests on the PAE Xen.> > Applies cleanly to 9638. > > Please apply to xenbits. > > Please apply to 3.0.2 testing. > > Signed-off-by: Tom Woller <thomas.woller@amd.com> > > ------------------------------------------------------------- > Here are the stack traces from the crashes on VT and SVM boxes. > > (XEN) BUG at shadow.c:3183 > (XEN) ----[ Xen-3.0-unstable Not tainted ]---- > (XEN) CPU: 0 > (XEN) EIP: e008:[<ff12e891>] gva_to_gpa_pae+0x21/0x30 > (XEN) EFLAGS: 00010292 CONTEXT: hypervisor > (XEN) eax: 00000000 ebx: 00430e25 ecx: 00002550 edx: 00000000 > (XEN) esi: ff183fb4 edi: ffbd3280 ebp: ff183fb4 esp: ff183f34 > (XEN) cr0: 8005003b cr3: 00ffe000 > (XEN) ds: e010 es: e010 fs: e010 gs: e010 ss: e010 cs: e008 > (XEN) Xen stack trace from esp=ff183f34: > (XEN) ff167dbc ff16ab61 00000c6f ff135815 00430e25 00000005 > ffbbe500 ff1524cf > (XEN) 00430e25 ff18e110 ffbd3280 ff1504df 00430e25 00000301 > ffbd3280 ff154c1c > (XEN) ffbd3280 00000000 4c69cfbc 000000a8 c0496000 00000000 > c0496000 00000000 > (XEN) ff183fb4 000000a8 00000000 00001000 80087000 80087008 > 0005ffd8 ff1554e2 > (XEN) 00001000 80050033 00645000 80087000 80087008 0005ffd8 > 00000671 00050010 > (XEN) 00414e85 00b90008 00000000 0005fc50 00000202 00000010 > 00000010 00000030 > (XEN) 00000000 00000000 ffbd3280 > (XEN) Xen call trace: > (XEN) [<ff12e891>] gva_to_gpa_pae+0x21/0x30 > (XEN) [<ff135815>] gva_to_gpa+0x25/0x30 > (XEN) [<ff1524cf>] vmx_do_page_fault+0x9f/0x170 > (XEN) [<ff1504df>] cpu_has_pending_irq+0x3f/0x60 > (XEN) [<ff154c1c>] vmx_vmexit_handler+0x85c/0x940 > (XEN) [<ff1554e2>] vmx_asm_vmexit_handler+0x22/0x30 > (XEN) > (XEN) > (XEN) **************************************** > (XEN) Panic on CPU 0: > (XEN) CPU0 FATAL TRAP: vector = 6 (invalid opcode) > (XEN) **************************************** > (XEN) > > > > (XEN) BUG at shadow.c:3183 > (XEN) ----[ Xen-3.0-unstable Not tainted ]---- > (XEN) CPU: 0 > (XEN) EIP: e008:[<ff12e891>] gva_to_gpa_pae+0x21/0x30 > (XEN) EFLAGS: 00010296 CONTEXT: hypervisor > (XEN) eax: 00000000 ebx: ff22d000 ecx: 000021e3 edx: 00000000 > (XEN) esi: ff22e080 edi: ff22e080 ebp: 00430e25 esp: ff183ea4 > (XEN) cr0: 80050033 cr3: 00f21000 > (XEN) ds: e010 es: e010 fs: 0000 gs: 0000 ss: e010 cs: e008 > (XEN) Xen stack trace from esp=ff183ea4: > (XEN) ff167dbc ff16ab61 00000c6f ff135815 00430e25 00000010 > 0005ffd8 ff14e669 > (XEN) 00430e25 ff183fb4 00000007 ff22e080 ffbe3718 ffbe2080 > ff22e080 ff14f8f8 > (XEN) ffbe3718 ff18e110 ff190684 00000000 ff183fb4 ff22e080 > 00000030 ff14d608 > (XEN) ff22e080 0007a120 00000000 ff22d000 42a17620 ff22e080 > 4299d500 ff1181c0 > (XEN) 4299d707 00000030 ff22e080 00000030 42a17620 00000030 > ff22e080 ff115467 > (XEN) 12a1d083 00000006 ff22d000 00000000 00000030 ff18e110 > ffbfee80 ff1118ba > (XEN) 42a17620 00000030 00000000 ff22e080 ff22e080 00000000 > 4299d6f1 00000030 > (XEN) ff183f88 00000000 80000011 00000000 ff22e080 00000000 > 00000007 00001000 > (XEN) 80087000 80087008 0005ffd8 ff150271 00001000 80000011 > 00645000 80087000 > (XEN) 80087008 0005ffd8 00000020 00000000 00430e25 00000008 > 00000086 0005ffbc > (XEN) 00000010 00000010 00000010 00000030 00000000 00000000 > ff22e080 (XEN) Xen call trace: > (XEN) [<ff12e891>] gva_to_gpa_pae+0x21/0x30 > (XEN) [<ff135815>] gva_to_gpa+0x25/0x30 > (XEN) [<ff14e669>] svm_vmexit_handler+0xd09/0x1a60 > (XEN) [<ff14f8f8>] svm_do_resume+0x48/0xe0 > (XEN) [<ff14d608>] arch_svm_do_resume+0x78/0x90 > (XEN) [<ff1181c0>] continue_running+0x10/0x40 > (XEN) [<ff115467>] reprogram_timer+0x27/0xe0 > (XEN) [<ff1118ba>] timer_softirq_action+0x12a/0x150 > (XEN) [<ff150271>] svm_asm_do_launch+0x71/0x80 > (XEN) > (XEN) > (XEN) **************************************** > (XEN) Panic on CPU 0: > (XEN) CPU0 FATAL TRAP: vector = 6 (invalid opcode) > (XEN) ****************************************Jun --- Intel Open Source Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Woller, Thomas
2006-Apr-20 22:22 UTC
RE: [Xen-devel] [PATCH][SVM] fix pae for guests on 32bit HV
> The current shadow code does not support PAE guests on the > PAE Xen. It''s much harder given (compared with x64-64) the > limited bits in page_info. > Should work on the 64-bit Xen. Anyway, we need to cleanly > kill such guests on the PAE Xen.Now this does mean no NX support on PAE xen. Attached patch simply turns off PAE if paging level < 4 in vt and svm. Tested win2003 EE on svm and vt, allows 32bit windows guests to boot without shadow.c bug() crash. Only issue seen is if setting guest config memory >~4096 then the guest does not boot, but does not crash the hv - stays in blocked state. So, I think that this solution is fine for now. Svm shadows PAE and NX so the code is slightly different. I''ll post with signed-off if ok for vmx also. thanks Tom _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Nakajima, Jun
2006-Apr-20 23:01 UTC
RE: [Xen-devel] [PATCH][SVM] fix pae for guests on 32bit HV
Woller, Thomas wrote:>> The current shadow code does not support PAE guests on the >> PAE Xen. It''s much harder given (compared with x64-64) the limited >> bits in page_info. Should work on the 64-bit Xen. Anyway, we need to >> cleanly kill such guests on the PAE Xen. > Now this does mean no NX support on PAE xen.That''s right.> > Attached patch simply turns off PAE if paging level < 4 in vt and svm.Actually it would cause a hang with bigsmp Linux; we debugged such guests. Such a PAE-confugred Linux checks PAE when paging level = 2, and stop booting if PAE is not available. Our solution was to disable pae (the default) in the xm config file.> > Tested win2003 EE on svm and vt, allows 32bit windows guests to boot > without shadow.c bug() crash. > > Only issue seen is if setting guest config memory >~4096 then the > guest does not boot, but does not crash the hv - stays in blocked > state. So, I think that this solution is fine for now. Svm shadows > PAE and NX so the code is slightly different. > I''ll post with signed-off if ok for vmx also. > thanks > TomJun --- Intel Open Source Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Petersson, Mats
2006-Apr-21 09:50 UTC
RE: [Xen-devel] [PATCH][SVM] fix pae for guests on 32bit HV
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > Nakajima, Jun > Sent: 21 April 2006 00:02 > To: Woller, Thomas; xen-devel@lists.xensource.com > Subject: RE: [Xen-devel] [PATCH][SVM] fix pae for guests on 32bit HV > > Woller, Thomas wrote: > >> The current shadow code does not support PAE guests on the > PAE Xen. > >> It''s much harder given (compared with x64-64) the limited bits in > >> page_info. Should work on the 64-bit Xen. Anyway, we need > to cleanly > >> kill such guests on the PAE Xen. > > Now this does mean no NX support on PAE xen. > > That''s right.And it''s not a big limitation. There''s no CPU''s (at least as far as I''m aware) available that are 32-bit only, that support NX - so you can run a 64-bit Hypervisor on all CPU''s that have NX support, and if you want to run a 32-bit guest with PAE + NX, that''ll work fine. -- Mats _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel