x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap() for RAM mappings
The ioremap() function is intended for mapping MMIO. For RAM, the memremap() function should be used. Convert calls from ioremap() to memremap() when re-mapping RAM. This will be used later by SME to control how the encryption mask is applied to memory mappings, with certain memory locations being mapped decrypted vs encrypted. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Borislav Petkov <bp@suse.de> Cc: Alexander Potapenko <glider@google.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Borislav Petkov <bp@alien8.de> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Dave Young <dyoung@redhat.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Larry Woodman <lwoodman@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Rik van Riel <riel@redhat.com> Cc: Toshimitsu Kani <toshi.kani@hpe.com> Cc: kasan-dev@googlegroups.com Cc: kvm@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-efi@vger.kernel.org Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/b13fccb9abbd547a7eef7b1fdfc223431b211c88.1500319216.git.thomas.lendacky@amd.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Este commit está contenido en:
@@ -25,6 +25,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/io.h>
|
||||
#include <asm/dmi.h>
|
||||
|
||||
#define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider
|
||||
the top entry type is only 8 bits */
|
||||
@@ -380,7 +381,7 @@ static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry,
|
||||
u8 __iomem *mapped;
|
||||
ssize_t wrote = 0;
|
||||
|
||||
mapped = ioremap(sel->access_method_address, sel->area_length);
|
||||
mapped = dmi_remap(sel->access_method_address, sel->area_length);
|
||||
if (!mapped)
|
||||
return -EIO;
|
||||
|
||||
@@ -390,7 +391,7 @@ static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry,
|
||||
wrote++;
|
||||
}
|
||||
|
||||
iounmap(mapped);
|
||||
dmi_unmap(mapped);
|
||||
return wrote;
|
||||
}
|
||||
|
||||
|
@@ -95,7 +95,7 @@ efi_setup_pcdp_console(char *cmdline)
|
||||
if (efi.hcdp == EFI_INVALID_TABLE_ADDR)
|
||||
return -ENODEV;
|
||||
|
||||
pcdp = early_ioremap(efi.hcdp, 4096);
|
||||
pcdp = early_memremap(efi.hcdp, 4096);
|
||||
printk(KERN_INFO "PCDP: v%d at 0x%lx\n", pcdp->rev, efi.hcdp);
|
||||
|
||||
if (strstr(cmdline, "console=hcdp")) {
|
||||
@@ -131,6 +131,6 @@ efi_setup_pcdp_console(char *cmdline)
|
||||
}
|
||||
|
||||
out:
|
||||
early_iounmap(pcdp, 4096);
|
||||
early_memunmap(pcdp, 4096);
|
||||
return rc;
|
||||
}
|
||||
|
Referencia en una nueva incidencia
Block a user