diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/memory.h | 40 | ||||
-rw-r--r-- | include/hw/acpi/aml-build.h | 22 | ||||
-rw-r--r-- | include/hw/acpi/cpu.h | 2 | ||||
-rw-r--r-- | include/hw/arm/virt.h | 1 | ||||
-rw-r--r-- | include/hw/boards.h | 3 | ||||
-rw-r--r-- | include/hw/i386/pc.h | 5 | ||||
-rw-r--r-- | include/hw/nvram/fw_cfg.h | 9 | ||||
-rw-r--r-- | include/hw/pci-host/gpex.h | 1 | ||||
-rw-r--r-- | include/hw/qdev-core.h | 28 | ||||
-rw-r--r-- | include/hw/virtio/virtio-net.h | 9 | ||||
-rw-r--r-- | include/qemu/vhost-user-server.h | 2 |
11 files changed, 83 insertions, 39 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 0f3e6bcd5e..521d9901d7 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -97,9 +97,14 @@ typedef enum { IOMMU_NOTIFIER_UNMAP = 0x1, /* Notify entry changes (newly created entries) */ IOMMU_NOTIFIER_MAP = 0x2, + /* Notify changes on device IOTLB entries */ + IOMMU_NOTIFIER_DEVIOTLB_UNMAP = 0x04, } IOMMUNotifierFlag; -#define IOMMU_NOTIFIER_ALL (IOMMU_NOTIFIER_MAP | IOMMU_NOTIFIER_UNMAP) +#define IOMMU_NOTIFIER_IOTLB_EVENTS (IOMMU_NOTIFIER_MAP | IOMMU_NOTIFIER_UNMAP) +#define IOMMU_NOTIFIER_DEVIOTLB_EVENTS IOMMU_NOTIFIER_DEVIOTLB_UNMAP +#define IOMMU_NOTIFIER_ALL (IOMMU_NOTIFIER_IOTLB_EVENTS | \ + IOMMU_NOTIFIER_DEVIOTLB_EVENTS) struct IOMMUNotifier; typedef void (*IOMMUNotify)(struct IOMMUNotifier *notifier, @@ -116,6 +121,11 @@ struct IOMMUNotifier { }; typedef struct IOMMUNotifier IOMMUNotifier; +typedef struct IOMMUTLBEvent { + IOMMUNotifierFlag type; + IOMMUTLBEntry entry; +} IOMMUTLBEvent; + /* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */ #define RAM_PREALLOC (1 << 0) @@ -236,7 +246,7 @@ enum IOMMUMemoryRegionAttr { * The IOMMU implementation must use the IOMMU notifier infrastructure * to report whenever mappings are changed, by calling * memory_region_notify_iommu() (or, if necessary, by calling - * memory_region_notify_one() for each registered notifier). + * memory_region_notify_iommu_one() for each registered notifier). * * Conceptually an IOMMU provides a mapping from input address * to an output TLB entry. If the IOMMU is aware of memory transaction @@ -1326,39 +1336,33 @@ uint64_t memory_region_iommu_get_min_page_size(IOMMUMemoryRegion *iommu_mr); /** * memory_region_notify_iommu: notify a change in an IOMMU translation entry. * - * The notification type will be decided by entry.perm bits: - * - * - For UNMAP (cache invalidation) notifies: set entry.perm to IOMMU_NONE. - * - For MAP (newly added entry) notifies: set entry.perm to the - * permission of the page (which is definitely !IOMMU_NONE). - * * Note: for any IOMMU implementation, an in-place mapping change * should be notified with an UNMAP followed by a MAP. * * @iommu_mr: the memory region that was changed * @iommu_idx: the IOMMU index for the translation table which has changed - * @entry: the new entry in the IOMMU translation table. The entry - * replaces all old entries for the same virtual I/O address range. - * Deleted entries have .@perm == 0. + * @event: TLB event with the new entry in the IOMMU translation table. + * The entry replaces all old entries for the same virtual I/O address + * range. */ void memory_region_notify_iommu(IOMMUMemoryRegion *iommu_mr, int iommu_idx, - IOMMUTLBEntry entry); + IOMMUTLBEvent event); /** - * memory_region_notify_one: notify a change in an IOMMU translation + * memory_region_notify_iommu_one: notify a change in an IOMMU translation * entry to a single notifier * * This works just like memory_region_notify_iommu(), but it only * notifies a specific notifier, not all of them. * * @notifier: the notifier to be notified - * @entry: the new entry in the IOMMU translation table. The entry - * replaces all old entries for the same virtual I/O address range. - * Deleted entries have .@perm == 0. + * @event: TLB event with the new entry in the IOMMU translation table. + * The entry replaces all old entries for the same virtual I/O address + * range. */ -void memory_region_notify_one(IOMMUNotifier *notifier, - IOMMUTLBEntry *entry); +void memory_region_notify_iommu_one(IOMMUNotifier *notifier, + IOMMUTLBEvent *event); /** * memory_region_register_iommu_notifier: register a notifier for changes to diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h index fe0055fffb..e727bea1bc 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -224,6 +224,20 @@ struct AcpiBuildTables { BIOSLinker *linker; } AcpiBuildTables; +typedef +struct CrsRangeEntry { + uint64_t base; + uint64_t limit; +} CrsRangeEntry; + +typedef +struct CrsRangeSet { + GPtrArray *io_ranges; + GPtrArray *mem_ranges; + GPtrArray *mem_64bit_ranges; +} CrsRangeSet; + + /* * ACPI 5.0: 6.4.3.8.2 Serial Bus Connection Descriptors * Serial Bus Type @@ -432,6 +446,14 @@ build_append_gas_from_struct(GArray *table, const struct AcpiGenericAddress *s) s->access_width, s->address); } +void crs_range_insert(GPtrArray *ranges, uint64_t base, uint64_t limit); +void crs_replace_with_free_ranges(GPtrArray *ranges, + uint64_t start, uint64_t end); +void crs_range_set_init(CrsRangeSet *range_set); +void crs_range_set_free(CrsRangeSet *range_set); + +Aml *build_crs(PCIHostState *host, CrsRangeSet *range_set); + void build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base, uint64_t len, int node, MemoryAffinityFlags flags); diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index 0eeedaa491..999caaf510 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -22,6 +22,7 @@ typedef struct AcpiCpuStatus { uint64_t arch_id; bool is_inserting; bool is_removing; + bool fw_remove; uint32_t ost_event; uint32_t ost_status; } AcpiCpuStatus; @@ -50,6 +51,7 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, typedef struct CPUHotplugFeatures { bool acpi_1_compatible; bool has_legacy_cphp; + bool fw_unplugs_cpu; const char *smi_path; } CPUHotplugFeatures; diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index aad6d69841..abf54fab49 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -163,6 +163,7 @@ struct VirtMachineState { DeviceState *gic; DeviceState *acpi_dev; Notifier powerdown_notifier; + PCIBus *bus; }; #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM) diff --git a/include/hw/boards.h b/include/hw/boards.h index a49e3a6b44..f94f4ad5d8 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -310,6 +310,9 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) +extern GlobalProperty hw_compat_5_2[]; +extern const size_t hw_compat_5_2_len; + extern GlobalProperty hw_compat_5_1[]; extern const size_t hw_compat_5_1_len; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 911e460097..2aa8797c6e 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -44,6 +44,7 @@ typedef struct PCMachineState { bool sata_enabled; bool pit_enabled; bool hpet_enabled; + uint64_t max_fw_size; /* NUMA information: */ uint64_t numa_nodes; @@ -60,6 +61,7 @@ typedef struct PCMachineState { #define PC_MACHINE_SMBUS "smbus" #define PC_MACHINE_SATA "sata" #define PC_MACHINE_PIT "pit" +#define PC_MACHINE_MAX_FW_SIZE "max-fw-size" /** * PCMachineClass: @@ -191,6 +193,9 @@ void pc_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid, const CPUArchIdList *apic_ids, GArray *entry); +extern GlobalProperty pc_compat_5_2[]; +extern const size_t pc_compat_5_2_len; + extern GlobalProperty pc_compat_5_1[]; extern const size_t pc_compat_5_1_len; diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index 8a9f5738bf..0e7a8bc7af 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -308,6 +308,15 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename, void *data, bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename, const char *gen_id, Error **errp); +/** + * fw_cfg_add_extra_pci_roots: + * @bus: main pci root bus to be scanned from + * @s: fw_cfg device being modified + * + * Add a new fw_cfg item... + */ +void fw_cfg_add_extra_pci_roots(PCIBus *bus, FWCfgState *s); + FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, AddressSpace *dma_as); FWCfgState *fw_cfg_init_io(uint32_t iobase); diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index d52ea80d4e..d48a020a95 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -59,6 +59,7 @@ struct GPEXConfig { MemMapEntry mmio64; MemMapEntry pio; int irq; + PCIBus *bus; }; int gpex_set_irq_num(GPEXHost *s, int index, int gsi); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 5e737195b5..6ac86db44e 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -81,16 +81,17 @@ typedef void (*BusUnrealize)(BusState *bus); * </note> * * # Hiding a device # - * To hide a device, a DeviceListener function should_be_hidden() needs to + * To hide a device, a DeviceListener function hide_device() needs to * be registered. - * It can be used to defer adding a device and therefore hide it from the - * guest. The handler registering to this DeviceListener can save the QOpts - * passed to it for re-using it later and must return that it wants the device - * to be/remain hidden or not. When the handler function decides the device - * shall not be hidden it will be added in qdev_device_add() and - * realized as any other device. Otherwise qdev_device_add() will return early - * without adding the device. The guest will not see a "hidden" device - * until it was marked don't hide and qdev_device_add called again. + * It can be used to defer adding a device and therefore hide it from + * the guest. The handler registering to this DeviceListener can save + * the QOpts passed to it for re-using it later. It must return if it + * wants the device to be hidden or visible. When the handler function + * decides the device shall be visible it will be added with + * qdev_device_add() and realized as any other device. Otherwise + * qdev_device_add() will return early without adding the device. The + * guest will not see a "hidden" device until it was marked visible + * and qdev_device_add called again. * */ struct DeviceClass { @@ -196,11 +197,12 @@ struct DeviceListener { void (*realize)(DeviceListener *listener, DeviceState *dev); void (*unrealize)(DeviceListener *listener, DeviceState *dev); /* - * This callback is called upon init of the DeviceState and allows to - * inform qdev that a device should be hidden, depending on the device - * opts, for example, to hide a standby device. + * This callback is called upon init of the DeviceState and + * informs qdev if a device should be visible or hidden. We can + * hide a failover device depending for example on the device + * opts. */ - int (*should_be_hidden)(DeviceListener *listener, QemuOpts *device_opts); + bool (*hide_device)(DeviceListener *listener, QemuOpts *device_opts); QTAILQ_ENTRY(DeviceListener) link; }; diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index f4852ac27b..7e96d193aa 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -202,13 +202,8 @@ struct VirtIONet { AnnounceTimer announce_timer; bool needs_vnet_hdr_swap; bool mtu_bypass_backend; - QemuOpts *primary_device_opts; - QDict *primary_device_dict; - DeviceState *primary_dev; - BusState *primary_bus; - char *primary_device_id; - char *standby_id; - bool primary_should_be_hidden; + /* primary failover device is hidden*/ + bool failover_primary_hidden; bool failover; DeviceListener primary_listener; Notifier migration_state; diff --git a/include/qemu/vhost-user-server.h b/include/qemu/vhost-user-server.h index 0da4c2cc4c..121ea1dedf 100644 --- a/include/qemu/vhost-user-server.h +++ b/include/qemu/vhost-user-server.h @@ -11,7 +11,7 @@ #ifndef VHOST_USER_SERVER_H #define VHOST_USER_SERVER_H -#include "contrib/libvhost-user/libvhost-user.h" +#include "subprojects/libvhost-user/libvhost-user.h" /* only for the type definitions */ #include "io/channel-socket.h" #include "io/channel-file.h" #include "io/net-listener.h" |