From patchwork Fri Jun 16 18:54:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793291 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 0D39460325 for ; Fri, 16 Jun 2017 18:56:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 004182865B for ; Fri, 16 Jun 2017 18:56:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E908228670; Fri, 16 Jun 2017 18:56:18 +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 6E2082865B for ; Fri, 16 Jun 2017 18:56: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 1dLwNq-0003PX-SC; Fri, 16 Jun 2017 18:54:14 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwNp-0003OR-ST for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:54:14 +0000 Received: from [85.158.143.35] by server-4.bemta-6.messagelabs.com id 9F/B9-02956-55924495; Fri, 16 Jun 2017 18:54:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+N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server-7.tower-21.messagelabs.com!1497639250!74321881!1 X-Originating-IP: [104.47.34.79] 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 30392 invoked from network); 16 Jun 2017 18:54:11 -0000 Received: from mail-by2nam01on0079.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.79) by server-7.tower-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:54:11 -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=283sl58O+0HaPa9YDphdA6fj81YwvB8b9tivyfD++Yc=; b=FJ7h+Yy0rdO/xe9r9jqIkR+pLeyCdK0q03uuMfB5Ct7gYMZy1MMck1qTF2l9FJMSbQ5rqxGhcxtGkNnWZf/cjh8EJ+CBd8OkmLx4UoRhlFKoa4LsETAhqERQtX7M5vARf7C8Qi9puCuFQ0toHwtbff6gbSW23lMIFohcwEurTjk= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by DM5PR12MB1148.namprd12.prod.outlook.com (10.168.236.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Fri, 16 Jun 2017 18:54:03 +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: Fri, 16 Jun 2017 13:54:00 -0500 Message-ID: <20170616185400.18967.86653.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170616184947.18967.84890.stgit@tlendack-t1.amdoffice.net> References: <20170616184947.18967.84890.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: BN6PR1001CA0003.namprd10.prod.outlook.com (10.174.84.16) To DM5PR12MB1148.namprd12.prod.outlook.com (10.168.236.143) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR12MB1148: X-MS-Office365-Filtering-Correlation-Id: ffdda638-da39-4681-13c8-08d4b4e910c5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:DM5PR12MB1148; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 3:mIp4l3hCeAojQkeqxjdvRZBw5GqOl04nQA0VWGgzJxwOmXGjHdbJ0ELTYlOyoFovQXcLOKgLxXH3a3qhqAGlY2paOTqtW36qqDndYwDW1ZGrO45C7ez8vKYWSugq/GYg+JbxEwoZbmdplK8tnXPsAIXd1vwF2bsQooswLjmLkf/V41Matqjbb86gJX5eOGyy/iwoQhfXVHGEt2m8TFGktubKVFkA9doatQo9lj2ePbky1ybOtFh3v9CBZvppPC2SBpi4nf2mbmnSuJvUjsCVBMmLBg85tcEOze6Cg7pYG5CNFAwqJz7poT45fMEvMUD2ZtMF45zZzPO9SMvE3YBwSnt/3va82XJ7X4XT1UzHb0o= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 25:aSAWTLfXGCg1nmwdVtKhqPlTZA+MbT0D7U5vFetXUjeatgMxQSTtn5cEFDoV5pb9SxlJlVKK//8E3LUia2GQTKbZNS7vbbgDzBfxyuAmf5LommnLUUG0MKEk7JFB0vhDjSfrPSuFhJKmjLeWMqlf1tpk5jjiZGPkDESqxQzfVAHZCdHKkOrxco/m6Z9HJ1jIFBqmaj3VJ9EB7vt6sji8q5ahqznPPld3H8p6bT3D8l5rXlj9ddbrIQtqcAwJxOP+QGNotCUmnq39GnP2prC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C8yWL3Kg9APby7O9YbXW0nNa3/56wY8ZTW5K+wwdT/d0mBjYu4NqsGUUmfiWgVUNWAHHdca6FWUgPUNhbyjq87NTo/ENVjvHtWUS6hBPAflA9IyrJ8s9btglAxMlDbXyIU9RFXM5Ka9ltBGYXQv/H4UqhiHCxz+iMd4MChlno1bZP6tfoDt8eFjVFnFZ7hN8RYOlERg73ZoZdTCsvCzvLbdcuMaMkbzBOblWA+1a/FWFAU+YcrRGr3OvU9GWHK7OY43NT6pKR+wTD53U1IpODxf3wLFrq87HhkMy6i/5T+08l7D8/94Q= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 20:kIWF8Ny8nfT5J3zSvdlZawBZIuv23eZR+JWCl2nq3zTxOaqZhtx/QSXB3wXQXeUH2p4nSt9cbEDtCjLdzEdvvGKXfTUMFg5pyeIRUBj9WvshxMcI3IlJpaf5DVZks+7Dro/tfxLgQ42GTgkTIP2iRehDx4gthCGwHYFwYhn4YxJMNae4ZxBJyeCGoCx+7Uz3J8PNuufq6XmpcGUUsE+D++YZHzhYEysPUtKWxZKOh0uQqVC/86HTkUBq6/q4FEhkUFlS06xGxvhCD4UhQjeBWDepTJGjHE2T4HaDZhg8RZasDuwv61mrUR/kmaRcgqQ61dhVtvTX06hUzr5/K74q4ecJ1WvmL5mmyQLFVh8KFL7Uc0JGBrzACL3bwUCinkUtwfSjdtD4Q4eOXt82i+98cAK2yCqbf6YucDturpxgSawtNF4KJLZxz7aJfWvzIrQzBj3SkiOv5BGACUnNMq9V9sHLJqa1U2j2caUCymqtZS+92T5t3wrD3/PY4AVKSVPX X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR12MB1148; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR12MB1148; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ4OzQ6N3h0RmliU2cvNXpkMDd3eVRoVUZrZ2V2QVUx?= =?utf-8?B?Wi90WTA1YlVLa0k0OVdGQ0QrU1NBN0ZuL1ZXeG1ZZHo1QTJ6Wm9MSDEzaVg1?= =?utf-8?B?Nm5MZm80a2FWK2JiNWZzVXIvc0VoODRiWnppRDZUdDF0WXRRZkhldGlTVUlT?= =?utf-8?B?ajg4aUNJc0VTVzhESFBUMVJZVnNzbG12S3FXRmV0aHVCUk9URFpKNFZPbkM5?= =?utf-8?B?RGVBazBVUGE4enEwTjR2R09pbWh4QlJ0R1pwbTQ2clM1T0g2Vm9CdjNMSnZl?= =?utf-8?B?dGdSb1QzZjNoNWFvd2ljYStYVEozY294Rjg3VU9PMUlVVXJiYU5iRUpoTVJV?= =?utf-8?B?d01NSXZ6RkpYTHFaWFJ4LytqbVBRcmNMZ2JDVkhhM2lRR1FQMkhZaE42bjdm?= =?utf-8?B?Y1FVQjJPMTN2dmUrbW9CV1dIZXNMWWNLZWNkK0JHMDhhT3pyVi8rREt0TUFI?= =?utf-8?B?czlpSGNPamlmOG9wTnVKSk81bG14bXZwOGFzazZTZ2lheEFMaUYzOGJLZHkw?= =?utf-8?B?WnFPZEY2MlpJYnZxbEhwTlhpWXNzS0pzYlhjUVpUYmZPcFdMaHVEWGd1V01D?= =?utf-8?B?VnhwNmZUV2Rsdnp6VGRGZ2E3RlF6MmF2emlTaytFekVhNmpMN25lVXNrelpi?= =?utf-8?B?YkVkWWNXTnVVZFY2YVdUVWJY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8?B?cFlXNTRMM3RoeVJBTndkRnRiTVJOMmY4TE9qWFBlTVdFcTg1S0ZIaUcwbUpJ?= =?utf-8?Q?fR6E9qflxbKdO+qaci7?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39860400002)(39850400002)(39400400002)(39840400002)(39450400003)(53416004)(7416002)(7406005)(33646002)(8676002)(478600001)(42186005)(25786009)(2950100002)(4001350100001)(81166006)(6116002)(3846002)(23676002)(83506001)(1076002)(189998001)(47776003)(72206003)(5660300001)(6506006)(2906002)(230700001)(305945005)(55016002)(7736002)(4326008)(9686003)(54906002)(110136004)(38730400002)(103116003)(50986999)(50466002)(54356999)(53936002)(86362001)(66066001)(76176999)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1148; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ4OzIzOjZZUW1odC9VUnZVeFVXcjZMSzk0UVRXRlRB?= =?utf-8?B?NGgwVnVrcDltSENGLzFLN0Z1TUlsTVZwSlVweDNuQytmbmFiVi94VmV3NERM?= =?utf-8?B?eFNUQkp0NWJHNW5DRTAremxaeVFhVnNRcnNsUEQzdEM4R2lPcWEwek1oOFl4?= =?utf-8?B?cm1IWFkrM0FsM0lobVdiSlFyTTNYcDFJei9KTVQ5UEplNUtkdmcwWEh1MW5t?= =?utf-8?B?WWl5KzBtWm5xUjgvVExobEJpVXgzcGU5Uk5LRktIK252QWczeFQ2d1V1aTU0?= =?utf-8?B?YUw4R1J0WFlwdGU1R1V5NXl3TkF0L0g5emxaeGlGaVl1WHdKMmxxK1hZZWpL?= =?utf-8?B?Q0QycWRCYVZ1bWxFUUpyVHRHTjVnOUR5MWRIR0J0aC8rdkRlUktrZ1JSMS9t?= =?utf-8?B?amFpZCtReTJZWk9nMFROcXNHdi94TVIyV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SOWm14ZnGiLs8R24iBPOykP8bbYemlbdSJgB+q+PU3Zx6XBF3rNd0cwGTElEBGPH7f0QeCHiXxsxRoduuk4K9m3mobAZfJykKGS5uTXwg9GvqnWrmSAooMdL7pz7E30e067SiB0buVudPQcGXMfbkbMZxELj6Dq+2LtH0cn1CcnoVkPe0k3ZbeA28i8oZaVDggQwHVjvwGq9iXz7yO9Ee+z3SrpoRAu2usx5ynWI3kaOCt/n8VbRIg3RjL9/MHBX5QbVR6sVBE/4p9OiB+Kp4FjGHruL2/RXIr1URgi01FNAcXvJrjDcOrfCVBgXKX/sjx5gXr1dV2TyZaHqTdlnx8lscfz8d5Qtpym9bJGKkBxnc5qId4tJhPJvEmkXZ+Khy44Wik92t+isqH/VF04r0cORQ6HkW11XTOzImEShdmtRYD4QKdmUWRS1Lp1orC4Rz4CCFz9upbEA= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 20:P7U+38qPm7zCECkrWvGXjJMLyMTMDlHWq7u/OQSooaPFKhkcrvNWyBZxSI1TsHJL99o10KUbh8jp4YymCNbjd2CQqfCfnlOBOTWQj34LibFy3GCtcRFhPuWvzjfMuzF82C5NfUWg8gsOnL9SF6Wuhx0Q0jvzfOYl3FoftQwWMKB8ki70GPW97YeLMtO+mEWxVfzrXJZo9J/3x2t2TWJlClx8UKbbYt1BjKRcxm0+VG1He8WefggV3KuLPPmP7231 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:54:03.5938 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1148 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 v7 22/36] x86/mm: Add support for changing the memory encryption attribute 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 for changing the memory encryption attribute for one or more memory pages. This will be useful when we have to change the AP trampoline area to not be encrypted. Or when we need to change the SWIOTLB area to not be encrypted in support of devices that can't support the encryption mask range. Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/include/asm/set_memory.h | 3 ++ arch/x86/mm/pageattr.c | 62 +++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/arch/x86/include/asm/set_memory.h b/arch/x86/include/asm/set_memory.h index eaec6c3..cd71273 100644 --- a/arch/x86/include/asm/set_memory.h +++ b/arch/x86/include/asm/set_memory.h @@ -11,6 +11,7 @@ * Executability : eXeutable, NoteXecutable * Read/Write : ReadOnly, ReadWrite * Presence : NotPresent + * Encryption : Encrypted, Decrypted * * Within a category, the attributes are mutually exclusive. * @@ -42,6 +43,8 @@ int set_memory_wb(unsigned long addr, int numpages); int set_memory_np(unsigned long addr, int numpages); int set_memory_4k(unsigned long addr, int numpages); +int set_memory_encrypted(unsigned long addr, int numpages); +int set_memory_decrypted(unsigned long addr, int numpages); int set_memory_array_uc(unsigned long *addr, int addrinarray); int set_memory_array_wc(unsigned long *addr, int addrinarray); diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index e7d3866..d9e09fb 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -1769,6 +1769,68 @@ int set_memory_4k(unsigned long addr, int numpages) __pgprot(0), 1, 0, NULL); } +static int __set_memory_enc_dec(unsigned long addr, int numpages, bool enc) +{ + struct cpa_data cpa; + unsigned long start; + int ret; + + /* Nothing to do if the SME is not active */ + if (!sme_active()) + return 0; + + /* Should not be working on unaligned addresses */ + if (WARN_ONCE(addr & ~PAGE_MASK, "misaligned address: %#lx\n", addr)) + addr &= PAGE_MASK; + + start = addr; + + memset(&cpa, 0, sizeof(cpa)); + cpa.vaddr = &addr; + cpa.numpages = numpages; + cpa.mask_set = enc ? __pgprot(_PAGE_ENC) : __pgprot(0); + cpa.mask_clr = enc ? __pgprot(0) : __pgprot(_PAGE_ENC); + cpa.pgd = init_mm.pgd; + + /* Must avoid aliasing mappings in the highmem code */ + kmap_flush_unused(); + vm_unmap_aliases(); + + /* + * Before changing the encryption attribute, we need to flush caches. + */ + if (static_cpu_has(X86_FEATURE_CLFLUSH)) + cpa_flush_range(start, numpages, 1); + else + cpa_flush_all(1); + + ret = __change_page_attr_set_clr(&cpa, 1); + + /* + * After changing the encryption attribute, we need to flush TLBs + * again in case any speculative TLB caching occurred (but no need + * to flush caches again). We could just use cpa_flush_all(), but + * in case TLB flushing gets optimized in the cpa_flush_range() + * path use the same logic as above. + */ + if (static_cpu_has(X86_FEATURE_CLFLUSH)) + cpa_flush_range(start, numpages, 0); + else + cpa_flush_all(0); + + return ret; +} + +int set_memory_encrypted(unsigned long addr, int numpages) +{ + return __set_memory_enc_dec(addr, numpages, true); +} + +int set_memory_decrypted(unsigned long addr, int numpages) +{ + return __set_memory_enc_dec(addr, numpages, false); +} + int set_pages_uc(struct page *page, int numpages) { unsigned long addr = (unsigned long)page_address(page);