Re: [PATCH 02/16] x86/entry/32: Enter the kernel via trampoline stack

From: Boris Ostrovsky
Date: Tue Jan 16 2018 - 21:48:57 EST




On 01/16/2018 11:36 AM, Joerg Roedel wrote:

/*
+ * Switch from the entry-trampline stack to the kernel stack of the
+ * running task.
+ *
+ * nr_regs is the number of dwords to push from the entry stack to the
+ * task stack. If it is > 0 it expects an irq frame at the bottom of the
+ * stack.
+ *
+ * check_user != 0 it will add a check to only switch stacks if the
+ * kernel entry was from user-space.
+ */
+.macro SWITCH_TO_KERNEL_STACK nr_regs=0 check_user=0


This (and next patch's SWITCH_TO_ENTRY_STACK) need X86_FEATURE_PTI check.

With those macros fixed I was able to boot 32-bit Xen PV guest.

-boris