From patchwork Tue Jun 27 15:12:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812475 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 DC74860351 for ; Tue, 27 Jun 2017 15:15:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE37C286BC for ; Tue, 27 Jun 2017 15:15:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF233286D0; Tue, 27 Jun 2017 15:15:02 +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 02FE7286BC for ; Tue, 27 Jun 2017 15:15:02 +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 1dPsAV-0002J5-3m; Tue, 27 Jun 2017 15:12:43 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPsAT-0002Hk-GO for xen-devel@lists.xen.org; Tue, 27 Jun 2017 15:12:41 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 0E/A8-03044-8E572595; Tue, 27 Jun 2017 15:12:40 +0000 X-Brightmail-Tracker: H4sIAAAAA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com!1498576357!105106954!1 X-Originating-IP: [104.47.40.74] 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 23478 invoked from network); 27 Jun 2017 15:12:39 -0000 Received: from mail-co1nam03on0074.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) (104.47.40.74) by server-7.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 15:12:39 -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=n8gUJ3T4FOHUw46TJWjc+wXoICoET8DT4Dc7YqSFOUk=; b=Vwp3DiqWB5yW6erjuGB7sarp+AcTOXpbVnbb0/ANF7oURsUU9NDOmJmVPRvCUCBYoKoudW3y0Ur5xFc4V7LG4LxJk1zili57l88JZA8xzCMfeOZg+pCR5eheDKV7Zeg1gc4qkiUhp201LVOkYDIHNFI5R7oo5aUtJJLuzAOMriQ= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by DM5PR12MB1145.namprd12.prod.outlook.com (10.168.236.140) 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:12:33 +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:12:30 -0500 Message-ID: <20170627151230.17428.75281.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: BN6PR1701CA0010.namprd17.prod.outlook.com (10.172.26.148) To DM5PR12MB1145.namprd12.prod.outlook.com (10.168.236.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10f5cd06-09ae-4e53-10c6-08d4bd6ef1a4 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:DM5PR12MB1145; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1145; 3:8ACMAX0h7P9ZUB3snCAmzdoDE8mkG/xEyKOXKDPH/GUfmowP0zlQq7Ol2k9dONPc7NXZgYIT0caEtmbwOpjeEwFJmTlFCSaOW6BsscQoyhVRZEzK/wjS0gt+RTw9O6AiTLDAChrjXHVOcMLj0Rvo5FCmuPSnVdliz6HW2/fh63wuDydqO6cogR3TgMb/qX80PVFmiP4k5K5x+C+9Y2Co0R+DLokhofgto14hq7wN49/iaJ5DoeNPSFcnp2wvvwx76ScArZYMRAIDUOCb42sQoqmNhGpIuRqYdwjFSoVvL2xBXjXlT+RzaLzuGBKCidygkwngar0UB8cerJMJBM3VkRK8wTLLlRsNmkrJEmM1drHqesu2bbjs4m+F2atGezf6W8tViHj08cX0ic7bBbjcpR4ovAuV64OqrW3LGif1MTB5Ehk+e7lcp4QjybGPYOOFDjV6cZRF7S8K6ClP2R1WyvF8HH88u9W+gJ1WUHVE+DjuIVvtFFTw5t4yIsGVm4GqPItu1r03SWGnYAbSFXLBac8MUydWwQW68/iYFCbRYEc+NmxDq0CVrww6PvJ8W6G0/lBubFSkyfz8oTxfflBmOjf889bS+IwOYaajjT0FgH5ySgvf83rwCVkW9RzCYea+FRw3d5DG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RLreArOosi2jbCED1YB6OjNnpspBWUghiIMe3Q9ajIQZ9PpSQvjAC7gYRxfvnR9AwfzTWyqEoLprtYaU2hqqi4bXjzIr91TBtd8tFM6eFOJ5ssYdB08y6BtbWX2lFI3ni6oPJbZPz3Y6nAINW3sWuvy9Bq8n9ioATW4CFLmgq62GhFUzo54Kgmqr0be4lp3I5pKLNV7IVUo90wmR52J1iv76Q0ZubXz9s4T56/Ra2gzZ9Ehb9JsT9uyxedISEFcn0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123560025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR12MB1145; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR12MB1145; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ1OzQ6WncrK25WMDhCTUpaSER5NzM0MHAyam5pK05K?= =?utf-8?B?OUI4a2RHZlVXOThCWTFLLzBjNXdiSmkzdGxndkhqdFRDNUVvSUkrNUVxK2tI?= =?utf-8?B?a3F5ZTVDUHdIYWZWMU9ESTlwRWJ5RUpURWF0aXNoUzNJTnF0WThqS2paZlpy?= =?utf-8?B?cVM1YkxTdzEyeDE5WE1IYmpBNnl5UUZMS2ZwYlhpb0pFaWhveStjK2JCOUZZ?= =?utf-8?B?SUZ2RDFqZWRxNkJ3TXllTXBVR2hqNGU2N3JrbzdBdnlVM1AycTc2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d0JXNUZPVWgvVTRZZ2RBdnZsb3FCUk5veGZD?= =?utf-8?B?NDVOd24rY0pDWUdsR0p0VENsZTB0Szc4WXpnanlwVnhRTHVFY0RxcVI1T1ZJ?= =?utf-8?B?dStEWlU4b1JPL0xwRHlocnNYZHlVM0llb2YzNWFOSTNMQTU1RVRjTENZa1VK?= =?utf-8?B?a3duMFQ1V0ZQcjRXSjREbnpDQzRMRXVseVJDUFpJKzlDQlB3WEVBZ2ZJQUc4?= =?utf-8?B?YlVuK01iV3VxSkxkTzVkRWc2bVQ0cXczV2loQiswWi80MWQ2OWs3YzNxSmtl?= =?utf-8?B?djAyUEF5WFliSzJPVlVBRXFEcW1zQkhpMFJ5RXVWbmRlSUx4NExlcDNOQkpu?= =?utf-8?B?TTJldjBtUElZb0JKR3ZUVFFVT1hhWXA5QUhiOFRpKy9yc2I5S25DZXNQZUNL?= =?utf-8?B?WktLbXhDMG5hVGRvM1F5Q0FqdHdFWTBjYXExbHlOZzZDL0p6L3hsU0YzMDRM?= =?utf-8?B?bWwva0w5UThqREN4L3RwTUhxUzJpbVRDbytMVFhWWGsyb3BSOUwzZmpZWTcx?= =?utf-8?Q?tix+Ye6bpwNYfVET+zXlqeazIFoXaOnsHijW5i?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39860400002)(39850400002)(39410400002)(39400400002)(39840400002)(3846002)(7406005)(6506006)(1076002)(7416002)(478600001)(103116003)(53416004)(5660300001)(86362001)(47776003)(2906002)(8676002)(50986999)(81166006)(97746001)(230700001)(6116002)(42186005)(305945005)(54356999)(76176999)(72206003)(33646002)(55016002)(7736002)(25786009)(2950100002)(4001350100001)(83506001)(53936002)(9686003)(50466002)(54906002)(23676002)(189998001)(66066001)(110136004)(38730400002)(4326008)(921003)(1121003)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1145; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; ML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microsoft-Exchange-Diagnostics: 1; DM5PR12MB1145; 20:5QXmNyDz/4Uqz3qMk+vvTiCejitHbfmE8d6r8H4Ekxw+FpQrE16BklFf2J+URgpV4eDajjlVLiOZ16wgsnYvrL0Irwl5T+5ck+bir2tD0thp68Qabm25Obq6bqLTXGfBAylxbPul79+I8zJT3J9mDq9c5ybGTut+fIhIk1RO5prX8NnVnQ6NFzFFyPn1vwxBxWZVohDR0IMoQb8xeFjhk11+rTQ9Z32cGbyqyAJZCcOHvo8sOfTvLLDglO8iYAh6 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 15:12:33.5914 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1145 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 27/38] 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. Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- 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 503849d..16cc54b 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