Skip to content

Commit 2d57c5f

Browse files
conghuic23acrnsi
authored andcommitted
dm: virtio-console: add subclass
Add subclass for virtio-console pci device. Without the subclass, the device may be probed by 8250_pci serial driver, and lead to segment fault in acrn-dm. This issue appears when running debian as Guest OS. But there is a potential issue, if a new serial driver, which use class and subclass same as virtio-console, the problem may still trigger. Need to fix it case by case. Tracked-On: #3615 Signed-off-by: Conghui Chen <conghui.chen@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com>
1 parent 66056c1 commit 2d57c5f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

devicemodel/hw/pci/virtio/virtio_console.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,7 @@ virtio_console_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
11361136
pci_set_cfgdata16(dev, PCIR_DEVICE, VIRTIO_DEV_CONSOLE);
11371137
pci_set_cfgdata16(dev, PCIR_VENDOR, VIRTIO_VENDOR);
11381138
pci_set_cfgdata8(dev, PCIR_CLASS, PCIC_SIMPLECOMM);
1139+
pci_set_cfgdata8(dev, PCIR_SUBCLASS, PCIS_SIMPLECOMM_OTHER);
11391140
pci_set_cfgdata16(dev, PCIR_SUBDEV_0, VIRTIO_TYPE_CONSOLE);
11401141
pci_set_cfgdata16(dev, PCIR_SUBVEND_0, VIRTIO_VENDOR);
11411142

0 commit comments

Comments
 (0)