mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
pc, acpi, virtio, tpm This includes pxb support by Marcel, as well as multiple enhancements all over the place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu Jun 4 11:51:02 2015 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: (28 commits) vhost: logs sharing hw/acpi: piix4_pm_init(): take fw_cfg object no more hw/acpi: move "etc/system-states" fw_cfg file from PIIX4 to core hw/acpi: acpi_pm1_cnt_init(): take "disable_s3" and "disable_s4" pc-dimm: don't assert if pc-dimm alignment != hotpluggable mem range size docs: Add PXB documentation apci: fix PXB behaviour if used with unsupported BIOS hw/pxb: add numa_node parameter hw/pci: add support for NUMA nodes hw/pxb: add map_irq func hw/pci: inform bios if the system has extra pci root buses hw/pci: introduce PCI Expander Bridge (PXB) hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query hw/acpi: remove from root bus 0 the crs resources used by other buses. hw/acpi: add _CRS method for extra root busses hw/apci: add _PRT method for extra PCI root busses hw/acpi: add support for i440fx 'snooping' root busses hw/pci: extend PCI config access to support devices behind PXB hw/i386: query only for q35/pc when looking for pci host bridge hw/pci: made pci_bus_num a PCIBusClass method ... Conflicts: hw/i386/pc_piix.c Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -91,6 +91,13 @@
|
||||
/* PM2_CNT */
|
||||
#define ACPI_BITMASK_ARB_DISABLE 0x0001
|
||||
|
||||
/* These values are part of guest ABI, and can not be changed */
|
||||
typedef enum {
|
||||
ACPI_PCI_HOTPLUG_STATUS = 2,
|
||||
ACPI_CPU_HOTPLUG_STATUS = 4,
|
||||
ACPI_MEMORY_HOTPLUG_STATUS = 8,
|
||||
} AcpiGPEStatusBits;
|
||||
|
||||
/* structs */
|
||||
typedef struct ACPIPMTimer ACPIPMTimer;
|
||||
typedef struct ACPIPM1EVT ACPIPM1EVT;
|
||||
@@ -160,7 +167,8 @@ void acpi_pm1_evt_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
|
||||
MemoryRegion *parent);
|
||||
|
||||
/* PM1a_CNT: piix and ich9 don't implement PM1b CNT. */
|
||||
void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent, uint8_t s4_val);
|
||||
void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
|
||||
bool disable_s3, bool disable_s4, uint8_t s4_val);
|
||||
void acpi_pm1_cnt_update(ACPIREGS *ar,
|
||||
bool sci_enable, bool sci_disable);
|
||||
void acpi_pm1_cnt_reset(ACPIREGS *ar);
|
||||
@@ -172,6 +180,9 @@ void acpi_gpe_reset(ACPIREGS *ar);
|
||||
void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val);
|
||||
uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr);
|
||||
|
||||
void acpi_send_gpe_event(ACPIREGS *ar, qemu_irq irq,
|
||||
AcpiGPEStatusBits status);
|
||||
|
||||
void acpi_update_sci(ACPIREGS *acpi_regs, qemu_irq irq);
|
||||
|
||||
/* acpi.c */
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include "hw/acpi/acpi.h"
|
||||
#include "migration/vmstate.h"
|
||||
|
||||
#define ACPI_MEMORY_HOTPLUG_STATUS 8
|
||||
|
||||
/**
|
||||
* MemStatus:
|
||||
* @is_removing: the memory device in slot has been requested to be ejected.
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* ONLY DEFINEs are permited in this file since it's shared
|
||||
* between C and ASL code.
|
||||
*/
|
||||
#define ACPI_CPU_HOTPLUG_STATUS 4
|
||||
|
||||
/* Limit for CPU arch IDs for CPU hotplug. All hotpluggable CPUs should
|
||||
* have CPUClass.get_arch_id() < ACPI_CPU_HOTPLUG_ID_LIMIT.
|
||||
|
||||
@@ -218,8 +218,7 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
|
||||
|
||||
I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
|
||||
qemu_irq sci_irq, qemu_irq smi_irq,
|
||||
int kvm_enabled, FWCfgState *fw_cfg,
|
||||
DeviceState **piix4_pm);
|
||||
int kvm_enabled, DeviceState **piix4_pm);
|
||||
void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
|
||||
|
||||
/* hpet.c */
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
#define PCI_DEVICE_ID_REDHAT_ROCKER 0x0006
|
||||
#define PCI_DEVICE_ID_REDHAT_SDHCI 0x0007
|
||||
#define PCI_DEVICE_ID_REDHAT_PCIE_HOST 0x0008
|
||||
#define PCI_DEVICE_ID_REDHAT_PXB 0x0009
|
||||
#define PCI_DEVICE_ID_REDHAT_QXL 0x0100
|
||||
|
||||
#define FMT_PCIBUS PRIx64
|
||||
@@ -346,6 +347,8 @@ typedef PCIINTxRoute (*pci_route_irq_fn)(void *opaque, int pin);
|
||||
|
||||
#define TYPE_PCI_BUS "PCI"
|
||||
#define PCI_BUS(obj) OBJECT_CHECK(PCIBus, (obj), TYPE_PCI_BUS)
|
||||
#define PCI_BUS_CLASS(klass) OBJECT_CLASS_CHECK(PCIBusClass, (klass), TYPE_PCI_BUS)
|
||||
#define PCI_BUS_GET_CLASS(obj) OBJECT_GET_CLASS(PCIBusClass, (obj), TYPE_PCI_BUS)
|
||||
#define TYPE_PCIE_BUS "PCIE"
|
||||
|
||||
bool pci_bus_is_express(PCIBus *bus);
|
||||
@@ -385,6 +388,7 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
|
||||
PCIDevice *pci_vga_init(PCIBus *bus);
|
||||
|
||||
int pci_bus_num(PCIBus *s);
|
||||
int pci_bus_numa_node(PCIBus *bus);
|
||||
void pci_for_each_device(PCIBus *bus, int bus_num,
|
||||
void (*fn)(PCIBus *bus, PCIDevice *d, void *opaque),
|
||||
void *opaque);
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
* use accessor functions in pci.h, pci_bridge.h
|
||||
*/
|
||||
|
||||
typedef struct PCIBusClass {
|
||||
/*< private >*/
|
||||
BusClass parent_class;
|
||||
/*< public >*/
|
||||
|
||||
bool (*is_root)(PCIBus *bus);
|
||||
int (*bus_num)(PCIBus *bus);
|
||||
uint16_t (*numa_node)(PCIBus *bus);
|
||||
} PCIBusClass;
|
||||
|
||||
struct PCIBus {
|
||||
BusState qbus;
|
||||
PCIIOMMUFunc iommu_fn;
|
||||
|
||||
@@ -28,6 +28,12 @@ typedef unsigned long vhost_log_chunk_t;
|
||||
#define VHOST_LOG_CHUNK (VHOST_LOG_PAGE * VHOST_LOG_BITS)
|
||||
#define VHOST_INVALID_FEATURE_BIT (0xff)
|
||||
|
||||
struct vhost_log {
|
||||
unsigned long long size;
|
||||
int refcnt;
|
||||
vhost_log_chunk_t log[0];
|
||||
};
|
||||
|
||||
struct vhost_memory;
|
||||
struct vhost_dev {
|
||||
MemoryListener memory_listener;
|
||||
@@ -43,7 +49,6 @@ struct vhost_dev {
|
||||
unsigned long long backend_features;
|
||||
bool started;
|
||||
bool log_enabled;
|
||||
vhost_log_chunk_t *log;
|
||||
unsigned long long log_size;
|
||||
Error *migration_blocker;
|
||||
bool force;
|
||||
@@ -52,6 +57,7 @@ struct vhost_dev {
|
||||
hwaddr mem_changed_end_addr;
|
||||
const VhostOps *vhost_ops;
|
||||
void *opaque;
|
||||
struct vhost_log *log;
|
||||
};
|
||||
|
||||
int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
|
||||
|
||||
@@ -98,7 +98,7 @@ typedef struct VirtioDeviceClass {
|
||||
DeviceUnrealize unrealize;
|
||||
uint64_t (*get_features)(VirtIODevice *vdev, uint64_t requested_features);
|
||||
uint64_t (*bad_features)(VirtIODevice *vdev);
|
||||
void (*set_features)(VirtIODevice *vdev, uint32_t val);
|
||||
void (*set_features)(VirtIODevice *vdev, uint64_t val);
|
||||
void (*get_config)(VirtIODevice *vdev, uint8_t *config);
|
||||
void (*set_config)(VirtIODevice *vdev, const uint8_t *config);
|
||||
void (*reset)(VirtIODevice *vdev);
|
||||
@@ -184,7 +184,7 @@ void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector);
|
||||
void virtio_set_status(VirtIODevice *vdev, uint8_t val);
|
||||
void virtio_reset(void *opaque);
|
||||
void virtio_update_irq(VirtIODevice *vdev);
|
||||
int virtio_set_features(VirtIODevice *vdev, uint32_t val);
|
||||
int virtio_set_features(VirtIODevice *vdev, uint64_t val);
|
||||
|
||||
/* Base devices. */
|
||||
typedef struct VirtIOBlkConf VirtIOBlkConf;
|
||||
@@ -230,19 +230,19 @@ VirtQueue *virtio_vector_next_queue(VirtQueue *vq);
|
||||
static inline void virtio_add_feature(uint64_t *features, unsigned int fbit)
|
||||
{
|
||||
assert(fbit < 64);
|
||||
*features |= (1 << fbit);
|
||||
*features |= (1ULL << fbit);
|
||||
}
|
||||
|
||||
static inline void virtio_clear_feature(uint64_t *features, unsigned int fbit)
|
||||
{
|
||||
assert(fbit < 64);
|
||||
*features &= ~(1 << fbit);
|
||||
*features &= ~(1ULL << fbit);
|
||||
}
|
||||
|
||||
static inline bool __virtio_has_feature(uint64_t features, unsigned int fbit)
|
||||
{
|
||||
assert(fbit < 64);
|
||||
return !!(features & (1 << fbit));
|
||||
return !!(features & (1ULL << fbit));
|
||||
}
|
||||
|
||||
static inline bool virtio_has_feature(VirtIODevice *vdev, unsigned int fbit)
|
||||
|
||||
Reference in New Issue
Block a user