[kvm-unit-tests PATCH] x86: Reload SS when switching to 5-level page tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux