diff --git a/hypervisor/debug/logmsg.c b/hypervisor/debug/logmsg.c index 9e374b1e8..31d2d41f9 100644 --- a/hypervisor/debug/logmsg.c +++ b/hypervisor/debug/logmsg.c @@ -29,6 +29,8 @@ void init_logmsg(uint32_t flags) { logmsg_ctl.flags = flags; logmsg_ctl.seq = 0; + + spinlock_init(&(logmsg_ctl.lock)); } void do_logmsg(uint32_t severity, const char *fmt, ...) diff --git a/hypervisor/hw/pci.c b/hypervisor/hw/pci.c index a323f907f..f6a004ee8 100644 --- a/hypervisor/hw/pci.c +++ b/hypervisor/hw/pci.c @@ -610,6 +610,9 @@ void init_pci_pdev_list(void) uint16_t bus; bool was_visited = false; + /* explicitly init the lock before using it */ + spinlock_init(&pci_device_lock); + pci_parse_iommu_devscopes(&bdfs_from_drhds, &drhd_idx_pci_all); /* TODO: iterate over list of PCI Host Bridges found in ACPI namespace */