From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753653AbdCBPaY (ORCPT ); Thu, 2 Mar 2017 10:30:24 -0500 Received: from mail-dm3nam03on0072.outbound.protection.outlook.com ([104.47.41.72]:52663 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753134AbdCBPaL (ORCPT ); Thu, 2 Mar 2017 10:30:11 -0500 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Subject: [RFC PATCH v2 09/32] x86: Change early_ioremap to early_memremap for BOOT data From: Brijesh Singh To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Date: Thu, 2 Mar 2017 10:13:53 -0500 Message-ID: <148846763334.2349.9327692408737971533.stgit@brijesh-build-machine> In-Reply-To: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> References: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR22CA0050.namprd22.prod.outlook.com (10.171.142.12) To CY4PR12MB1607.namprd12.prod.outlook.com (10.172.72.16) X-MS-Office365-Filtering-Correlation-Id: 757a84d4-fadd-449a-6bfb-08d4617eccfd X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081);SRVR:CY4PR12MB1607; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1607;3:dltl4W4ajiE6YdSa2kxJpIQr/DexSIYw7sfLeBso/0OsP+a1qabVRRrTjeXkkLwVziirJGmaXfBWM6KLmlDKGl9jFd8fVy1SSz4bdm6pLbyLhCjJOZLqSdK0pgF6Y+kg6Z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cc74f5uqaoXUYzQLq8pNIvqAPNbJyGf5sdPoid0xGcUT5RbtKnkbWE3qHqkyC9pI3k477bi1Btmo6STEQfFrtgcJLdGBxpSsut5BfckCgcN0G3J0MIxcKeUf8iJgD0thBNDAxf9mAb/1mT0L1tQVHi+3MNjjRBsJS5L8eOMtWMDiI7+mq+pZQUumgfIUjHNEh+nriemwCm5qDLJrTP3yuBRbTov6dzMAlFKivJ8R4ixWhhL4AzcQQIbjQj81YMT2iVHZOnYw9boWcMcg8mbQdxwZF3sSSWeusbUSCdyQunsT7wFZFs5mVh6lIW6dvg68tERk6YEK11doO0Exn2pTB29WCbxqI9IW2Hv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123558025)(20161123564025)(20161123560025)(20161123555025)(6072148);SRVR:CY4PR12MB1607;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1607; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1607;4:OkvOyh7El2F5efPeInfePDlRhBfYpwWzdGhWDt/cqRws4xC9n9f3Wio7yKzl4KzMicjybJCRPNapzEsB2Y1wdHSX/rKohv+H0Wd/xN7gh9LIDPPAxOOlMkSkY2M8TvVupAOqugqd8PHKaphyOpmWyMB9630BxQ+P2xxpTtNZui56oYfboLmowSJ5nKlhUQ7RTRb/f/+pCD4+8Db5GGYfGNRe0zvzZRe//edHzheLNHJ0mGCp/YLj0k8s3B4W6Ovv8l9AEi48QjDEV+ga6Q4JihlEL0yacpz4prlSGxBnKeVS6kwM43JH34Lw9OXPht3vlVIDMi3RVQc8rO3W85PdtkjADQ93s74CkKD33HIElXB0xyD4aWXM2mizM5RJqRmt/ok1X2zIuFSLYsMpvfXd034Z+WXrGREXRrg7pUe5sJksd8QHkZvDQ+BrSdNsjrScOSmN0Zptk8/c/ICi6Uni/Qm5jOEUGmQnomj0Qb+zemy1jdVmvTWF221H+RXWmazcuYG6fKFZYfpDbX8BkUFRvRyg4tH80+s712FtsSz0tzqhDjuePzcpTrsDpz4+yopoXQYNkO2L2FTW8Bdp3Cy8MC5YHV5HJnHUpvBVQ9pLp9jKr4M60MCJ04hnckenII7fSQcmMa23sJZmQQZ2tZPvXI1i0WXCaa9v+kZj8IxsBcY= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(39410400002)(39840400002)(39850400002)(39860400002)(39450400003)(33716001)(53936002)(7736002)(38730400002)(6486002)(77096006)(25786008)(90366009)(189998001)(1191002)(305945005)(50986999)(76176999)(54356999)(33646002)(2950100002)(5660300001)(6666003)(83506001)(9686003)(6116002)(3846002)(92566002)(2201001)(230700001)(7406005)(86362001)(7366002)(7416002)(50466002)(2906002)(23676002)(42186005)(103116003)(47776003)(81166006)(66066001)(8676002)(921003)(1121003)(2101003)(83996005)(84006005)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1607;H:[127.0.1.1];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxNjA3OzIzOkJQcTNlY1VPb214TDBBSzBuVlBIdXVMWVNw?= =?utf-8?B?WGE2dlBVMXJpWVVPUk50VHNsUXlhaHJsajdHcGpQSHM5THpFRGJKL05XZHVs?= =?utf-8?B?aWRUNmZoR3F0alZhcUpXc2xLOUpoOXRuMHBlNmJJWExUWnVYU3JybXN5M2lS?= =?utf-8?B?NEIwSFlCZzhZemNNRDVNTjZqeTI4bVpHZmQ1NS94cnErbDlOdklxT1pXZkVO?= =?utf-8?B?dHdCQUlXaTVpYk9BQUU0cDdzbzZibDJjT0VNTWlXYld2M0Zqd0dqYjJOUFFP?= =?utf-8?B?R1VTclVtdm1rNWtpODBHWHR0dDZQU2FWOFVWVHdidmViW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i6bTkTJk2fKrKpl1TbqUgSVM2F4KVpBrwKCvxBVZLuw04kSJ3I7LeHSlCq6O8Upm6QEUIp3K0eT6FeUt87ZIdYVlQE3fP7iMqWO5TnREe3990NkwO6IPdXG1VQfL+JGYMzYY5PWfPg==;24:XTYOv1dENvCyfnCvuerD8Q7jxdlnY/eoQP89sGPfik3qckzPfptkZmuVvbNz6NE+6rjA100ZLoGveFUfmNyVGdT0tqRcWstMHzp2BsTAoDc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1607;7:+HTGtr2VB4lI1PKMF4BLNR8gCttbETdoJIC4azB5sVyiOqFmohzYP4iKarRFujRqFCv0BJgrmujJ9HUASysql73d3InTb2P2R5rE5FnnU0eWBX9LV8/SxKYn4NNOygn21lcYE5i+VuIJZVxhmYEXuqjGET50vkH0ovl3t3cLZKHt+WRuwPulG1tpi88hy5TRG3zceUkldYKgg7tXj3a93j7nCmZ9gU+Jx5Jw4KMu925UwTRNTNdEKbkt3gPvOPVixClyxRQZdeHhPzJMGa4Vp46z8pBMn0MFlXpE4mQeJoHV3SiB7NKSLMgY5qMpBI+SbAStPpsxa241u/WFSh7dJw==;20:QCVy/5eLPBTvys+Sy2+8kRsEeprEr1E6Uw0+lgfSHouL+z3vzE3Ngkuu3WXcDMEKE1xhSc1cf1Pt1ujzNbbtsZ1en+zGQvEi4YoC6Xqb7Jqv8gMdqgJt37PBkshhbWErJ/RFRpYnfDipIbb1+MQ6tlpXkM06bSwvCXOm5vUV7KNTIqKOLLMHJ0uz2so5kC7Ums76F0MhWHIoMhan7Jnmgk4YPi0MMMGl6PNRpyhITJKeMY28WhPNPasRKUaLnj7w X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 15:14:15.7609 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1607 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Lendacky In order to map BOOT data with the proper encryption bit, the early_ioremap() function calls are changed to early_memremap() calls. This allows the proper access for both SME and SEV. Signed-off-by: Tom Lendacky --- arch/x86/kernel/acpi/boot.c | 4 ++-- arch/x86/kernel/mpparse.c | 10 +++++----- drivers/sfi/sfi_core.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 35174c6..468c25a 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -124,7 +124,7 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) if (!phys || !size) return NULL; - return early_ioremap(phys, size); + return early_memremap(phys, size); } void __init __acpi_unmap_table(char *map, unsigned long size) @@ -132,7 +132,7 @@ void __init __acpi_unmap_table(char *map, unsigned long size) if (!map || !size) return; - early_iounmap(map, size); + early_memunmap(map, size); } #ifdef CONFIG_X86_LOCAL_APIC diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 0d904d7..fd37f39 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -436,9 +436,9 @@ static unsigned long __init get_mpc_size(unsigned long physptr) struct mpc_table *mpc; unsigned long size; - mpc = early_ioremap(physptr, PAGE_SIZE); + mpc = early_memremap(physptr, PAGE_SIZE); size = mpc->length; - early_iounmap(mpc, PAGE_SIZE); + early_memunmap(mpc, PAGE_SIZE); apic_printk(APIC_VERBOSE, " mpc: %lx-%lx\n", physptr, physptr + size); return size; @@ -450,7 +450,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) unsigned long size; size = get_mpc_size(mpf->physptr); - mpc = early_ioremap(mpf->physptr, size); + mpc = early_memremap(mpf->physptr, size); /* * Read the physical hardware table. Anything here will * override the defaults. @@ -461,10 +461,10 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) #endif pr_err("BIOS bug, MP table errors detected!...\n"); pr_cont("... disabling SMP support. (tell your hw vendor)\n"); - early_iounmap(mpc, size); + early_memunmap(mpc, size); return -1; } - early_iounmap(mpc, size); + early_memunmap(mpc, size); if (early) return -1; diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c index 296db7a..d00ae3f 100644 --- a/drivers/sfi/sfi_core.c +++ b/drivers/sfi/sfi_core.c @@ -92,7 +92,7 @@ static struct sfi_table_simple *syst_va __read_mostly; static u32 sfi_use_ioremap __read_mostly; /* - * sfi_un/map_memory calls early_ioremap/iounmap which is a __init function + * sfi_un/map_memory calls early_memremap/memunmap which is a __init function * and introduces section mismatch. So use __ref to make it calm. */ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) @@ -103,7 +103,7 @@ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) if (sfi_use_ioremap) return ioremap_cache(phys, size); else - return early_ioremap(phys, size); + return early_memremap(phys, size); } static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) @@ -114,7 +114,7 @@ static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) if (sfi_use_ioremap) iounmap(virt); else - early_iounmap(virt, size); + early_memunmap(virt, size); } static void sfi_print_table_header(unsigned long long pa, From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brijesh Singh Subject: [RFC PATCH v2 09/32] x86: Change early_ioremap to early_memremap for BOOT data Date: Thu, 2 Mar 2017 10:13:53 -0500 Message-ID: <148846763334.2349.9327692408737971533.stgit@brijesh-build-machine> References: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> Sender: owner-linux-mm@kvack.org To: simon.guinot@sequanux.org, linux-efi@vger.kernel.org, brijesh.singh@amd.com, kvm@vger.kernel.org, rkrcmar@redhat.com, matt@codeblueprint.co.uk, linux-pci@vger.kernel.org, linus.walleij@linaro.org, gary.hook@amd.com, linux-mm@kvack.org, paul.gortmaker@windriver.com, hpa@zytor.com, cl@linux.com, dan.j.williams@intel.com, aarcange@redhat.com, sfr@canb.auug.org.au, andriy.shevchenko@linux.intel.com, herbert@gondor.apana.org.au, bhe@redhat.com, xemul@parallels.com, joro@8bytes.org, x86@kernel.org, peterz@infradead.org, piotr.luc@intel.com, mingo@redhat.com, msalter@redhat.com, ross.zwisler@linux.intel.com, bp@suse.de, dyoung@redhat.com, thomas.lendacky@amd.com, jroedel@suse.de, keescook@chromium.org, arnd@arndb.de, toshi.kani@hpe.com, mathieu.desnoyers@efficios.com, luto@kernel.org, devel@linuxdriverproj List-Id: linux-efi@vger.kernel.org From: Tom Lendacky In order to map BOOT data with the proper encryption bit, the early_ioremap() function calls are changed to early_memremap() calls. This allows the proper access for both SME and SEV. Signed-off-by: Tom Lendacky --- arch/x86/kernel/acpi/boot.c | 4 ++-- arch/x86/kernel/mpparse.c | 10 +++++----- drivers/sfi/sfi_core.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 35174c6..468c25a 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -124,7 +124,7 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) if (!phys || !size) return NULL; - return early_ioremap(phys, size); + return early_memremap(phys, size); } void __init __acpi_unmap_table(char *map, unsigned long size) @@ -132,7 +132,7 @@ void __init __acpi_unmap_table(char *map, unsigned long size) if (!map || !size) return; - early_iounmap(map, size); + early_memunmap(map, size); } #ifdef CONFIG_X86_LOCAL_APIC diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 0d904d7..fd37f39 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -436,9 +436,9 @@ static unsigned long __init get_mpc_size(unsigned long physptr) struct mpc_table *mpc; unsigned long size; - mpc = early_ioremap(physptr, PAGE_SIZE); + mpc = early_memremap(physptr, PAGE_SIZE); size = mpc->length; - early_iounmap(mpc, PAGE_SIZE); + early_memunmap(mpc, PAGE_SIZE); apic_printk(APIC_VERBOSE, " mpc: %lx-%lx\n", physptr, physptr + size); return size; @@ -450,7 +450,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) unsigned long size; size = get_mpc_size(mpf->physptr); - mpc = early_ioremap(mpf->physptr, size); + mpc = early_memremap(mpf->physptr, size); /* * Read the physical hardware table. Anything here will * override the defaults. @@ -461,10 +461,10 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) #endif pr_err("BIOS bug, MP table errors detected!...\n"); pr_cont("... disabling SMP support. (tell your hw vendor)\n"); - early_iounmap(mpc, size); + early_memunmap(mpc, size); return -1; } - early_iounmap(mpc, size); + early_memunmap(mpc, size); if (early) return -1; diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c index 296db7a..d00ae3f 100644 --- a/drivers/sfi/sfi_core.c +++ b/drivers/sfi/sfi_core.c @@ -92,7 +92,7 @@ static struct sfi_table_simple *syst_va __read_mostly; static u32 sfi_use_ioremap __read_mostly; /* - * sfi_un/map_memory calls early_ioremap/iounmap which is a __init function + * sfi_un/map_memory calls early_memremap/memunmap which is a __init function * and introduces section mismatch. So use __ref to make it calm. */ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) @@ -103,7 +103,7 @@ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) if (sfi_use_ioremap) return ioremap_cache(phys, size); else - return early_ioremap(phys, size); + return early_memremap(phys, size); } static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) @@ -114,7 +114,7 @@ static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) if (sfi_use_ioremap) iounmap(virt); else - early_iounmap(virt, size); + early_memunmap(virt, size); } static void sfi_print_table_header(unsigned long long pa, -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brijesh Singh Subject: [RFC PATCH v2 09/32] x86: Change early_ioremap to early_memremap for BOOT data Date: Thu, 2 Mar 2017 10:13:53 -0500 Message-ID: <148846763334.2349.9327692408737971533.stgit@brijesh-build-machine> References: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , In-Reply-To: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org From: Tom Lendacky In order to map BOOT data with the proper encryption bit, the early_ioremap() function calls are changed to early_memremap() calls. This allows the proper access for both SME and SEV. Signed-off-by: Tom Lendacky --- arch/x86/kernel/acpi/boot.c | 4 ++-- arch/x86/kernel/mpparse.c | 10 +++++----- drivers/sfi/sfi_core.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 35174c6..468c25a 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -124,7 +124,7 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) if (!phys || !size) return NULL; - return early_ioremap(phys, size); + return early_memremap(phys, size); } void __init __acpi_unmap_table(char *map, unsigned long size) @@ -132,7 +132,7 @@ void __init __acpi_unmap_table(char *map, unsigned long size) if (!map || !size) return; - early_iounmap(map, size); + early_memunmap(map, size); } #ifdef CONFIG_X86_LOCAL_APIC diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 0d904d7..fd37f39 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -436,9 +436,9 @@ static unsigned long __init get_mpc_size(unsigned long physptr) struct mpc_table *mpc; unsigned long size; - mpc = early_ioremap(physptr, PAGE_SIZE); + mpc = early_memremap(physptr, PAGE_SIZE); size = mpc->length; - early_iounmap(mpc, PAGE_SIZE); + early_memunmap(mpc, PAGE_SIZE); apic_printk(APIC_VERBOSE, " mpc: %lx-%lx\n", physptr, physptr + size); return size; @@ -450,7 +450,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) unsigned long size; size = get_mpc_size(mpf->physptr); - mpc = early_ioremap(mpf->physptr, size); + mpc = early_memremap(mpf->physptr, size); /* * Read the physical hardware table. Anything here will * override the defaults. @@ -461,10 +461,10 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) #endif pr_err("BIOS bug, MP table errors detected!...\n"); pr_cont("... disabling SMP support. (tell your hw vendor)\n"); - early_iounmap(mpc, size); + early_memunmap(mpc, size); return -1; } - early_iounmap(mpc, size); + early_memunmap(mpc, size); if (early) return -1; diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c index 296db7a..d00ae3f 100644 --- a/drivers/sfi/sfi_core.c +++ b/drivers/sfi/sfi_core.c @@ -92,7 +92,7 @@ static struct sfi_table_simple *syst_va __read_mostly; static u32 sfi_use_ioremap __read_mostly; /* - * sfi_un/map_memory calls early_ioremap/iounmap which is a __init function + * sfi_un/map_memory calls early_memremap/memunmap which is a __init function * and introduces section mismatch. So use __ref to make it calm. */ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) @@ -103,7 +103,7 @@ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) if (sfi_use_ioremap) return ioremap_cache(phys, size); else - return early_ioremap(phys, size); + return early_memremap(phys, size); } static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) @@ -114,7 +114,7 @@ static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) if (sfi_use_ioremap) iounmap(virt); else - early_iounmap(virt, size); + early_memunmap(virt, size); } static void sfi_print_table_header(unsigned long long pa, -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f69.google.com (mail-pg0-f69.google.com [74.125.83.69]) by kanga.kvack.org (Postfix) with ESMTP id B326B6B0399 for ; Thu, 2 Mar 2017 10:14:22 -0500 (EST) Received: by mail-pg0-f69.google.com with SMTP id f21so94565210pgi.4 for ; Thu, 02 Mar 2017 07:14:22 -0800 (PST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0087.outbound.protection.outlook.com. [104.47.41.87]) by mx.google.com with ESMTPS id a62si7651216pgc.371.2017.03.02.07.14.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Mar 2017 07:14:21 -0800 (PST) Subject: [RFC PATCH v2 09/32] x86: Change early_ioremap to early_memremap for BOOT data From: Brijesh Singh Date: Thu, 2 Mar 2017 10:13:53 -0500 Message-ID: <148846763334.2349.9327692408737971533.stgit@brijesh-build-machine> In-Reply-To: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> References: <148846752022.2349.13667498174822419498.stgit@brijesh-build-machine> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: simon.guinot@sequanux.org, linux-efi@vger.kernel.org, brijesh.singh@amd.com, kvm@vger.kernel.org, rkrcmar@redhat.com, matt@codeblueprint.co.uk, linux-pci@vger.kernel.org, linus.walleij@linaro.org, gary.hook@amd.com, linux-mm@kvack.org, paul.gortmaker@windriver.com, hpa@zytor.com, cl@linux.com, dan.j.williams@intel.com, aarcange@redhat.com, sfr@canb.auug.org.au, andriy.shevchenko@linux.intel.com, herbert@gondor.apana.org.au, bhe@redhat.com, xemul@parallels.com, joro@8bytes.org, x86@kernel.org, peterz@infradead.org, piotr.luc@intel.com, mingo@redhat.com, msalter@redhat.com, ross.zwisler@linux.intel.com, bp@suse.de, dyoung@redhat.com, thomas.lendacky@amd.com, jroedel@suse.de, keescook@chromium.org, arnd@arndb.de, toshi.kani@hpe.com, mathieu.desnoyers@efficios.com, luto@kernel.org, devel@linuxdriverproject.org, bhelgaas@google.com, tglx@linutronix.de, mchehab@kernel.org, iamjoonsoo.kim@lge.com, labbott@fedoraproject.org, tony.luck@intel.com, alexandre.bounine@idt.com, kuleshovmail@gmail.com, linux-kernel@vger.kernel.org, mcgrof@kernel.org, mst@redhat.com, linux-crypto@vger.kernel.org, tj@kernel.org, pbonzini@redhat.com, akpm@linux-foundation.org, davem@davemloft.net From: Tom Lendacky In order to map BOOT data with the proper encryption bit, the early_ioremap() function calls are changed to early_memremap() calls. This allows the proper access for both SME and SEV. Signed-off-by: Tom Lendacky --- arch/x86/kernel/acpi/boot.c | 4 ++-- arch/x86/kernel/mpparse.c | 10 +++++----- drivers/sfi/sfi_core.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 35174c6..468c25a 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -124,7 +124,7 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) if (!phys || !size) return NULL; - return early_ioremap(phys, size); + return early_memremap(phys, size); } void __init __acpi_unmap_table(char *map, unsigned long size) @@ -132,7 +132,7 @@ void __init __acpi_unmap_table(char *map, unsigned long size) if (!map || !size) return; - early_iounmap(map, size); + early_memunmap(map, size); } #ifdef CONFIG_X86_LOCAL_APIC diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 0d904d7..fd37f39 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -436,9 +436,9 @@ static unsigned long __init get_mpc_size(unsigned long physptr) struct mpc_table *mpc; unsigned long size; - mpc = early_ioremap(physptr, PAGE_SIZE); + mpc = early_memremap(physptr, PAGE_SIZE); size = mpc->length; - early_iounmap(mpc, PAGE_SIZE); + early_memunmap(mpc, PAGE_SIZE); apic_printk(APIC_VERBOSE, " mpc: %lx-%lx\n", physptr, physptr + size); return size; @@ -450,7 +450,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) unsigned long size; size = get_mpc_size(mpf->physptr); - mpc = early_ioremap(mpf->physptr, size); + mpc = early_memremap(mpf->physptr, size); /* * Read the physical hardware table. Anything here will * override the defaults. @@ -461,10 +461,10 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) #endif pr_err("BIOS bug, MP table errors detected!...\n"); pr_cont("... disabling SMP support. (tell your hw vendor)\n"); - early_iounmap(mpc, size); + early_memunmap(mpc, size); return -1; } - early_iounmap(mpc, size); + early_memunmap(mpc, size); if (early) return -1; diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c index 296db7a..d00ae3f 100644 --- a/drivers/sfi/sfi_core.c +++ b/drivers/sfi/sfi_core.c @@ -92,7 +92,7 @@ static struct sfi_table_simple *syst_va __read_mostly; static u32 sfi_use_ioremap __read_mostly; /* - * sfi_un/map_memory calls early_ioremap/iounmap which is a __init function + * sfi_un/map_memory calls early_memremap/memunmap which is a __init function * and introduces section mismatch. So use __ref to make it calm. */ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) @@ -103,7 +103,7 @@ static void __iomem * __ref sfi_map_memory(u64 phys, u32 size) if (sfi_use_ioremap) return ioremap_cache(phys, size); else - return early_ioremap(phys, size); + return early_memremap(phys, size); } static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) @@ -114,7 +114,7 @@ static void __ref sfi_unmap_memory(void __iomem *virt, u32 size) if (sfi_use_ioremap) iounmap(virt); else - early_iounmap(virt, size); + early_memunmap(virt, size); } static void sfi_print_table_header(unsigned long long pa, -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org