From patchwork Fri Jun 16 18:54:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793329 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 07FCD60325 for ; Fri, 16 Jun 2017 18:57:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDD232865B for ; Fri, 16 Jun 2017 18:57:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E244E2866B; Fri, 16 Jun 2017 18:57:54 +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 C96B528671 for ; Fri, 16 Jun 2017 18:57:52 +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 1dLwOo-00049z-DM; Fri, 16 Jun 2017 18:55: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 1dLwOm-00048U-FS for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:55:12 +0000 Received: from [85.158.143.35] by server-7.bemta-6.messagelabs.com id 62/6B-03620-F8924495; Fri, 16 Jun 2017 18:55:11 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1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308!62323795!1 X-Originating-IP: [104.47.34.64] 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 60459 invoked from network); 16 Jun 2017 18:55:10 -0000 Received: from mail-by2nam01on0064.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.64) by server-16.tower-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:55:10 -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=BJpyf29rPipDj2hrBxG/AXMjyc/9yC27mppojdGYfXI=; b=cAgB7oiRU3IfuG+ZLNOx3L2rAmOmlahrfRRq5DDIOQClNFTYoGYCi2vbThkJn4dWILtjdeCLf6bcYjdd5G5aQx5TMOjFDPWt7/0zV74U2n1p92UhnT+QO2hBnUvf2SZohHBiYp10HaNv+21Lb7QHvDg3mNU+kTHolKMFhMzlTS8= 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:55:02 +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:59 -0500 Message-ID: <20170616185459.18967.72790.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: BN6PR17CA0001.namprd17.prod.outlook.com (10.173.147.11) To DM5PR12MB1148.namprd12.prod.outlook.com (10.168.236.143) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR12MB1148: X-MS-Office365-Filtering-Correlation-Id: c17a920b-396a-414c-e7ed-08d4b4e93367 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:6mHM71PzWnRfz/B7HFJKyEUo3y+UMA4fBwytSAbzMveEjed1zXuLmIF16kvARUQnoMRCbIWaN+ZaqbmxgzWCOOjgdcU5f41kWOgCZVXeBH7Ggvb9aVBWUxR7s+1VLJAJMKyHUavvC40vxW+eftspzA1NOq+1b0ugwfGUCU3l0/QJ9aFOsz2+f99NJKhqMaegWkxjoO7H2pD02Mg6/r9/WHb/c4oSQUPMRZ/zi3H4bdoQkLyQB10DBuXvj6Jr4QIAiCBIqrwCrbgzmJDaqCdMW87CIx+vk3qLW0ZKYGykdEVVesWPSJI1Gwc6mZTLOUvHxZuGy31BS1qYOJqlAwBYbPM4OyykfNItr3pqFtNjQa0= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 25:w1R+KrtowVwVYeML69p2u5XvRIDKXNAZuCiEIIaLgyoroLHlNMeEpOhUZXYmffU3RGthsoCODvjBHPdebHvWH4Pu+mYOR6w/iCKg2rf8jH1kUJfPVKCtV559p00Xi08joJfRqOXWzlOtPNn+Vho0VsRQajAamTulJHQE9zhz1akIO/pilFDBI+zA5znGwj08Rm7BlQ9WISw/+8DvRTEN3cEcEHIsn/+G5UUKRrZ8Or/JKl5bOCP6i6+l715nb6eOO4FZUM+jO2SLYUgK0Qwo/MJO50bamPLGnwehtftn/OTc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r6/zXpBGFpbW5hHmFs+kQ6QQkzlkST2IT+a7KdumlHu1O6T7zFrfYlGBeiddXbEcsPEkdnpmtqCoVZYLvOZBV+yg13y/66ab+hTcjer4kXaGjeQ7MXwfnjWNqQRF6dfkRqDh7CIYvyBla4FVJD3mg4jle2yk1lhlpiyA16i1BTJTibRZsi3v9IrrsMPXmWKvfIbt99cP376RLJ/NkHW27bwCl71dsq+Z+5Zu1zcXDGiT7JnkmIqYE8b4uCnuCayD4WvWdHT0RLpebuLGGc= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 20:csyeoE3h5NfG8Yf3pSxGOWInF9M/u8zjfXfrX6I0sd3VocnBqSR+bVEKHEAniRLe4Gyu+joSw+o8aQyLDnCp6BzB+HEHbr0HeRVhNhQwwk5AB5QaGbhpsVxCgMLDcpvvCmZEt23/oYsrMu7ed4anakM9lyizVcsNXJJI5tACqH5fC5i78L0PiIfXko9oXVJJfVgirXNhxiHLDwbphB7z/jQvKjQODgIP7tatfuNpnEXz+cmWpw0ntIRjpbBMQAIIFd5GybpA8egybVGZt6yoqikDi5BaRz12UpAs1iD6TGlgwsHPWzoDac2DoS08KHOMmZuryZoKxEsTuWAaDn3vr7Z6GlEm0fzeJrgy7hYRy88OVqPj9ZX4DUmtwiQAOooINIG41zfsJflRa+jJqgmZsJyZb4Fv8CCk3tad2CRKJlAom71+RSCjVtAJwuAU5Fhk7ActH55zuX1p7dO9ZJVEu0a8W9VFRh9/a3oLCmmjncHtEdoh7yv5y019IIYz/Egj 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?MTtETTVQUjEyTUIxMTQ4OzQ6ZWtzN05iSlNCSHdiOFprQVdobmxxZjV5Q3dj?= =?utf-8?B?TFY0SWx3VlNsTWJvQk1CSFNQSE9HbEdQU2d3S0NxbFNKeTAvOTV1bnRLS1hk?= =?utf-8?B?SnpwakR4eU9UOUgzR2laY2NsYVY3YSs3THBZaWt4QTRlOW1NR3hRbzVMZVlW?= =?utf-8?B?MHU1d3NGUDZaUjRKdnpKVU50VDF1cjhsV0h4bmZuMG1iV3IxbUNOTHRmSnUw?= =?utf-8?B?U1hmZG9QNzgrcUFlV3BsdjdQL1krVnNXQnFlM3hEMjBQOWhBWG80ek83NDNQ?= =?utf-8?B?T0JISWJ5VEFiTDM0eE5Pbm0ydEFnSll3aVFpVVM0TVgrWE9zeXpQZ29RMWd5?= =?utf-8?B?RGM5SmpJdW8wN2phckpJSXF1VmtOdEVNOHozSWpmQVM1ZXRQZExHTERXZTQy?= =?utf-8?B?RnJWeFFzakJnbTFqNUR3Z2k2YU9reVRwUjlRaktDb0JOeTRrVzJ4MVRVT3g1?= =?utf-8?B?UEgreC9KWmEyRjlJMExvazBydkJ3MHBSMU9wR1ZwQXZUOTFGUXdBU0tkSVhu?= =?utf-8?B?QjNBY05wSHlKWmsrY3gyd0FVMktEaE0ydjdpaWhJMFFPL2hYUWR6VlBrQTJU?= =?utf-8?B?SXo0T2xwS3VNM1I5VVNYN1RUU3kzK09qRktmRG5jOVNBUnZMN1VsSEd3ZEdv?= =?utf-8?B?V1hxWFVMRlRuS0pncHBuQXBmYTl1WWVsUjlwUjVId2piRmJoOTdRNmNmRlNh?= =?utf-8?B?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= =?utf-8?Q?QqLmsiIh/iXlDsVjq6K?= 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)(217873001)(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?MTtETTVQUjEyTUIxMTQ4OzIzOm55VndreFVORllVc0VSWUZpcXM5ckowSzVY?= =?utf-8?B?K09EclJYRWtZbzIrVDFjenBOb3ZmdDNwd1JLaG9QeVlKamtaMzVWbFErSVU0?= =?utf-8?B?Q1lnTThhTnpiUXR3Zkl0WGNvQjZIdno0Tkl0TmFkOS92TjY3VHhnTXZBQjBX?= =?utf-8?B?NHBCNzZsR3cxZmplVUpqMzRRZ0VyTUVmbWZyVzIxa3p5UGVRa0hzRWRpbzNX?= =?utf-8?B?Z242aEZoWU5LamJQR1dlS2dDeFVxdHFuN3kvZjlNZWlENVA1ZktnTmhNcXlG?= =?utf-8?B?eDlha2hHSXJ5K1dsYk5WbTc3KzQ4WVpPSE81QVR1YXNiOHdqMVd4UmRtOWZY?= =?utf-8?B?ZEJXekhDWnV4aCs2OHJvSjhEZGpaSGh6WWFSZ1hhOVhUUXpPWHREaWZ0Sng5?= =?utf-8?B?eHdtNm5ITTlNbm5iVFIvVHUvMFd0RlVPZUlkMHgzbnBEbCtGYWhuTk9UTGR5?= =?utf-8?B?Z2xnYXpB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JGhBnKZM2xnhVcAh02CrXQcj0JKAZM70jcNmBRSwTAcEKJmryvEef+nhEOp2YlwKH6mBnG0v674r4wOm/Q3aF2YNA7D90MUDe50nU9ONUzvxSryVOxtXmaDk+feMoZeZHmJq5NvfJkMiMzE6WsM1XYz2rjMzHombEIpsUOmEaQM98oRt0T5+2Zw/K2bc8yONA7j619APoXviQU2OlgdFbmOsaEcIRwTZ+6VtdKH7N725ayElkLmzRI9jXM0jzmKdPSfTEuIRsKSYTIXW7KPbDdMh2ylaovs+uPKtDhQFVFMkREGYvVayxvyvCyOCT3pVwSBItp1H8ST6GCdXbQtG/7NPpcECj08DYxK6x72phlkdGJY8jhSEoq611aHrSrl3/hb+LNGeOZs/7n6zJIFFgGKyBBTcFMMm2VRzNqHxvDMKh44hH8haLsLXxODSr5fm4qw/MiO0VPI= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1148; 20:4if77OTmQwNSmiWVEWafIoMRlp/hCUAUp5KPaOK71Md6jzDbEijmjIdZufBprWlztd66g1D7k2KhbikhPXlDvRXiyZ1vth+5tkdPH/dDd2Z/xelmNjazx1a59glbbNPEtGBK46nnPZwgSBq1m26OKd9tAy2bQ9dvPNkmgfeHOC+kqQM2Jd4yxTjKGVC6ONHE/EKof2xOnP5fR89AzlXgj94UlYEWVtaMBYaKDgS45rtvbKYgcv1hFQHfGo4EK5nN X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:55:02.1565 (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 27/36] iommu/amd: Allow the AMD IOMMU to work with memory encryption 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 The IOMMU is programmed with physical addresses for the various tables and buffers that are used to communicate between the device and the driver. When the driver allocates this memory it is encrypted. In order for the IOMMU to access the memory as encrypted the encryption mask needs to be included in these physical addresses during configuration. The PTE entries created by the IOMMU should also include the encryption mask so that when the device behind the IOMMU performs a DMA, the DMA will be performed to encrypted memory. Signed-off-by: Tom Lendacky Reviewed-by: Borislav Petkov --- drivers/iommu/amd_iommu.c | 30 ++++++++++++++++-------------- drivers/iommu/amd_iommu_init.c | 34 ++++++++++++++++++++++++++++------ drivers/iommu/amd_iommu_proto.h | 10 ++++++++++ drivers/iommu/amd_iommu_types.h | 2 +- 4 files changed, 55 insertions(+), 21 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 63cacf5..912008c 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -544,7 +544,7 @@ static void dump_dte_entry(u16 devid) static void dump_command(unsigned long phys_addr) { - struct iommu_cmd *cmd = phys_to_virt(phys_addr); + struct iommu_cmd *cmd = iommu_phys_to_virt(phys_addr); int i; for (i = 0; i < 4; ++i) @@ -865,11 +865,13 @@ static void copy_cmd_to_buffer(struct amd_iommu *iommu, static void build_completion_wait(struct iommu_cmd *cmd, u64 address) { + u64 paddr = iommu_virt_to_phys((void *)address); + WARN_ON(address & 0x7ULL); memset(cmd, 0, sizeof(*cmd)); - cmd->data[0] = lower_32_bits(__pa(address)) | CMD_COMPL_WAIT_STORE_MASK; - cmd->data[1] = upper_32_bits(__pa(address)); + cmd->data[0] = lower_32_bits(paddr) | CMD_COMPL_WAIT_STORE_MASK; + cmd->data[1] = upper_32_bits(paddr); cmd->data[2] = 1; CMD_SET_TYPE(cmd, CMD_COMPL_WAIT); } @@ -1328,7 +1330,7 @@ static bool increase_address_space(struct protection_domain *domain, return false; *pte = PM_LEVEL_PDE(domain->mode, - virt_to_phys(domain->pt_root)); + iommu_virt_to_phys(domain->pt_root)); domain->pt_root = pte; domain->mode += 1; domain->updated = true; @@ -1365,7 +1367,7 @@ static u64 *alloc_pte(struct protection_domain *domain, if (!page) return NULL; - __npte = PM_LEVEL_PDE(level, virt_to_phys(page)); + __npte = PM_LEVEL_PDE(level, iommu_virt_to_phys(page)); /* pte could have been changed somewhere. */ if (cmpxchg64(pte, __pte, __npte) != __pte) { @@ -1481,10 +1483,10 @@ static int iommu_map_page(struct protection_domain *dom, return -EBUSY; if (count > 1) { - __pte = PAGE_SIZE_PTE(phys_addr, page_size); + __pte = PAGE_SIZE_PTE(__sme_set(phys_addr), page_size); __pte |= PM_LEVEL_ENC(7) | IOMMU_PTE_P | IOMMU_PTE_FC; } else - __pte = phys_addr | IOMMU_PTE_P | IOMMU_PTE_FC; + __pte = __sme_set(phys_addr) | IOMMU_PTE_P | IOMMU_PTE_FC; if (prot & IOMMU_PROT_IR) __pte |= IOMMU_PTE_IR; @@ -1700,7 +1702,7 @@ static void free_gcr3_tbl_level1(u64 *tbl) if (!(tbl[i] & GCR3_VALID)) continue; - ptr = __va(tbl[i] & PAGE_MASK); + ptr = iommu_phys_to_virt(tbl[i] & PAGE_MASK); free_page((unsigned long)ptr); } @@ -1715,7 +1717,7 @@ static void free_gcr3_tbl_level2(u64 *tbl) if (!(tbl[i] & GCR3_VALID)) continue; - ptr = __va(tbl[i] & PAGE_MASK); + ptr = iommu_phys_to_virt(tbl[i] & PAGE_MASK); free_gcr3_tbl_level1(ptr); } @@ -1807,7 +1809,7 @@ static void set_dte_entry(u16 devid, struct protection_domain *domain, bool ats) u64 flags = 0; if (domain->mode != PAGE_MODE_NONE) - pte_root = virt_to_phys(domain->pt_root); + pte_root = iommu_virt_to_phys(domain->pt_root); pte_root |= (domain->mode & DEV_ENTRY_MODE_MASK) << DEV_ENTRY_MODE_SHIFT; @@ -1819,7 +1821,7 @@ static void set_dte_entry(u16 devid, struct protection_domain *domain, bool ats) flags |= DTE_FLAG_IOTLB; if (domain->flags & PD_IOMMUV2_MASK) { - u64 gcr3 = __pa(domain->gcr3_tbl); + u64 gcr3 = iommu_virt_to_phys(domain->gcr3_tbl); u64 glx = domain->glx; u64 tmp; @@ -3470,10 +3472,10 @@ static u64 *__get_gcr3_pte(u64 *root, int level, int pasid, bool alloc) if (root == NULL) return NULL; - *pte = __pa(root) | GCR3_VALID; + *pte = iommu_virt_to_phys(root) | GCR3_VALID; } - root = __va(*pte & PAGE_MASK); + root = iommu_phys_to_virt(*pte & PAGE_MASK); level -= 1; } @@ -3652,7 +3654,7 @@ static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table) dte = amd_iommu_dev_table[devid].data[2]; dte &= ~DTE_IRQ_PHYS_ADDR_MASK; - dte |= virt_to_phys(table->table); + dte |= iommu_virt_to_phys(table->table); dte |= DTE_IRQ_REMAP_INTCTL; dte |= DTE_IRQ_TABLE_LEN; dte |= DTE_IRQ_REMAP_ENABLE; diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 5a11328..26862f1 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -346,7 +347,7 @@ static void iommu_set_device_table(struct amd_iommu *iommu) BUG_ON(iommu->mmio_base == NULL); - entry = virt_to_phys(amd_iommu_dev_table); + entry = iommu_virt_to_phys(amd_iommu_dev_table); entry |= (dev_table_size >> 12) - 1; memcpy_toio(iommu->mmio_base + MMIO_DEV_TABLE_OFFSET, &entry, sizeof(entry)); @@ -602,7 +603,7 @@ static void iommu_enable_command_buffer(struct amd_iommu *iommu) BUG_ON(iommu->cmd_buf == NULL); - entry = (u64)virt_to_phys(iommu->cmd_buf); + entry = iommu_virt_to_phys(iommu->cmd_buf); entry |= MMIO_CMD_SIZE_512; memcpy_toio(iommu->mmio_base + MMIO_CMD_BUF_OFFSET, @@ -631,7 +632,7 @@ static void iommu_enable_event_buffer(struct amd_iommu *iommu) BUG_ON(iommu->evt_buf == NULL); - entry = (u64)virt_to_phys(iommu->evt_buf) | EVT_LEN_MASK; + entry = iommu_virt_to_phys(iommu->evt_buf) | EVT_LEN_MASK; memcpy_toio(iommu->mmio_base + MMIO_EVT_BUF_OFFSET, &entry, sizeof(entry)); @@ -664,7 +665,7 @@ static void iommu_enable_ppr_log(struct amd_iommu *iommu) if (iommu->ppr_log == NULL) return; - entry = (u64)virt_to_phys(iommu->ppr_log) | PPR_LOG_SIZE_512; + entry = iommu_virt_to_phys(iommu->ppr_log) | PPR_LOG_SIZE_512; memcpy_toio(iommu->mmio_base + MMIO_PPR_LOG_OFFSET, &entry, sizeof(entry)); @@ -744,10 +745,10 @@ static int iommu_init_ga_log(struct amd_iommu *iommu) if (!iommu->ga_log_tail) goto err_out; - entry = (u64)virt_to_phys(iommu->ga_log) | GA_LOG_SIZE_512; + entry = iommu_virt_to_phys(iommu->ga_log) | GA_LOG_SIZE_512; memcpy_toio(iommu->mmio_base + MMIO_GA_LOG_BASE_OFFSET, &entry, sizeof(entry)); - entry = ((u64)virt_to_phys(iommu->ga_log) & 0xFFFFFFFFFFFFFULL) & ~7ULL; + entry = (iommu_virt_to_phys(iommu->ga_log) & 0xFFFFFFFFFFFFFULL) & ~7ULL; memcpy_toio(iommu->mmio_base + MMIO_GA_LOG_TAIL_OFFSET, &entry, sizeof(entry)); writel(0x00, iommu->mmio_base + MMIO_GA_HEAD_OFFSET); @@ -2535,6 +2536,24 @@ static int __init amd_iommu_init(void) return ret; } +static bool amd_iommu_supports_sme(void) +{ + if (!sme_active() || (boot_cpu_data.x86 != 0x17)) + return true; + + /* For Fam17h, a specific level of support is required */ + if (boot_cpu_data.microcode >= 0x08001205) + return true; + + if ((boot_cpu_data.microcode >= 0x08001126) && + (boot_cpu_data.microcode <= 0x080011ff)) + return true; + + pr_notice("AMD-Vi: IOMMU not currently supported when SME is active\n"); + + return false; +} + /**************************************************************************** * * Early detect code. This code runs at IOMMU detection time in the DMA @@ -2552,6 +2571,9 @@ int __init amd_iommu_detect(void) if (amd_iommu_disabled) return -ENODEV; + if (!amd_iommu_supports_sme()) + return -ENODEV; + ret = iommu_go_to_state(IOMMU_IVRS_DETECTED); if (ret) return ret; diff --git a/drivers/iommu/amd_iommu_proto.h b/drivers/iommu/amd_iommu_proto.h index 466260f..3f12fb2 100644 --- a/drivers/iommu/amd_iommu_proto.h +++ b/drivers/iommu/amd_iommu_proto.h @@ -87,4 +87,14 @@ static inline bool iommu_feature(struct amd_iommu *iommu, u64 f) return !!(iommu->features & f); } +static inline u64 iommu_virt_to_phys(void *vaddr) +{ + return (u64)__sme_set(virt_to_phys(vaddr)); +} + +static inline void *iommu_phys_to_virt(unsigned long paddr) +{ + return phys_to_virt(__sme_clr(paddr)); +} + #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */ diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index 4de8f41..3ce587d 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -343,7 +343,7 @@ #define IOMMU_PAGE_MASK (((1ULL << 52) - 1) & ~0xfffULL) #define IOMMU_PTE_PRESENT(pte) ((pte) & IOMMU_PTE_P) -#define IOMMU_PTE_PAGE(pte) (phys_to_virt((pte) & IOMMU_PAGE_MASK)) +#define IOMMU_PTE_PAGE(pte) (iommu_phys_to_virt((pte) & IOMMU_PAGE_MASK)) #define IOMMU_PTE_MODE(pte) (((pte) >> 9) & 0x07) #define IOMMU_PROT_MASK 0x03