* [kvm-unit-tests PATCH] x86: Reload SS when switching to 5-level page tables
@ 2020-03-10 3:47 Sean Christopherson
0 siblings, 0 replies; only message in thread
From: Sean Christopherson @ 2020-03-10 3:47 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: kvm
Load SS with a valid segment when switching to 5-level page tables to
avoid taking a #SS due to a NULL segment when making a CALL with paging
disabled.
The "access" test calls setup_5level_page_table()/switch_to_5level()
after generating and handling usermode exceptions. Per Intel's SDM,
SS is nullified on an exception that changes CPL:
The new SS is set to NULL if there is a change in CPL.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
x86/cstart64.S | 3 +++
1 file changed, 3 insertions(+)
diff --git a/x86/cstart64.S b/x86/cstart64.S
index 6c1c87d..cffbb07 100644
--- a/x86/cstart64.S
+++ b/x86/cstart64.S
@@ -159,6 +159,9 @@ switch_to_5level:
bts $12, %eax
mov %eax, %cr4
+ mov $0x10, %ax
+ mov %ax, %ss
+
call enter_long_mode
jmpl $8, $lvl5
--
2.24.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-10 3:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 3:47 [kvm-unit-tests PATCH] x86: Reload SS when switching to 5-level page tables Sean Christopherson
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).