mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-25 10:43:46 +00:00
dm/VBS-U: implement virtio_dev_error
When the device has experienced an error from which it cannot re-cover, DEVICE_NEEDS_RESET is set to the device status register and a config change intr is sent to the guest driver. Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Reviewed-by: Hao Li <hao.l.li@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -1008,6 +1008,19 @@ virtio_set_modern_bar(struct virtio_base *base, bool use_notify_pio)
|
||||
return rc;
|
||||
}
|
||||
|
||||
void
|
||||
virtio_dev_error(struct virtio_base *base)
|
||||
{
|
||||
if (base->negotiated_caps & VIRTIO_F_VERSION_1) {
|
||||
/* see 2.1.2. if DRIVER_OK is set, need to send
|
||||
* a device configuration change notification to the driver
|
||||
*/
|
||||
base->status |= VIRTIO_CR_STATUS_NEEDS_RESET;
|
||||
if (base->status & VIRTIO_CR_STATUS_DRIVER_OK)
|
||||
virtio_config_changed(base);
|
||||
}
|
||||
}
|
||||
|
||||
static struct cap_region {
|
||||
uint64_t cap_offset; /* offset of capability region */
|
||||
int cap_size; /* size of capability region */
|
||||
|
Reference in New Issue
Block a user