mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
PCI/TSM: Establish Secure Sessions and Link Encryption
The PCIe 7.0 specification, section 11, defines the Trusted Execution
Environment (TEE) Device Interface Security Protocol (TDISP). This
protocol definition builds upon Component Measurement and Authentication
(CMA), and link Integrity and Data Encryption (IDE). It adds support for
assigning devices (PCI physical or virtual function) to a confidential VM
such that the assigned device is enabled to access guest private memory
protected by technologies like Intel TDX, AMD SEV-SNP, RISCV COVE, or ARM
CCA.
The "TSM" (TEE Security Manager) is a concept in the TDISP specification
of an agent that mediates between a "DSM" (Device Security Manager) and
system software in both a VMM and a confidential VM. A VMM uses TSM ABIs
to setup link security and assign devices. A confidential VM uses TSM
ABIs to transition an assigned device into the TDISP "RUN" state and
validate its configuration. From a Linux perspective the TSM abstracts
many of the details of TDISP, IDE, and CMA. Some of those details leak
through at times, but for the most part TDISP is an internal
implementation detail of the TSM.
CONFIG_PCI_TSM adds an "authenticated" attribute and "tsm/" subdirectory
to pci-sysfs. Consider that the TSM driver may itself be a PCI driver.
Userspace can watch for the arrival of a "TSM" device,
/sys/class/tsm/tsm0/uevent KOBJ_CHANGE, to know when the PCI core has
initialized TSM services.
The operations that can be executed against a PCI device are split into
two mutually exclusive operation sets, "Link" and "Security" (struct
pci_tsm_{link,security}_ops). The "Link" operations manage physical link
security properties and communication with the device's Device Security
Manager firmware. These are the host side operations in TDISP. The
"Security" operations coordinate the security state of the assigned
virtual device (TDI). These are the guest side operations in TDISP.
Only "link" (Secure Session and physical Link Encryption) operations are
defined at this stage. There are placeholders for the device security
(Trusted Computing Base entry / exit) operations.
The locking allows for multiple devices to be executing commands
simultaneously, one outstanding command per-device and an rwsem
synchronizes the implementation relative to TSM registration/unregistration
events.
Thanks to Wu Hao for his work on an early draft of this support.
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Samuel Ortiz <sameo@rivosinc.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Alexey Kardashevskiy <aik@amd.com>
Co-developed-by: Xu Yilun <yilun.xu@linux.intel.com>
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
Link: https://patch.msgid.link/20251031212902.2256310-5-dan.j.williams@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
@@ -621,3 +621,54 @@ Description:
|
||||
number extended capability. The file is read only and due to
|
||||
the possible sensitivity of accessible serial numbers, admin
|
||||
only.
|
||||
|
||||
What: /sys/bus/pci/devices/.../tsm/
|
||||
Contact: linux-coco@lists.linux.dev
|
||||
Description:
|
||||
This directory only appears if a physical device function
|
||||
supports authentication (PCIe CMA-SPDM), interface security
|
||||
(PCIe TDISP), and is accepted for secure operation by the
|
||||
platform TSM driver. This attribute directory appears
|
||||
dynamically after the platform TSM driver loads. So, only after
|
||||
the /sys/class/tsm/tsm0 device arrives can tools assume that
|
||||
devices without a tsm/ attribute directory will never have one;
|
||||
before that, the security capabilities of the device relative to
|
||||
the platform TSM are unknown. See
|
||||
Documentation/ABI/testing/sysfs-class-tsm.
|
||||
|
||||
What: /sys/bus/pci/devices/.../tsm/connect
|
||||
Contact: linux-coco@lists.linux.dev
|
||||
Description:
|
||||
(RW) Write the name of a TSM (TEE Security Manager) device from
|
||||
/sys/class/tsm to this file to establish a connection with the
|
||||
device. This typically includes an SPDM (DMTF Security
|
||||
Protocols and Data Models) session over PCIe DOE (Data Object
|
||||
Exchange) and may also include PCIe IDE (Integrity and Data
|
||||
Encryption) establishment. Reads from this attribute return the
|
||||
name of the connected TSM or the empty string if not
|
||||
connected. A TSM device signals its readiness to accept PCI
|
||||
connection via a KOBJ_CHANGE event.
|
||||
|
||||
What: /sys/bus/pci/devices/.../tsm/disconnect
|
||||
Contact: linux-coco@lists.linux.dev
|
||||
Description:
|
||||
(WO) Write the name of the TSM device that was specified
|
||||
to 'connect' to teardown the connection.
|
||||
|
||||
What: /sys/bus/pci/devices/.../authenticated
|
||||
Contact: linux-pci@vger.kernel.org
|
||||
Description:
|
||||
When the device's tsm/ directory is present device
|
||||
authentication (PCIe CMA-SPDM) and link encryption (PCIe IDE)
|
||||
are handled by the platform TSM (TEE Security Manager). When the
|
||||
tsm/ directory is not present this attribute reflects only the
|
||||
native CMA-SPDM authentication state with the kernel's
|
||||
certificate store.
|
||||
|
||||
If the attribute is not present, it indicates that
|
||||
authentication is unsupported by the device, or the TSM has no
|
||||
available authentication methods for the device.
|
||||
|
||||
When present and the tsm/ attribute directory is present, the
|
||||
authenticated attribute is an alias for the device 'connect'
|
||||
state. See the 'tsm/connect' attribute for more details.
|
||||
|
||||
@@ -10,6 +10,7 @@ The Linux PCI driver implementer's API guide
|
||||
|
||||
pci
|
||||
p2pdma
|
||||
tsm
|
||||
|
||||
.. only:: subproject and html
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. include:: <isonum.txt>
|
||||
|
||||
========================================================
|
||||
PCI Trusted Execution Environment Security Manager (TSM)
|
||||
========================================================
|
||||
|
||||
Subsystem Interfaces
|
||||
====================
|
||||
|
||||
.. kernel-doc:: include/linux/pci-ide.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: drivers/pci/ide.c
|
||||
:export:
|
||||
|
||||
.. kernel-doc:: include/linux/pci-tsm.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: drivers/pci/tsm.c
|
||||
:export:
|
||||
+3
-1
@@ -26118,8 +26118,10 @@ L: linux-coco@lists.linux.dev
|
||||
S: Maintained
|
||||
F: Documentation/ABI/testing/configfs-tsm-report
|
||||
F: Documentation/driver-api/coco/
|
||||
F: Documentation/driver-api/pci/tsm.rst
|
||||
F: drivers/pci/tsm.c
|
||||
F: drivers/virt/coco/guest/
|
||||
F: include/linux/tsm*.h
|
||||
F: include/linux/*tsm*.h
|
||||
F: samples/tsm-mr/
|
||||
|
||||
TRUSTED SERVICES TEE DRIVER
|
||||
|
||||
@@ -125,6 +125,21 @@ config PCI_ATS
|
||||
config PCI_IDE
|
||||
bool
|
||||
|
||||
config PCI_TSM
|
||||
bool "PCI TSM: Device security protocol support"
|
||||
select PCI_IDE
|
||||
select PCI_DOE
|
||||
select TSM
|
||||
help
|
||||
The TEE (Trusted Execution Environment) Device Interface
|
||||
Security Protocol (TDISP) defines a "TSM" as a platform agent
|
||||
that manages device authentication, link encryption, link
|
||||
integrity protection, and assignment of PCI device functions
|
||||
(virtual or physical) to confidential computing VMs that can
|
||||
access (DMA) guest private memory.
|
||||
|
||||
Enable a platform TSM driver to use this capability.
|
||||
|
||||
config PCI_DOE
|
||||
bool "Enable PCI Data Object Exchange (DOE) support"
|
||||
help
|
||||
|
||||
@@ -35,6 +35,7 @@ obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o
|
||||
obj-$(CONFIG_VGA_ARB) += vgaarb.o
|
||||
obj-$(CONFIG_PCI_DOE) += doe.o
|
||||
obj-$(CONFIG_PCI_IDE) += ide.o
|
||||
obj-$(CONFIG_PCI_TSM) += tsm.o
|
||||
obj-$(CONFIG_PCI_DYNAMIC_OF_NODES) += of_property.o
|
||||
obj-$(CONFIG_PCI_NPEM) += npem.o
|
||||
obj-$(CONFIG_PCIE_TPH) += tph.o
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
#include "pci.h"
|
||||
|
||||
#define PCI_DOE_FEATURE_DISCOVERY 0
|
||||
|
||||
/* Timeout of 1 second from 6.30.2 Operation, PCI Spec r6.0 */
|
||||
#define PCI_DOE_TIMEOUT HZ
|
||||
#define PCI_DOE_POLL_INTERVAL (PCI_DOE_TIMEOUT / 128)
|
||||
|
||||
@@ -1868,6 +1868,10 @@ const struct attribute_group *pci_dev_attr_groups[] = {
|
||||
#endif
|
||||
#ifdef CONFIG_PCI_DOE
|
||||
&pci_doe_sysfs_group,
|
||||
#endif
|
||||
#ifdef CONFIG_PCI_TSM
|
||||
&pci_tsm_auth_attr_group,
|
||||
&pci_tsm_attr_group,
|
||||
#endif
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -619,6 +619,16 @@ void pci_ide_init(struct pci_dev *dev);
|
||||
static inline void pci_ide_init(struct pci_dev *dev) { }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PCI_TSM
|
||||
void pci_tsm_init(struct pci_dev *pdev);
|
||||
void pci_tsm_destroy(struct pci_dev *pdev);
|
||||
extern const struct attribute_group pci_tsm_attr_group;
|
||||
extern const struct attribute_group pci_tsm_auth_attr_group;
|
||||
#else
|
||||
static inline void pci_tsm_init(struct pci_dev *pdev) { }
|
||||
static inline void pci_tsm_destroy(struct pci_dev *pdev) { }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* pci_dev_set_io_state - Set the new error state if possible.
|
||||
*
|
||||
|
||||
@@ -2763,6 +2763,9 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
|
||||
ret = device_add(&dev->dev);
|
||||
WARN_ON(ret < 0);
|
||||
|
||||
/* Establish pdev->tsm for newly added (e.g. new SR-IOV VFs) */
|
||||
pci_tsm_init(dev);
|
||||
|
||||
pci_npem_create(dev);
|
||||
|
||||
pci_doe_sysfs_init(dev);
|
||||
|
||||
@@ -57,6 +57,12 @@ static void pci_destroy_dev(struct pci_dev *dev)
|
||||
pci_doe_sysfs_teardown(dev);
|
||||
pci_npem_remove(dev);
|
||||
|
||||
/*
|
||||
* While device is in D0 drop the device from TSM link operations
|
||||
* including unbind and disconnect (IDE + SPDM teardown).
|
||||
*/
|
||||
pci_tsm_destroy(dev);
|
||||
|
||||
device_del(&dev->dev);
|
||||
|
||||
down_write(&pci_bus_sem);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,11 +8,29 @@
|
||||
#include <linux/device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/pci-tsm.h>
|
||||
|
||||
static struct class *tsm_class;
|
||||
static DECLARE_RWSEM(tsm_rwsem);
|
||||
static DEFINE_IDA(tsm_ida);
|
||||
|
||||
static int match_id(struct device *dev, const void *data)
|
||||
{
|
||||
struct tsm_dev *tsm_dev = container_of(dev, struct tsm_dev, dev);
|
||||
int id = *(const int *)data;
|
||||
|
||||
return tsm_dev->id == id;
|
||||
}
|
||||
|
||||
struct tsm_dev *find_tsm_dev(int id)
|
||||
{
|
||||
struct device *dev = class_find_device(tsm_class, NULL, &id, match_id);
|
||||
|
||||
if (!dev)
|
||||
return NULL;
|
||||
return container_of(dev, struct tsm_dev, dev);
|
||||
}
|
||||
|
||||
static struct tsm_dev *alloc_tsm_dev(struct device *parent)
|
||||
{
|
||||
struct device *dev;
|
||||
@@ -36,7 +54,29 @@ static struct tsm_dev *alloc_tsm_dev(struct device *parent)
|
||||
return no_free_ptr(tsm_dev);
|
||||
}
|
||||
|
||||
struct tsm_dev *tsm_register(struct device *parent)
|
||||
static struct tsm_dev *tsm_register_pci_or_reset(struct tsm_dev *tsm_dev,
|
||||
struct pci_tsm_ops *pci_ops)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (!pci_ops)
|
||||
return tsm_dev;
|
||||
|
||||
tsm_dev->pci_ops = pci_ops;
|
||||
rc = pci_tsm_register(tsm_dev);
|
||||
if (rc) {
|
||||
dev_err(tsm_dev->dev.parent,
|
||||
"PCI/TSM registration failure: %d\n", rc);
|
||||
device_unregister(&tsm_dev->dev);
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
/* Notify TSM userspace that PCI/TSM operations are now possible */
|
||||
kobject_uevent(&tsm_dev->dev.kobj, KOBJ_CHANGE);
|
||||
return tsm_dev;
|
||||
}
|
||||
|
||||
struct tsm_dev *tsm_register(struct device *parent, struct pci_tsm_ops *pci_ops)
|
||||
{
|
||||
struct tsm_dev *tsm_dev __free(put_tsm_dev) = alloc_tsm_dev(parent);
|
||||
struct device *dev;
|
||||
@@ -54,12 +94,14 @@ struct tsm_dev *tsm_register(struct device *parent)
|
||||
if (rc)
|
||||
return ERR_PTR(rc);
|
||||
|
||||
return no_free_ptr(tsm_dev);
|
||||
return tsm_register_pci_or_reset(no_free_ptr(tsm_dev), pci_ops);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(tsm_register);
|
||||
|
||||
void tsm_unregister(struct tsm_dev *tsm_dev)
|
||||
{
|
||||
if (tsm_dev->pci_ops)
|
||||
pci_tsm_unregister(tsm_dev);
|
||||
device_unregister(&tsm_dev->dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(tsm_unregister);
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
|
||||
struct pci_doe_mb;
|
||||
|
||||
#define PCI_DOE_FEATURE_DISCOVERY 0
|
||||
#define PCI_DOE_FEATURE_CMA 1
|
||||
#define PCI_DOE_FEATURE_SSESSION 2
|
||||
|
||||
struct pci_doe_mb *pci_find_doe_mailbox(struct pci_dev *pdev, u16 vendor,
|
||||
u8 type);
|
||||
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __PCI_TSM_H
|
||||
#define __PCI_TSM_H
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
struct pci_tsm;
|
||||
struct tsm_dev;
|
||||
|
||||
/*
|
||||
* struct pci_tsm_ops - manage confidential links and security state
|
||||
* @link_ops: Coordinate PCIe SPDM and IDE establishment via a platform TSM.
|
||||
* Provide a secure session transport for TDISP state management
|
||||
* (typically bare metal physical function operations).
|
||||
* @devsec_ops: Lock, unlock, and interrogate the security state of the
|
||||
* function via the platform TSM (typically virtual function
|
||||
* operations).
|
||||
*
|
||||
* This operations are mutually exclusive either a tsm_dev instance
|
||||
* manages physical link properties or it manages function security
|
||||
* states like TDISP lock/unlock.
|
||||
*/
|
||||
struct pci_tsm_ops {
|
||||
/*
|
||||
* struct pci_tsm_link_ops - Manage physical link and the TSM/DSM session
|
||||
* @probe: establish context with the TSM (allocate / wrap 'struct
|
||||
* pci_tsm') for follow-on link operations
|
||||
* @remove: destroy link operations context
|
||||
* @connect: establish / validate a secure connection (e.g. IDE)
|
||||
* with the device
|
||||
* @disconnect: teardown the secure link
|
||||
*
|
||||
* Context: @probe, @remove, @connect, and @disconnect run under
|
||||
* pci_tsm_rwsem held for write to sync with TSM unregistration and
|
||||
* mutual exclusion of @connect and @disconnect. @connect and
|
||||
* @disconnect additionally run under the DSM lock (struct
|
||||
* pci_tsm_pf0::lock) as well as @probe and @remove of the subfunctions.
|
||||
*/
|
||||
struct_group_tagged(pci_tsm_link_ops, link_ops,
|
||||
struct pci_tsm *(*probe)(struct tsm_dev *tsm_dev,
|
||||
struct pci_dev *pdev);
|
||||
void (*remove)(struct pci_tsm *tsm);
|
||||
int (*connect)(struct pci_dev *pdev);
|
||||
void (*disconnect)(struct pci_dev *pdev);
|
||||
);
|
||||
|
||||
/*
|
||||
* struct pci_tsm_devsec_ops - Manage the security state of the function
|
||||
* @lock: establish context with the TSM (allocate / wrap 'struct
|
||||
* pci_tsm') for follow-on security state transitions from the
|
||||
* LOCKED state
|
||||
* @unlock: destroy TSM context and return device to UNLOCKED state
|
||||
*
|
||||
* Context: @lock and @unlock run under pci_tsm_rwsem held for write to
|
||||
* sync with TSM unregistration and each other
|
||||
*/
|
||||
struct_group_tagged(pci_tsm_devsec_ops, devsec_ops,
|
||||
struct pci_tsm *(*lock)(struct tsm_dev *tsm_dev,
|
||||
struct pci_dev *pdev);
|
||||
void (*unlock)(struct pci_tsm *tsm);
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pci_tsm - Core TSM context for a given PCIe endpoint
|
||||
* @pdev: Back ref to device function, distinguishes type of pci_tsm context
|
||||
* @dsm_dev: PCI Device Security Manager for link operations on @pdev
|
||||
* @tsm_dev: PCI TEE Security Manager device for Link Confidentiality or Device
|
||||
* Function Security operations
|
||||
*
|
||||
* This structure is wrapped by low level TSM driver data and returned by
|
||||
* probe()/lock(), it is freed by the corresponding remove()/unlock().
|
||||
*
|
||||
* For link operations it serves to cache the association between a Device
|
||||
* Security Manager (DSM) and the functions that manager can assign to a TVM.
|
||||
* That can be "self", for assigning function0 of a TEE I/O device, a
|
||||
* sub-function (SR-IOV virtual function, or non-function0
|
||||
* multifunction-device), or a downstream endpoint (PCIe upstream switch-port as
|
||||
* DSM).
|
||||
*/
|
||||
struct pci_tsm {
|
||||
struct pci_dev *pdev;
|
||||
struct pci_dev *dsm_dev;
|
||||
struct tsm_dev *tsm_dev;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct pci_tsm_pf0 - Physical Function 0 TDISP link context
|
||||
* @base_tsm: generic core "tsm" context
|
||||
* @lock: mutual exclustion for pci_tsm_ops invocation
|
||||
* @doe_mb: PCIe Data Object Exchange mailbox
|
||||
*/
|
||||
struct pci_tsm_pf0 {
|
||||
struct pci_tsm base_tsm;
|
||||
struct mutex lock;
|
||||
struct pci_doe_mb *doe_mb;
|
||||
};
|
||||
|
||||
/* physical function0 and capable of 'connect' */
|
||||
static inline bool is_pci_tsm_pf0(struct pci_dev *pdev)
|
||||
{
|
||||
if (!pdev)
|
||||
return false;
|
||||
|
||||
if (!pci_is_pcie(pdev))
|
||||
return false;
|
||||
|
||||
if (pdev->is_virtfn)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Allow for a Device Security Manager (DSM) associated with function0
|
||||
* of an Endpoint to coordinate TDISP requests for other functions
|
||||
* (physical or virtual) of the device, or allow for an Upstream Port
|
||||
* DSM to accept TDISP requests for the Endpoints downstream of the
|
||||
* switch.
|
||||
*/
|
||||
switch (pci_pcie_type(pdev)) {
|
||||
case PCI_EXP_TYPE_ENDPOINT:
|
||||
case PCI_EXP_TYPE_UPSTREAM:
|
||||
case PCI_EXP_TYPE_RC_END:
|
||||
if (pdev->ide_cap || (pdev->devcap & PCI_EXP_DEVCAP_TEE))
|
||||
break;
|
||||
fallthrough;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return PCI_FUNC(pdev->devfn) == 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI_TSM
|
||||
int pci_tsm_register(struct tsm_dev *tsm_dev);
|
||||
void pci_tsm_unregister(struct tsm_dev *tsm_dev);
|
||||
int pci_tsm_link_constructor(struct pci_dev *pdev, struct pci_tsm *tsm,
|
||||
struct tsm_dev *tsm_dev);
|
||||
int pci_tsm_pf0_constructor(struct pci_dev *pdev, struct pci_tsm_pf0 *tsm,
|
||||
struct tsm_dev *tsm_dev);
|
||||
void pci_tsm_pf0_destructor(struct pci_tsm_pf0 *tsm);
|
||||
int pci_tsm_doe_transfer(struct pci_dev *pdev, u8 type, const void *req,
|
||||
size_t req_sz, void *resp, size_t resp_sz);
|
||||
#else
|
||||
static inline int pci_tsm_register(struct tsm_dev *tsm_dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void pci_tsm_unregister(struct tsm_dev *tsm_dev)
|
||||
{
|
||||
}
|
||||
static inline int pci_tsm_doe_transfer(struct pci_dev *pdev, u8 type,
|
||||
const void *req, size_t req_sz,
|
||||
void *resp, size_t resp_sz)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
#endif
|
||||
#endif /*__PCI_TSM_H */
|
||||
@@ -546,6 +546,9 @@ struct pci_dev {
|
||||
u8 nr_link_ide; /* Link Stream count (Selective Stream offset) */
|
||||
unsigned int ide_cfg:1; /* Config cycles over IDE */
|
||||
unsigned int ide_tee_limit:1; /* Disallow T=0 traffic over IDE */
|
||||
#endif
|
||||
#ifdef CONFIG_PCI_TSM
|
||||
struct pci_tsm *tsm; /* TSM operation state */
|
||||
#endif
|
||||
u16 acs_cap; /* ACS Capability offset */
|
||||
u8 supported_speeds; /* Supported Link Speeds Vector */
|
||||
|
||||
+4
-1
@@ -108,9 +108,11 @@ struct tsm_report_ops {
|
||||
bool (*report_bin_attr_visible)(int n);
|
||||
};
|
||||
|
||||
struct pci_tsm_ops;
|
||||
struct tsm_dev {
|
||||
struct device dev;
|
||||
int id;
|
||||
const struct pci_tsm_ops *pci_ops;
|
||||
};
|
||||
|
||||
DEFINE_FREE(put_tsm_dev, struct tsm_dev *,
|
||||
@@ -118,6 +120,7 @@ DEFINE_FREE(put_tsm_dev, struct tsm_dev *,
|
||||
|
||||
int tsm_report_register(const struct tsm_report_ops *ops, void *priv);
|
||||
int tsm_report_unregister(const struct tsm_report_ops *ops);
|
||||
struct tsm_dev *tsm_register(struct device *parent);
|
||||
struct tsm_dev *tsm_register(struct device *parent, struct pci_tsm_ops *ops);
|
||||
void tsm_unregister(struct tsm_dev *tsm_dev);
|
||||
struct tsm_dev *find_tsm_dev(int id);
|
||||
#endif /* __TSM_H */
|
||||
|
||||
@@ -503,6 +503,7 @@
|
||||
#define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */
|
||||
#define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */
|
||||
#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */
|
||||
#define PCI_EXP_DEVCAP_TEE 0x40000000 /* TEE I/O (TDISP) Support */
|
||||
#define PCI_EXP_DEVCTL 0x08 /* Device Control */
|
||||
#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
|
||||
#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
|
||||
|
||||
Reference in New Issue
Block a user