mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 02:31:27 +02:00
Merge branch 'pci/p2pdma'
- Prevent P2PDMA as well as CPU access to non-mappable BARs, e.g., s390 ISM BARs (Matt Evans) - Add Intel QAT, DSA, IAA devices to whitelist (Lukas Wunner) * pci/p2pdma: PCI/P2PDMA: Add Intel QAT, DSA, IAA devices to whitelist PCI/P2PDMA: Avoid returning a provider for non_mappable_bars
This commit is contained in:
commit
5ea9159447
|
|
@ -28,15 +28,10 @@
|
|||
#define ADF_4XXX_DEVICE_NAME "4xxx"
|
||||
#define ADF_420XX_DEVICE_NAME "420xx"
|
||||
#define ADF_6XXX_DEVICE_NAME "6xxx"
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_4XXX 0x4940
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_4XXXIOV 0x4941
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_401XX 0x4942
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_401XXIOV 0x4943
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_402XX 0x4944
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_402XXIOV 0x4945
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_420XX 0x4946
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_420XXIOV 0x4947
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_6XXX 0x4948
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_6XXX_IOV 0x4949
|
||||
|
||||
#define ADF_DEVICE_FUSECTL_OFFSET 0x40
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@
|
|||
#endif
|
||||
|
||||
/* PCI Config */
|
||||
#define PCI_DEVICE_ID_INTEL_DSA_GNRD 0x11fb
|
||||
#define PCI_DEVICE_ID_INTEL_DSA_DMR 0x1212
|
||||
#define PCI_DEVICE_ID_INTEL_IAA_DMR 0x1216
|
||||
#define PCI_DEVICE_ID_INTEL_IAA_PTL 0xb02d
|
||||
#define PCI_DEVICE_ID_INTEL_IAA_WCL 0xfd2d
|
||||
|
||||
|
|
|
|||
|
|
@ -262,6 +262,9 @@ int pcim_p2pdma_init(struct pci_dev *pdev)
|
|||
struct pci_p2pdma *p2p;
|
||||
int i, ret;
|
||||
|
||||
if (pdev->non_mappable_bars)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
p2p = rcu_dereference_protected(pdev->p2pdma, 1);
|
||||
if (p2p)
|
||||
return 0;
|
||||
|
|
@ -318,7 +321,8 @@ struct p2pdma_provider *pcim_p2pdma_provider(struct pci_dev *pdev, int bar)
|
|||
{
|
||||
struct pci_p2pdma *p2p;
|
||||
|
||||
if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
|
||||
if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM) ||
|
||||
pdev->non_mappable_bars)
|
||||
return NULL;
|
||||
|
||||
p2p = rcu_dereference_protected(pdev->p2pdma, 1);
|
||||
|
|
@ -548,6 +552,16 @@ static const struct pci_p2pdma_whitelist_entry {
|
|||
{PCI_VENDOR_ID_INTEL, 0x2033, 0},
|
||||
{PCI_VENDOR_ID_INTEL, 0x2020, 0},
|
||||
{PCI_VENDOR_ID_INTEL, 0x09a2, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DSA_SPR0, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IAX_SPR0, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DSA_GNRD, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DSA_DMR, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IAA_DMR, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_4XXX, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_401XX, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_402XX, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_420XX, 0},
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QAT_6XXX, 0},
|
||||
/* Google SoCs. */
|
||||
{PCI_VENDOR_ID_GOOGLE, PCI_ANY_ID, 0},
|
||||
{}
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ struct pci_dev {
|
|||
unsigned int no_command_memory:1; /* No PCI_COMMAND_MEMORY */
|
||||
unsigned int rom_bar_overlap:1; /* ROM BAR disable broken */
|
||||
unsigned int rom_attr_enabled:1; /* Display of ROM attribute enabled? */
|
||||
unsigned int non_mappable_bars:1; /* BARs can't be mapped to user-space */
|
||||
unsigned int non_mappable_bars:1; /* BARs can't be mapped by CPU or peers */
|
||||
pci_dev_flags_t dev_flags;
|
||||
atomic_t enable_cnt; /* pci_enable_device has been called */
|
||||
|
||||
|
|
|
|||
|
|
@ -2732,6 +2732,9 @@
|
|||
#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
|
||||
#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
|
||||
#define PCI_DEVICE_ID_INTEL_SST_TNG 0x119a
|
||||
#define PCI_DEVICE_ID_INTEL_DSA_GNRD 0x11fb
|
||||
#define PCI_DEVICE_ID_INTEL_DSA_DMR 0x1212
|
||||
#define PCI_DEVICE_ID_INTEL_IAA_DMR 0x1216
|
||||
#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
|
||||
#define PCI_DEVICE_ID_INTEL_82437 0x122d
|
||||
#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
|
||||
|
|
@ -3052,6 +3055,11 @@
|
|||
#define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_TGL_H 0x43c8
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_DG1 0x490d
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_4XXX 0x4940
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_401XX 0x4942
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_402XX 0x4944
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_420XX 0x4946
|
||||
#define PCI_DEVICE_ID_INTEL_QAT_6XXX 0x4948
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_EHL_0 0x4b55
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_EHL_3 0x4b58
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_WCL 0x4d28
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user