From patchwork Wed Sep 25 13:45:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 11160715 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 102A514DB for ; Wed, 25 Sep 2019 13:45:26 +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 EB04421D7F for ; Wed, 25 Sep 2019 13:45:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB04421D7F 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 0ACDB6EBB8; Wed, 25 Sep 2019 13:45:25 +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-dm3nam05on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe51::615]) by gabe.freedesktop.org (Postfix) with ESMTPS id 26CFC6EBB5; Wed, 25 Sep 2019 13:45:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H3dQSCLMkfwv8fJYb1XFx6x0NuO1/BOKtA+HbostBw0yCCbfuduzOUE1MEj1iP8HpLzkURygsCxNkvKPEGXsbJYWuOzI5T898AT9dgqL6FNUDQKB6IGddMPhBmgjzG4cFZH1ST2KNfw0noRpgUpi9lDRwylCcSclw6PiMfKMi0qXdRLiQd3NrF/0P/Zt/4QAfheqafJz8p6ARukpQX3LDQeeGEab5KAGKDz0RNuFvwHG1qJw7HaWMOY143PYK2WBtXpL4R436sagGzXQZwEQzEVxZeaz5xkzoGFAUr1IDsp0GvPNpIOsU/C5RxWMPrBfcRANjxlJjSxtTPE1Ft2DSg== 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=hmeqChAxyqwO6NZ57JnGwuzmZVA61vyphC0q9AzXQBQ=; b=VI3pulX9du8lZ1xy8RhLKKjir3dVcE08euRxwgV0srXZ9tG3e4Vh+qFyDHdbnvmfR5TsVbeYLApb5JPxreDwLTG33ZI4dvHb8ouRrXXf8Jrx4yJQKzYYy97o3pawEtgQr8VYbHJ6eOq4mBgOO0sUwojcitC1GSGybU8dwPCmNMNEqjWupc5Ogje4dE4HnfE8+d1sOvBk4yB8ohxBYBnZDdgDLW8quoAr4CArPMfxEW4OYNFe51EltgSljRKr7uKeYLbYltq31ZrQAA9xDNrR2ePh4JLGVNddgpJmFdeJUjENdqE3/QI3vsbU2MSUyt2zqbDycrSrtt+2jXcj8zp9MQ== 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:21 +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:21 +0000 From: "Huang, Ray" To: "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "Deucher, Alexander" Subject: [PATCH v2 04/11] drm/amdgpu: add tmz feature parameter (v2) Thread-Topic: [PATCH v2 04/11] drm/amdgpu: add tmz feature parameter (v2) Thread-Index: AQHVc6d5LDMLCCkjDkuRHVizXsCgBw== Date: Wed, 25 Sep 2019 13:45:21 +0000 Message-ID: <1569419090-5304-5-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: 970b6585-b1ce-49f6-227c-08d741be9bec 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:7219; 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)(256004)(6486002)(6116002)(3846002)(6436002)(6512007)(2906002)(4326008)(66066001)(102836004)(26005)(186003)(52116002)(76176011)(486006)(476003)(2616005)(11346002)(66946007)(66476007)(66556008)(64756008)(66446008)(446003)(99286004)(5660300002)(81156014)(6506007)(81166006)(450100002)(25786009)(36756003)(316002)(478600001)(386003)(8676002)(71190400001)(71200400001)(110136005)(54906003)(7736002)(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: /GsgYH95H5H81Oc8htWRS+AgY9v9/gnZR5Bz0CU/drzcijVK0JRm467yz9MY43fZo/us2Ct0u/9blvfW7y/IIRAFu1a6KH9ajmkLDle0YsSRWre7bDnEPem/tp0LmBXj2GhFPBRg1B45GGRN7TkkaZlegSAuM8d7K8HcDyFVrjkVjOBnsYkQ3ToPR24MsqnWmTZDo21U70OQAtveRaEdPgzMCsSoKtfOY+M29tUZxybgoig0iD/M7yiT0uidRN4I7+uT3r+l3mM0BIX7AwqH/+BHh/Id2UTsQ0ykxh0HNf8QqWRnol6ZjifvF8UGoPjLxUyMp3T37pTc5j9lVoKcHQvXnEhQhCo5rcXIytNHZj2IrXmsuvCQrAcgH/ZMmhixDe18nGIdgg1ALPju4IxFxb9VN6xNYQIXi2pnIE2rui4= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 970b6585-b1ce-49f6-227c-08d741be9bec X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2019 13:45:21.4928 (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: /tWIgWEf2XhtDEzNbe5s4GLNCYw9g4pG8Wi/GVDT3HjZwpZuOwdGeXNGm3ItJFc5Oc/FFVCFauWCxOOAlK793w== 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=hmeqChAxyqwO6NZ57JnGwuzmZVA61vyphC0q9AzXQBQ=; b=aNy3Gk5E3sFY66d3K0P5vhLN0Rl0KwfwwrsoW5rGo/mllJ4sBtm5kovRM0fuImZnBAJ07v1X2/X50DmYJ4tRkEKaVrRX+vXkvPZ/ODs1NjLy7D2FuKcB5sNXYiGGHjVrzg2hy74nukU3Op8YWSBKN+vNdkEpmB+VsXmLRK7qwws= 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" , "Huang, Ray" , "Koenig, Christian" , "Liu, Aaron" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patch adds tmz parameter to enable/disable the feature in the amdgpu kernel module. Nomally, by default, it should be auto (rely on the hardware capability). But right now, it need to set "off" to avoid breaking other developers' work because it's not totally completed. Will set "auto" till the feature is stable and completely verified. v2: add "auto" option for future use. Signed-off-by: Huang Rui Reviewed-by: Alex Deucher Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index a1516a3..930643c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -172,6 +172,7 @@ extern int amdgpu_force_asic_type; #ifdef CONFIG_HSA_AMD extern int sched_policy; #endif +extern int amdgpu_tmz; #ifdef CONFIG_DRM_AMDGPU_SI extern int amdgpu_si_support; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 6978d17..606f1d3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -145,6 +145,7 @@ int amdgpu_discovery = -1; int amdgpu_mes = 0; int amdgpu_noretry = 1; int amdgpu_force_asic_type = -1; +int amdgpu_tmz = 0; struct amdgpu_mgpu_info mgpu_info = { .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex), @@ -752,6 +753,16 @@ uint amdgpu_dm_abm_level = 0; MODULE_PARM_DESC(abmlevel, "ABM level (0 = off (default), 1-4 = backlight reduction level) "); module_param_named(abmlevel, amdgpu_dm_abm_level, uint, 0444); +/** + * DOC: tmz (int) + * Trust Memory Zone (TMZ) is a method to protect the contents being written to + * and read from memory. + * + * The default value: 0 (off). TODO: change to auto till it is completed. + */ +MODULE_PARM_DESC(tmz, "Enable TMZ feature (-1 = auto, 0 = off (default), 1 = on)"); +module_param_named(tmz, amdgpu_tmz, int, 0444); + static const struct pci_device_id pciidlist[] = { #ifdef CONFIG_DRM_AMDGPU_SI {0x1002, 0x6780, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI},