lkml.org 
[lkml]   [2017]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 2/2] acpi, x86: Remove encryption mask from ACPI page protection type
On Wed, Jul 26, 2017 at 01:04:34PM -0500, Tom Lendacky wrote:
> The function arch_apei_get_mem_attributes() is used to set the page
> protection type for ACPI physical addresses. When SME is active, the
> associated protection type needs to not have the encryption mask set
> since the ACPI tables live in un-encrypted memory. Modify the
> arch_apei_get_mem_attributes() function to remove the encryption mask
> when SME is active by returning the PAGE_KERNEL_IO protection type.
>
> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
> arch/x86/include/asm/acpi.h | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
> index 562286f..89df39d 100644
> --- a/arch/x86/include/asm/acpi.h
> +++ b/arch/x86/include/asm/acpi.h
> @@ -34,6 +34,7 @@
>
> #ifdef CONFIG_ACPI_APEI
> # include <asm/pgtable_types.h>
> +# include <linux/mem_encrypt.h>
> #endif
>
> #ifdef CONFIG_ACPI
> @@ -164,8 +165,12 @@ static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
> * anything other than PAGE_KERNEL (some arm64 platforms
> * require the equivalent of PAGE_KERNEL_NOCACHE), return that
> * until we know differently.
> + *
> + * When SME is active, the ACPI information will not reside in
> + * 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?

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--

\
 
 \ /
  Last update: 2017-07-27 16:43    [W:0.107 / U:53.856 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site