Re: [PATCH v8 05/21] x86/cea: Export API for per-CPU exception stacks for KVM

Peter Zijlstra
2025-10-23T08:06:37Z

On Mon, Oct 13, 2025 at 06:09:34PM -0700, Xin Li (Intel) wrote:

> FRED introduced new fields in the host-state area of the VMCS for stack
> levels 1->3 (HOST_IA32_FRED_RSP[123]), each respectively corresponding to
> per-CPU exception stacks for #DB, NMI and #DF. KVM must populate these
> fields each time a vCPU is loaded onto a CPU.

> +noinstr unsigned long __this_cpu_ist_top_va(enum exception_stack_ordering stack)
> +{
> + return __this_cpu_ist_bottom_va(stack) + EXCEPTION_STKSZ;
> +}
> +EXPORT_SYMBOL(__this_cpu_ist_top_va);

This has no business being a !GPL export. But please use:

EXPORT_SYMBOL_FOR_MODULES(__this_cpu_ist_top_val, "kvm");

(or "kvm-intel", depending on which actual module ends up needing this
symbol).