Re: [PATCH v1 2/2] acpi, x86: Remove encryption mask from ACPI page protection type

From: Ingo Molnar
Date: Fri Jul 28 2017 - 02:28:22 EST



* Tom Lendacky <thomas.lendacky@xxxxxxx> wrote:

> > > + * in memory in an encrypted state so return a protection attribute
> > > + * that does not have the encryption bit set.
> > > */
> > > - return PAGE_KERNEL;
> > > + return sme_active() ? PAGE_KERNEL_IO : PAGE_KERNEL;
> >
> > Why isn't there a PAGE_KERNEL_NOENC define which you can simply return
> > instead of testing?
>
> Sounds like something I should add to pgtable_types.h (which has a
> #define for PAGE_KERNEL_EXEC_NOENC, but not PAGE_KERNEL_NOENC). I'll
> create that #define.
>
> As for the sme_active() check I was getting ahead of myself since
> under SEV the encryption mask is needed. I'll change it to just
> return PAGE_KERNEL_NOENC and then worry about the SEV change in
> the SEV patches.

Ok, that works for me too, as we at least don't sprinke the code with repeated
sme_active() toggles.

Thanks,

Ingo