From patchwork Tue Jun 27 15:00:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812265 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 37EC460351 for ; Tue, 27 Jun 2017 15:03:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C04B827FAD for ; Tue, 27 Jun 2017 15:03:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B44A128401; Tue, 27 Jun 2017 15:03:42 +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 A183827FAD for ; Tue, 27 Jun 2017 15:03:41 +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 1dPrzO-0005wt-EU; Tue, 27 Jun 2017 15:01: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 1dPrzN-0005vr-Bo for xen-devel@lists.xen.org; Tue, 27 Jun 2017 15:01:13 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id 04/8F-03557-83372595; Tue, 27 Jun 2017 15:01:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1VSeUgUURjvzc6skzjxXBW/lg5bs0NaKzqsiIr S2qDCDGK7zFkd3Y29mlllu0DKQi2PrKQWKckMKqTDaLs027BaMSkTC9YOLSSN3SVSlA5pxrHr /fV73+96HzxaoTqkVNOc08HxVtasUYaSxtlxq7SJQuqWOd6f0xZd+FJNrkC6pnvfiRS0lTJZD TZnOmW8/sFH2r1rnEc97WQe+ry0CIXSJM5XQOuPekq6IHwCQe2rckURGkur8BECngRiJKzEs6 DD309IOALrwddRjSQciasI6K7AklmB/UpoaG1RSgSBJ0DV+ZqRIBLHwduhB6SEGayDipaSkfl YvBZKehpHy3RQ/PBriISj8CS49DKfkvXh4D3zUfTSYsFMuHp3tjRW4Mng9leOWAHHgHtwUCm9 AXABgmfNd5CcORVcX5+HyKKJ0PSskpTxeqg77R3JBBwLzfkbZG8NAcGWq6OhxUrwPt4oa+Kh9 FiyPO4OgYulWlnfTcHNk8OETNwiwde6S8ZmqHjRO9q7DX48KaVkQwsFhbVeQr74MdR43lJlSO v6Z1HX30Vd/yxahRSX0XSB43M5XjsvwcCbso0OC2sya+fOWZhg4QSBzebMrEFIyLBZbiDxR4w Rz21UMLzSg8bThCaKuQKpW1TjDLbMPUZWMO7kc8yc4EHTaRqfbzq4SU1abVZOA8y53aIsnOey OWeWySz+sN9KoMM0kUyHXaQZwc5aBFO2TDWjKepoJiD5sEQYc6x/bL//ZhuaqI5gkPgmVZid4 y0mx/98H4qmkSaCWcyLKWEmq+NPep9YTIjF5NkUqdjB/qXUeYj1tg/UrUmKji3PzZ3XntnUlY BwMGv74QmPlgzk+b7VzejcPZT+1BaOy97DRWtbj7thR5pbv27fjN5tkweXt13ryrjx+r7tQNS nZMM1/fykuMB+E94T3DupPtlZuDo96w11VjdcEOSXCWmBodBTC3T9iRs3d17PeOfTH+caMztV GlIwsnPjFbzA/gJW925clgMAAA== X-Env-Sender: Thomas.Lendacky@amd.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1498575669!109889164!1 X-Originating-IP: [104.47.37.67] 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 65423 invoked from network); 27 Jun 2017 15:01:11 -0000 Received: from mail-cys01nam02on0067.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) (104.47.37.67) by server-6.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 15:01: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=n8gUJ3T4FOHUw46TJWjc+wXoICoET8DT4Dc7YqSFOUk=; b=WQ8z3eSB+BsWoCB0QuKpba/bDIGUfrI7/Gesb8aZkcz3Px4oAj8OgS21RWL77Ge3W9UMHn0CBjz53wPzVHtQ6+WVh9CD9gwh5mI0KmTKUJ9gMeTKqLIriI0UOyZH5GPfxhviXaWrTJkkJjuFiMNXUSwRMwDMgK/Zzd69WqUUcNM= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by BN6PR12MB1139.namprd12.prod.outlook.com (10.168.226.141) 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:01:00 +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:00:56 -0500 Message-ID: <20170627150056.15908.79730.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170627145607.15908.26571.stgit@tlendack-t1.amdoffice.net> References: <20170627145607.15908.26571.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: MWHPR2201CA0051.namprd22.prod.outlook.com (10.172.59.25) To BN6PR12MB1139.namprd12.prod.outlook.com (10.168.226.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6798cd62-0973-4776-0d4b-08d4bd6d556b 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:BN6PR12MB1139; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1139; 3:ojG9GkXrDosMpUcxRyjOFA041IGMXauG0oP2ztQOV62d1gmesdkR95l/Iu2kZ3rDowa4vF1STBJ8l6XDQSDR+Ye8PI+37Jy18k+UgnD8Chrv9EkCVxGRBrKW+VvVNt8UmrLn8DBG8o5S93BQjp0QKm/WOJhMsp/hCazCTM4oO7goWODZXTRG93LB6RY1G47FWlqfI0ojLwRjQ1zl+YFIJ6ni67iC4exSQ5x0E1mtH4fRYp7hXjSE0DxoghKGeLitpxWRKF9rJvoMC9vXgWLS0kIukwTlg4GGu+O9TwnuzcWfz1ldbpLZ0bDOrUOylzPqz+2umHWsPg5j4ctmeF3Bs7lF2RKIs/91eYHo6Eog6M5MwQnvRuv+hMkkvlkRUCFkt6Wf+A8DGT30FIQA8pPFmJ/fJNJecrhf9c7Cxe9jdXFvZeVqp44j+jdzRalH4W9qAf3BcKrmVTA57upZB9tnxqjC/v7B5s0eEJdu3b3hEPku0aJoIpkpg6YDakL8T5X6ULnMwX9vh6C4sbLAJfZXyu3pxPMDeUlo3WMmkVOpOGNP0RoianTLbpqfoDI0tqtHjbAEYwC/tIQI0PvySBeDvP1Y09X5ywhtKELYXYe29D7S44t9561Dzv9bz+rl/9IMd9H0H24JgH3A2zHnXrUyu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ft-Exchange-Diagnostics: 1; BN6PR12MB1139; 31:P+BkcqvVsHcLM5KON5xjeXLRaDQZP9OJhR6jro2gwCYce9a9wx21hv7MzxExpSgURTSwfEhpANGG6YOUX5Ae6Pcp4hL+s18YTDi5NKSSupk5Cgevwd8bHlmzuUeyOj592ZncTPE9BwWuTwuJPyh5YXcDg2YdUenNuE5YoYM72oCTP2skyd09P0ejWO7dzVzrljBrJhOV9IW0UWYZvE0JDekNPcVZSEFkirIVUbyrZ7pB7b10pYRXHT/xTHbu8Riv/zfCaBMoigxr/Ahh/hUZM9ITOCyXKn2x70Ovexi9pjVxcex8ekn/8bIJZYi3/gr/ll3NfACiw+v1Qx1zl9e401zwG/NwoWNrICct6obAHUwLsoVwGk/OCiOU9Lf5jqiHapdaWGvbCQvq4tNSOHGRTEamwuqEIr+PfZ6gq8LIGRBVShF6dRPArnKgddzZiHTv9Y7RaNX/zfy1MYPRWfAbajvj5gqT8WXQpMBacijq/ZELDF8wQ4SEIdnKPU+aXeh4zY1XTTVX+gOpbWTLCifcDOBMStVMTbGK5OblFJBiG7APXck4HeHS9E667faD6oZYXEXhWN39wT6ElRqsYngzdQm2E7cOWNSLos0WtSLR7E+5bZV9M88QR77GRnICZXM4vxS5+5TvJPNeMoacuZo958kImQgJPFf0azKGYyrcG5s= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1139; 20:KQ+tbdCEfBA8Yqa+8uujS5lukNzC6RCNoIgTJjjTDmFZriq0bcB8B8FIIqiew3gw2FhW5TsFXC/tGl9JhkuXu5HyNN5xnZ7gNd6DanfjaH0V6fyiqA8mJfBYnzf3taQMDrf47tg8UMK3R64Hb/I1RgWS304/KzhIKd+Bv2Go65wZK5nFykev01bxNk1C8pkewlIUF9b722riSwpQ/7gB48fL11IR+D37i0N2GTAxWNqel2OFbhz9nEIkJeTXyOnfAMeVljjPG/vlvjnQJ0CDajIqIjqo28GvdrERp5nYS1rpO4yuyCdIn/HpQs2i5xuI473amwv2GS05/HWh7mts/z3u+OyFJUP1S9IH4pUIhLJ4zetux/OO+fhj8Mps3iiFBSAkw5lXJZ2O5qK248ERQxgB+sIUKBQYYnlkOjP1jcKrQOZ5diIMqEi1t1e6mXlvPOiFqcMj+X5MRjhn+D6uxJCP5B3wBXrfELs2xIvx9TxHuX3wo8euZnFhZku5AMfB 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)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR12MB1139; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR12MB1139; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTM5OzQ6MUNaQmV5aTNSbHFmQzM4bURXRkkwdlBNcTJZ?= =?utf-8?B?V3M1VGswN1VoQ2FteCtjb0F6K3JiNy93Tk5PMzh2b1ZmaHk1SFh1ckk4R0dn?= =?utf-8?B?ejFJRkJUMys4WitLVXhMTUtqSnJLbVRMeS9BYlRocUhXQTk3eEU4bVlDbFQv?= =?utf-8?B?ajFmU2NxdWtqMWJUdXhkQlVibDNhL3FoclEyRlIyVDdqdWxkTGVNUVExNmV4?= =?utf-8?B?NG9ZNU5xYU0zOEJxbEhCT0xtL0dvcDFCU3FQeUNZRWpUbmJtS0xSbW5vYlFr?= =?utf-8?B?cEpPSTB0NFhOKzQxNVRZREF5dkVJbEJOR2tJanhYUDZtL2VaaXZ3SmxnNFRC?= =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ck90emgxRlpIN3FYeDN2eFQ1?= =?utf-8?B?SkJWRnFNbWduQmdhTGNzWEoyMGNPWDVKUzhWbkIyeDhFc2JGb0NCYXNXd1E5?= =?utf-8?B?eDFKUHZDQ0FUSjloWEo1UnlQdGJPa2N3QzZ2WWo3NjA1cnhUamhwVEhBa3Ir?= =?utf-8?B?Wm8zU0ZTTFllT21RMkNSakZuQ2s4QjNET0lXRlVJZmV3VlVYcUhGV1lpbTI3?= =?utf-8?B?dGhEOXNmSEVXMUxmaWR4Q3lRMFY3L3NOM2lXWkN4dzVhR2VkUFlDUzdSa3VU?= =?utf-8?B?cmZWVWdMMmNPOWVPR0xOVGZrclhHWGUxbHoyRDk1SmVoNVhhc05tM0VoR2Fv?= =?utf-8?B?Rks1WCszdFpCVTVvdmRJa0tZRy9MY2c4SUhuSUNCcjY2YmxxbThtNjlza1lm?= =?utf-8?B?TjRrb1JGYWNXcnN4OTNvc0pGeFgvZEtCc2pqQVBoaG9DUXN4V3J5YlJiTmJR?= =?utf-8?Q?4bBY/WSMUAhj/YVGWtV8a32fDBNUOPy1nDfLma?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39410400002)(39840400002)(39400400002)(39850400002)(39450400003)(2950100002)(6666003)(4326008)(81166006)(7416002)(7406005)(6506006)(1076002)(25786009)(6116002)(2906002)(3846002)(55016002)(54906002)(9686003)(53936002)(5660300001)(86362001)(76176999)(53416004)(72206003)(54356999)(230700001)(47776003)(189998001)(50986999)(110136004)(50466002)(7736002)(66066001)(103116003)(83506001)(8676002)(23676002)(4001350100001)(478600001)(42186005)(33646002)(38730400002)(97746001)(305945005)(921003)(217873001)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1139; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTM5OzIzOk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2SgX7RkCsUvMqmXiwpTsD/R6YhYzw8J5QQ+G/j9GU9kxuyhubSZDe7yZkU3YaTko3ESRDS00eRjSUftB8vt+E7YXLyPdjIqIotZIzY5/pAimDtC+0su4elOjntZrczI3VovybvcC7GEUqg7bruTTIM5G86eWziGwdxWI5P1bHb/bIkzQue6V35yicDJTcB1YXroKBbwzSp3QDkJxzMWPCzLMklr8a6uil0TbE5m X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 15:01:00.2933 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1139 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 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