Received: by 10.213.65.68 with SMTP id h4csp1544944imn; Mon, 19 Mar 2018 07:06:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELvh4+JMMwZ0cTtxGu9CJLfcmorjkmcx2fo6IeK2frC0yYcIt4J3OX7ZCYXfjGbH+IjqXl4H X-Received: by 2002:a17:902:57d2:: with SMTP id g18-v6mr515468plj.381.1521468389827; Mon, 19 Mar 2018 07:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521468389; cv=none; d=google.com; s=arc-20160816; b=Xoou7bKS0PaVDVqK8yYYVyPS2UStq6ZTtBViLXBu7HQJsxTB4WQjMqUJNkP1uX4MyE qu8yZfNUZ+1ugKCcEeiOc1O2InyBw1o7M80YydQkZw2MWbnw2jXh3vSR220A4BEbcg9p FDlzCIAlPPyjBXr7RdaZkLdsoggOxRI+PNasaQgpzs83D0ch8OLMkU9UzuyPCxrVUZ4/ cMs/7L9BGROytUjt0VPVAIMqn18noUCupBV4o6hne5JOpTlN06ycKaIHs565J4ghvf9E XEjqKBttgBl6O1DoasKHBbV1hiyVJ0lImlxSydlnEwFWs/svBhwMdAXAwBm4ufxdbgtm dtrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=3uPWQlI3LX5fJPx/0mSyVsdF5OHx0NxMigI2AH46K7k=; b=CnJO/O1XLbrmly2G6ppmZawTZWFQe3aw11HaQTtkiyZr6BJjZVEPEzA5GHF8T8pICm etX6ZxU6n3B/nDw/48B4fapQBka87XYhDJD04T+BLl0isefHENfch0RDL9FLloG9hig9 cDK3/VLlnQFLakwQzj8M2YWavJr+VG4E3f9FgDOJsRvA56SQ7Ja/M2225aav5bGmVlJ2 TNDUgg1xg2hF4XU0PC/l6sA+KNgEvKhYYJJ50FzyCZklUawXIgmpH2U8FLIJqbh7YXRi lkKP6Eokic8m1d3THEYy4VWMks3TiLWKUzaxGWBNEq45TY5bD74rVPqeh8TDQ0PABLoz QMFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=S29jahhD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24-v6si48902pll.85.2018.03.19.07.05.41; Mon, 19 Mar 2018 07:06:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=S29jahhD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933294AbeCSOBJ (ORCPT + 99 others); Mon, 19 Mar 2018 10:01:09 -0400 Received: from mail-bl2nam02on0053.outbound.protection.outlook.com ([104.47.38.53]:13573 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932528AbeCSOBF (ORCPT ); Mon, 19 Mar 2018 10:01:05 -0400 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=3uPWQlI3LX5fJPx/0mSyVsdF5OHx0NxMigI2AH46K7k=; b=S29jahhD/quKJXXiz2jKMwpldKxx391A/BMoJUOd0rWGXn06zAryuScTeLqI/WL3+mWYvuG3Cw8HEgT//T1CkrXZK6ni7UwpFt71YascES/4pjTcGgWsC3wbA0TyWhAzGtdeAJV3ZEUSQND6IQxFPEKekyQ+oMg3h7vpAzj6Jok= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from [10.236.65.116] (165.204.78.1) by DM5PR12MB1145.namprd12.prod.outlook.com (2603:10b6:3:73::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Mon, 19 Mar 2018 14:01:01 +0000 Subject: Re: use generic dma-direct and swiotlb code for x86 V3 To: Christoph Hellwig , x86@kernel.org Cc: Konrad Rzeszutek Wilk , David Woodhouse , Muli Ben-Yehuda , Jon Mason , Joerg Roedel , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20180319103826.12853-1-hch@lst.de> From: Tom Lendacky Message-ID: <8fcf5cf4-5db4-8197-0012-e69dc8f41b18@amd.com> Date: Mon, 19 Mar 2018 09:00:56 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180319103826.12853-1-hch@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR21CA0019.namprd21.prod.outlook.com (2603:10b6:404:8e::29) To DM5PR12MB1145.namprd12.prod.outlook.com (2603:10b6:3:73::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9164649a-af91-4dcd-fe2c-08d58da1da46 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM5PR12MB1145; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1145;3:aUKL9j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WS3DNFRyJp3ZR53zW6zmx4XICQc3ARufB7/vvysDYQazT10MC2yAepkiS66Y86YgIowMkHWJ9ruD3BaxxeRXnRUBGElWbekw4zRg72Dh89f9A3J/vjUAiLkHlcNllt9qbLhm4xxvzYjO+TbuvfHP0W10nD3nGaVHF1nWpqGCQFL8vPFI0MApHeLblDtGN0sQZjdTJQFxLsVt/SAUuWFPsyD/dO/uCX30+2BrMGEseWlFtiwmcwGODNfldkt1mIv5dgXsuegPNxV4ZrKU5M2Ycat9emciv4kZBsbxAROEBMcJWsH6ehq3zm4h55bbaXLaNBgJf;4:gHqBscfyMGyo6dryzXOz8h9yLPM4KMhFC5k3u0s17rgDpdxtCw3KN8KazWP87LcInlIcHwR2NGNz/UPNJzIUfsf+wusjVypfx0tF03pUG3aXNyDlMgkaA8BFxO2xjnF7pLPyx6AzKIoolAcMqdfJcOeWuAqMi1rZi4OwzePoiXysf7K/CalSOvSKDV72YQ3HLBMDpE25vxInRBD+09pj6afDWjtRl1J4pDbqlgO3tXiMGQ5+DFNe+krhq33iLjZDdMLv+D0qJvUvEVpP1zBigsaHYXUedxxWBDTrLJSdEnONLYy7Q3JPQWwYKMBWKNtk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231221)(944501244)(52105095)(6055026)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:DM5PR12MB1145;BCL:0;PCL:0;RULEID:;SRVR:DM5PR12MB1145; X-Forefront-PRVS: 06167FAD59 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(396003)(346002)(376002)(366004)(39380400002)(39860400002)(54534003)(189003)(199004)(53754006)(186003)(316002)(478600001)(47776003)(105586002)(230700001)(68736007)(86362001)(52116002)(52146003)(76176011)(2486003)(386003)(23676004)(72206003)(5660300001)(16526019)(53546011)(8676002)(81166006)(36756003)(81156014)(77096007)(66066001)(8936002)(65806001)(26005)(65956001)(6486002)(305945005)(6246003)(16576012)(54906003)(31686004)(31696002)(106356001)(6666003)(25786009)(50466002)(6116002)(3846002)(4326008)(7736002)(65826007)(64126003)(2950100002)(97736004)(229853002)(3260700006)(2906002)(53936002)(58126008)(41533002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1145;H:[10.236.65.116];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ1OzIzOi85TE5UYlB0OUZVWVJWZEE0eU01ZkIrc29n?= =?utf-8?B?MkFHOFdQdXdXVEJEbUt6UFlCV1pjZkV0MXdYSXpTTVVaallDbW1KN053S2sw?= =?utf-8?B?aWJUWG1hWUNUZ1JhM3E4aTJWT2ZsN1RBZW1JNE1zNFJUU2MvUU5KQmk2ZFlZ?= =?utf-8?B?NHJYMTY3QmpvSE5wQzYzZWhER2ZJU2RJc0REdExEUmlLRmRBVVFnSmdmMU5i?= =?utf-8?B?ZFZHVnNlbDJLdnVDODIwVEhUVjV3NUg5T3EwQXhTNUc3dG1wb1pWdnM0Ty9F?= =?utf-8?B?eVlZbXNQVnE4b0VYTHRQa2NsRDRTV01Mc3FLck9nNmtYUGNFYVBvM3FRMGJC?= =?utf-8?B?RVhDRTR2b3FFYnhHekkrK0VuNUxhRzFuVHNtd1N0dVVDTUFpSFl2TlJqZmM1?= =?utf-8?B?M3h4YlRlUkdEc1Rlcjc1Z1N2dUVFNy9ONTVoYjg2MDNHSmxlSVVPMWRkeXhN?= =?utf-8?B?SU5WUVFzbEFLYS9YbXVDckZnSmpIRnZDNVd5UGZnWWRVbmZ4RnZWbFAvRldV?= =?utf-8?B?bHcy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.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2018 14:01:01.3348 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9164649a-af91-4dcd-fe2c-08d58da1da46 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1145 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/19/2018 5:38 AM, Christoph Hellwig wrote: > Hi all, > > this series switches the x86 code the the dma-direct implementation > for direct (non-iommu) dma and the generic swiotlb ops. This includes > getting rid of the special ops for the AMD memory encryption case and > the STA2x11 SOC. The generic implementations are based on the x86 > code, so they provide the same functionality. > Booted the system with SME on and off and the IOMMU on, off and in passthrough mode without issues. In each case, booted an SEV guest without issues. I'll be able to do more extensive testing later, but for now... Tested-by: Tom Lendacky > Changes since V2: > - minor changelog tweaks > - made is_sta2x11 a plain bool > > Changes since V1: > - fix the length in the set_memory_decrypted call > - fix the SEV case >