Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1683600
| From | Brian Gerst <brgerst@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v9 07/38] x86/mm: Remove phys_to_virt() usage in ioremap() |
| Date | 2017-07-08 15:00 +0200 |
| Message-ID | <u0Xv4-2jl-13@gated-at.bofh.it> (permalink) |
| References | <u0UdP-oM-3@gated-at.bofh.it> <u0Xv4-2jl-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Jul 7, 2017 at 9:39 AM, Tom Lendacky <thomas.lendacky@amd.com> wrote: > Currently there is a check if the address being mapped is in the ISA > range (is_ISA_range()), and if it is, then phys_to_virt() is used to > perform the mapping. When SME is active, the default is to add pagetable > mappings with the encryption bit set unless specifically overridden. The > resulting pagetable mapping from phys_to_virt() will result in a mapping > that has the encryption bit set. With SME, the use of ioremap() is > intended to generate pagetable mappings that do not have the encryption > bit set through the use of the PAGE_KERNEL_IO protection value. > > Rather than special case the SME scenario, remove the ISA range check and > usage of phys_to_virt() and have ISA range mappings continue through the > remaining ioremap() path. > > Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> > --- > arch/x86/mm/ioremap.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c > index 4c1b5fd..bfc3e2d 100644 > --- a/arch/x86/mm/ioremap.c > +++ b/arch/x86/mm/ioremap.c > @@ -13,6 +13,7 @@ > #include <linux/slab.h> > #include <linux/vmalloc.h> > #include <linux/mmiotrace.h> > +#include <linux/mem_encrypt.h> > > #include <asm/set_memory.h> > #include <asm/e820/api.h> > @@ -106,12 +107,6 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, > } > > /* > - * Don't remap the low PCI/ISA area, it's always mapped.. > - */ > - if (is_ISA_range(phys_addr, last_addr)) > - return (__force void __iomem *)phys_to_virt(phys_addr); > - > - /* > * Don't allow anybody to remap normal RAM that we're using.. > */ > pfn = phys_addr >> PAGE_SHIFT; > Removing this also affects 32-bit, which is more likely to access legacy devices in this range. Put in a check for SME instead (provided you follow my recommendations to not set the SME feature bit on 32-bit even when the processor supports it). -- Brian Gerst
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH v9 07/38] x86/mm: Remove phys_to_virt() usage in ioremap() Brian Gerst <brgerst@gmail.com> - 2017-07-08 15:00 +0200
Re: [PATCH v9 07/38] x86/mm: Remove phys_to_virt() usage in ioremap() Brian Gerst <brgerst@gmail.com> - 2017-07-11 07:00 +0200
Re: [PATCH v9 07/38] x86/mm: Remove phys_to_virt() usage in ioremap() Arnd Bergmann <arnd@arndb.de> - 2017-07-11 10:40 +0200
Re: [PATCH v9 07/38] x86/mm: Remove phys_to_virt() usage in ioremap() Brian Gerst <brgerst@gmail.com> - 2017-07-11 14:10 +0200
Re: [PATCH v9 07/38] x86/mm: Remove phys_to_virt() usage in ioremap() Brian Gerst <brgerst@gmail.com> - 2017-07-11 17:40 +0200
csiph-web