From patchwork Mon Jul 17 21:10:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9846213 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0D4CF60212 for ; Mon, 17 Jul 2017 21:18:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 452D127F7F for ; Mon, 17 Jul 2017 21:18:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39FDE27F89; Mon, 17 Jul 2017 21:18:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 760F427F81 for ; Mon, 17 Jul 2017 21:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752058AbdGQVM1 (ORCPT ); Mon, 17 Jul 2017 17:12:27 -0400 Received: from mail-bn3nam01on0065.outbound.protection.outlook.com ([104.47.33.65]:52969 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752013AbdGQVMO (ORCPT ); Mon, 17 Jul 2017 17:12:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gxu7seeKv7Lzj5lS20B8aOopqn0uzhTzfX7DkIF/qe0=; b=Ba9UsO8GJK8DeIFjnY4D64sQD8r0WzV/0OWTPB1H7hlTQZO8IMdg7sal/EyBuRhUeeUfKzPKSWl4ReiVuMg/y4Hm2fZta5mib98qRuh/Ew8nK/oQpM6GxMqwdnEdp8q9fQJD85OIOnQWd12Z+hS8DHf1urZKCwtqAaJpwQ+iwDs= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by MWHPR12MB1151.namprd12.prod.outlook.com (10.169.204.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Mon, 17 Jul 2017 21:12:01 +0000 From: Tom Lendacky To: x86@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kasan-dev@googlegroups.com Cc: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Konrad Rzeszutek Wilk , Andrey Ryabinin , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , Paolo Bonzini , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov , Rik van Riel , Larry Woodman , Dave Young , Toshimitsu Kani , "Michael S. Tsirkin" , Brijesh Singh Subject: [PATCH v10 20/38] x86, mpparse: Use memremap to map the mpf and mpc data Date: Mon, 17 Jul 2017 16:10:17 -0500 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR03CA0008.namprd03.prod.outlook.com (10.168.230.146) To MWHPR12MB1151.namprd12.prod.outlook.com (10.169.204.15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3012803-4ffc-4a43-f0b3-08d4cd587cd7 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR12MB1151; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 3:+cqpPrs0b2wtZB82aFarLU6Mbcs5NBr2kyG1S1Ax0JRXPAOjvjgMuvlBAtZYQCbYiM9fJjVHJOwWbJlKzDioAdLVDs0N3Pg9gPUCKC3kibsyrAPlnG/IfO1wbGlhjsF6LWpFuSffidl+B/Qo0QTNaE2VSNnVdkyW3ZUaua6geYng1O4RY8IkCVEHW5KIUkZgbEy0Dz0edVUVah+2RGrc3eBCmxZhO7dXy5qfCeZHHKuUIN/bZ1hxVZKITLbbAza5B2ZMrBDeO0AfczrjQMCGBFgqGMGNJ49veOvhQbF92fu09FIkAa+R/pqLBFd+nOjSRYm/LKJeU+eHlbRVV3iOU5mDrWi4Re0+Wv2c8DIXbuG++RsI4LbQ2KqA6kNcwVXCtNirVABamub1oQH3irz+0ylGFYXzLhQbpHJ/boMUSd2XEDORHTzDr5hO7ruvUmhhi0w5HLc/u0+jHzj+byHEXQcwKTMInRj40aG36L28EA1oAyWpEIP4rLsKE2HIJ6+zdIjz7RXJNit6W4Fjzjq0gCflLb/YsrIIYvYMwPeyI/yh2UOCs3vjLellvfPaVDpPvFTADFJwez0eJ4COEf7K3ygZqz1y6xPzrGkDOK6tQMmwAVFdMfkwQpqOXP+IjuAxEHOHkCGf/fR9tFTlFJT98GIAtgZ1eBKDPwaXfVx6H4QmMNH7t/QpJKIGrAjPAtpaYSe95ogY5Y4QnCpfC/bYy1XwUEqVEm7H06JpkiLR6RUISYc0SRDe61TfvP92FInP8AwDh4CoRhxbpI9cwekx0A== X-MS-TrafficTypeDiagnostic: MWHPR12MB1151: X-Microsoft-Exchange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DLnBfJ3a9wMzZd1MDAhpwoD82HvuVBeb7sECYm7ggn9FSljuuEnYV0BhrX+L9p09QlKV3QHRTULVx4S8+01K6LQBp X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110)(788757137089)(148574349560750)(167848164394848); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1151; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1151; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 4:97APCyCquGifL/O3lhHumDxWWR65ebDNe1+fEngEh1?= =?us-ascii?Q?YFhZqZHfdYAI7wMOVACKLGtyWJ8deGfqoX8I0SdbzHSNwEtiGBho0FsoGhPO?= =?us-ascii?Q?TNQ6+liOZcyj/Iwxc7zgPhb+6Ip/Imut5/8xRA3HIaQ7jh9ZDODSZAORfGiI?= =?us-ascii?Q?D3tKvIBNtwciAb+khht0MgdNgB7xGBG+nzh4cs4n8CUaqNTl9ddW2CdVGCUR?= =?us-ascii?Q?gSti6mKF3H4+CxZEUyubxiXE6Xz3KcNzkuCTwHNH6qcaHEF2wqpmRYQV9bxE?= =?us-ascii?Q?bwIIxUN5SiTc5DQAh+n1prNeIe//fiQuV2dTYrm+T5iDdDxnB7vFSaN3jjRn?= =?us-ascii?Q?IlP8rUgE5CI89sFYJFtVPfRtI8ZdLeb8Pswc6I8P967sHLP2DN9S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cOy7wtuNZWnxnZJ6txlQowkZGF+yw+e?= =?us-ascii?Q?/RWDtzylPDe7nvIIDOZADIE6U++eH4RPsccDx06RDsYA78tERBZqAyKTHEoA?= =?us-ascii?Q?JjWOP3mB7STdouEXKaEz2sYc4=3D?= X-Forefront-PRVS: 0371762FE7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39410400002)(39850400002)(39840400002)(39860400002)(39400400002)(39450400003)(25786009)(6506006)(33646002)(54906002)(7416002)(76176999)(478600001)(8676002)(50986999)(6486002)(47776003)(5660300001)(189998001)(42186005)(38730400002)(305945005)(72206003)(53416004)(66066001)(50466002)(48376002)(110136004)(118296001)(2950100002)(81166006)(5003940100001)(3846002)(6666003)(36756003)(53936002)(7350300001)(6512007)(2906002)(7736002)(6116002)(86362001)(4326008)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1151; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 23:A9Gk4XIWvFiIBseihry6Bpsh/Rks4wHmqMY36Zy7X?= =?us-ascii?Q?g2Ut0IFE0wxwu3Q9k7kNDMA05X+xVAdWi78dFPsm95IirxkU767l/Z4xoI1r?= =?us-ascii?Q?SYZ/eL+JrrdYsFMWEJkap90U/UV8fEupN4+TRkhRJSQZ5Hml5u5R3/ag4vU/?= =?us-ascii?Q?trQneTmp1Axikj6kcjDRtEV4QJsagmNp1r5NTBJDqzyOt3SFF3/B2GzZoe7y?= =?us-ascii?Q?qp5lyCQVScSf8UwIYa6OmVzQ/eFphQdkzC8CVORkwQH/5/KZLQkUlLIrKxsP?= =?us-ascii?Q?KHo2U6Feu4FOcqNhW+NPyT+06FSR047ZjMUPJRzP6qpJChkfYizvnNiTFL3T?= =?us-ascii?Q?bhnG5Y9ZACRJwH41X72a3Tl5PD/zXQLDbPeIekE33oK4QVuQ94aNKclfUxAE?= =?us-ascii?Q?zlROheWYUBToQrzNbHKc7TJy12m6Tv8uIeUm92cCr+hmrN9CltaRkhvPIysI?= =?us-ascii?Q?bhf3C6UwuTpCZNo/CHtRjevDN26AHoeyU3Gr8KS6myOjSJxVzM8N6CPn8fAF?= =?us-ascii?Q?1tOPhRqJeH6QUntYElY3vpCGGeZ0hpF/6aawpF0Q5p7uZG7JX6YiujQtbCAn?= =?us-ascii?Q?9qqhE3jDTcb3a6xaALnI3FBoBM77sjsOfw1D0G++J/OWgae6vFOW/riAHHO3?= =?us-ascii?Q?OSk8RUJwL7EJrJpi+f55KvKadRAHDnOb+vih6BzBtjj3TeLTYs/ZsIybWIxV?= =?us-ascii?Q?Xi6JqcDGc3M9idQ2ujAlUKR8eKDh81OEoCWkxGytz90oDkvsX8tkOFH9xuDf?= =?us-ascii?Q?tf5YTNOLCwr0/sqeRfqVJAZYlN2MRf7qyN3WUG80Sl62xrK86yVqPvDnrP6P?= =?us-ascii?Q?bopBmKiOOOhpVJ0ggyJuEBkVW6o2If5iDpBP3fZG+IEyP1/ipOjclTOdSU8o?= =?us-ascii?Q?qjVyeelWB/gxSFF5B7Ht5qeGQnPSRwuHkpg4qkFyVhlis94p9oQNRJxtcMtU?= =?us-ascii?Q?Ke+i6PYnWnXnAFJLfWFA3OgPHP9CnttuSvfSkBf8p/22KP1d4rSljOFxHeA9?= =?us-ascii?Q?T/G8gOM6z3hi9nE+s8krZAX4/sfNdeCE+R+POiJuxh4gatCy0KZpa1IyZ+1V?= =?us-ascii?Q?MWCZFlotdIrvN4mM5KkstuFNP3K+655Gt+BA0kuxobC+yyugBw4C082RXJgu?= =?us-ascii?Q?Pahdx6qec4DtGbxTp49mGlqKAs/RHqhDen/9LP/zMTZm4dW9A1T9ocA2ZJso?= =?us-ascii?Q?RkYshgVfRqLk3M=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 6:grqg/+H/mr4g2qQKUHKTrGIG1qFftyvAKspnO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u2Dq38Ytnzmk9THCr9zP3+MVcaMaUTcWR?= =?us-ascii?Q?PwCASoAwGl8DAE8SiyXHOSFmOoRMfNe0UEMBGi6SajM+uLiiS9vVEuHlyVy7?= =?us-ascii?Q?LRvQjuSOO78bam/Xsqn9RF?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 5:cJuj16TypRNq4Wt/ZzCTSmFYLXNR6pL2cAxg+BxKoJnKwt1LpBNDHSoqCS1dCJ/ZYejm9l+SQlXexMlalEuqMipihHiVvcSGDsNUKz8rRZxmArdmqXgp2VBwtndtgSTy8yoVD+qqziIMNSgiKOzGa4nbSOnOKoxFmK0Mb/k9RYZ1DmfGWmdpdOMXKvTjUznrBbAHFOiyECa7ARcvLMnhZ6/937DBoW/Yx+lyEOuTbWIqDtgodd64xyr+yCfEWXY8X7p14mIgwAfYnTZtnYnqtIB86xrcDJtWOYZnyHALboM4pqIbb3MliPsm5vxt3LRdi4+XYvzlRNl7jBP6e3zTgO/c/NAax0foVN4bSYiALpkPfjaXbdmZZb/ARfkbUFimwkDRRBDFEg6BejzSlEVyFzVEEMPqz+SKhNTXc06/p0cc7OXki1+L0AKebqbWiNTfXNoAmH9cpeAXNvADuz34FXzinjjYm8ribqshp18Owj8174vR4NXHhAa0RYToqlHr; 24:ySF2022MpLLlI6TsIADLeEPgqa57mUbP58BCBvmm3bpV6OCt5m8W83XDfgUO9IB4gFyCHgRGJ180D/pUaW7TbfMVioccgsc4sD0eWG8E1g8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 7:kmCneOQacJ4zvAg9dQNQ5xJ4RP7xV0Guk+icHyHjGqMeXkY5AZSakN+10sfJdRMhIuheBk9nuhw206H9MUQNunKOWWAEG1x7kJLUlKlgj95by5sd2qnqObtVe1P26gu6x4v3czNDeFcT8l4ZtnrVqdRSKLn686FV8kQncmQ4ks8kelexyve7BYNk4C4EbA35DyxszTWE/xNzjzmUFqQXZPvX3+uZ+3L+P0rm86vR7VLJXJqdg2/mlq7dsLrlmq8+MwknRyfQ9QVu8wYwQEk1qh4qdgpQDtp/EgkPnddedA9ZKiuU2b/Br14mN1UkLpOZoRUt+lf+sVK6l32aUZ00HIkOZB2ilLPbD3V8OHbuxARQa4AqjEFKDnfY5mFrBbvmw9RLyOQPai6mztHMAvSsyA8+5iBD3IG2TjAxLWpKXVTv1fR5iRrJ8SHMj0TCzoOfNHP1EPveDk68HadKBbfDvdmh7XKRCvfRskDXnj9GjejLOXaTQd6tjcNCFw8mxeiEKD5Ghi32NoQSwc5BA/OnFUnky3qpDXsrkrwRc+mrUMnb9T8jb5qPG3Spp/vhDJA/KeZseKGNzQlwD0aalPPPLl400RIA2t7neKax9r2da0c6tb59Ydw6PYQhrSxgghi0t5kXVDBXqYV+Ya5ik+JokzMwPGc/xXFjrrWu9cJT7XZvj7vdODjNJZ93EVsD7hDqT5yvWbhPA8hd0K1HCdrBUG6WEm7jju7yATggdg5n/2R7CQCjKxoY3kHNZY+DiaKwyoN/huGsSmA/2RHkUF1TzT/ATSkaiBlxAkmUcsblNxg= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 20:ZbebY42zeGnbZxbUsWJiUuJAUhp3upBNb9DvB1MqK5tIfKH1Qd4uGmvzFFUgHudzuLUg1njjdPrbidPWb3f/Z3AqEBzcaBmBteDP8taL+70nHMVQLK6XXiOB0PCHq7pK04mfQPPF2pZvJbpGeb1XJxXyNRtGpwInAC3bw5LHqQ8uKHBe4WYX4571vOPLgoTJZBWfIyjRkfUig5i3RHLLSOB4cHGV23CoGR8jbb0HW01kJ0K5+wfTXwR3Tfj/hOqu X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2017 21:12:01.3842 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1151 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SMP MP-table is built by UEFI and placed in memory in a decrypted state. These tables are accessed using a mix of early_memremap(), early_memunmap(), phys_to_virt() and virt_to_phys(). Change all accesses to use early_memremap()/early_memunmap(). This allows for proper setting of the encryption mask so that the data can be successfully accessed when SME is active. Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/kernel/mpparse.c | 98 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 28 deletions(-) diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index fd37f39..5cbb317 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -429,7 +429,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) } } -static struct mpf_intel *mpf_found; +static unsigned long mpf_base; static unsigned long __init get_mpc_size(unsigned long physptr) { @@ -451,6 +451,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) size = get_mpc_size(mpf->physptr); mpc = early_memremap(mpf->physptr, size); + /* * Read the physical hardware table. Anything here will * override the defaults. @@ -497,12 +498,12 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early) */ void __init default_get_smp_config(unsigned int early) { - struct mpf_intel *mpf = mpf_found; + struct mpf_intel *mpf; if (!smp_found_config) return; - if (!mpf) + if (!mpf_base) return; if (acpi_lapic && early) @@ -515,6 +516,12 @@ void __init default_get_smp_config(unsigned int early) if (acpi_lapic && acpi_ioapic) return; + mpf = early_memremap(mpf_base, sizeof(*mpf)); + if (!mpf) { + pr_err("MPTABLE: error mapping MP table\n"); + return; + } + pr_info("Intel MultiProcessor Specification v1.%d\n", mpf->specification); #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) @@ -529,7 +536,7 @@ void __init default_get_smp_config(unsigned int early) /* * Now see if we need to read further. */ - if (mpf->feature1 != 0) { + if (mpf->feature1) { if (early) { /* * local APIC has default address @@ -542,8 +549,10 @@ void __init default_get_smp_config(unsigned int early) construct_default_ISA_mptable(mpf->feature1); } else if (mpf->physptr) { - if (check_physptr(mpf, early)) + if (check_physptr(mpf, early)) { + early_memunmap(mpf, sizeof(*mpf)); return; + } } else BUG(); @@ -552,6 +561,8 @@ void __init default_get_smp_config(unsigned int early) /* * Only use the first configuration found. */ + + early_memunmap(mpf, sizeof(*mpf)); } static void __init smp_reserve_memory(struct mpf_intel *mpf) @@ -561,15 +572,16 @@ static void __init smp_reserve_memory(struct mpf_intel *mpf) static int __init smp_scan_config(unsigned long base, unsigned long length) { - unsigned int *bp = phys_to_virt(base); + unsigned int *bp; struct mpf_intel *mpf; - unsigned long mem; + int ret = 0; apic_printk(APIC_VERBOSE, "Scan for SMP in [mem %#010lx-%#010lx]\n", base, base + length - 1); BUILD_BUG_ON(sizeof(*mpf) != 16); while (length > 0) { + bp = early_memremap(base, length); mpf = (struct mpf_intel *)bp; if ((*bp == SMP_MAGIC_IDENT) && (mpf->length == 1) && @@ -579,24 +591,26 @@ static int __init smp_scan_config(unsigned long base, unsigned long length) #ifdef CONFIG_X86_LOCAL_APIC smp_found_config = 1; #endif - mpf_found = mpf; + mpf_base = base; - pr_info("found SMP MP-table at [mem %#010llx-%#010llx] mapped at [%p]\n", - (unsigned long long) virt_to_phys(mpf), - (unsigned long long) virt_to_phys(mpf) + - sizeof(*mpf) - 1, mpf); + pr_info("found SMP MP-table at [mem %#010lx-%#010lx] mapped at [%p]\n", + base, base + sizeof(*mpf) - 1, mpf); - mem = virt_to_phys(mpf); - memblock_reserve(mem, sizeof(*mpf)); + memblock_reserve(base, sizeof(*mpf)); if (mpf->physptr) smp_reserve_memory(mpf); - return 1; + ret = 1; } - bp += 4; + early_memunmap(bp, length); + + if (ret) + break; + + base += 16; length -= 16; } - return 0; + return ret; } void __init default_find_smp_config(void) @@ -838,29 +852,40 @@ static int __init update_mp_table(void) char oem[10]; struct mpf_intel *mpf; struct mpc_table *mpc, *mpc_new; + unsigned long size; if (!enable_update_mptable) return 0; - mpf = mpf_found; - if (!mpf) + if (!mpf_base) + return 0; + + mpf = early_memremap(mpf_base, sizeof(*mpf)); + if (!mpf) { + pr_err("MPTABLE: mpf early_memremap() failed\n"); return 0; + } /* * Now see if we need to go further. */ - if (mpf->feature1 != 0) - return 0; + if (mpf->feature1) + goto do_unmap_mpf; if (!mpf->physptr) - return 0; + goto do_unmap_mpf; - mpc = phys_to_virt(mpf->physptr); + size = get_mpc_size(mpf->physptr); + mpc = early_memremap(mpf->physptr, size); + if (!mpc) { + pr_err("MPTABLE: mpc early_memremap() failed\n"); + goto do_unmap_mpf; + } if (!smp_check_mpc(mpc, oem, str)) - return 0; + goto do_unmap_mpc; - pr_info("mpf: %llx\n", (u64)virt_to_phys(mpf)); + pr_info("mpf: %llx\n", (u64)mpf_base); pr_info("physptr: %x\n", mpf->physptr); if (mpc_new_phys && mpc->length > mpc_new_length) { @@ -878,21 +903,32 @@ static int __init update_mp_table(void) new = mpf_checksum((unsigned char *)mpc, mpc->length); if (old == new) { pr_info("mpc is readonly, please try alloc_mptable instead\n"); - return 0; + goto do_unmap_mpc; } pr_info("use in-position replacing\n"); } else { + mpc_new = early_memremap(mpc_new_phys, mpc_new_length); + if (!mpc_new) { + pr_err("MPTABLE: new mpc early_memremap() failed\n"); + goto do_unmap_mpc; + } mpf->physptr = mpc_new_phys; - mpc_new = phys_to_virt(mpc_new_phys); memcpy(mpc_new, mpc, mpc->length); + early_memunmap(mpc, size); mpc = mpc_new; + size = mpc_new_length; /* check if we can modify that */ if (mpc_new_phys - mpf->physptr) { struct mpf_intel *mpf_new; /* steal 16 bytes from [0, 1k) */ + mpf_new = early_memremap(0x400 - 16, sizeof(*mpf_new)); + if (!mpf_new) { + pr_err("MPTABLE: new mpf early_memremap() failed\n"); + goto do_unmap_mpc; + } pr_info("mpf new: %x\n", 0x400 - 16); - mpf_new = phys_to_virt(0x400 - 16); memcpy(mpf_new, mpf, 16); + early_memunmap(mpf, sizeof(*mpf)); mpf = mpf_new; mpf->physptr = mpc_new_phys; } @@ -909,6 +945,12 @@ static int __init update_mp_table(void) */ replace_intsrc_all(mpc, mpc_new_phys, mpc_new_length); +do_unmap_mpc: + early_memunmap(mpc, size); + +do_unmap_mpf: + early_memunmap(mpf, sizeof(*mpf)); + return 0; }