Re: [PATCH v2 2/2] x86/sev-es: Invalidate the GHCB after completing VMGEXIT

From: Joerg Roedel
Date: Tue May 18 2021 - 05:03:28 EST


On Mon, May 17, 2021 at 12:42:33PM -0500, Tom Lendacky wrote:
> Since the VMGEXIT instruction can be issued from userspace, invalidate
> the GHCB after performing VMGEXIT processing in the kernel.
>
> Invalidation is only required after userspace is available, so call
> vc_ghcb_invalidate() from sev_es_put_ghcb(). Update vc_ghcb_invalidate()
> to additionally clear the GHCB exit code, so that a value of 0 is always
> present outside VMGEXIT processing in the kernel.
>
> Fixes: 0786138c78e79 ("x86/sev-es: Add a Runtime #VC Exception Handler")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Tom Lendacky <thomas.lendacky@xxxxxxx>

Reviewed-by: Joerg Roedel <jroedel@xxxxxxx>