Skip to content

Commit 5412fed

Browse files
committed
Merge tag 'x86_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - Add a forgotten CPU vendor check in the AMD microcode post-loading callback so that the callback runs only on AMD - Make sure SEV-ES protocol negotiation happens only once and on the BSP * tag 'x86_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/CPU/AMD: Check vendor in the AMD microcode callback x86/sev: Fix kernel crash due to late update to read-only ghcb_version
2 parents 0aea22c + 9b8493d commit 5412fed

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,9 @@ static void zenbleed_check_cpu(void *unused)
13201320

13211321
void amd_check_microcode(void)
13221322
{
1323+
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
1324+
return;
1325+
13231326
on_each_cpu(zenbleed_check_cpu, NULL, 1);
13241327
}
13251328

arch/x86/kernel/sev.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,10 +1234,6 @@ void setup_ghcb(void)
12341234
if (!cc_platform_has(CC_ATTR_GUEST_STATE_ENCRYPT))
12351235
return;
12361236

1237-
/* First make sure the hypervisor talks a supported protocol. */
1238-
if (!sev_es_negotiate_protocol())
1239-
sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SEV_ES_GEN_REQ);
1240-
12411237
/*
12421238
* Check whether the runtime #VC exception handler is active. It uses
12431239
* the per-CPU GHCB page which is set up by sev_es_init_vc_handling().
@@ -1254,6 +1250,13 @@ void setup_ghcb(void)
12541250
return;
12551251
}
12561252

1253+
/*
1254+
* Make sure the hypervisor talks a supported protocol.
1255+
* This gets called only in the BSP boot phase.
1256+
*/
1257+
if (!sev_es_negotiate_protocol())
1258+
sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SEV_ES_GEN_REQ);
1259+
12571260
/*
12581261
* Clear the boot_ghcb. The first exception comes in before the bss
12591262
* section is cleared.

0 commit comments

Comments
 (0)