From b13882f8bd258fabca6e9536f50e4770932f22e5 Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Tue, 31 Jul 2018 22:49:36 +0800 Subject: [PATCH] hv: vioapic: improve the vioapic reset flow During ioapic reset, some registers need to be set to the default value which defined in ioapic spec. So far, the vioapic function only be called by ioapic itself in ioapic_init. And just invoked after calloc the vioapic object, so all the content are already set to zero. But this vioapic_reset function be exported as one API which maybe invoked by other scenarios in future. So this patch resolves this potential issue. Signed-off-by: Yu Wang Acked-by: Anthony Xu --- hypervisor/arch/x86/guest/vioapic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hypervisor/arch/x86/guest/vioapic.c b/hypervisor/arch/x86/guest/vioapic.c index 4d34fd10e..0d453a6cb 100644 --- a/hypervisor/arch/x86/guest/vioapic.c +++ b/hypervisor/arch/x86/guest/vioapic.c @@ -540,6 +540,8 @@ vioapic_reset(struct vioapic *vioapic) for (pin = 0U; pin < pincount; pin++) { vioapic->rtbl[pin].full = MASK_ALL_INTERRUPTS; } + vioapic->id = 0U; + vioapic->ioregsel = 0U; } struct vioapic *