From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E90633D6F7; Thu, 11 Jun 2026 04:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781152493; cv=none; b=KQSya0GbOk975syo7IjugASdWGcpsRBZbIN+y6FvbG5apcR4UriulbncEMEPS05pWtF0OBZcHZ/8wmdQb138E3OtPmyybZ/tBycTpTAvgc+skDmfFAhAC2QiG5FooxTv1NT1gjtrmVSXrxMCAoBkPpH9WcFqKtf3be3DIjD/DFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781152493; c=relaxed/simple; bh=35igKJF0B92Vkg3IeHZbclI0jEf1ip3+70ftwUSFIBk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rdycyw0JyGiD9Zeb5gftqZnJ6zH9YyRGGZ+WUSt4KKxDpze++UfS3GbvahqGy6jJgsw1N5begyT97QxhzeuHFoXvnMGlUfRPR5VEtNHk/cAOeLT0cRpjxpxGu+nI+Rc5TxiJKLpJ37WnQ5gMshRITZeh/ZY5uZK1giGeCS5HaX0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Fq+gJCws; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Fq+gJCws" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781152492; x=1812688492; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=35igKJF0B92Vkg3IeHZbclI0jEf1ip3+70ftwUSFIBk=; b=Fq+gJCwsye4AThvGAbJJXGRk6m6Uf0A/Y79JSRehCkT8d20h3OUzyXrP Ys2ubFJmWjEEkwKKad0KpfWUPwyvAqRGFZ+9Jimh0JFODyAIO7xbggauN AeRzqSe8pYhA57k8rqQJIfP9vJwuTiXVPKYe0clAwPH8+nSqh+wJq9IpQ A7yNuVe9wt2TDJOg+3opibosDA8pRMFC6SH7OdZkOFp29zJCejOeVX+k4 vKeL8sNqgWCnbVloJzI5K1IoNtFGKOuPKZOzflCPEp31a3WwAMqB5bHmr ocX5dCWh5j7jM5USmNOixFGI+snqoref0LnXebro9EItJKwTzMozV7H5J g==; X-CSE-ConnectionGUID: BuAH3VegRqGqClpnDfLNGQ== X-CSE-MsgGUID: QVARmo6ITqKQdaxYVM+0TA== X-IronPort-AV: E=McAfee;i="6800,10657,11813"; a="84530983" X-IronPort-AV: E=Sophos;i="6.24,198,1774335600"; d="scan'208";a="84530983" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2026 21:34:51 -0700 X-CSE-ConnectionGUID: hWiWUQQHSZWbiGqLihjGMA== X-CSE-MsgGUID: iSo1SrqTQNW4wpfg69Y+9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,198,1774335600"; d="scan'208";a="251468340" Received: from debox1-desk4.jf.intel.com ([10.88.27.138]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2026 21:34:51 -0700 From: "David E. Box" To: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, irenic.rajneesh@gmail.com Cc: "David E. Box" , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, srinivas.pandruvada@linux.intel.com, xi.pardee@linux.intel.com Subject: [PATCH v7 01/15] platform/x86/intel/pmt: Add pre/post decode hooks around header parsing Date: Wed, 10 Jun 2026 21:34:29 -0700 Message-ID: <8b560f0ac1731698ea7ad5fa316b8f9458597ca1.1781146840.git.david.e.box@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Add optional pre- and post-decode callbacks to the PMT class so namespaces can perform setup and cleanup steps around header parsing. - Add pmt_pre_decode() and pmt_post_decode() to struct intel_pmt_namespace. - Update intel_pmt_dev_create() to invoke, in order: pre =E2=86=92 header_decode() =E2=86=92 post. - Keep the existing pmt_header_decode() callback unchanged. No functional changes. This adds flexibility for upcoming decoders while preserving current behavior. Signed-off-by: David E. Box Reviewed-by: Ilpo J=C3=A4rvinen --- V7 - No changes V6 - No changes V5 - No changes V4 - No changes V3 - No changes V2 - No changes drivers/platform/x86/intel/pmt/class.c | 12 ++++++++++++ drivers/platform/x86/intel/pmt/class.h | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/drivers/platform/x86/intel/pmt/class.c b/drivers/platform/x86/= intel/pmt/class.c index b4c9964df807..9b315334a69b 100644 --- a/drivers/platform/x86/intel/pmt/class.c +++ b/drivers/platform/x86/intel/pmt/class.c @@ -381,10 +381,22 @@ int intel_pmt_dev_create(struct intel_pmt_entry *entr= y, struct intel_pmt_namespa if (IS_ERR(entry->disc_table)) return PTR_ERR(entry->disc_table); =20 + if (ns->pmt_pre_decode) { + ret =3D ns->pmt_pre_decode(intel_vsec_dev, entry); + if (ret) + return ret; + } + ret =3D ns->pmt_header_decode(entry, dev); if (ret) return ret; =20 + if (ns->pmt_post_decode) { + ret =3D ns->pmt_post_decode(intel_vsec_dev, entry); + if (ret) + return ret; + } + ret =3D intel_pmt_populate_entry(entry, intel_vsec_dev, disc_res); if (ret) return ret; diff --git a/drivers/platform/x86/intel/pmt/class.h b/drivers/platform/x86/= intel/pmt/class.h index 1ae56a5baad2..ff39014b208c 100644 --- a/drivers/platform/x86/intel/pmt/class.h +++ b/drivers/platform/x86/intel/pmt/class.h @@ -62,6 +62,10 @@ struct intel_pmt_namespace { struct xarray *xa; int (*pmt_header_decode)(struct intel_pmt_entry *entry, struct device *dev); + int (*pmt_pre_decode)(struct intel_vsec_device *ivdev, + struct intel_pmt_entry *entry); + int (*pmt_post_decode)(struct intel_vsec_device *ivdev, + struct intel_pmt_entry *entry); int (*pmt_add_endpoint)(struct intel_vsec_device *ivdev, struct intel_pmt_entry *entry); }; --=20 2.43.0