diff --git a/hypervisor/arch/x86/ioapic.c b/hypervisor/arch/x86/ioapic.c index 3a70e252f..f3f84d22e 100644 --- a/hypervisor/arch/x86/ioapic.c +++ b/hypervisor/arch/x86/ioapic.c @@ -19,7 +19,7 @@ static struct gsi_table gsi_table_data[NR_MAX_GSI]; static uint32_t ioapic_max_nr_gsi; -static spinlock_t ioapic_lock; +static spinlock_t ioapic_lock = { .head = 0U, .tail = 0U, }; static union ioapic_rte saved_rte[CONFIG_MAX_IOAPIC_NUM][CONFIG_MAX_IOAPIC_LINES]; @@ -425,8 +425,6 @@ void ioapic_setup_irqs(void) uint32_t gsi = 0U; uint32_t vr; - spinlock_init(&ioapic_lock); - for (ioapic_id = 0U; ioapic_id < ioapic_num; ioapic_id++) { void *addr; diff --git a/hypervisor/common/ptdev.c b/hypervisor/common/ptdev.c index dce77d0b1..761f07fe3 100644 --- a/hypervisor/common/ptdev.c +++ b/hypervisor/common/ptdev.c @@ -19,7 +19,7 @@ #define PTIRQ_BITMAP_ARRAY_SIZE INT_DIV_ROUNDUP(CONFIG_MAX_PT_IRQ_ENTRIES, 64U) struct ptirq_remapping_info ptirq_entries[CONFIG_MAX_PT_IRQ_ENTRIES]; static uint64_t ptirq_entry_bitmaps[PTIRQ_BITMAP_ARRAY_SIZE]; -spinlock_t ptdev_lock; +spinlock_t ptdev_lock = { .head = 0U, .tail = 0U, }; static struct ptirq_entry_head { struct hlist_head list; @@ -223,7 +223,6 @@ void ptirq_deactivate_entry(struct ptirq_remapping_info *entry) void ptdev_init(void) { if (get_pcpu_id() == BSP_CPU_ID) { - spinlock_init(&ptdev_lock); register_softirq(SOFTIRQ_PTDEV, ptirq_softirq); } INIT_LIST_HEAD(&get_cpu_var(softirq_dev_entry_list));