Skip to content

Commit b13882f

Browse files
ywan170lijinxia
authored andcommitted
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 <yu1.wang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 86de47b commit b13882f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hypervisor/arch/x86/guest/vioapic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ vioapic_reset(struct vioapic *vioapic)
540540
for (pin = 0U; pin < pincount; pin++) {
541541
vioapic->rtbl[pin].full = MASK_ALL_INTERRUPTS;
542542
}
543+
vioapic->id = 0U;
544+
vioapic->ioregsel = 0U;
543545
}
544546

545547
struct vioapic *

0 commit comments

Comments
 (0)