From 3d7aa346b82b590c4f32ea30a3e87be0207166fd Mon Sep 17 00:00:00 2001 From: Edwin Zhai Date: Wed, 30 May 2018 13:18:28 +0800 Subject: [PATCH] DM: Disable audio NHLT table by default NHLT table is used by some audio driver for topology data, but current default audio driver doens't depend on it. Disable it by default due to possible boot failure with different SOS firmware. Signed-off-by: Edwin Zhai Reviewed-by: Kevin Tian --- devicemodel/hw/pci/passthrough.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devicemodel/hw/pci/passthrough.c b/devicemodel/hw/pci/passthrough.c index 19db7a509..8c18df92d 100644 --- a/devicemodel/hw/pci/passthrough.c +++ b/devicemodel/hw/pci/passthrough.c @@ -81,6 +81,12 @@ #define PCI_BDF(bus, dev, func) (((bus & 0xFF)<<8) | ((dev & 0x1F)<<3) \ | ((func & 0x7))) +/* Some audio driver get topology data from ACPI NHLT table, thus need copy host + * NHLT to guest. Default audio driver doesn't require this, so make it off by + * default to avoid unexpected failure. + */ +#define AUDIO_NHLT_HACK 0 + static int iofd = -1; static int memfd = -1; @@ -968,12 +974,14 @@ passthru_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) pci_set_cfgdata16(dev, PCIR_MINGNT, read_config(ptdev->phys_dev, PCIR_MINGNT, 2)); +#if AUDIO_NHLT_HACK /* device specific handling: * audio: enable NHLT ACPI table */ if (read_config(ptdev->phys_dev, PCIR_VENDOR, 2) == 0x8086 && read_config(ptdev->phys_dev, PCIR_DEVICE, 2) == 0x5a98) acpi_table_enable(NHLT_ENTRY_NO); +#endif /* initialize config space */ error = cfginit(ctx, ptdev, bus, slot, func);