From patchwork Wed Sep 25 13:45:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 11160717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDCF414DB for ; Wed, 25 Sep 2019 13:45:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C55EE21D7F for ; Wed, 25 Sep 2019 13:45:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C55EE21D7F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07B926EBB9; Wed, 25 Sep 2019 13:45:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730068.outbound.protection.outlook.com [40.107.73.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1BBE56EBB3; Wed, 25 Sep 2019 13:45:13 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IVCoyShZF+Kt3KkGrEt8J7fmKqGbBKLYUopV/4eJN4e78McqnRBNmaY3rR6dyj5lpXp6h/vry4kBBESxROorHKLfFP9P4+J75aHF6s41T8t6JAfqi6FuUwytt4jzdcRvyt82bJQ5sFBT91FvtY2g0SnbBrFo5RXleARl0k0yE+DI3s0ca6GHY7wABgTavmaQy5dFk/k1NrWXF1eTzbrCpkYmogu7yuZojWBKDNXTWPvOvb1ItLS4RvTx15rkwxjVfYEKHPnp0PhsowfW8Ic73IM8xh2fHe2c0Ht1z8mXqGBpxAveJo51VZrSThvF6c+Z+SzGGFuDZDZTNsF7M+yIYA== 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=f3bAjAulClvu9ph2kT/jW3gO6vlZITV00+33w8bnlXw=; b=fPOTZp88lzHyW0tSCeP3s8OsZcX3eNK86CtmctHqYYgvd5HZxuct+85pYXK1lN5Y+P+LykGv36urtfUbN3lypMTpbtyhMiWiCd527EiaYHJ+Wx/uKqqeXeNYhXhqT3c4hAWeQzQFogEOS1P31LsQsVot5CSfgENRkgPXpHOqBtNJbIpOdWXDXhFmxu/ekxPXC3itsV7PW6FpRyk+2TqQtBS74m6Cy9UlUnS3xieGmPRKREcWmyjZFcCyZISMsLjDvEv1rHrcRTlLo8vBr8TZIlHikkvp4rBPZEubOBGdMQ8iJd9lwZJxtMNTrBNzYGtbnumLb/RrvWPpA64GefwNeg== 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 Received: from MN2PR12MB3309.namprd12.prod.outlook.com (20.179.83.157) by MN2PR12MB4304.namprd12.prod.outlook.com (10.255.224.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2284.20; Wed, 25 Sep 2019 13:45:11 +0000 Received: from MN2PR12MB3309.namprd12.prod.outlook.com ([fe80::e105:cd24:c71d:c38d]) by MN2PR12MB3309.namprd12.prod.outlook.com ([fe80::e105:cd24:c71d:c38d%4]) with mapi id 15.20.2305.016; Wed, 25 Sep 2019 13:45:11 +0000 From: "Huang, Ray" To: "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "Deucher, Alexander" Subject: [PATCH v2 01/11] drm/amdgpu: add UAPI for creating encrypted buffers Thread-Topic: [PATCH v2 01/11] drm/amdgpu: add UAPI for creating encrypted buffers Thread-Index: AQHVc6dzBSlURytWtU+KU92WjhXpBA== Date: Wed, 25 Sep 2019 13:45:11 +0000 Message-ID: <1569419090-5304-2-git-send-email-ray.huang@amd.com> References: <1569419090-5304-1-git-send-email-ray.huang@amd.com> In-Reply-To: <1569419090-5304-1-git-send-email-ray.huang@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [180.167.199.189] x-clientproxiedby: HK2PR02CA0186.apcprd02.prod.outlook.com (2603:1096:201:21::22) To MN2PR12MB3309.namprd12.prod.outlook.com (2603:10b6:208:106::29) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0fe246a8-62e2-4a0e-b979-08d741be95f0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600167)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:MN2PR12MB4304; x-ms-traffictypediagnostic: MN2PR12MB4304: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 01713B2841 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(136003)(376002)(346002)(396003)(366004)(189003)(199004)(86362001)(8936002)(305945005)(2501003)(50226002)(6636002)(14444005)(256004)(6486002)(6116002)(3846002)(6436002)(6512007)(2906002)(4326008)(66066001)(102836004)(26005)(186003)(52116002)(76176011)(486006)(476003)(2616005)(11346002)(66946007)(66476007)(66556008)(64756008)(66446008)(446003)(66574012)(99286004)(5660300002)(81156014)(6506007)(81166006)(450100002)(25786009)(36756003)(316002)(478600001)(386003)(8676002)(71190400001)(71200400001)(110136005)(54906003)(7736002)(4744005)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB4304; H:MN2PR12MB3309.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: LMli6ol8rwj6RlDePqpttZ78usrxCf4epIUQI3D8Uo5RPQWeHuIlL1gibI5dMs52CX4JjaGJj0Q5Gz1drhvqVGImRzlNxhJw09d6w425Pk01JPOlBXgx20DIms2qD2gd79iRAonMAOuE0yLGrFioZ5AKkfj0f/JEo465Hzf8k7DknpPjg31YW7UeTa/1NEWs3kdtivUcBfHO0Cf1PAqLRmKZAWx/0u/22ZM+qJ4YN1WKMqdYu2R290P7bTK+oZLhWXwjQrFI/+/6M3JR8HQhZm2oqw6LC+cColHmmEpe1asYNuUyVJrGGtqozxbd0xmiK5LgXa8h/64zzyxAOimr+7zzKUyYTxvx18caT9yeXGiLgcus2m6qH2yXEMdUKG5tmv5+UxlFKGlPk9eW18hVx6ge5sahk2AvvNl3ThvJ5eo= Content-ID: <8099FBBC75C83A4B8A2D7BD1CFF9D698@namprd12.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fe246a8-62e2-4a0e-b979-08d741be95f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2019 13:45:11.6434 (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: QvfE3fBGeUgNLhMNGh/s5SZvmOd+Iw1kdMKFwmcW64TxvDTcAfuIavd2phJjdWwXFf5BDyq1AVJUB4c2c3kXIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4304 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f3bAjAulClvu9ph2kT/jW3gO6vlZITV00+33w8bnlXw=; b=XrR/BhVEf4GyGPzZSUa06Xk2z4U2SJfNxtVxyI2587cmAzPgpHKXdG9bm/4Nvr5tR+2GjWAucM+tw4Dq/2jF7GcsV9YuU9Pu41jR+mK2nQcCUD1j45PcZAzZu/gVP9CsyoEXW9BWmmXmhUTfiGKP1XVNrkutZucKCVS12ENNj2Q= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ray.Huang@amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Tuikov, Luben" , "Koenig, Christian" , "Liu, Aaron" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Alex Deucher Add a flag to the GEM_CREATE ioctl to create encrypted buffers. Buffers with this flag set will be created with the TMZ bit set in the PTEs or engines accessing them. This is required in order to properly access the data from the engines. Signed-off-by: Alex Deucher Reviewed-by: Huang Rui Reviewed-by: Christian König --- include/uapi/drm/amdgpu_drm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h index f3ad429..f90b453 100644 --- a/include/uapi/drm/amdgpu_drm.h +++ b/include/uapi/drm/amdgpu_drm.h @@ -135,6 +135,11 @@ extern "C" { * releasing the memory */ #define AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE (1 << 9) +/* Flag that BO will be encrypted and that the TMZ bit should be + * set in the PTEs when mapping this buffer via GPUVM or + * accessing it with various hw blocks + */ +#define AMDGPU_GEM_CREATE_ENCRYPTED (1 << 10) struct drm_amdgpu_gem_create_in { /** the requested memory size */