Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp54616imu; Tue, 22 Jan 2019 13:42:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN7/o+LA8V9yOnbSsXnzb7PnRp9xD+/jhyWgim5dUw/cEVRY8xZ4TkdUFF+Hfh96gROSk4q+ X-Received: by 2002:a17:902:e085:: with SMTP id cb5mr35601649plb.24.1548193358653; Tue, 22 Jan 2019 13:42:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548193358; cv=none; d=google.com; s=arc-20160816; b=oYdvU73QzrshNJeu/W9Hzuac6BegHon+PH9zXG2NQkJzVj3KGdoY04u2jUxTK4nPh/ ev9G5bOv1yVaaeVufOTRv5IPX532NhVW9wbqhs8pRo925X8lvGk2CJh5N1B2N7/8vHDC j79I52wMcRrF5x6De4FqZVJS271VOfAC1UMp5jPBGQAuieRQPvJCMz9ddW0Z7xSYU5o6 oXs7PLTmLU+slkIwyIcG7MNZ241I5N6/QxVR2FV6Ud3A+5orGXn8mxzho4zsalkLVHco YQz3y1Xj4XwZFLoPSkR+SB8LJOpLt6JLHIv6JuGP+CessXNv2PHvS4NnJZzw+CZJxZzT 6hew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=pNJA8wccno8VxRfOCWNYYUmZFQgL7n7ylmk+2zxkwE4=; b=mCWXWJNlf45PuyR+IsBHXdsjC4ZpIVNFbEg/+LZkJwEya1aHfNfEqmXMeelRUoYUOP aQMCNk7Bk8KIH4f9/tIKHwZ68IeMK2dNcC1OErQBobiqwn9TOCr80/e+gYqN27Dew0q2 +8QvykS1rOjMDChvMGlNJu+Dlbp/mlX6Ss+pHpwkSFa/GAWrPtf7ANZDH8C/F6dRSq+/ CuWX5iufjK5wSiDhqY9u4dbkMMwirb3eNt0DWGiP+3EcHiTNZdsHELetAnwJpyykLnJA kD46nIdtcPVmv5QqyROLB7a4/LuEjY8QlsZHPoMLpEbifH3L54/UF+A25juSG26GNA09 z3hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=HpMBtGU8; 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 c10si16849432pll.271.2019.01.22.13.42.13; Tue, 22 Jan 2019 13:42:38 -0800 (PST) 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=HpMBtGU8; 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 S1726849AbfAVVkW (ORCPT + 99 others); Tue, 22 Jan 2019 16:40:22 -0500 Received: from mail-eopbgr720086.outbound.protection.outlook.com ([40.107.72.86]:27199 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726423AbfAVVkW (ORCPT ); Tue, 22 Jan 2019 16:40:22 -0500 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:X-MS-Exchange-SenderADCheck; bh=pNJA8wccno8VxRfOCWNYYUmZFQgL7n7ylmk+2zxkwE4=; b=HpMBtGU8uSg1wb9cmGjSdHFgZXKMHIyzG9QsWyo9vc9ALOMtn1gLcdsM2E2S1M1wk+So4ytURacWBpYxFUiLt9V2rgHo4x2z4M8WbsYb7veeFaBisMkEyUd0ZHzeCisZybVmM7tjDIV3eUeaJScFlLDlzlAdMRh+qb/Xo6xx9IE= Received: from MN2PR12MB3631.namprd12.prod.outlook.com (20.178.243.19) by MN2PR12MB3230.namprd12.prod.outlook.com (20.179.82.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.26; Tue, 22 Jan 2019 21:40:16 +0000 Received: from MN2PR12MB3631.namprd12.prod.outlook.com ([fe80::a861:43c0:476d:e044]) by MN2PR12MB3631.namprd12.prod.outlook.com ([fe80::a861:43c0:476d:e044%5]) with mapi id 15.20.1537.031; Tue, 22 Jan 2019 21:40:16 +0000 From: "Lendacky, Thomas" To: Thiago Jung Bauermann , "x86@kernel.org" CC: "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Paolo Bonzini , =?utf-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Ram Pai Subject: Re: [PATCH 1/2] dma-direct: set_memory_{en,de}crypted() take number of pages Thread-Topic: [PATCH 1/2] dma-direct: set_memory_{en,de}crypted() take number of pages Thread-Index: AQHUspgJ4IESYvO40E+HEyQBiP4mGaW70OyA Date: Tue, 22 Jan 2019 21:40:16 +0000 Message-ID: References: <20190122211758.8317-1-bauerman@linux.ibm.com> In-Reply-To: <20190122211758.8317-1-bauerman@linux.ibm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0501CA0006.namprd05.prod.outlook.com (2603:10b6:803:40::19) To MN2PR12MB3631.namprd12.prod.outlook.com (2603:10b6:208:cc::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MN2PR12MB3230;20:JFES4iPXdgJpFM+pl6e7qFJuO61TYFbPmzdoChEp71kOPKLos3pJAXP/CEsFamEYqDlAF1usyn2LADKuO9BjZl8DF8eXq0Kp2THVuCf/tXv7+1RRr+Ue2nD4NFjlLbwl8tz2zbQe62cclC57qjJfZj3KtC0Bufe7fxH+iWk/Gl18ToK/yGTEGMualY8kJ9L8EpXIwQkxflbfFeHlwdFM0JyPhmlLq+JhtRs8lQdyPf54CipgjlGQTnWmXErorshF x-ms-office365-filtering-correlation-id: 154504cd-f3ca-4e2d-2da6-08d680b23294 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:MN2PR12MB3230; x-ms-traffictypediagnostic: MN2PR12MB3230: x-microsoft-antispam-prvs: x-forefront-prvs: 0925081676 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(376002)(346002)(136003)(39860400002)(366004)(199004)(189003)(7416002)(7736002)(305945005)(2616005)(11346002)(446003)(31696002)(6486002)(2501003)(86362001)(478600001)(386003)(53546011)(6116002)(316002)(26005)(3846002)(476003)(6506007)(8936002)(102836004)(97736004)(486006)(8676002)(54906003)(110136005)(186003)(81156014)(81166006)(71200400001)(68736007)(4326008)(71190400001)(53936002)(14444005)(6246003)(52116002)(76176011)(25786009)(256004)(99286004)(6512007)(31686004)(14454004)(66066001)(6436002)(72206003)(36756003)(2906002)(105586002)(229853002)(106356001)(142933001);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR12MB3230;H:MN2PR12MB3631.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: EyJcgFTyUCpc37JCxbe2T3bawQY2hng6zWTWrxFbsmxqlx+f8GTnZfZV4TpZhmIa9GXkzJ3Q7dk9dttq89Ug29QEBlGqLmV1Rmykxx7fKzW0WX6f0xCTted2OUzDbNd17TqypPOGR5nqyiQE9YEbZDdiyspecHtSYyWKXdZMcaFtgPCSfHWKc2e2hREOZqEQn4UM4gbEv2eBM/k3r4H9j/iXNUY02ZCAQRmM6bk8Jg8bkG22rKLIEs9pPHwsBaTk7a3neERyZkQP7ZmypEBL4zpgJAadfx+bBY3TxHgBOdlKV31A0Qdjay8LE/lTcU301t3mP+pNqyxHZMXQwzIJtITeBOdgOrI1uPjIkhA06TTxjk8CFW8Y4cYjtRk8O5SOxRRFW8d0YMA4hxm1wNPoz3BUiaXc1qaLfGtSqBhJ91E= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 154504cd-f3ca-4e2d-2da6-08d680b23294 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2019 21:40:15.0972 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3230 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gMS8yMi8xOSAzOjE3IFBNLCBUaGlhZ28gSnVuZyBCYXVlcm1hbm4gd3JvdGU6DQo+IEZyb206 IFJhbSBQYWkgPGxpbnV4cmFtQHVzLmlibS5jb20+DQo+IA0KPiBzZXRfbWVtb3J5X2VuY3J5cHRl ZCgpIGFuZCBzZXRfbWVtb3J5X2RlY3J5cH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