Skip to contentSkip to conversation

misc/pvpanic-pci: Allow automatic loading

PATCH In review Eric Auger 1 participant 2 messages Jun 29, 2021 – Jul 8, 2021 Char and misc drivers

lore
Share & tools
lore

Eric Auger

author
#0 lore raw

PATCH v2 1/1 misc/pvpanic-pci: Allow automatic loading

The virtual machine monitor (QEMU) exposes the pvpanic-pci device to the guest. On guest side the module exists but currently isn't loaded automatically. So the driver fails to be probed and does not its job of handling guest panic events.

Instead of requiring manual modprobe, let's include a device database using the MODULE_DEVICE_TABLE macro and let the module auto-load when the guest gets exposed with such a pvpanic-pci device.

---

v1 -> v2:
- enhance the commit message with additional info (Greg, Andy)

---
 drivers/misc/pvpanic/pvpanic-pci.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/misc/pvpanic/pvpanic-pci.c +2 -0
index 9ecc4e8559d5d..30290d42d8aa8 100644
@@ -122,4 +122,6 @@ static struct pci_driver pvpanic_pci_driver = {
 	},
 };
 
+MODULE_DEVICE_TABLE(pci, pvpanic_pci_id_tbl);
+
 module_pci_driver(pvpanic_pci_driver);
Signature · 1 line
2.26.3
author
#1 lore raw

Hi Greg,

Quoted 6 lines · Eric Auger

The virtual machine monitor (QEMU) exposes the pvpanic-pci device to the guest. On guest side the module exists but currently isn't loaded automatically. So the driver fails to be probed and does not its job of handling guest panic events.

Quoted 6 lines

Instead of requiring manual modprobe, let's include a device database using the MODULE_DEVICE_TABLE macro and let the module auto-load when the guest gets exposed with such a pvpanic-pci device.

Maybe I misunderstood your question on the v1. This patch does not result from an issue found by a tool/script but was identified while exercising the pvpanic-pci use case "manually".

Thanks

Eric

Quoted 20 lines

---

v1 -> v2:
- enhance the commit message with additional info (Greg, Andy)

---
 drivers/misc/pvpanic/pvpanic-pci.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/misc/pvpanic/pvpanic-pci.c +2 -0
index 9ecc4e8559d5d..30290d42d8aa8 100644
@@ -122,4 +122,6 @@ static struct pci_driver pvpanic_pci_driver = {
 	},
 };
 
+MODULE_DEVICE_TABLE(pci, pvpanic_pci_id_tbl);
+
 module_pci_driver(pvpanic_pci_driver);