Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756441AbdGXTKO (ORCPT ); Mon, 24 Jul 2017 15:10:14 -0400 Received: from mail-bn3nam01on0045.outbound.protection.outlook.com ([104.47.33.45]:41632 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756152AbdGXTJI (ORCPT ); Mon, 24 Jul 2017 15:09:08 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; From: Brijesh Singh To: linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Borislav Petkov , Andy Lutomirski , Tony Luck , Piotr Luc , Tom Lendacky , Fenghua Yu , Lu Baolu , Reza Arbab , David Howells , Matt Fleming , "Kirill A . Shutemov" , Laura Abbott , Ard Biesheuvel , Andrew Morton , Eric Biederman , Benjamin Herrenschmidt , Paul Mackerras , Konrad Rzeszutek Wilk , Jonathan Corbet , Dave Airlie , Kees Cook , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Arnd Bergmann , Tejun Heo , Christoph Lameter , Brijesh Singh Subject: [RFC Part1 PATCH v3 08/17] x86/efi: Access EFI data as encrypted when SEV is active Date: Mon, 24 Jul 2017 14:07:48 -0500 Message-Id: <20170724190757.11278-9-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170724190757.11278-1-brijesh.singh@amd.com> References: <20170724190757.11278-1-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR04CA0049.namprd04.prod.outlook.com (10.171.243.142) To CY1PR12MB0150.namprd12.prod.outlook.com (10.161.173.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b700cf7-e496-4a9c-02ae-08d4d2c75f03 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:CY1PR12MB0150; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0150;3:5QWrcb08Nj8/spB1+pj2vidCpKJgsRVEiSC5gkrKOtPExxQ5brk89NyN1HNBzKWvy/jUWGQocrzQcn+U2VBjtafZzrs1uf3M/phZ/yqunaDXuGlJML0BpyDVDLSNhBdbgwQQ0/0r6A1wugdQP/LjjYwAcS1qKWoi/NvDXvmWiS8htUb/SulxacGR8IWlpfCb624NuwuQyaFI9V3T+k/4xyenn/Ek3brflE9DUGLEJmDgzqnszxcMuxWpmrcdx4F57pJVzT37an4s4UV3zPPdnGqzGBdDd+fWECe1UUup91kgYjtsEjPG3q9wWpL9TyCoYBmC/29btmi+xFkJI9J6YPgSOaZK9Jx4rJRag2OjLaCSRgDKt+oBla3KedEtq3vUxGMJipCeOe4EjI/jGCloLB6QycO6xNVi8g6Da0FF7snWhQwNlhdItYhYwPZsmChPURDDBSKkxkt/IfEjy0tHZeBgYE6AGsNEmMEYlOy8rn4+tNee7Ux1/dS7YdbTslVtuYQd6+cyHPnZDTY94PbCidfCGSkr/mix2Rn/hI5vuRQwjy8gAUmfF9XHSY35tCH5FVqkMj/+pZCtZ07sUjk+Nawi4RttACShOtm1K+gO7bOXt3q9y0X0JpKKiZVq61qMtz7pl3C3GwzH8nNKlcFh9q2ZXctfQcHYpWgTyfkpSkcdPUiqg3aFvMjaYpk5kjggGbTwqNMs39QZADQZVh3esgtPW6+db82Y/IstOuHADuBbUX/rkYHa2qV6bFv5HVY9OQCU9m3At+uWXEwMN+HFkg== X-MS-TrafficTypeDiagnostic: CY1PR12MB0150: X-Microsoft-Exch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2w8CIZMW21WgnDqpYePENVMcZNBayBbiYk0VaajM0k1TLPwFu35YW9SC8gIT2OL1TnTY/2 X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR12MB0150;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR12MB0150; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR12MB0150;4:lZa1XA9GN6+/6PTNCd85AdM4z6mPfGCVv2i0O5lZRd?= =?us-ascii?Q?tjRJzVxarMFoqpRA2ZLIBWuegK39giaYR2a8KCpXGd7E1fol+z7uaYbZwH4j?= =?us-ascii?Q?pYPkaIRvSS/PWj7B4E+PTyklLuB7FysQ35RyCWoczCuhY1oENb8klcjlmUg0?= =?us-ascii?Q?PZWBxhw/jeDTeU+FOxnOjOvUAa2ZTwFFC6Ed7dhhctVNQuN9dKYM57x1iJix?= =?us-ascii?Q?vOuvbGkwLWJ4c4ctIIgGCMKXhSo+FeQAI/kefOgnoashRlKFPjUPxvPYd9b5?= =?us-ascii?Q?n5pz1M50j+zh5SlMb75ubphPOqUYyTnDceo7rvqpeWXeNjBFVT2JzrN9CmkU?= =?us-ascii?Q?SrOsI0oaq8aPJ6a34y57xmZTUzYfGhfaXeq9WYs7pYamNkc/mS4uGed85f12?= =?us-ascii?Q?U6szDN4v037+R5GeqcufS25RNfmPS41IOwjlMUp6ZSh9nm064TPFpre0DUsK?= =?us-ascii?Q?NOFCWSAdS7Nt7wl1WXw3ToVqCQJCyq4Jkp/87Xw6hRRlT7cT2S2oMQPJeDXz?= =?us-ascii?Q?hs+ecnquXVy/+eS9aID0/pCzGhjnlwmxtfyk4ZjBCjwQd6xYjZ0/58tKdu3P?= =?us-ascii?Q?bTLsmz8MqWBQz56eIHgvGUORV63jEO1QBtZ2PgvwyI5zXtb8qdh46Ysi7vWN?= =?us-ascii?Q?/Jq/KXJ6jqBjCdpzPxc53ir642lpNCEGA2+5bF4ZU56N1YxZzA+c3e2QJ9l2?= =?us-ascii?Q?PFWgFCBlGK7UaUujNPxgL0UTcRWmfi86p1vmnmreT3vAo6LySfkjW8WquHPy?= =?us-ascii?Q?c5W8sV+hExrqPQfyCUIHNNOF5LaK4smG2iQTiq4LIajUyJT7K1neaDrtdO7w?= =?us-ascii?Q?eQ/MLR0+LTwmTthXEbi7ApabajlpCTK5djBhyNie2jHL5YiwuvnzSpcqCbfx?= =?us-ascii?Q?SZu96Hd5BobLbWYm/Wnp9GkGoeU/EMXQ3Wnkqs794v1HvG9vFcc78LWUwU2/?= =?us-ascii?Q?J3g1qYqO/SXc9X/7+o8K15mc1HajAhhYElQP6w4Nsyav97WKNB5hoaWRz5s1?= =?us-ascii?Q?J/sykbLrdC/xrLxnJO9Tfq+VbFXy1XzdYTdDbxfI4nb8ZVl1MJhtes1v+bMg?= =?us-ascii?Q?+HDLIF9aOQKCDrL1gNi2DDJDax2f9h+0AogJ+pQRmeH4BR4+JlKNpd81Aoi6?= =?us-ascii?Q?FsXtp6SVA9KCuL622UNRPqdjubKv7cE85iMKUfmaybRPZO+foLCGGJd2QNDN?= =?us-ascii?Q?RBqLiUystwaHL7qj1fCN2Nm963oOlPNRqC?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39840400002)(39850400002)(39450400003)(39400400002)(39410400002)(39860400002)(199003)(189002)(4326008)(81156014)(7350300001)(81166006)(50226002)(50466002)(68736007)(36756003)(38730400002)(1076002)(110136004)(53936002)(6116002)(25786009)(48376002)(8676002)(86362001)(305945005)(54906002)(7736002)(2950100002)(6666003)(50986999)(101416001)(47776003)(105586002)(5660300001)(5003940100001)(7416002)(33646002)(106356001)(66066001)(6486002)(7406005)(97736004)(189998001)(3846002)(76176999)(2906002)(53416004)(42186005)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0150;H:ubuntu-010236106000.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR12MB0150;23:5MFE7Gz//ZCKKrIGC80gUi0U31ZXS+Xl+qRcw/Awz?= =?us-ascii?Q?LqiycTV0rRqEXHCnM+AUTL1cdb2MGgdnXlUz5Iqjm1EQ9woaqUw7RKUVn5Uh?= =?us-ascii?Q?N9GzaWx7aNR+z8c3USJfKjMe2MZGXxJwv0WRzQjnNgSW8OLAPWWH/INOdMwF?= =?us-ascii?Q?XcxE+/4p9mGvdBvjTfhf2xX2v8lKcyMAgu4BYfXvlw9AcqTe3MUiEeChHufc?= =?us-ascii?Q?+MJx6f6UVRo7ThCWs9bMBRpLQYMM9S7ui1RRRL71CZcCZf3HYouxwY95i4Jn?= =?us-ascii?Q?CWtoQRWvkFEz4ATFMmDJ6wLOMrQECnt1q91Uwc8cti/jZfm9s1V5nzNEpCH2?= =?us-ascii?Q?JNHEhicHIOvA5jdNNXitYMB7bij2bkNrD3ay0pQ9SDM/wJOlHm/tbmUCwBnh?= =?us-ascii?Q?URRzC34ABw0Esjg03kaLp++Alcq556edJWUZYXqlc3D3J8vHO4vKsU0w8pIZ?= =?us-ascii?Q?fS8bZz7aUTI5tljEzQnbyagwt2mntVwqBLFxl93NdqalydNguWyUY1pm93dW?= =?us-ascii?Q?FrklZt+TS8XcbQPTMj9UjbZ8LTmyc/FjtmJJVqWmAjitrcKgzF/6u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+syJDVgA2svyyX6+UYm2GnHjB2KRU+h/bliWvpPP/yBvS3uxlREmCT6vBCEw50JvuNDLTbgA+YhkHc4T6k6+Uzg0IEgU4yox4DiCGZ4nBR0uR06lSeIIHQgjyi1j2zEcKwknQMhmrh5SvQWWrlW9CF9u/RU96XktX199c7HjFBcBZ95/MKvTF8f78g4dwNo5mKqJXq4t9JkQkXVUXJsBR8bc9XGDgPDmkkAjQHNCefxhLGX3UbGpBw0kiMPXW7RRaBbxMG5/eZ2LYRbopxUvXlewxVYo5LNru9C3a1loXBtR+w5K4fVouvutFTjfIst0X9rWr8Arx8fvIubSPk4EwieTrF1GG9LFgnCK3HizFg9v33N4QC29s/Q+DpMeubyLH+FLv/QXMFFHDNZKlZAYATWAnt6e4xDwHAP0HFsSaRjv5yFP1tQgWdlZh2Xk5PaTT/MNF1LrbtQcqh70KksZqpYqDvH5/hav03aK6aQvFEKRHzmqUXZnwrnxkZMMBovPp35AYeOQAii7VXGELERlCMu2vnMk6FX68bzqTi0C2xB4PMz8tAcZbqJwutZAyT+lBjc= X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0150;20:d5877E/xyZZ0Kt/La7jtP1nkvJdq4UOkKLkjs4Ay2dNa7S5PRpGGKK/Xqa+xIxO+JhO3I1phqGSeRLggQaE7jmZ/VKbIe70MwAm7Q0tYe2WQabn6O8ZObLoVUXJuVOyrov8gmaMzG19e9Mqu+pinTKJxBxF1wLGK97hJARBEic16Kc5DUQLFxaCfgIdiL/UJxAPaJR4+KSlsWsAmO2/Un/xTMHnouJbguWuL8wZe8RQMcOSvJvn1lGQABAHupQBu X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 19:08:28.5909 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0150 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2148 Lines: 68 From: Tom Lendacky EFI data is encrypted when the kernel is run under SEV. Update the page table references to be sure the EFI memory areas are accessed encrypted. Signed-off-by: Tom Lendacky Signed-off-by: Brijesh Singh --- arch/x86/platform/efi/efi_64.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 12e8388..1ecb3f6 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -369,7 +370,10 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) * as trim_bios_range() will reserve the first page and isolate it away * from memory allocators anyway. */ - if (kernel_map_pages_in_pgd(pgd, 0x0, 0x0, 1, _PAGE_RW)) { + pf = _PAGE_RW; + if (sev_active()) + pf |= _PAGE_ENC; + if (kernel_map_pages_in_pgd(pgd, 0x0, 0x0, 1, pf)) { pr_err("Failed to create 1:1 mapping for the first page!\n"); return 1; } @@ -412,6 +416,9 @@ static void __init __map_region(efi_memory_desc_t *md, u64 va) if (!(md->attribute & EFI_MEMORY_WB)) flags |= _PAGE_PCD; + if (sev_active()) + flags |= _PAGE_ENC; + pfn = md->phys_addr >> PAGE_SHIFT; if (kernel_map_pages_in_pgd(pgd, pfn, va, md->num_pages, flags)) pr_warn("Error mapping PA 0x%llx -> VA 0x%llx!\n", @@ -511,6 +518,9 @@ static int __init efi_update_mappings(efi_memory_desc_t *md, unsigned long pf) pgd_t *pgd = efi_pgd; int err1, err2; + if (sev_active()) + pf |= _PAGE_ENC; + /* Update the 1:1 mapping */ pfn = md->phys_addr >> PAGE_SHIFT; err1 = kernel_map_pages_in_pgd(pgd, pfn, md->phys_addr, md->num_pages, pf); @@ -589,6 +599,9 @@ void __init efi_runtime_update_mappings(void) (md->type != EFI_RUNTIME_SERVICES_CODE)) pf |= _PAGE_RW; + if (sev_active()) + pf |= _PAGE_ENC; + efi_update_mappings(md, pf); } } -- 2.9.4