Commit dfbd9e40 authored by Juergen Gross's avatar Juergen Gross Committed by Borislav Petkov
Browse files

x86/cpu: Drop 32-bit Xen PV guest code in update_task_stack()



Testing for Xen PV guest mode in a 32-bit only code section can be
dropped, as Xen PV guests are supported in 64-bit mode only.

While at it, switch from boot_cpu_has() to cpu_feature_enabled() in the
64-bit part of the code.

Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Acked-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/r/20221104072701.20283-4-jgross@suse.com
parent 0bafc51b
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -66,13 +66,10 @@ static inline void update_task_stack(struct task_struct *task)
{
{
	/* sp0 always points to the entry trampoline stack, which is constant: */
	/* sp0 always points to the entry trampoline stack, which is constant: */
#ifdef CONFIG_X86_32
#ifdef CONFIG_X86_32
	if (static_cpu_has(X86_FEATURE_XENPV))
		load_sp0(task->thread.sp0);
	else
	this_cpu_write(cpu_tss_rw.x86_tss.sp1, task->thread.sp0);
	this_cpu_write(cpu_tss_rw.x86_tss.sp1, task->thread.sp0);
#else
#else
	/* Xen PV enters the kernel on the thread stack. */
	/* Xen PV enters the kernel on the thread stack. */
	if (static_cpu_has(X86_FEATURE_XENPV))
	if (cpu_feature_enabled(X86_FEATURE_XENPV))
		load_sp0(task_top_of_stack(task));
		load_sp0(task_top_of_stack(task));
#endif
#endif
}
}