Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: vmd: Only assign _OSC features in bare metal OS.
@ 2026-06-29 17:01 Nirmal Patel
  2026-06-29 17:11 ` sashiko-bot
  0 siblings, 1 reply; 6+ messages in thread
From: Nirmal Patel @ 2026-06-29 17:01 UTC (permalink / raw)
  To: nirmal.patel, linux-pci
  Cc: bhelgaas, kwilczynski, mani, robh, lpieralisi, linux-pc,
	Nirmal Patel, Andy Shevchenko

From: Nirmal Patel <nirmal.patel@intel.com>

Copy valid _OSC flags from root bridge only when OS can provide correct
values. In virtual machine, all of the control features are disabled as
hypervisor will not passthrough root bridge information to VM.

Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Reviewed-by:  Andy Shevchenko <andriy.shevchenko@intel.com>
---
 drivers/pci/controller/vmd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index d4ae250d4bc6..f9e38f2f926a 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -910,8 +910,10 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 		return -ENODEV;
 	}
 
-	vmd_copy_host_bridge_flags(pci_find_host_bridge(vmd->dev->bus),
-				   to_pci_host_bridge(vmd->bus->bridge));
+	/* Don't copy _OSC control flags in VM, it disables features.*/
+	if (!offset[0] || !offset[1])
+		vmd_copy_host_bridge_flags(pci_find_host_bridge(vmd->dev->bus),
+					 to_pci_host_bridge(vmd->bus->bridge));
 
 	vmd_attach_resources(vmd);
 	if (vmd->irq_domain)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] PCI: vmd: Only assign _OSC features in bare metal OS.
@ 2026-06-29 17:02 Nirmal Patel
  2026-06-29 17:13 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nirmal Patel @ 2026-06-29 17:02 UTC (permalink / raw)
  To: nirmal.patel, linux-pci
  Cc: bhelgaas, kwilczynski, mani, robh, lpieralisi, Nirmal Patel,
	Andy Shevchenko

From: Nirmal Patel <nirmal.patel@intel.com>

Copy valid _OSC flags from root bridge only when OS can provide correct
values. In virtual machine, all of the control features are disabled as
hypervisor will not passthrough root bridge information to VM.

Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Reviewed-by:  Andy Shevchenko <andriy.shevchenko@intel.com>
---
 drivers/pci/controller/vmd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index d4ae250d4bc6..f9e38f2f926a 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -910,8 +910,10 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
 		return -ENODEV;
 	}
 
-	vmd_copy_host_bridge_flags(pci_find_host_bridge(vmd->dev->bus),
-				   to_pci_host_bridge(vmd->bus->bridge));
+	/* Don't copy _OSC control flags in VM, it disables features.*/
+	if (!offset[0] || !offset[1])
+		vmd_copy_host_bridge_flags(pci_find_host_bridge(vmd->dev->bus),
+					 to_pci_host_bridge(vmd->bus->bridge));
 
 	vmd_attach_resources(vmd);
 	if (vmd->irq_domain)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-30 17:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29 17:01 [PATCH] PCI: vmd: Only assign _OSC features in bare metal OS Nirmal Patel
2026-06-29 17:11 ` sashiko-bot
  -- strict thread matches above, loose matches on Subject: below --
2026-06-29 17:02 Nirmal Patel
2026-06-29 17:13 ` sashiko-bot
2026-06-29 17:18 ` Andy Shevchenko
2026-06-30 17:10 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox