From patchwork Tue Jun 27 15:09:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812409 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 5A7DC60351 for ; Tue, 27 Jun 2017 15:12:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E518286DD for ; Tue, 27 Jun 2017 15:12:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42596286CA; Tue, 27 Jun 2017 15:12:19 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 944CB286CA for ; Tue, 27 Jun 2017 15:12:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPs7j-0008L8-Hh; Tue, 27 Jun 2017 15:09:51 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPs7i-0008KB-Ie for xen-devel@lists.xen.org; Tue, 27 Jun 2017 15:09:50 +0000 Received: from [85.158.143.35] by server-9.bemta-6.messagelabs.com id 6D/8B-03557-D3572595; Tue, 27 Jun 2017 15:09:49 +0000 X-Brightmail-Tracker: H4sIAA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-6.tower-21.messagelabs.com!1498576187!52854586!1 X-Originating-IP: [104.47.36.85] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51936 invoked from network); 27 Jun 2017 15:09:48 -0000 Received: from mail-sn1nam02on0085.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) (104.47.36.85) by server-6.tower-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 15:09:48 -0000 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=3h9FkEjeTeXgezmnLcdGv+P/QMHMj48x7OfbfH9IWi4=; b=qr0CsQDPs5gYM7Su1ynk7ffCI3+y0w7lzWo7XahPVkyfUldjpn7Sg044xJIyta4lk+zaXIQkWFHx6WCKEA0Tg3cxsB4n7HjIq6PuagJO20HK7n3Jw5PE48SWSxI0qXj5vB0G0/d9X+ED/IlsB/fIKQQJhXz2lDM4PQcnebf4njI= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by BN6PR12MB1140.namprd12.prod.outlook.com (10.168.226.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Tue, 27 Jun 2017 15:09:40 +0000 From: Tom Lendacky To: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, xen-devel@lists.xen.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org Date: Tue, 27 Jun 2017 10:09:39 -0500 Message-ID: <20170627150939.17428.62679.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170627150718.17428.81813.stgit@tlendack-t1.amdoffice.net> References: <20170627150718.17428.81813.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR17CA0048.namprd17.prod.outlook.com (10.173.128.162) To BN6PR12MB1140.namprd12.prod.outlook.com (10.168.226.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 844d9697-a2e4-4224-cdfe-08d4bd6e8a25 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); SRVR:BN6PR12MB1140; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1140; 3:bcq6u25TKqUQWOMEp+2aFYBsy6spBHl/2V6xFvLPFed7r7Q9prLd1CafUCVgO/ncZj+cXWp+7u3P5G9ESAnWfEWaiixtys3Lo6t5hbh6DAU7WEY5FDlC5QB4tfRdxFhV73qanWHaJ4CJdUK2TnZDyRb9b/bcVDVuwCtPHcSMYwuGW9LsYBx4htAlk4QjlaWk/6B8U40ItLcQJTTUGsQcJnShbOfIuJg/AQF6TQbw7GLtiUdyWT9fcQPRKPHK6SIFY07xk1otZs0mGDQXPIImZ4dRYbvlPXfCNKYi11UM9Azb7q8vA3EhRh5mI3p2Xz2ZmURxL+CgvdkUMyCbRX2HQMW8PiPWEI38UVYsaxJMYLscqRqeY10tFML/Y+8kjMD85nk7DfZR8/zIfCmZHe5SQLtqKKOJG9XdJchp3mQHoGcLhJtqD5bBBvF9wCQrQmNvy/ufRXsn9ZSbRX04cuxJHrySGOjCJIvgsnZtD3uLiSJrUpqpgLYUO9GlsUbTfc78Juxf8u0voBzqP0nMgcWz3UVE5wzokwpHoH0JdPLjqW3TF2COgbRVoD7+eHR+thCags3q5urcZr0mUwD1BQF1NHgUHo1M5e/hkbBhtewfgf40916fdp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B/T/NvvqP44vAizsrzDuk5+G0h4HaNuV4ONnyO/k22jDDHaDPhtjp/OuAO648MsYb9iZ3uT8USBY0WyEjyCctzBEdn4tiRTdejZSrj54cE4DxWE/WIGeCwcKLz26fN37MhrlC0yb8Wpbiq4R/bIW2tvhbMf4/n2XhZR4TRQDTscTp3pVo0zX5l2AtQhrVhSW9UEWfWpeQFGVYvSJrb4yyihm837/jNTygqjUdkqcWd4I6raA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228)(767451399110)(247924648384137); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR12MB1140; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR12MB1140; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTQwOzQ6ZkxEbGFJcVZMQ1lPdTN0WXJMcUZYNGVMcHlX?= =?utf-8?B?NFhaeUU1YVRmSnhMZG9KT2Q1RzdQUStjR3V1YW9PMmlSd21XSnlIUmtLdDZr?= =?utf-8?B?RFZOYnVvTVcyZ2tyYm1wOTRQWHJLY2ZlQUdMM3VUQ1FsTGEvZ2tsa1JiUTU4?= =?utf-8?B?UVNvZlBZN0pLMmkzSTFIVlFBc1hhYWk2Rk14ODdZQXlDdzhFbHhrV3YvdnV5?= =?utf-8?B?VDZIL1FqdUo2RE41REVVV2VDNHB0aGhnSlZVWHg0UFo5eDNjY3JFNjM3L0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9ndU0zMXVyRW5kcnJLZjFtd0tlUDg5MFh4?= =?utf-8?B?VjNvMno3MDc3NC9EdXVHNUFYaWhVbDQzRVBkNVh3eCs5YnVydnF2Rk11Q0I0?= =?utf-8?B?bXROMm05azBMT0l2UDV1Rlo4aEltL29VSGMyMDZzMER1TlBJczJxb2RnNjhC?= =?utf-8?B?eTdEendtY0lBak4xQTVjMVYrTEZoTTM0Z0ZUdVh3V0R0K2JmdXYwZlBQOUxt?= =?utf-8?B?M1NndkVTdGMxWjZ5UzhvSndWUjE2Um1iUUVjTFlNNUJ6TVZRdlJIOHU4N0ty?= =?utf-8?B?cXB2d0IxS2R6b0taTk5SZnJoMW1POXNEQWtxSEZsZzc3b21aeWZFUHUrS2V1?= =?utf-8?B?ZGRLTGJDdUc2UzI5Y1laNERHUjBiS0ZzNENsWklQSS9TSnBtdFBRZXNScld1?= =?utf-8?B?VEViZkJaUTZ0WE5TajN1NmI1cjd3aDVjYWdiVTh4TDhoeFJkclI5MGl0ajFT?= =?utf-8?B?SjZvQmJyaWZZekFWSk5aTXVRbUNQZkJVcE10aERaOTdBM3E4anFwQXh4V3Fi?= =?utf-8?B?UzFSTXo3bGpLbHpNNXI3UnNucWpBeUZReXo2S3puQ2JucTRqbER1cDJXWHVK?= =?utf-8?Q?Masiv0qLR8GE4IQIVa63L5n5ng/4JxNb1eCk=3D?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39450400003)(39850400002)(39860400002)(39410400002)(39840400002)(72206003)(50466002)(54906002)(53416004)(2950100002)(55016002)(9686003)(83506001)(42186005)(53936002)(4326008)(50986999)(54356999)(76176999)(6506006)(189998001)(4001350100001)(25786009)(478600001)(33646002)(86362001)(305945005)(3846002)(97746001)(6116002)(7736002)(2906002)(8676002)(103116003)(110136004)(38730400002)(47776003)(1076002)(7406005)(66066001)(5660300001)(81166006)(230700001)(7416002)(23676002)(921003)(1121003); DIR:OUT; S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o8ySiWUeUV2c/0KGaJPHnBykGbxmnkI2lG9Q7vzqt4CcTmgRXgS5GNgy9Oj3I9wWNAyT+PvAR+MS1XgaXZKTdY3+Hn4DJ6Ac= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1140; 20:DvsrRLwgv1Ss3bdhgju7QdDQEB2qnBT5w7QNrKZVup/lWOr400Rs8lyqemQggKx6Om/68gtCzrPfzacrb4bjBemtK0Xbjrvi/oLoZuAOchcLzxhs05F9oNbr2dQXa1/oJTX7EifM/mgg90Cjl1N86CvTPF8PWwY9xjcX4i+y525zqRv7SDXgLfeDu0hFSkr0TYF1ybH4NjlME5arHZNRLHAeFxiTujQplpLMHCN3tOqmo4LXpYI/x1x9vEDxw3DB X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 15:09:40.7711 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1140 Cc: Brijesh Singh , Toshimitsu Kani , "Michael S. Tsirkin" , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Boris Ostrovsky , Jonathan Corbet , Joerg Roedel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Larry Woodman , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Dmitry Vyukov , Juergen Gross , Paolo Bonzini Subject: [Xen-devel] [PATCH v8 RESEND 13/38] x86/mm: Add support for early encrypt/decrypt of memory X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add support to be able to either encrypt or decrypt data in place during the early stages of booting the kernel. This does not change the memory encryption attribute - it is used for ensuring that data present in either an encrypted or decrypted memory area is in the proper state (for example the initrd will have been loaded by the boot loader and will not be encrypted, but the memory that it resides in is marked as encrypted). Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/include/asm/mem_encrypt.h | 10 +++++ arch/x86/mm/mem_encrypt.c | 76 ++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index dbae7a5..8baa35b 100644 --- a/arch/x86/include/asm/mem_encrypt.h +++ b/arch/x86/include/asm/mem_encrypt.h @@ -21,6 +21,11 @@ extern unsigned long sme_me_mask; +void __init sme_early_encrypt(resource_size_t paddr, + unsigned long size); +void __init sme_early_decrypt(resource_size_t paddr, + unsigned long size); + void __init sme_early_init(void); void __init sme_encrypt_kernel(void); @@ -30,6 +35,11 @@ #define sme_me_mask 0UL +static inline void __init sme_early_encrypt(resource_size_t paddr, + unsigned long size) { } +static inline void __init sme_early_decrypt(resource_size_t paddr, + unsigned long size) { } + static inline void __init sme_early_init(void) { } static inline void __init sme_encrypt_kernel(void) { } diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c index f973d3d..54bb73c 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c @@ -14,6 +14,9 @@ #include #include +#include +#include + /* * Since SME related variables are set early in the boot process they must * reside in the .data section so as not to be zeroed out when the .bss @@ -22,6 +25,79 @@ unsigned long sme_me_mask __section(.data) = 0; EXPORT_SYMBOL_GPL(sme_me_mask); +/* Buffer used for early in-place encryption by BSP, no locking needed */ +static char sme_early_buffer[PAGE_SIZE] __aligned(PAGE_SIZE); + +/* + * This routine does not change the underlying encryption setting of the + * page(s) that map this memory. It assumes that eventually the memory is + * meant to be accessed as either encrypted or decrypted but the contents + * are currently not in the desired state. + * + * This routine follows the steps outlined in the AMD64 Architecture + * Programmer's Manual Volume 2, Section 7.10.8 Encrypt-in-Place. + */ +static void __init __sme_early_enc_dec(resource_size_t paddr, + unsigned long size, bool enc) +{ + void *src, *dst; + size_t len; + + if (!sme_me_mask) + return; + + local_flush_tlb(); + wbinvd(); + + /* + * There are limited number of early mapping slots, so map (at most) + * one page at time. + */ + while (size) { + len = min_t(size_t, sizeof(sme_early_buffer), size); + + /* + * Create mappings for the current and desired format of + * the memory. Use a write-protected mapping for the source. + */ + src = enc ? early_memremap_decrypted_wp(paddr, len) : + early_memremap_encrypted_wp(paddr, len); + + dst = enc ? early_memremap_encrypted(paddr, len) : + early_memremap_decrypted(paddr, len); + + /* + * If a mapping can't be obtained to perform the operation, + * then eventual access of that area in the desired mode + * will cause a crash. + */ + BUG_ON(!src || !dst); + + /* + * Use a temporary buffer, of cache-line multiple size, to + * avoid data corruption as documented in the APM. + */ + memcpy(sme_early_buffer, src, len); + memcpy(dst, sme_early_buffer, len); + + early_memunmap(dst, len); + early_memunmap(src, len); + + paddr += len; + size -= len; + } +} + +void __init sme_early_encrypt(resource_size_t paddr, unsigned long size) +{ + __sme_early_enc_dec(paddr, size, true); +} + +void __init sme_early_decrypt(resource_size_t paddr, unsigned long size) +{ + __sme_early_enc_dec(paddr, size, false); +} + void __init sme_early_init(void) { unsigned int i;