From patchwork Fri Jun 16 18:54:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793309 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 4886060325 for ; Fri, 16 Jun 2017 18:56:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A9452865B for ; Fri, 16 Jun 2017 18:56:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F12A28670; Fri, 16 Jun 2017 18:56:52 +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 428D52865B for ; Fri, 16 Jun 2017 18:56:51 +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 1dLwOG-0003ho-Ec; Fri, 16 Jun 2017 18:54:40 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwOE-0003g8-DP for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:54:38 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id BA/60-01992-D6924495; Fri, 16 Jun 2017 18:54:37 +0000 X-Brightmail-Tracker: H4sIAAAAAAAA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.com!1497639274!103663234!1 X-Originating-IP: [104.47.34.42] 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 33412 invoked from network); 16 Jun 2017 18:54:36 -0000 Received: from mail-by2nam01on0042.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.42) by server-8.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:54:36 -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=VcPyQAZ4376KPIpFnIeKAcAQMdM4+v6n6+iynUuEW00=; b=CZod/hrHdreJuOIMdD2cOSTEbwiFt5QOnZMqJzPhQmly1VmfhdfPHJGxV/tzCOMJLG/9+K1rcJsbyOYLo5tJHRqbUil6FlgLTWDlEy1oei09wMWuXJ24CPMC2aVLHoqyREaa6JBgY+Alj+tVTUpewupN5MkeBaIYjGwSusSXvco= 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:27 +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:24 -0500 Message-ID: <20170616185423.18967.19605.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: MWHPR02CA0016.namprd02.prod.outlook.com (10.168.209.154) To DM5PR12MB1148.namprd12.prod.outlook.com (10.168.236.143) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR12MB1148: X-MS-Office365-Filtering-Correlation-Id: d89684f0-8705-4c97-0d20-08d4b4e91f0c 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:m+OrAhdAywkfzfRQ55XgPQhU/mCXYoVO9iQVr+uOHOWSFp7PDgvG9GMEaMPDm0rwayDljk35tIASB1JiIutNARTGFSFHAQ2ureMRouPNeB2ZpaFBf+cSHrwJdUsaQgAmesG0uTpRuPTkQJWgOuT/CNmy1hYdLF2ybcO0IoyJLKF9hmbGSXsbfOk5GL5zKa7awO56SjE6jxTuaIcDiM4sePG1+JzdhXNOXOlL20l6EJKxTxUJ/OAUP9LKMi1gvAdh/BBWntAlt7t8ukiN74YWmkWxZu7SPL4MmL0Tnu8FUxWv9hMTTaaScx8VsOhPII6nuqZt96QVmg/TtP+p8XFCVaxAiNuLM4oj44OtaX0Igw8= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 25:IQznxlYufDS8PzZDX3aiIRVZFW/5fQR3s3dsgSxdjQ5Vw7nMUu0pyCSV1fx5/QbpBeyeS75lVCBL1qD5BCiKBJ3mQYA3RzB2zRBGQGRu2mcM72uVPUVnHYSSINH21t4daVJR6xTrtV3XfFRsZhUeWcADdQMq17EEdpSUpehzQQFQtqYN3dl+Q/0/Y29w8eyvv7ZrDjn9/O8AuOWoCIeO2i/Wq8XCTwTJmFSMqFvCFbKZBdXjqq78fHW5K2UdlspJf1vAHcp/6OgT6zcKimCIQaW5D89H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jkxDwV2avq6jB/fX3ik2hg7UypKCmdCe8n7ENgjuMqerun8X3Fc2KHbvaPYBLJHCorp4FVN7ISDKprV8WQa/BgdELnXd0i2d4hNHVY6M4Uj9gxb3vIcz/kJOvWjgqeBCcZxmwbQjr1E7AVymNUmWXuOAScUSMFERTXWAqZcZzdE26bMHi4IsoWCDLa6/qZjH7dG5nZP0+ePge5XVDC18BOJicw60GPsJ1KRLTwPcShiUnNtb37N6xgk6ZlZ9pgj7PXjTG2M8tL/jMsT7AdH9Fr7JncAugI13yGW+njDCvllZAqw= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 20:x9a4WUpvu9Kbg1I/FiRT9kd1zCHFNcurmG5FRtzPhF2ICDvkQUP2pdgoFZGolt7OBXjd4vGwUdGueP15nozZHFbZpbaAtBDgrqdWGnRKApePxDDDurZEB8zkqVANN2dFY1A7jLt9Xgm+KO8FvfdmgMQRLmjShlOduOO2J+pzDP/i6FH+RA7Dbp3sGhgNgiouQpA7n28foKgML/87ws4GDpwdjmLxCd0C35hl3Wjdl5Bk8KkRyDG2NeNm+thvqbJoH5EmmXN1fvJZfcQ/4J1U3LaqaoSD9yDtUSjT6tRsNb/wmamcDvTAuh7TmGiv0bDWLoXa7m1CS6ucHLdu8CF24pd4c6V0Wm+rd1edWtxGmHaXBanCVjMMIQKVIxxTsKYanB/vBazyvXXh3H1ihybfYd3rAaSXwRjtsU/LSsovonN6GXGZUvR4oUfbt2gmwMXwzL3pDhRS+UAKnKaSAEHDRO33KRrPIHMhwPDRSrJ+hXtuh7MRIZS0sB5C5WfjMhYm 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?MTtETTVQUjEyTUIxMTQ4OzQ6ZXI5UHF4NDNhT0xhL3NQUjRxVCtSTzRiODlT?= =?utf-8?B?U2pGZk5YZzFQVU1ZWk16L3ZXbCs1L0tLWThLMU9LN2FqRXU3Y3IxWmN2MEVj?= =?utf-8?B?dGRraXRJa08zREpYc0hxM2xsUTNsOC9tT3N3SUpNNC9jUCtWUHRYNzhwMUNZ?= =?utf-8?B?OG40SEkyR0RTd25QVFFxakRUakJQZzkrT1ZJaXFiNGZXa2s3dFVlN1YxcEFQ?= =?utf-8?B?Qis5dXNhRktWVmpLeWdnZFZRYlpnMWRSL0NOb2Q3bGRGOWRtY3NnbGdyVWFx?= =?utf-8?B?dGphamFpd21qa0NIUXlwYWJRTWRsRVlPNmh2WTVDK0NEcmViSHRTbFYvZzVI?= =?utf-8?B?NmlnM0lGSFhaVkYveHZaNnBwZnRSS0hmUE5nVWNFUnFKN1lzWlpIMlYwa08r?= =?utf-8?B?cVUyempURXZ6UUdtaFpwaGk1WW05QWNSSnFjZy8vTGVyV0pQUFVOaVphKzJW?= =?utf-8?B?Z3JhT0Y3Zk5HWktqL3AzKzBsU0Q3MldoWUY4cmcwMzgxZnVBRFQ1c3JBT2Nh?= =?utf-8?B?ZzZuaEtlVkJ4aDhhSU9WWVBUTWtwYnVrS2IrQ3F3T2R1OWZVUUxGeXhUNEZU?= =?utf-8?B?UkEyR3ZnNHRlSHJ5T1poSE82aHcxMkVsUmZjY2FYbGVxclpqSXpaZE4xYXNE?= =?utf-8?B?YzRmNEhDbU9OT3hqRVF6V3E2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HBzc2ZYV3ZWSFY0bWJvU0gzbkFzZHdaNXVLZDdnWnA1?= =?utf-8?Q?Y67LoUX39wJ6IwU3aAU?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39860400002)(39850400002)(39400400002)(39840400002)(39450400003)(53416004)(7416002)(7406005)(6666003)(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?MTtETTVQUjEyTUIxMTQ4OzIzOnRrRnRLOG5Gc01SRGx3ZzFkS09JQ0xWL3Rr?= =?utf-8?B?UWdiOWdrSUswb1hucFVZdU9jS21DaGVpY0lEOWgwTFl3QUptdGZaLzk3YXJm?= =?utf-8?B?Z3NFa2dyQitpd09rYmVuMENwbW91cHRCMXNReGpKZjl0R0paVVMwRk9zZFRs?= =?utf-8?B?czNJejEwNGpESkwwOWF1b3lIb2FzZS9GV2xPZy9ZRDdhbDI3bUNvUG82OXJF?= =?utf-8?B?Y3ZDbHJHYUhkQlBYT3hneUp3MVdtYUxyRlRlME9pdWdvOWtvREFiOEtHc3VS?= =?utf-8?B?aDVvVXlNSDVzMEJ3WTdDT0M0bHR3NlJLRlQwbWtNSmVHWWNvVjY5ck5tdUgy?= =?utf-8?B?dm83TkNVQjBPN1RON1N3c3pkNUU3ODJiZkxvL21RcllmSHE0eHZLZCtoOFNK?= =?utf-8?B?QmlHTWdWVU9Za0RaSUR6NEU3NGZsSVY4eElJMmQ4M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HaASCIIvbz+50jrzYKrkCpdLhz12IMyQu+nY90fNXPaW6abhCv3erKYyTIAJO67j956C4wKJPbqHEuRnetVV8VK8tpS81rCLsh6h/mI+jiJ6DggHIpQFJr5H66Os7mrjmcGy1TXxxOTaUVapQX4qnpaJOhSiDmTFQdOCQwoCL87O7FUXqCLv6FLdqnf2ptG9fTJ5jB4CLK5uD2E384PHRUwTBa9H8gC3mD/Z59gbpd2S4driKYkndY2mtk862vnm/ySpie+8lrAbw3YRpgwag8mZy9cSB7G/JMdZc5XnP/zhmFEWS/P9MZHbvl4zanp6nj/A+ib1foO8kFeOPlU1MBb2NqqFWIO/lTP1lfmLYMrY+EyDCa3RWTXUpVSUJz2eIt6oLb7ng0vs+bWItRXWT5w4/AOiGJ4kNXEoCio= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 20:f8dJ8ssFyRe6FzWNUlxBSeZX3K2wAzPoiXmrW31HFw4TcHMsuSmHlJy2iqMAeAvN5G68qvdy7P75BdnF3mm1Z+qs7w8F+1OwJ7p1vb2ST90XTlBZomg1pIVJZ31Qm8wiDX0c+Mqp4nFSn0rEmGK+QYxuYag2/dEHH8MJAio64SSXMRbcVSVNgTrNq6ez7p9tpuGdcY73qpN4Lis8B+5U1LMQRBKzkIHf6ABSTCuVo17zYO8YuxlJ7jwXaUWwiwNI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:54:27.4064 (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 24/36] x86, swiotlb: Add memory encryption support 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 Since DMA addresses will effectively look like 48-bit addresses when the memory encryption mask is set, SWIOTLB is needed if the DMA mask of the device performing the DMA does not support 48-bits. SWIOTLB will be initialized to create decrypted bounce buffers for use by these devices. Signed-off-by: Tom Lendacky Reviewed-by: Borislav Petkov --- arch/x86/include/asm/dma-mapping.h | 5 ++- arch/x86/include/asm/mem_encrypt.h | 5 +++ arch/x86/kernel/pci-dma.c | 11 +++++-- arch/x86/kernel/pci-nommu.c | 2 + arch/x86/kernel/pci-swiotlb.c | 15 +++++++++- arch/x86/mm/mem_encrypt.c | 22 +++++++++++++++ include/linux/swiotlb.h | 1 + init/main.c | 10 +++++++ lib/swiotlb.c | 54 +++++++++++++++++++++++++++++++----- 9 files changed, 108 insertions(+), 17 deletions(-) diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index 08a0838..191f9a5 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h @@ -12,6 +12,7 @@ #include #include #include +#include #ifdef CONFIG_ISA # define ISA_DMA_BIT_MASK DMA_BIT_MASK(24) @@ -62,12 +63,12 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) { - return paddr; + return __sme_set(paddr); } static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) { - return daddr; + return __sme_clr(daddr); } #endif /* CONFIG_X86_DMA_REMAP */ diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index 3ffa5fa..af835cf 100644 --- a/arch/x86/include/asm/mem_encrypt.h +++ b/arch/x86/include/asm/mem_encrypt.h @@ -33,6 +33,11 @@ void __init sme_early_decrypt(resource_size_t paddr, void __init sme_enable(void); +/* Architecture __weak replacement functions */ +void __init mem_encrypt_init(void); + +void swiotlb_set_mem_attributes(void *vaddr, unsigned long size); + #else /* !CONFIG_AMD_MEM_ENCRYPT */ #define sme_me_mask 0UL diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 3a216ec..72d96d4 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -93,9 +93,12 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, if (gfpflags_allow_blocking(flag)) { page = dma_alloc_from_contiguous(dev, count, get_order(size), flag); - if (page && page_to_phys(page) + size > dma_mask) { - dma_release_from_contiguous(dev, page, count); - page = NULL; + if (page) { + addr = phys_to_dma(dev, page_to_phys(page)); + if (addr + size > dma_mask) { + dma_release_from_contiguous(dev, page, count); + page = NULL; + } } } /* fallback */ @@ -104,7 +107,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, if (!page) return NULL; - addr = page_to_phys(page); + addr = phys_to_dma(dev, page_to_phys(page)); if (addr + size > dma_mask) { __free_pages(page, get_order(size)); diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c index a88952e..98b576a 100644 --- a/arch/x86/kernel/pci-nommu.c +++ b/arch/x86/kernel/pci-nommu.c @@ -30,7 +30,7 @@ static dma_addr_t nommu_map_page(struct device *dev, struct page *page, enum dma_data_direction dir, unsigned long attrs) { - dma_addr_t bus = page_to_phys(page) + offset; + dma_addr_t bus = phys_to_dma(dev, page_to_phys(page)) + offset; WARN_ON(size == 0); if (!check_addr("map_single", dev, bus, size)) return DMA_ERROR_CODE; diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c index 1e23577..6770775 100644 --- a/arch/x86/kernel/pci-swiotlb.c +++ b/arch/x86/kernel/pci-swiotlb.c @@ -6,12 +6,14 @@ #include #include #include +#include #include #include #include #include #include + int swiotlb __read_mostly; void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, @@ -79,8 +81,8 @@ int __init pci_swiotlb_detect_override(void) pci_swiotlb_late_init); /* - * if 4GB or more detected (and iommu=off not set) return 1 - * and set swiotlb to 1. + * If 4GB or more detected (and iommu=off not set) or if SME is active + * then set swiotlb to 1 and return 1. */ int __init pci_swiotlb_detect_4gb(void) { @@ -89,6 +91,15 @@ int __init pci_swiotlb_detect_4gb(void) if (!no_iommu && max_possible_pfn > MAX_DMA32_PFN) swiotlb = 1; #endif + + /* + * If SME is active then swiotlb will be set to 1 so that bounce + * buffers are allocated and used for devices that do not support + * the addressing range required for the encryption mask. + */ + if (sme_active()) + swiotlb = 1; + return swiotlb; } IOMMU_INIT(pci_swiotlb_detect_4gb, diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c index ea5e3a6..842c8a6 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c @@ -16,11 +16,14 @@ #ifdef CONFIG_AMD_MEM_ENCRYPT #include +#include +#include #include #include #include #include +#include /* * Since SME related variables are set early in the boot process they must @@ -187,6 +190,25 @@ void __init sme_early_init(void) protection_map[i] = pgprot_encrypted(protection_map[i]); } +/* Architecture __weak replacement functions */ +void __init mem_encrypt_init(void) +{ + if (!sme_me_mask) + return; + + /* Call into SWIOTLB to update the SWIOTLB DMA buffers */ + swiotlb_update_mem_attributes(); +} + +void swiotlb_set_mem_attributes(void *vaddr, unsigned long size) +{ + WARN(PAGE_ALIGN(size) != size, + "size is not page-aligned (%#lx)\n", size); + + /* Make the SWIOTLB buffer area decrypted */ + set_memory_decrypted((unsigned long)vaddr, size >> PAGE_SHIFT); +} + void __init sme_encrypt_kernel(void) { } diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 4ee479f..15e7160 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h @@ -35,6 +35,7 @@ enum swiotlb_force { extern unsigned long swiotlb_nr_tbl(void); unsigned long swiotlb_size_or_default(void); extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); +extern void __init swiotlb_update_mem_attributes(void); /* * Enumeration for sync targets diff --git a/init/main.c b/init/main.c index df58a41..5013cbc 100644 --- a/init/main.c +++ b/init/main.c @@ -488,6 +488,8 @@ void __init __weak thread_stack_cache_init(void) } #endif +void __init __weak mem_encrypt_init(void) { } + /* * Set up kernel memory allocators */ @@ -640,6 +642,14 @@ asmlinkage __visible void __init start_kernel(void) */ locking_selftest(); + /* + * This needs to be called before any devices perform DMA + * operations that might use the SWIOTLB bounce buffers. It will + * mark the bounce buffers as decrypted so that their usage will + * not cause "plain-text" data to be decrypted when accessed. + */ + mem_encrypt_init(); + #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start && !initrd_below_start_ok && page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) { diff --git a/lib/swiotlb.c b/lib/swiotlb.c index a8d74a7..04ac91a 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -155,6 +156,15 @@ unsigned long swiotlb_size_or_default(void) return size ? size : (IO_TLB_DEFAULT_SIZE); } +void __weak swiotlb_set_mem_attributes(void *vaddr, unsigned long size) { } + +/* For swiotlb, clear memory encryption mask from dma addresses */ +static dma_addr_t swiotlb_phys_to_dma(struct device *hwdev, + phys_addr_t address) +{ + return __sme_clr(phys_to_dma(hwdev, address)); +} + /* Note that this doesn't work with highmem page */ static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev, volatile void *address) @@ -183,6 +193,31 @@ void swiotlb_print_info(void) bytes >> 20, vstart, vend - 1); } +/* + * Early SWIOTLB allocation may be too early to allow an architecture to + * perform the desired operations. This function allows the architecture to + * call SWIOTLB when the operations are possible. It needs to be called + * before the SWIOTLB memory is used. + */ +void __init swiotlb_update_mem_attributes(void) +{ + void *vaddr; + unsigned long bytes; + + if (no_iotlb_memory || late_alloc) + return; + + vaddr = phys_to_virt(io_tlb_start); + bytes = PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT); + swiotlb_set_mem_attributes(vaddr, bytes); + memset(vaddr, 0, bytes); + + vaddr = phys_to_virt(io_tlb_overflow_buffer); + bytes = PAGE_ALIGN(io_tlb_overflow); + swiotlb_set_mem_attributes(vaddr, bytes); + memset(vaddr, 0, bytes); +} + int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) { void *v_overflow_buffer; @@ -320,6 +355,7 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) io_tlb_start = virt_to_phys(tlb); io_tlb_end = io_tlb_start + bytes; + swiotlb_set_mem_attributes(tlb, bytes); memset(tlb, 0, bytes); /* @@ -330,6 +366,8 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) if (!v_overflow_buffer) goto cleanup2; + swiotlb_set_mem_attributes(v_overflow_buffer, io_tlb_overflow); + memset(v_overflow_buffer, 0, io_tlb_overflow); io_tlb_overflow_buffer = virt_to_phys(v_overflow_buffer); /* @@ -581,7 +619,7 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, return SWIOTLB_MAP_ERROR; } - start_dma_addr = phys_to_dma(hwdev, io_tlb_start); + start_dma_addr = swiotlb_phys_to_dma(hwdev, io_tlb_start); return swiotlb_tbl_map_single(hwdev, start_dma_addr, phys, size, dir, attrs); } @@ -702,7 +740,7 @@ void swiotlb_tbl_sync_single(struct device *hwdev, phys_addr_t tlb_addr, goto err_warn; ret = phys_to_virt(paddr); - dev_addr = phys_to_dma(hwdev, paddr); + dev_addr = swiotlb_phys_to_dma(hwdev, paddr); /* Confirm address can be DMA'd by device */ if (dev_addr + size - 1 > dma_mask) { @@ -812,10 +850,10 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, map = map_single(dev, phys, size, dir, attrs); if (map == SWIOTLB_MAP_ERROR) { swiotlb_full(dev, size, dir, 1); - return phys_to_dma(dev, io_tlb_overflow_buffer); + return swiotlb_phys_to_dma(dev, io_tlb_overflow_buffer); } - dev_addr = phys_to_dma(dev, map); + dev_addr = swiotlb_phys_to_dma(dev, map); /* Ensure that the address returned is DMA'ble */ if (dma_capable(dev, dev_addr, size)) @@ -824,7 +862,7 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, attrs |= DMA_ATTR_SKIP_CPU_SYNC; swiotlb_tbl_unmap_single(dev, map, size, dir, attrs); - return phys_to_dma(dev, io_tlb_overflow_buffer); + return swiotlb_phys_to_dma(dev, io_tlb_overflow_buffer); } EXPORT_SYMBOL_GPL(swiotlb_map_page); @@ -958,7 +996,7 @@ void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, sg_dma_len(sgl) = 0; return 0; } - sg->dma_address = phys_to_dma(hwdev, map); + sg->dma_address = swiotlb_phys_to_dma(hwdev, map); } else sg->dma_address = dev_addr; sg_dma_len(sg) = sg->length; @@ -1026,7 +1064,7 @@ void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, int swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr) { - return (dma_addr == phys_to_dma(hwdev, io_tlb_overflow_buffer)); + return (dma_addr == swiotlb_phys_to_dma(hwdev, io_tlb_overflow_buffer)); } EXPORT_SYMBOL(swiotlb_dma_mapping_error); @@ -1039,6 +1077,6 @@ void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, int swiotlb_dma_supported(struct device *hwdev, u64 mask) { - return phys_to_dma(hwdev, io_tlb_end - 1) <= mask; + return swiotlb_phys_to_dma(hwdev, io_tlb_end - 1) <= mask; } EXPORT_SYMBOL(swiotlb_dma_supported);