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