aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2020-06-04 12:59:20 -0500
committerBjorn Helgaas <bhelgaas@google.com>2020-06-04 12:59:20 -0500
commit2bd81cd04a3f5eb873cc81fa16c469377be3b092 (patch)
tree34d43c8c473e1304bffa0d290a9743febb9e5d9d
parentMerge branch 'remotes/lorenzo/pci/v3-semi' (diff)
parentPCI: vmd: Filter resource type bits from shadow register (diff)
downloadwireguard-linux-2bd81cd04a3f5eb873cc81fa16c469377be3b092.tar.xz
wireguard-linux-2bd81cd04a3f5eb873cc81fa16c469377be3b092.zip
Merge branch 'remotes/lorenzo/pci/vmd'
- Fix vmd resource address calculation using Host Physical Address shadow register (Jon Derrick) * remotes/lorenzo/pci/vmd: PCI: vmd: Filter resource type bits from shadow register
-rw-r--r--drivers/pci/controller/vmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index dac91d60701d..e386d4eac407 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -445,9 +445,11 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
if (!membar2)
return -ENOMEM;
offset[0] = vmd->dev->resource[VMD_MEMBAR1].start -
- readq(membar2 + MB2_SHADOW_OFFSET);
+ (readq(membar2 + MB2_SHADOW_OFFSET) &
+ PCI_BASE_ADDRESS_MEM_MASK);
offset[1] = vmd->dev->resource[VMD_MEMBAR2].start -
- readq(membar2 + MB2_SHADOW_OFFSET + 8);
+ (readq(membar2 + MB2_SHADOW_OFFSET + 8) &
+ PCI_BASE_ADDRESS_MEM_MASK);
pci_iounmap(vmd->dev, membar2);
}
}