DM: add system reset (with RAM content kept)

This function add high level reset_vdev function. Which is
implemented to call deinit/init pairing to emulate the virtual
device reset operation.

This patch also add the system reset which keep the UOS RAM
content functionality to DM.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yin Fengwei
2018-07-16 18:15:24 +08:00
committed by lijinxia
parent b33012aee8
commit 9878543356
3 changed files with 96 additions and 4 deletions

View File

@@ -827,6 +827,7 @@ pci_emul_deinit(struct vmctx *ctx, struct pci_vdev_ops *ops, int bus, int slot,
free(fi->fi_param);
if (fi->fi_devi) {
pci_lintr_release(fi->fi_devi);
pci_emul_free_bars(fi->fi_devi);
free(fi->fi_devi);
}
@@ -1621,6 +1622,25 @@ pci_lintr_request(struct pci_vdev *dev)
pci_set_cfgdata8(dev, PCIR_INTPIN, bestpin + 1);
}
void
pci_lintr_release(struct pci_vdev *dev)
{
struct businfo *bi;
struct slotinfo *si;
int pin;
bi = pci_businfo[dev->bus];
assert(bi != NULL);
si = &bi->slotinfo[dev->slot];
for (pin = 1; pin < 4; pin++) {
si->si_intpins[pin].ii_count = 0;
si->si_intpins[pin].ii_pirq_pin = 0;
si->si_intpins[pin].ii_ioapic_irq = 0;
}
}
static void
pci_lintr_route(struct pci_vdev *dev)
{