Commit c23719ab authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86-urgent-2026-03-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:

 - Fix SEV guest boot failures in certain circumstances, due to
   very early code relying on a BSS-zeroed variable that isn't
   actually zeroed yet an may contain non-zero bootup values

   Move the variable into the .data section go gain even earlier
   zeroing

 - Expose & allow the IBPB-on-Entry feature on SNP guests, which
   was not properly exposed to guests due to initial implementational
   caution

 - Fix O= build failure when CONFIG_EFI_SBAT_FILE is using relative
   file paths

 - Fix the various SNC (Sub-NUMA Clustering) topology enumeration
   bugs/artifacts (sched-domain build errors mostly).

   SNC enumeration data got more complicated with Granite Rapids X
   (GNR) and Clearwater Forest X (CWF), which exposed these bugs
   and made their effects more serious

 - Also use the now sane(r) SNC code to fix resctrl SNC detection bugs

 - Work around a historic libgcc unwinder bug in the vdso32 sigreturn
   code (again), which regressed during an overly aggressive recent
   cleanup of DWARF annotations

* tag 'x86-urgent-2026-03-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/entry/vdso32: Work around libgcc unwinder bug
  x86/resctrl: Fix SNC detection
  x86/topo: Fix SNC topology mess
  x86/topo: Replace x86_has_numa_in_package
  x86/topo: Add topology_num_nodes_per_package()
  x86/numa: Store extra copy of numa_nodes_parsed
  x86/boot: Handle relative CONFIG_EFI_SBAT_FILE file paths
  x86/sev: Allow IBPB-on-Entry feature for SNP guests
  x86/boot/sev: Move SEV decompressor variables into the .data section
parents 6ff1020c b5ef09a7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ vmlinux-objs-$(CONFIG_EFI_SBAT) += $(obj)/sbat.o

ifdef CONFIG_EFI_SBAT
$(obj)/sbat.o: $(CONFIG_EFI_SBAT_FILE)
AFLAGS_sbat.o += -I $(srctree)
endif

$(obj)/vmlinux: $(vmlinux-objs-y) $(vmlinux-libs-y) FORCE
+5 −4
Original line number Diff line number Diff line
@@ -28,17 +28,17 @@
#include "sev.h"

static struct ghcb boot_ghcb_page __aligned(PAGE_SIZE);
struct ghcb *boot_ghcb;
struct ghcb *boot_ghcb __section(".data");

#undef __init
#define __init

#define __BOOT_COMPRESSED

u8 snp_vmpl;
u16 ghcb_version;
u8 snp_vmpl __section(".data");
u16 ghcb_version __section(".data");

u64 boot_svsm_caa_pa;
u64 boot_svsm_caa_pa __section(".data");

/* Include code for early handlers */
#include "../../boot/startup/sev-shared.c"
@@ -188,6 +188,7 @@ bool sev_es_check_ghcb_fault(unsigned long address)
				 MSR_AMD64_SNP_RESERVED_BIT13 |		\
				 MSR_AMD64_SNP_RESERVED_BIT15 |		\
				 MSR_AMD64_SNP_SECURE_AVIC |		\
				 MSR_AMD64_SNP_RESERVED_BITS19_22 |	\
				 MSR_AMD64_SNP_RESERVED_MASK)

#ifdef CONFIG_AMD_SECURE_AVIC
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ static u32 cpuid_std_range_max __ro_after_init;
static u32 cpuid_hyp_range_max __ro_after_init;
static u32 cpuid_ext_range_max __ro_after_init;

bool sev_snp_needs_sfw;
bool sev_snp_needs_sfw __section(".data");

void __noreturn
sev_es_terminate(unsigned int set, unsigned int reason)
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ static const char * const sev_status_feat_names[] = {
	[MSR_AMD64_SNP_VMSA_REG_PROT_BIT]	= "VMSARegProt",
	[MSR_AMD64_SNP_SMT_PROT_BIT]		= "SMTProt",
	[MSR_AMD64_SNP_SECURE_AVIC_BIT]		= "SecureAVIC",
	[MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT]	= "IBPBOnEntry",
};

/*
+30 −0
Original line number Diff line number Diff line
@@ -35,9 +35,38 @@
#endif
.endm

/*
 * WARNING:
 *
 * A bug in the libgcc unwinder as of at least gcc 15.2 (2026) means that
 * the unwinder fails to recognize the signal frame flag.
 *
 * There is a hacky legacy fallback path in libgcc which ends up
 * getting invoked instead. It happens to work as long as BOTH of the
 * following conditions are true:
 *
 * 1. There is at least one byte before the each of the sigreturn
 *    functions which falls outside any function. This is enforced by
 *    an explicit nop instruction before the ALIGN.
 * 2. The code sequences between the entry point up to and including
 *    the int $0x80 below need to match EXACTLY. Do not change them
 *    in any way. The exact byte sequences are:
 *
 *    __kernel_sigreturn:
 *        0:   58                      pop    %eax
 *        1:   b8 77 00 00 00          mov    $0x77,%eax
 *        6:   cd 80                   int    $0x80
 *
 *    __kernel_rt_sigreturn:
 *        0:   b8 ad 00 00 00          mov    $0xad,%eax
 *        5:   cd 80                   int    $0x80
 *
 * For details, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124050
 */
	.text
	.globl __kernel_sigreturn
	.type __kernel_sigreturn,@function
	nop			/* libgcc hack: see comment above */
	ALIGN
__kernel_sigreturn:
	STARTPROC_SIGNAL_FRAME IA32_SIGFRAME_sigcontext
@@ -52,6 +81,7 @@ SYM_INNER_LABEL(vdso32_sigreturn_landing_pad, SYM_L_GLOBAL)

	.globl __kernel_rt_sigreturn
	.type __kernel_rt_sigreturn,@function
	nop			/* libgcc hack: see comment above */
	ALIGN
__kernel_rt_sigreturn:
	STARTPROC_SIGNAL_FRAME IA32_RT_SIGFRAME_sigcontext
Loading