aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiqian Chen <Jiqian.Chen@amd.com>2023-07-25 18:45:45 +0800
committerHuang Rui <ray.huang@amd.com>2023-08-20 17:09:50 +0800
commitde602e087e62187c807c072c3249651aa4c3441c (patch)
tree0150e16a462851a724ef57974853fe435b9ff05e
parentfa7c8bf8de79d0b3cb6ecdb6a25d5e961827b119 (diff)
downloadlinux-upstream-for-xen-v2.tar.gz
drivers/pci: Workaround for restore Rebar stateupstream-for-xen-v2
Rebar capability is disabled when dGPU is used on PVH dom0. So, we don't restore rebar state here. This workaround can be removed when Rebar is correctly performed. Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com> Reviewed-by: Huang Rui <Ray.Huang@amd.com> Signed-off-by: Huang Rui <ray.huang@amd.com>
-rw-r--r--drivers/pci/pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 60230da957e0c4..4b05bccc2ece9d 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -32,6 +32,7 @@
#include <asm/dma.h>
#include <linux/aer.h>
#include <linux/bitfield.h>
+#include <xen/xen.h>
#include "pci.h"
DEFINE_MUTEX(pci_slot_mutex);
@@ -1765,6 +1766,14 @@ static void pci_restore_rebar_state(struct pci_dev *pdev)
unsigned int pos, nbars, i;
u32 ctrl;
+ /*
+ * PVH dom0 doesn't support resizable bar capability,
+ * we don't need to restore rebar on PVH dom0.
+ */
+ if (xen_initial_domain() && xen_pvh_domain()) {
+ return;
+ }
+
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_REBAR);
if (!pos)
return;