Re: [PATCH] x86/sev: Fix kernel crash due to late update to read-only ghcb_version

From: Tom Lendacky
Date: Thu Nov 30 2023 - 11:07:35 EST


On 11/30/23 03:30, Ingo Molnar wrote:

* Ashwin Dayanand Kamat <kashwindayan@xxxxxxxxxx> wrote:

From: Ashwin Dayanand Kamat <ashwin.kamat@xxxxxxxxxxxx>

kernel crash was observed because of page fault, while running
cpuhotplug ltp testcases on SEV-ES enabled systems. The crash was
observed during hotplug after the CPU was offlined and the process
was migrated to different cpu. setup_ghcb() is called again which
tries to update ghcb_version in sev_es_negotiate_protocol(). Ideally this
is a read_only variable which is initialised during booting.
This results in pagefault.

Applied to tip:x86/urgent, thanks.

Tom: I've added your Suggested-by and Acked-by, which appeared to be the
case given the v1 discussion, let me know if that's not accurate.

All good.

Thanks,
Tom


I've also tidied up the changelog - final version attached below.

Thanks,

Ingo