Skip to content

Commit a885a27

Browse files
debox1ij-intel
authored andcommitted
platform/x86/intel/vsec: Set OOBMSM to CPU mapping
Add functions, intel_vsec_set/get_mapping(), to set and retrieve the OOBMSM-to-CPU mapping data in the private data of the parent Intel VSEC driver. With this mapping information available, other Intel VSEC features on the same OOBMSM device can easily access and use the mapping data, allowing each of the OOBMSM features to map to the CPUs they provides data for. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20250703022832.1302928-12-david.e.box@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 934954d commit a885a27

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

drivers/platform/x86/intel/vsec.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ enum vsec_device_state {
4444
struct vsec_priv {
4545
struct intel_vsec_platform_info *info;
4646
struct device *suppliers[VSEC_FEATURE_COUNT];
47+
struct oobmsm_plat_info plat_info;
4748
enum vsec_device_state state[VSEC_FEATURE_COUNT];
4849
unsigned long found_caps;
4950
};
@@ -665,6 +666,36 @@ static int intel_vsec_pci_probe(struct pci_dev *pdev, const struct pci_device_id
665666
return 0;
666667
}
667668

669+
int intel_vsec_set_mapping(struct oobmsm_plat_info *plat_info,
670+
struct intel_vsec_device *vsec_dev)
671+
{
672+
struct vsec_priv *priv;
673+
674+
priv = pci_get_drvdata(vsec_dev->pcidev);
675+
if (!priv)
676+
return -EINVAL;
677+
678+
priv->plat_info = *plat_info;
679+
680+
return 0;
681+
}
682+
EXPORT_SYMBOL_NS_GPL(intel_vsec_set_mapping, "INTEL_VSEC");
683+
684+
struct oobmsm_plat_info *intel_vsec_get_mapping(struct pci_dev *pdev)
685+
{
686+
struct vsec_priv *priv;
687+
688+
if (!pci_match_id(intel_vsec_pci_ids, pdev))
689+
return ERR_PTR(-EINVAL);
690+
691+
priv = pci_get_drvdata(pdev);
692+
if (!priv)
693+
return ERR_PTR(-EINVAL);
694+
695+
return &priv->plat_info;
696+
}
697+
EXPORT_SYMBOL_NS_GPL(intel_vsec_get_mapping, "INTEL_VSEC");
698+
668699
/* DG1 info */
669700
static struct intel_vsec_header dg1_header = {
670701
.length = 0x10,

include/linux/intel_vsec.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,23 @@ static inline struct intel_vsec_device *auxdev_to_ivdev(struct auxiliary_device
183183
#if IS_ENABLED(CONFIG_INTEL_VSEC)
184184
int intel_vsec_register(struct pci_dev *pdev,
185185
struct intel_vsec_platform_info *info);
186+
int intel_vsec_set_mapping(struct oobmsm_plat_info *plat_info,
187+
struct intel_vsec_device *vsec_dev);
188+
struct oobmsm_plat_info *intel_vsec_get_mapping(struct pci_dev *pdev);
186189
#else
187190
static inline int intel_vsec_register(struct pci_dev *pdev,
188191
struct intel_vsec_platform_info *info)
189192
{
190193
return -ENODEV;
191194
}
195+
static inline int intel_vsec_set_mapping(struct oobmsm_plat_info *plat_info,
196+
struct intel_vsec_device *vsec_dev)
197+
{
198+
return -ENODEV;
199+
}
200+
static inline struct oobmsm_plat_info *intel_vsec_get_mapping(struct pci_dev *pdev)
201+
{
202+
return ERR_PTR(-ENODEV);
203+
}
192204
#endif
193205
#endif

0 commit comments

Comments
 (0)