Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3933285ybv; Tue, 25 Feb 2020 09:56:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwGUJJr9sDo/q1H2Kj09RJfF2bCA+DOAXEJsMwti7yJT6XlTYmkY8bLZkWqH/2Y18JaSWsS X-Received: by 2002:a05:6808:8d0:: with SMTP id k16mr131990oij.68.1582653386480; Tue, 25 Feb 2020 09:56:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1582653386; cv=pass; d=google.com; s=arc-20160816; b=INZoWgdlVw2bgXKbzume5Ps6yzY7vGFZnJyiVsgWcNfWL1sFnoXY98gtcbzFsMKJqy H4BS6oIl7oR9S11a+TvgmnLJBrx7EBnbmyI5cANTln9QNVLJZDYVDxffCSFOD8Y+UN5b hJMe4CvfE7cDY/9YIGkr4s1mpB2F3ToNJ1TIDYeoAhoE3chgK/eb5ToDYwZMuJ06e4F8 7P0/WzefDpfnrgiKk2B69i0Xs3vcFlWQMHTIqj+Pe/XWenoTkRDydX2whC+4KY4vRNjU chG5sT7179wgj8hiIp+o9FN9sKWBDXQTss2AReB1fRnc8m4O/bmpcRSx0Ox/GLIGLS8U gnHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=AjneBDvsnLQdnepiwO96/O7C93f/e0k0WmzetU/zjI0=; b=CS88DYt7DDBAcRxPrrVnmSUSeyqbwF5EyI5uzSmWof5qebq7P/ynCIxW356TCZbWLM g7ipFCWXx9lLmysCVGzgdMpC6lxP+KZqr7uFNgNipSIW3IzMJLO1uoerKW4GkRPqe2OD TwebIsnE6uFTaoEc7DcLrfHsopoKeG4+DolfT0R3cenBmF67GTG9bsAAykpVy4beXYQ2 pMxEb3/cEcLeBp7NwnfjBNpeYvmrs2Wl2Lv4lAMqMTKL7d7h6cQ3OP31dMhGwTwxV/eq roE+tBEHPtxojL6StGhvSVaoT0emxb1JSb2T4VWFYPzXwU6m0cEmenWRYrY5QjCUq2mW kHaw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=zNFribzm; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g22si7961814otp.55.2020.02.25.09.56.14; Tue, 25 Feb 2020 09:56:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=zNFribzm; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730646AbgBYRlY (ORCPT + 99 others); Tue, 25 Feb 2020 12:41:24 -0500 Received: from mail-bn8nam12on2055.outbound.protection.outlook.com ([40.107.237.55]:6057 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728499AbgBYRlY (ORCPT ); Tue, 25 Feb 2020 12:41:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RLPPPmh861BW0P1eq7Mpoy20u6ZY5utk+R5I2Qg5q9PxEgh0W4tr0aRdYueGRN+OI96tYfsNwyy6t6atL68r1rffwjFd+FoRSP7+OzaRvUFKX/wye3uMhz09ShGAr5Wn6X+xQw52V4mE0FGmyjoUSe0NjV0pUvaDixZDxjYs6r0sopra9XIbV0S8HMrnNEIGGrIG25oqNn14wyEzoqOhCOZr16jPzXw6IwTgfq6wcwJ6mKcG1yaID/i5Q4WGzxKCPB11rSr3Jn+qqVnRuJHqrg3p9EIWLMA9ngp6N8lOh8dr50+Es9cyKa65Y76KZ9uNJeZxuBWpXf/eilaFIvb2Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AjneBDvsnLQdnepiwO96/O7C93f/e0k0WmzetU/zjI0=; b=ZP+rFBAdKgGntQx1WBlA0qKYTbNe8W1XwWTBMe47ZcMTffN8ZkOcPugOVZ5BhRv3sHW13CvK/dpyHKJv1cLDtwmq9hFumzFAE6mWXYygDpUsJkecQ4HlBHWvFzBOMVrFR/fLfg2mq5JV2z3jPdiAKHGuX6RuJS/oHxhid+zCm97zYJGv+k+rI+Ki/XxuFkGbGIwSba7/aRn4lfJsTDM9pTuir5XJ9UGMQ3H8NlwpLcBQBsXLHQHLagjrRVLmPfdMxUgpFnnh02sY6UVTeUerDQq14DA9gU0Hav6jx9hYrkM5tyRrAABLH4sZ7767kf4+486elBGB0nG7vVsJABzoAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AjneBDvsnLQdnepiwO96/O7C93f/e0k0WmzetU/zjI0=; b=zNFribzmJIcNXrYS1nQJgUXykgn/oS1jVsG1In1M0xwQbHA3i7pWcTbKSVclWFQxPWHuEQhAHqkLu9tdmsbPx1LNvvugVQ3N2hyOlegt+TlxkfPMtqncik+t/cZzavCFCyb/Tf6NBdkesAlZB3qtQq5TrhUNDu6dSNpQPoJICUk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) by DM6PR12MB3850.namprd12.prod.outlook.com (2603:10b6:5:1c3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.22; Tue, 25 Feb 2020 17:41:21 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::f0f9:a88f:f840:2733]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::f0f9:a88f:f840:2733%7]) with mapi id 15.20.2750.021; Tue, 25 Feb 2020 17:41:21 +0000 From: Tom Lendacky To: linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: Ard Biesheuvel , Darren Hart , Andy Shevchenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v2] x86/efi: Add additional efi tables for unencrypted mapping checks Date: Tue, 25 Feb 2020 11:41:06 -0600 Message-Id: <261ea8108c6290e95962be2638bd204f90787c1c.1582652466.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-ClientProxiedBy: DM6PR18CA0016.namprd18.prod.outlook.com (2603:10b6:5:15b::29) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by DM6PR18CA0016.namprd18.prod.outlook.com (2603:10b6:5:15b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18 via Frontend Transport; Tue, 25 Feb 2020 17:41:19 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 84b99741-3dd3-4b43-afde-08d7ba19ece1 X-MS-TrafficTypeDiagnostic: DM6PR12MB3850:|DM6PR12MB3850: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0324C2C0E2 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(136003)(366004)(39860400002)(346002)(396003)(189003)(199004)(5660300002)(66946007)(16526019)(26005)(6666004)(478600001)(66476007)(186003)(7696005)(4326008)(86362001)(52116002)(66556008)(8936002)(6486002)(81156014)(2906002)(316002)(54906003)(4744005)(36756003)(7416002)(81166006)(956004)(2616005)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB3850;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oIfylyXYPOjLVk9TKhCuB7MU4iMCYFTa2N8zUEfq+iWaqnPmzUDwmxO4CttiFahuO7uUF9bJfY+x/KwBenkyPVkJDIyB5HqenjelBVOel6Ia558XYCaIYUMaY3xoJlVjPHmJN32ALCcv1qpU16rBGYJOHm8U128iN3PTVUjVC060zjTotZp9DmCtLR+0QFBXUajpV6J8aL3zscKfmBI1do7gDyplFtBl4RwZShj8xDkKy+BwapRuXXXQm7SX0y+v5liao5sRhcvLN36sru6Ys7CKTPzQ+BIfkB/7LSDy95zWqCXV5hMRgnBlhZSE0jbUCYduzJrG2CZxQxKPOvBLQ1nbhK70HwAIXnqH8A3JfiV0vZJj+5EzEwHUKqaHQNllcQPX09+byZJWg+FGuyYSgEt69YKbw1NKYqrBQn9F/VPBa8zt3h87tGc3P1Lc19YW X-MS-Exchange-AntiSpam-MessageData: rw6nUIPllrqBbo34HT3ysGeYbBAs2Sn3k7Jo6Zg4rjr9/j/PuSDxJuB7b4M3leuwkwqnEegQT1OZF5ZupPrJjUrFTAY7LotLdQQmk3xfjwltP9XnGm0M8sfR9gj5XWGZeFSHkaTWwTGiHLfMVWVp0Q== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84b99741-3dd3-4b43-afde-08d7ba19ece1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2020 17:41:20.9905 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AvOBjVeFcyzO1z8gAjqFtEuq2kj3WBMeKbEgpyaKM15jrXg3TyVpOWUHSOJwYaR1a+rzSU48M4UGgKzuJY+UmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3850 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When booting with SME active, EFI tables must be mapped unencrypted since they were built by UEFI in unencrypted memory. Update the list of tables to be checked during early_memremap() processing to account for new EFI tables. This fixes a bug where an EFI TPM log table has been created by UEFI, but it lives in memory that has been marked as usable rather than reserved. Signed-off-by: Tom Lendacky --- Changes since v1: - Re-spun against EFI tree --- arch/x86/platform/efi/efi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 43b24e149312..c6ca959e2366 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -88,6 +88,9 @@ static const unsigned long * const efi_tables[] = { #ifdef CONFIG_EFI_RCI2_TABLE &rci2_table_phys, #endif + &efi.rng_seed, + &efi.tpm_log, + &efi.tpm_final_log, }; u64 efi_setup; /* efi setup_data physical address */ -- 2.17.1