Skip to content

Commit 3d7aa34

Browse files
gzhai7lijinxia
authored andcommitted
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 <edwin.zhai@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
1 parent c6d8e7f commit 3d7aa34

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

devicemodel/hw/pci/passthrough.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181
#define PCI_BDF(bus, dev, func) (((bus & 0xFF)<<8) | ((dev & 0x1F)<<3) \
8282
| ((func & 0x7)))
8383

84+
/* Some audio driver get topology data from ACPI NHLT table, thus need copy host
85+
* NHLT to guest. Default audio driver doesn't require this, so make it off by
86+
* default to avoid unexpected failure.
87+
*/
88+
#define AUDIO_NHLT_HACK 0
89+
8490
static int iofd = -1;
8591
static int memfd = -1;
8692

@@ -968,12 +974,14 @@ passthru_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
968974
pci_set_cfgdata16(dev, PCIR_MINGNT,
969975
read_config(ptdev->phys_dev, PCIR_MINGNT, 2));
970976

977+
#if AUDIO_NHLT_HACK
971978
/* device specific handling:
972979
* audio: enable NHLT ACPI table
973980
*/
974981
if (read_config(ptdev->phys_dev, PCIR_VENDOR, 2) == 0x8086 &&
975982
read_config(ptdev->phys_dev, PCIR_DEVICE, 2) == 0x5a98)
976983
acpi_table_enable(NHLT_ENTRY_NO);
984+
#endif
977985

978986
/* initialize config space */
979987
error = cfginit(ctx, ptdev, bus, slot, func);

0 commit comments

Comments
 (0)