Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10053166ybi; Wed, 24 Jul 2019 15:02:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEvDfzqz5JKaMCLNv8Tneu5hSOG5y2E8a3Ukk2tu4MfIqrHi8OhT3zFmf+R0+GTqvb4rsL X-Received: by 2002:a63:f13:: with SMTP id e19mr83004689pgl.132.1564005737434; Wed, 24 Jul 2019 15:02:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1564005737; cv=pass; d=google.com; s=arc-20160816; b=uaZm4H3amq0lA7zhjw1n2RRsrkUFwTJ9T4sUaG8DWCIKJiq7WNG0qLSDmcohTBsDB6 9BkdEkZxvek8V64H1ToHLxD9SnC6eqUncyxKnFAUBN5WSau0z13JwLiCMIwwtQmmvqZA fuazQw8sceERyUVzuapzVfZkGus6lAr1jVV+9xw1hl2o15CMUumW06m3VRketol7B0sQ tPSixIRfoyKN6J94xRnDNOvLjCZzJAEvhiPLf0fXatGkwHR3V3wRC2Knf44XtewSC6iS pyMSdO49THmwmsTM0OGXv3USIlb81hwr/aQ2fvwUinXw+W4za60h/ERz5VNRdprji/TX mPag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=grrlUXCjNXwy9On16Bs8VdVEGT/QhAX2Tyx7xJc6iLw=; b=rWvDWayIhUyT3kYPpPHE1JzRhe0bDnjtfzBi+xa/NN60vFZoFUa/QgnyqFKYCaQHcY va8WEiEkuOvoJ0Y+5umPG1p1WkL81dNHAlx4GULkjEZbAUVN4GxHvbor7PHGQnikLmNj T9zaQXZCYUzLY6a4/nlYFncZl+Is2s8be3GtuhBtFfe7kUrdwwQyHp6VnY9PRgEMBhqL IM8M1RWDGcv2YoothqyDD+MNGjs8ixU8DVVN1JXrFefDXED9UatubJmcSHPExCRGxU0l ESfPYgnulPLUvkUuAO2hmEzxi5gcpOJXcvpHFEEDRKiyxmllhY8Ki6J3sMFNc5LK0ZXl yh4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amdcloud-onmicrosoft-com header.b=UP5AkOUH; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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 b123si17695643pfa.14.2019.07.24.15.02.02; Wed, 24 Jul 2019 15:02:17 -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-amdcloud-onmicrosoft-com header.b=UP5AkOUH; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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 S1727589AbfGXStP (ORCPT + 99 others); Wed, 24 Jul 2019 14:49:15 -0400 Received: from mail-eopbgr770055.outbound.protection.outlook.com ([40.107.77.55]:43937 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725883AbfGXStP (ORCPT ); Wed, 24 Jul 2019 14:49:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mqKLeaWBBH4k/rrYHn0mc6aPeEkv2fZ9AlZnpDm4zZ+lPTPA0T+TGRNJM4P2IqTkV5EHvpPD+yIuyP4HPi+SlgJkezB38AF9v8hdga6HajBLdqJkdoyuBx5F1MWfCOsDCp4l3/k8iWf8r5P3JdVk8BA7HnmR9uneWC3HZBEtYaZqcpUk3bOMrGQHdnqOLnIDc2VIaeECX2+kEjHpmBQc3nFRRI7aiq0XeFC6t1MkeBAJ4pzEQJEFmnbnACtp6k6IAr/YsX7sAMcktG1K04xmhuBWhPqO2HdLX4KOqzqgWhEiPJii+hkRJZEY+rfjOf0VI/QIdtH0elUfKmv+/WBOiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=grrlUXCjNXwy9On16Bs8VdVEGT/QhAX2Tyx7xJc6iLw=; b=PA2GTgjot0SVX3Uysf5o1xYLtlbNfSu1gBxgd9KFBUG9t3LXtyDnJqHCc8Q/TDxzjoQ265XD4ExuIHQ6hjYYP/0LQtjrBIwmH2vUV7MEEvynzleT5rhOU3EyKZ3oSORoazPAEr9jr5Yl9QP00M755PAUwvKrAXCwJUS5beG1PkE5d4JovotwPwPxfXXAkBmdA38Ck53m0uVniiVRvD2b6VBmm7oAos0U5myzvfltLXXEA3lbiHn04bFnNiTnie5r8COnIMfhNTClKlv+elyyfvoMY096BcQypHmiKyd5NHibvz9ZoAgFZxW7w/v4hPJP8m8kR7Jcrw//75j8xSbJrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=amd.com;dmarc=pass action=none header.from=amd.com;dkim=pass header.d=amd.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=grrlUXCjNXwy9On16Bs8VdVEGT/QhAX2Tyx7xJc6iLw=; b=UP5AkOUHL2Vm55y9csprOq7/jij1C0b/1U7CuyO8T6Tj82ERo1mlA3lcAeTD5cbuqLVPGu2tm6Ap+1taDGOrHyG71XC8i0gWX58BDngR8EZoN7JwQNkHjGCTTnR7/jqYE1pCojwaHPsGE+J8q4VK8qHx8cKNmgnGAnhe9oHZvwE= Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.104.150) by DM6PR12MB2603.namprd12.prod.outlook.com (20.176.116.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.16; Wed, 24 Jul 2019 18:49:10 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::9c3d:8593:906c:e4f7]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::9c3d:8593:906c:e4f7%6]) with mapi id 15.20.2094.013; Wed, 24 Jul 2019 18:49:10 +0000 From: "Lendacky, Thomas" To: "Kirill A. Shutemov" CC: Robin Murphy , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , Christoph Hellwig , Marek Szyprowski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Lianbo Jiang Subject: Re: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks Thread-Topic: [PATCH] dma-direct: Force unencrypted DMA under SME for certain DMA masks Thread-Index: AQHVN1HbhkVejMp04kW0O/tJG/K57qbaAcwAgAANJYCAAAaagIAAB+IAgAAKaYD//7FlgIAAVpiAgAACe4A= Date: Wed, 24 Jul 2019 18:49:09 +0000 Message-ID: References: <10b83d9ff31bca88e94da2ff34e30619eb396078.1562785123.git.thomas.lendacky@amd.com> <20190724155530.hlingpcirjcf2ljg@box> <20190724181139.yebja5yflzjgfxlx@box> <9f9bfd05-0010-9050-20f0-8c89b2f039ef@amd.com> <20190724184015.ye6gjoikowiyh63f@box> In-Reply-To: <20190724184015.ye6gjoikowiyh63f@box> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0201CA0044.namprd02.prod.outlook.com (2603:10b6:803:2e::30) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:182::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f9f1f122-609f-41a9-f5a9-08d710679cef x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:DM6PR12MB2603; x-ms-traffictypediagnostic: DM6PR12MB2603: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0108A997B2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(39860400002)(346002)(366004)(396003)(376002)(136003)(189003)(199004)(486006)(81166006)(66556008)(64756008)(11346002)(2616005)(6512007)(476003)(446003)(66946007)(66476007)(7736002)(66446008)(7416002)(6246003)(54906003)(102836004)(26005)(8676002)(305945005)(31696002)(2906002)(256004)(6506007)(86362001)(71200400001)(386003)(53546011)(68736007)(229853002)(99286004)(186003)(478600001)(71190400001)(76176011)(66066001)(36756003)(4326008)(6436002)(31686004)(52116002)(8936002)(53936002)(25786009)(6486002)(5660300002)(3846002)(6116002)(81156014)(14454004)(316002)(6916009);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB2603;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Yns1LfAahoBe1dv/IAdkPYXVEGJEm5Cj/LQIVMfLhGLUG+GQg126B8a80kQmy/rkQ2plV5Kfm3lzWi4nCouH6jZwGPP2GdCk54fLxP66v4L7Slxl4gbP0qXXrrG8PeFNVZNXIhfUchpJew2IKD37HnHOzObD9+29c2GXlGBquqJTX3yfzc7syUwxbhiCBvbxQSDOcyApsPq/+8dtcrzKvRX1bC2gOjx7Dc+vJlDI2qodhdvn7F3PyHhH2Ft4T53aAcdyWn2uv+JlNlKNKF9Yg6kt8RqI96Kon9Wha76Exe5bLbKP7J+lKb7hZraCN8ecTiDBOXET6aWl4+zoJ9B9Xn8pXyOJLY1xq/I5DY8evq3ALedNhydHJbMPuJ8Y0ZVBy9T7ORTJvLA285B8P5aqbdul5Yp3g445dN2d0jLgkNQ= Content-Type: text/plain; charset="utf-8" Content-ID: <2D5CE35306A1774E847CC23EDA6DF7C3@namprd12.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9f1f122-609f-41a9-f5a9-08d710679cef X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2019 18:49:09.9570 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tlendack@amd.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2603 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gNy8yNC8xOSAxOjQwIFBNLCBLaXJpbGwgQS4gU2h1dGVtb3Ygd3JvdGU6DQo+IE9uIFdlZCwg SnVsIDI0LCAyMDE5IGF0IDA2OjMwOjIxUE0gKzAwMDAsIExlbmRhY2t5LCBUaG9tYXMgd3JvdGU6 DQo+PiBPbiA3LzI0LzE5ID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