From patchwork Fri Jun 16 18:56:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793343 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 561D460325 for ; Fri, 16 Jun 2017 18:58:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 484A72865B for ; Fri, 16 Jun 2017 18:58:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BF3728670; Fri, 16 Jun 2017 18:58:30 +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 848912865B for ; Fri, 16 Jun 2017 18:58:29 +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 1dLwPu-0005Ds-7s; Fri, 16 Jun 2017 18:56:22 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwPt-0005Cn-Ef for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:56:21 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id F8/EB-02180-4D924495; Fri, 16 Jun 2017 18:56:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAA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s.com!1497639375!83191396!1 X-Originating-IP: [104.47.38.57] 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 55768 invoked from network); 16 Jun 2017 18:56:16 -0000 Received: from mail-bl2nam02on0057.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) (104.47.38.57) by server-2.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:56:16 -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=pYcC76W9XPWQmgvJuG+h3xCK5goQlzUjlYDLDl9ptbo=; b=fNtGQe8L7STr54dX0iK37O2mnnyukPKZqM9iDBERJeNYKkOUD0M4C0OV9+i4FzXKtpyh87Q5FIL10Usen+6R7OnG/pUNa7SALR+lHxYp7C8vBx3VPJNCZXqXfvGCluuF+/vflppsVkHTKf7O2YuJVPDNuANCj87afHGO97ZvjNM= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) 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:56:10 +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:56:07 -0500 Message-ID: <20170616185607.18967.51412.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: BN6PR1001CA0016.namprd10.prod.outlook.com (10.174.84.29) To CY4PR12MB1141.namprd12.prod.outlook.com (10.168.163.149) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR12MB1141: X-MS-Office365-Filtering-Correlation-Id: e1ed54c1-8da7-46b4-c4d2-08d4b4e95ce5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 3:AeJlehDPWie5lTtOkqmPHdbjZdzlITkqPdAIyquiI15Jv7kigncc62abvR5ZbafWAWPr1M+BbhNvhDsefy2hCv5CbMpyd5lrAZa3DSuGEeN39gChmfd8snOD4MmoOiExJroiy5v+Hxo75JZubvurFnYIqjortjBMAMbTwRZKNSoj0rRIji4YZJBwYPxMd1e9mfYTr3NYBWXVC61pLyH8+iaLxl63UIEoFVlltjORRVl1uPpDXdDqjq1hKEowAcu2pez+hljuV99pomAyt9P9pm03a656+Zsb/tlSHcuJXH1ymaU65e7uw+us+gIwj1s3pgBKchiF7emaDlwohGH2nUdXY5LCbO/81eHSFueM3Ew=; 25:VunkP6Xuk4Oufrgmpn41iS30l9wqh3yClpCAzIpbbAY1r9I/3NDdtKeoooPB7wESDURZeuT5wn6sZ7QtRIvWfgCDtoTgJIWAFrQgF1Lmy9Lj6Wm45L65rRlP7HCG6W+2NrKIAoq1N3qy3Eo45bsspMvmAk0GoLMbCwfQwZAotDIdXvnBLdurB8KPBGlCGB2vrEsp+PLO5mJGjtp08c5PQQhsEc4q++Cwbv7nPawkzJ+N5nGQQvZ5uNnQ+5ozG7xoltbD8RNGgNV8Ci02o6D5Eynq/wjir/iXo0BNK+BtCHhB1o4cjvIRd2oLg/JmZYkTjvt9G7F7x0Ymy08cFkj/+YDmUfvtM8RFuLy3kB1a6ozJQqY2a8eFbkkN9hu9aYi313nbu6b06XvCdQ4ZeH1uQdP127M8nXR8cptSjQLJt0XPT4reqLaRyG0EcKvJjWnpre5KU3AeEyhjW27cfvQsKMaQprt65i6gAQGXZoEkpI4= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 31:mte/461IG5c6QrOuPfqOkIQ5GgfU1Gi8znPFp0mkRLAX2myfK448YBwj6yWJjljfH0sT2R4N5pm3cWDYvTFEhloQyHmRFZbWLzFGOM6clazyGtrRK0Vsq/Ml6KztJwm7UtGlByPMbptQStH6NOvBf1fG03saNkC3YPIf2sRrYLXaJhYkcICrksfjmUYC0KglCzeurd6ghTpIBcJfLSTCEt6aVXTbUWOMCEGIIqvd9io=; 20:ugQTY45YWu/zR9M5DvyomgQL0cJoe1j/fd4cWGRRCP9fJLD1UTLyeoUkv2i+YTcJP12w0aioAGcLdjTo3thkp1yhg3bIFSss25Lzd8/sov+iUvmv5yPN+oXXnNC+H5JvN2O5HyCE2cQO5jiF0tTvWqb9AU89kRJaYRU40E8HeDhFkH5iLtccGP0acwqRTi2FGtRGAwQCqIZgbNWVTsncpnPRA3ZysfC55dgpLGl9P5vqRm5KsLvBi+dm2TANnOzoXlcecayUBSxXkRpfXgCYdzIpGcLBDv6Eni3u9J5lIUFnAl4pOgbTQrq2cmyvWl4z32we9x9Mt2eTuSIvpOY1QJfU8e5yQYMHwJ1bzYdvLeq8drZB7w3Jhawdq4yCHyk2fg9opeeuXkFVnPeb9v/ovArKgGhZX8TZmPEAC2hP60ZqKX+Sedwwi2PnRe4XJJNA7TxHlaNxfjXklfMC7HaLDm2OrQu2VW+853Zg61bU/mwKUqN3IajODxOalEjjsDYd 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)(8121501046)(5005006)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1141; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1141; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzQ6M2ZYWkZQN2tsanNNMnlDM3FERWdLQzBuNmN6?= =?utf-8?B?b0Vvcm1FSjdhZnFUWUdMOGpJaFNRbkFuYjhoMVFGLzUyMjIveXVubGs5ZWVC?= =?utf-8?B?eWF6dXF0U2krRkpySk9BMDVNbEFMT0FRV2dRSXl0K1E5dTArZXVEbTRXSDcx?= =?utf-8?B?VG1VTWxoVnkza1E2cUttNmIzMW5xbTJIdVo5VTl2R29sWmpONnppYVJWcFNH?= =?utf-8?B?a2dYaitRNnJ3dmQ4aENWSGV2dTFrSVJZbDE0cUw1RC9tbUhwd2tIN0xSU0pr?= =?utf-8?B?MzBlQXhIayttclAzeVdmREQ2ODJUQ28rU2RWR1k0RGpDN2IxZFJyZE5ZRlB4?= =?utf-8?B?cUJXTXdIRnhleU5xaUdoOTZuNVAxVzFrbHFsbFNKWDRwbFdvY3VXWFpVYkRN?= =?utf-8?B?T2g0TGlQaXdBWURCZ0Foclg2TGpWcHpNcXRvSEQ2T2s0SktSMjE3ejF2RGUx?= =?utf-8?B?b3pIYlAwR0JUbEVJdjlTOVlLb3Rabnh4WjJOcDFNN2lNdWpONWVIWHUvOUtG?= =?utf-8?B?UWNMRFQ4U1NsODBrYy9yWElnT1RWM1p4RTlYQm1MK21hN2hXRXNpeFU5WTJH?= =?utf-8?B?UkFHWW9nekZBK2tYNzJNSDRy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utf-8?B?Q1RPQWRycjJIUTZnSy81OHhXY3JzNDFyczA0aWZNamJaRkRCWFNGamNmQmln?= =?utf-8?B?UEVIcXltVUR0M1B2QjVMTmY2dkNub2EvUmhVMUpKc3M1VTJsbC9SZE1icjhv?= =?utf-8?Q?g86uypxNQ+pE8WNlQGH?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39850400002)(39410400002)(39860400002)(39400400002)(39840400002)(39450400003)(2906002)(23676002)(33646002)(103116003)(2950100002)(230700001)(6666003)(9686003)(66066001)(3846002)(6116002)(47776003)(72206003)(53936002)(42186005)(53416004)(55016002)(50466002)(7406005)(54906002)(7416002)(38730400002)(110136004)(478600001)(8676002)(81166006)(86362001)(76176999)(6506006)(50986999)(305945005)(54356999)(4001350100001)(1076002)(5660300001)(7736002)(4326008)(83506001)(25786009)(189998001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1141; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQxOzIzOktmVUhnRkMrejA0cVpDMlRvOE9WNCt2WU1Q?= =?utf-8?B?SGRCeGJUaURkdXcwclBuUGkwWHAxWE1UQ0FzVDh0K2RkSHl6Y2R0a1RMVVFF?= =?utf-8?B?L1YyOFhOeUw1ejdoOThnMThtWE9pNGZlcThIMCsxYlh0SWNUZmdTUWlJY2NE?= =?utf-8?B?UU9ydjR5c2ZEU3J0SWJGTWZCaW1DUCttN3lqN3hiUUNKVTBJZithNi9rZ1dn?= =?utf-8?B?V1ZNVHhZYmxuMHlwQVk0Qnp6cDk3cTNyaFVIaElXcUdqVXFCbWdsSUtXWkta?= =?utf-8?B?RW5XdzlnQ21aWk5TeE5UdVJsTXBnQmtlRTJoZUFEelI0eXB6MjBRQnhibHY0?= =?utf-8?B?Nit2S0FZeHcxUzhoUFlOZ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bKHzlWFESXC38YT7NZmjx4VUoyWOdnnuZHP55LWXLZA/MsXELTw0O0rXPcZyVfHjkb+gCaK2PoEz+ayExnFkYf+TRR4be1UrGFD3GTjkSwIyI8wEr+K4LnzdD9aoay/tO0ur31VwyvqR1LswxOuIh5df2BqE+KeXbPUUMMfVyy17DFA7Gzd9z2emYymvTdBStIn5xL6mRKWiZtqUMPOPSdg06LISuRuch3uVeXa4LK2u9gH3HxQWU7tNhUY7edM3EAQjSUtx5PNg5NACXMSsql5k/DOrK4uhWV/ZiI4VFwtlxEbY/+e3IakMo7OQAHyY34spmE/4ibC2VrlYEd78Ex0GZWgrapgkTh/s22d33/M0WgDcHUdlmO+ZPyeVsqT+V93pGF7BNcEPnv6MaW26yU5E5z5N7q1jkJ7rwR/3QaEZaIsa+3JluDtFcMf3KviZy8TzbPGzacyGLhF1cTzAYXE2wHyJ2Gi/QZ6pHZ+6SKKLexK2W3bXbz68wXGDsH4V207HaXulGthiXbDzuoa0FBPs8W0o= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1141; 20:5KiHFpUt7hM7mfZKAmKOEf5PsgwEWYrlCyU8P6CYZBzvLDLJU83CBGIn02PmndHV9cMD/wH0t4MO0EHwNEKy1/IIiDVH5KFDAxa0cuaRTWvCaYiNrVJo1+PmHGUZK4+h/qq37awDTlTsD8HkY/jzl7Z9RR7PDXemdHekKSUm2LEIL+WOivkO7tWlNpJfXUrx2nqYr/s1QmEmJFkf8heSrGHsGsIGttBS0VxdnKb4pV8W5kfw4UWa4Vmfin0OrqfX X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:56:10.9584 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1141 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 33/36] x86/mm: Use proper encryption attributes with /dev/mem 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 When accessing memory using /dev/mem (or /dev/kmem) use the proper encryption attributes when mapping the memory. To insure the proper attributes are applied when reading or writing /dev/mem, update the xlate_dev_mem_ptr() function to use memremap() which will essentially perform the same steps of applying __va for RAM or using ioremap() for if not RAM. To insure the proper attributes are applied when mmapping /dev/mem, update the phys_mem_access_prot() to call phys_mem_access_encrypted(), a new function which will check if the memory should be mapped encrypted or not. If it is not to be mapped encrypted then the VMA protection value is updated to remove the encryption bit. Signed-off-by: Tom Lendacky Reviewed-by: Borislav Petkov --- arch/x86/include/asm/io.h | 3 +++ arch/x86/mm/ioremap.c | 18 +++++++++--------- arch/x86/mm/pat.c | 3 +++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 09c5557..e080a39 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -386,4 +386,7 @@ extern bool arch_memremap_can_ram_remap(resource_size_t offset, unsigned long flags); #define arch_memremap_can_ram_remap arch_memremap_can_ram_remap +extern bool phys_mem_access_encrypted(unsigned long phys_addr, + unsigned long size); + #endif /* _ASM_X86_IO_H */ diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 0254b78..5d8b3cf 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -404,12 +404,10 @@ void *xlate_dev_mem_ptr(phys_addr_t phys) unsigned long offset = phys & ~PAGE_MASK; void *vaddr; - /* If page is RAM, we can use __va. Otherwise ioremap and unmap. */ - if (page_is_ram(start >> PAGE_SHIFT)) - return __va(phys); + /* memremap() maps if RAM, otherwise falls back to ioremap() */ + vaddr = memremap(start, PAGE_SIZE, MEMREMAP_WB); - vaddr = ioremap_cache(start, PAGE_SIZE); - /* Only add the offset on success and return NULL if the ioremap() failed: */ + /* Only add the offset on success and return NULL if memremap() failed */ if (vaddr) vaddr += offset; @@ -418,10 +416,7 @@ void *xlate_dev_mem_ptr(phys_addr_t phys) void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) { - if (page_is_ram(phys >> PAGE_SHIFT)) - return; - - iounmap((void __iomem *)((unsigned long)addr & PAGE_MASK)); + memunmap((void *)((unsigned long)addr & PAGE_MASK)); } /* @@ -630,6 +625,11 @@ pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr, return prot; } +bool phys_mem_access_encrypted(unsigned long phys_addr, unsigned long size) +{ + return arch_memremap_can_ram_remap(phys_addr, size, 0); +} + #ifdef CONFIG_ARCH_USE_MEMREMAP_PROT /* Remap memory with encryption */ void __init *early_memremap_encrypted(resource_size_t phys_addr, diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 6753d9c..b970c95 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -748,6 +748,9 @@ void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size) pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, unsigned long size, pgprot_t vma_prot) { + if (!phys_mem_access_encrypted(pfn << PAGE_SHIFT, size)) + vma_prot = pgprot_decrypted(vma_prot); + return vma_prot; }