mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00

Do not reset a vfio-pci device during CPR, and do not complain if the kernel's PCI config space changes for non-emulated bits between the vmstate save and load, which can happen due to ongoing interrupt activity. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/qemu-devel/1749569991-25171-12-git-send-email-steven.sistare@oracle.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
57 lines
1.7 KiB
C
57 lines
1.7 KiB
C
/*
|
|
* VFIO CPR
|
|
*
|
|
* Copyright (c) 2025 Oracle and/or its affiliates.
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef HW_VFIO_VFIO_CPR_H
|
|
#define HW_VFIO_VFIO_CPR_H
|
|
|
|
#include "migration/misc.h"
|
|
#include "system/memory.h"
|
|
|
|
struct VFIOContainer;
|
|
struct VFIOContainerBase;
|
|
struct VFIOGroup;
|
|
|
|
typedef struct VFIOContainerCPR {
|
|
Error *blocker;
|
|
bool vaddr_unmapped;
|
|
NotifierWithReturn transfer_notifier;
|
|
MemoryListener remap_listener;
|
|
int (*saved_dma_map)(const struct VFIOContainerBase *bcontainer,
|
|
hwaddr iova, ram_addr_t size,
|
|
void *vaddr, bool readonly, MemoryRegion *mr);
|
|
} VFIOContainerCPR;
|
|
|
|
typedef struct VFIODeviceCPR {
|
|
Error *mdev_blocker;
|
|
} VFIODeviceCPR;
|
|
|
|
bool vfio_legacy_cpr_register_container(struct VFIOContainer *container,
|
|
Error **errp);
|
|
void vfio_legacy_cpr_unregister_container(struct VFIOContainer *container);
|
|
|
|
int vfio_cpr_reboot_notifier(NotifierWithReturn *notifier, MigrationEvent *e,
|
|
Error **errp);
|
|
|
|
bool vfio_cpr_register_container(struct VFIOContainerBase *bcontainer,
|
|
Error **errp);
|
|
void vfio_cpr_unregister_container(struct VFIOContainerBase *bcontainer);
|
|
|
|
int vfio_cpr_group_get_device_fd(int d, const char *name);
|
|
|
|
bool vfio_cpr_container_match(struct VFIOContainer *container,
|
|
struct VFIOGroup *group, int fd);
|
|
|
|
void vfio_cpr_giommu_remap(struct VFIOContainerBase *bcontainer,
|
|
MemoryRegionSection *section);
|
|
|
|
bool vfio_cpr_ram_discard_register_listener(
|
|
struct VFIOContainerBase *bcontainer, MemoryRegionSection *section);
|
|
|
|
extern const VMStateDescription vfio_cpr_pci_vmstate;
|
|
|
|
#endif /* HW_VFIO_VFIO_CPR_H */
|