[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160613120322.GA2658@codeblueprint.co.uk>
Date: Mon, 13 Jun 2016 13:03:22 +0100
From: Matt Fleming <matt@...eblueprint.co.uk>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: Borislav Petkov <bp@...en8.de>,
Leif Lindholm <leif.lindholm@...aro.org>,
Mark Salter <msalter@...hat.com>,
Daniel Kiper <daniel.kiper@...cle.com>,
linux-arch@...r.kernel.org, linux-efi@...r.kernel.org,
kvm@...r.kernel.org, linux-doc@...r.kernel.org, x86@...nel.org,
linux-kernel@...r.kernel.org, kasan-dev@...glegroups.com,
linux-mm@...ck.org, iommu@...ts.linux-foundation.org,
Radim Krčmář <rkrcmar@...hat.com>,
Arnd Bergmann <arnd@...db.de>,
Jonathan Corbet <corbet@....net>,
Joerg Roedel <joro@...tes.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Dmitry Vyukov <dvyukov@...gle.com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>
Subject: Re: [RFC PATCH v1 10/18] x86/efi: Access EFI related tables in the
clear
On Thu, 09 Jun, at 11:16:40AM, Tom Lendacky wrote:
>
> So maybe something along the lines of an enum that would have entries
> (initially) like KERNEL_DATA (equal to zero) and EFI_DATA. Others could
> be added later as needed.
Sure, that works for me, though maybe BOOT_DATA would be more
applicable considering the devicetree case too.
> Would you then want to allow the protection attributes to be updated
> by architecture specific code through something like a __weak function?
> In the x86 case I can add this function as a non-SME specific function
> that would initially just have the SME-related mask modification in it.
Would we need a new function? Couldn't we just have a new
FIXMAP_PAGE_* constant? e.g. would something like this work?
---
enum memremap_owner {
KERNEL_DATA = 0,
BOOT_DATA,
};
void __init *
early_memremap(resource_size_t phys_addr, unsigned long size,
enum memremap_owner owner)
{
pgprot_t prot;
switch (owner) {
case BOOT_DATA:
prot = FIXMAP_PAGE_BOOT;
break;
case KERNEL_DATA: /* FALLTHROUGH */
default:
prot = FIXMAP_PAGE_NORMAL;
}
return (__force void *)__early_ioremap(phys_addr, size, prot);
}
Powered by blists - more mailing lists