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>
This commit is contained in:
Yu Wang 2018-07-31 22:49:36 +08:00 committed by lijinxia
parent 86de47b142
commit b13882f8bd
1 changed files with 2 additions and 0 deletions

View File

@ -540,6 +540,8 @@ vioapic_reset(struct vioapic *vioapic)
for (pin = 0U; pin < pincount; pin++) { for (pin = 0U; pin < pincount; pin++) {
vioapic->rtbl[pin].full = MASK_ALL_INTERRUPTS; vioapic->rtbl[pin].full = MASK_ALL_INTERRUPTS;
} }
vioapic->id = 0U;
vioapic->ioregsel = 0U;
} }
struct vioapic * struct vioapic *