From patchwork Sat Nov 21 00:35:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Sean Z" X-Patchwork-Id: 11922985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F960C56202 for ; Sat, 21 Nov 2020 00:35:44 +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 B4C8E23A65 for ; Sat, 21 Nov 2020 00:35:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4C8E23A65 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 577106E94F; Sat, 21 Nov 2020 00:35:42 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 853DB6E93F for ; Sat, 21 Nov 2020 00:35:41 +0000 (UTC) IronPort-SDR: /uYIbHxXdp4UsuYklCCuOtUq6xx9juqxhp7AOxaUcJXIWmv/0Z+cma5icFES4+qz+lzmG0twJK cysTjzQuTBRg== X-IronPort-AV: E=McAfee;i="6000,8403,9811"; a="235707194" X-IronPort-AV: E=Sophos;i="5.78,357,1599548400"; d="scan'208";a="235707194" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2020 16:35:40 -0800 IronPort-SDR: wK8F04qY5KItx6mwtufb1Ht0vdjygGc1V1MA7oaQb1T9PFsdrrJU83gmNf+17pS13zZ1PjH1sa V3HnNBQLJkaQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,357,1599548400"; d="scan'208";a="369352670" Received: from sean-virtualbox.fm.intel.com ([10.105.158.96]) by FMSMGA003.fm.intel.com with ESMTP; 20 Nov 2020 16:35:40 -0800 From: "Huang, Sean Z" To: Intel-gfx@lists.freedesktop.org Date: Fri, 20 Nov 2020 16:35:15 -0800 Message-Id: <20201121003540.24980-2-sean.z.huang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201121003540.24980-1-sean.z.huang@intel.com> References: <20201121003540.24980-1-sean.z.huang@intel.com> Subject: [Intel-gfx] [RFC-v2 01/26] drm/i915/pxp: Introduce Intel PXP component X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" PXP (Protected Xe Path) is an i915 componment, that helps user space to establish the hardware protected session and manage the status of each alive software session, as well as the life cycle of each session. By design PXP will expose ioctl so allow user space to create, set, and destroy each session. It will also provide the communication chanel to TEE (Trusted Execution Environment) for the protected hardware session creation. Signed-off-by: Huang, Sean Z --- drivers/gpu/drm/i915/Makefile | 4 ++++ drivers/gpu/drm/i915/i915_drv.c | 4 ++++ drivers/gpu/drm/i915/i915_drv.h | 4 ++++ drivers/gpu/drm/i915/pxp/intel_pxp.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/pxp/intel_pxp.h | 22 ++++++++++++++++++++++ 5 files changed, 52 insertions(+) create mode 100644 drivers/gpu/drm/i915/pxp/intel_pxp.c create mode 100644 drivers/gpu/drm/i915/pxp/intel_pxp.h diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index e5574e506a5c..8274fea96009 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -254,6 +254,10 @@ i915-y += \ i915-y += i915_perf.o +# Protected execution platform (PXP) support +i915-y += \ + pxp/intel_pxp.o + # Post-mortem debug and GPU hang state capture i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o i915-$(CONFIG_DRM_I915_SELFTEST) += \ diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index f2389ba49c69..c8b9c42fcbd6 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -889,6 +889,8 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) goto out_cleanup_gem; + intel_pxp_init(i915); + i915_driver_register(i915); enable_rpm_wakeref_asserts(&i915->runtime_pm); @@ -938,6 +940,8 @@ void i915_driver_remove(struct drm_i915_private *i915) /* Flush any external code that still may be under the RCU lock */ synchronize_rcu(); + intel_pxp_uninit(i915); + i915_gem_suspend(i915); drm_atomic_helper_shutdown(&i915->drm); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 15be8debae54..f34ed07a68ee 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -105,6 +105,8 @@ #include "intel_region_lmem.h" +#include "pxp/intel_pxp.h" + /* General customization: */ @@ -1215,6 +1217,8 @@ struct drm_i915_private { /* Mutex to protect the above hdcp component related values. */ struct mutex hdcp_comp_mutex; + struct intel_pxp pxp; + I915_SELFTEST_DECLARE(struct i915_selftest_stash selftest;) /* diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.c b/drivers/gpu/drm/i915/pxp/intel_pxp.c new file mode 100644 index 000000000000..bc19024e43f0 --- /dev/null +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.c @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: MIT +/* + * Copyright(c) 2020 Intel Corporation. + */ + +#include "i915_drv.h" +#include "intel_pxp.h" + +int intel_pxp_init(struct drm_i915_private *i915) +{ + drm_info(&i915->drm, "i915 PXP is inited with i915=[%p]\n", i915); + + return 0; +} + +void intel_pxp_uninit(struct drm_i915_private *i915) +{ +} diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp.h b/drivers/gpu/drm/i915/pxp/intel_pxp.h new file mode 100644 index 000000000000..d92b9bbcef2e --- /dev/null +++ b/drivers/gpu/drm/i915/pxp/intel_pxp.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright(c) 2020, Intel Corporation. All rights reserved. + */ + +#ifndef __INTEL_PXP_H__ +#define __INTEL_PXP_H__ + +#include + +struct pxp_context; + +struct intel_pxp { + struct pxp_context *ctx; +}; + +struct drm_i915_private; + +int intel_pxp_init(struct drm_i915_private *i915); +void intel_pxp_uninit(struct drm_i915_private *i915); + +#endif