Re: [PATCH Part1 v5 11/38] x86/compressed: Add helper for validating pages in the decompression stage

Borislav Petkov
2021-08-23T14:16:29Z

On Fri, Aug 20, 2021 at 10:19:06AM -0500, Brijesh Singh wrote:
> diff --git a/arch/x86/include/asm/sev-common.h b/arch/x86/include/asm/sev-common.h
> index d426c30ae7b4..1cd8ce838af8 100644
> --- a/arch/x86/include/asm/sev-common.h
> +++ b/arch/x86/include/asm/sev-common.h
> @@ -57,6 +57,26 @@
> #define GHCB_MSR_AP_RESET_HOLD_REQ 0x006
> #define GHCB_MSR_AP_RESET_HOLD_RESP 0x007
>
> +/* SNP Page State Change */

Let's make it very clear here that those cmd numbers below are actually
part of the protocol and not randomly chosen:

/*
* ...
*
* 0x014 – SNP Page State Change Request
*
* GHCBData[55:52] – Page operation:
* 0x0001 – Page assignment, Private
* 0x0002 – Page assignment, Shared
*/

> +enum psc_op {
> + SNP_PAGE_STATE_PRIVATE = 1,
> + SNP_PAGE_STATE_SHARED,
> +};
> +

--
Regards/Gruss,
Boris.