pci, pc, virtio: fixes, features
The following changes since commit f163448536e5f7ae8905b14547eab37a41a75f6c:
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20181216' into staging (2018-12-17 13:04:25 +0000)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to 562774d542e9be84411de0233308da380256f631:
hw/i386: Remove deprecated machines pc-0.10 and pc-0.11 (2018-12-17 22:45:59 -0500)
----------------------------------------------------------------
pci, pc, virtio: fixes, features
VTD fixes
ACPI refactoring
new names for virtio devices
multiple pcie link width/speeds
----------------------------------------------------------------
Alex Williamson (8):
pcie: Create enums for link speed and width
pci: Sync PCIe downstream port LNKSTA on read
qapi: Define PCIe link speed and width properties
pcie: Add link speed and width fields to PCIESlot
pcie: Fill PCIESlot link fields to support higher speeds and widths
pcie: Allow generic PCIe root port to specify link speed and width vfio/pci: Remove PCIe Link Status emulation
pcie: Fast PCIe root ports for new machines
Corey Minyard (1):
pc:piix4: Update smbus I/O space after a migration
Eduardo Habkost (2):
virtio: Helper for registering virtio device types
virtio: Provide version-specific variants of virtio PCI devices
Igor Mammedov (2):
hw: arm: acpi: Fix incorrect checksums in RSDP
hw: i386: Use correct RSDT length for checksum
Matthias Weckbecker (1):
hw/pci-bridge: Fix invalid free()
Peter Xu (5):
intel_iommu: dump correct iova when failed
intel_iommu: convert invalid traces into error reports
intel_iommu: dma read/write draining support
intel_iommu: remove "x-" prefix for "aw-bits"
intel_iommu: turn on IR by default
Philippe Mathieu-Daudé (4):
tests: Remove unused include
hw/smbios: Restrict access to "hw/smbios/ipmi.h" hw/smbios: Remove "smbios_ipmi.h" hw/smbios: Move to the hw/firmware/ subdirectory
Samuel Ortiz (6):
hw: acpi: The RSDP build API can return void
hw: arm: Carry RSDP specific data through AcpiRsdpData
hw: arm: Convert the RSDP build to the buid_append_foo() API
hw: arm: Support both legacy and current RSDP build
hw: acpi: Export and share the ARM RSDP build
hw: acpi: Remove AcpiRsdpDescriptor and fix tests
Thomas Huth (1):
hw/i386: Remove deprecated machines pc-0.10 and pc-0.11
Zheng Xiang (1):
pcie: set link state inactive/active after hot unplug/plug
qapi/common.json | 42 +++++
hw/i386/intel_iommu_internal.h | 3 +
hw/smbios/smbios_build.h | 4 +
hw/virtio/virtio-pci.h | 78 +++++++--
include/hw/acpi/acpi-defs.h | 19 +--
include/hw/acpi/aml-build.h | 2 +
include/hw/compat.h | 10 +-
include/hw/{smbios => firmware}/smbios.h | 0
include/hw/i386/intel_iommu.h | 1 +
include/hw/i386/pc.h | 9 +
include/hw/pci/pci.h | 13 ++
include/hw/pci/pcie.h | 1 +
include/hw/pci/pcie_port.h | 4 +
include/hw/pci/pcie_regs.h | 23 ++-
include/hw/qdev-properties.h | 8 +
include/hw/smbios/ipmi.h | 15 --
tests/acpi-utils.h | 4 +-
hw/acpi/aml-build.c | 68 ++++++++
hw/acpi/piix4.c | 1 +
hw/arm/virt-acpi-build.c | 40 +----
hw/arm/virt.c | 2 +-
hw/core/qdev-properties.c | 176 ++++++++++++++++++++
hw/display/virtio-gpu-pci.c | 7 +-
hw/display/virtio-vga.c | 7 +-
hw/i386/acpi-build.c | 46 +++---
hw/i386/intel_iommu.c | 66 ++++++--
hw/i386/pc.c | 2 +-
hw/i386/pc_piix.c | 72 +-------
hw/i386/pc_q35.c | 2 +-
hw/i386/x86-iommu.c | 2 +-
hw/pci-bridge/gen_pcie_root_port.c | 4 +
hw/pci-bridge/pcie_root_port.c | 14 ++
hw/pci/pci.c | 4 +
hw/pci/pci_bridge.c | 2 +-
hw/pci/pcie.c | 132 ++++++++++++++-
hw/smbios/smbios-stub.c | 2 +-
hw/smbios/smbios.c | 3 +-
hw/smbios/smbios_type_38-stub.c | 2 +-
hw/smbios/smbios_type_38.c | 3 +-
hw/vfio/pci.c | 9 +-
hw/virtio/virtio-crypto-pci.c | 7 +-
hw/virtio/virtio-pci.c | 271 +++++++++++++++++++++++--------
tests/acpi-utils.c | 47 +++++-
tests/bios-tables-test.c | 24 ++-
tests/cpu-plug-test.c | 4 +-
tests/vmgenid-test.c | 8 +-
vl.c | 2 +-
MAINTAINERS | 2 +-
hw/i386/trace-events | 6 -
qemu-deprecated.texi | 2 +-
tests/acceptance/virtio_version.py | 176 ++++++++++++++++++++
51 files changed, 1133 insertions(+), 318 deletions(-)
rename include/hw/{smbios => firmware}/smbios.h (100%)
delete mode 100644 include/hw/smbios/ipmi.h
create mode 100644 tests/acceptance/virtio_version.py[Qemu-devel] [PULL 01/31] pcie: set link state inactive/active after hot unplug/plug
From: Zheng Xiang <[email protected]>
When VM boots from the latest version of linux kernel, after hot-unpluging virtio-blk disks which are hotplugged into pcie-root-port, the VM's dmesg log shows:
[ 151.046242] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0001 from Slot Status [ 151.046365] pciehp 0000:00:05.0:pcie004: Slot(0-3): Attention button pressed [ 151.046369] pciehp 0000:00:05.0:pcie004: Slot(0-3): Powering off due to button press [ 151.046420] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 151.046425] pciehp 0000:00:05.0:pcie004: pciehp_green_led_blink: SLOTCTRL a8 write cmd 200 [ 151.046464] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 151.046468] pciehp 0000:00:05.0:pcie004: pciehp_set_attention_status: SLOTCTRL a8 write cmd c0 [ 156.163421] pciehp 0000:00:05.0:pcie004: pciehp_get_power_status: SLOTCTRL a8 value read 2f1 [ 156.163427] pciehp 0000:00:05.0:pcie004: pciehp_unconfigure_device: domain:bus:dev = 0000:06:00 [ 156.198736] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 156.198772] pciehp 0000:00:05.0:pcie004: pciehp_power_off_slot: SLOTCTRL a8 write cmd 400 [ 157.224124] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0018 from Slot Status [ 157.224194] pciehp 0000:00:05.0:pcie004: pciehp_green_led_off: SLOTCTRL a8 write cmd 300 [ 157.224220] pciehp 0000:00:05.0:pcie004: pciehp_check_link_active: lnk_status = 2011 [ 157.224223] pciehp 0000:00:05.0:pcie004: Slot(0-3): Link Up [ 157.224233] pciehp 0000:00:05.0:pcie004: pciehp_get_power_status: SLOTCTRL a8 value read 7f1 [ 157.224281] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 157.224285] pciehp 0000:00:05.0:pcie004: pciehp_power_on_slot: SLOTCTRL a8 write cmd 0 [ 157.224300] pciehp 0000:00:05.0:pcie004: __pciehp_link_set: lnk_ctrl = 0 [ 157.224336] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 157.224339] pciehp 0000:00:05.0:pcie004: pciehp_green_led_blink: SLOTCTRL a8 write cmd 200 [ 159.739294] pci 0000:06:00.0 id reading try 50 times with interval 20 ms to get ffffffff [ 159.739315] pciehp 0000:00:05.0:pcie004: pciehp_check_link_status: lnk_status = 2011 [ 159.739318] pciehp 0000:00:05.0:pcie004: Failed to check link status [ 159.739371] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 159.739394] pciehp 0000:00:05.0:pcie004: pciehp_power_off_slot: SLOTCTRL a8 write cmd 400 [ 160.771426] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 160.771452] pciehp 0000:00:05.0:pcie004: pciehp_green_led_off: SLOTCTRL a8 write cmd 300 [ 160.771495] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 160.771499] pciehp 0000:00:05.0:pcie004: pciehp_set_attention_status: SLOTCTRL a8 write cmd 40 [ 160.771535] pciehp 0000:00:05.0:pcie004: pending interrupts 0x0010 from Slot Status [ 160.771539] pciehp 0000:00:05.0:pcie004: pciehp_green_led_off: SLOTCTRL a8 write cmd 300
After analyzing the log information, it seems that qemu doesn't change the Link Status from active to inactive after hot-unplug. This results in the abnormal log after the linux kernel commit d331710ea78fea merged.
Furthermore, If I hotplug the same virtio-blk disk after hot-unplug, the virtio-blk would turn on and then back off.
So this patch set the Link Status inactive after hot-unplug and active after hot-plug.
--- hw/pci/pcie.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
hw/pci/pcie.c +12 -0
@@ -345,6 +345,10 @@ void pcie_cap_slot_hotplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,if (!dev->hotplugged) {pci_word_test_and_set_mask (exp_cap +PCI_EXP_SLTSTA ,PCI_EXP_SLTSTA_PDS ); +if (pci_dev->cap_present &QEMU_PCIE_LNKSTA_DLLLA ) { +pci_word_test_and_set_mask (exp_cap +PCI_EXP_LNKSTA , +PCI_EXP_LNKSTA_DLLLA ); + }return ; }
@@ -355,6 +359,10 @@ void pcie_cap_slot_hotplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,if (pci_get_function_0 (pci_dev)) {pci_word_test_and_set_mask (exp_cap +PCI_EXP_SLTSTA ,PCI_EXP_SLTSTA_PDS ); +if (pci_dev->cap_present &QEMU_PCIE_LNKSTA_DLLLA ) { +pci_word_test_and_set_mask (exp_cap +PCI_EXP_LNKSTA , +PCI_EXP_LNKSTA_DLLLA ); + }pcie_cap_slot_event (PCI_DEVICE (hotplug_dev),PCI_EXP_HP_EV_PDC |PCI_EXP_HP_EV_ABP ); }
@@ -531,6 +539,10 @@ void pcie_cap_slot_write_config(PCIDevice *dev,pci_word_test_and_clear_mask (exp_cap +PCI_EXP_SLTSTA ,PCI_EXP_SLTSTA_PDS ); +if (dev->cap_present &QEMU_PCIE_LNKSTA_DLLLA ) { +pci_word_test_and_clear_mask (exp_cap +PCI_EXP_LNKSTA , +PCI_EXP_LNKSTA_DLLLA ); + }pci_word_test_and_set_mask (exp_cap +PCI_EXP_SLTSTA ,PCI_EXP_SLTSTA_PDC ); }
Signature · 1 line
MST
[Qemu-devel] [PULL 02/31] pc:piix4: Update smbus I/O space after a migration
In reply to Michael S. TsirkinFrom: Corey Minyard <[email protected]>
Otherwise it won't be set up correctly and won't work after miigration.
--- hw/acpi/piix4.c | 1 + 1 file changed, 1 insertion(+)
hw/acpi/piix4.c +1 -0
@@ -173,6 +173,7 @@ static int vmstate_acpi_post_load(void *opaque, int version_id)PIIX4PMState *s = opaque;pm_io_space_update (s); +smbus_io_space_update (s);return 0 ; }
Signature · 1 line
MST
[Qemu-devel] [PULL 03/31] virtio: Helper for registering virtio device types
In reply to Michael S. TsirkinFrom: Eduardo Habkost <[email protected]>
Introduce a helper for registering different flavours of virtio devices. Convert code to use the helper, but keep only the existing generic types. Transitional and non-transitional device types will be added by another patch.
--- hw/virtio/virtio-pci.h | 54 ++++++++ hw/display/virtio-gpu-pci.c | 7 +- hw/display/virtio-vga.c | 7 +- hw/virtio/virtio-crypto-pci.c | 7 +- hw/virtio/virtio-pci.c | 235 ++++++++++++++++++++++++---------- 5 files changed, 230 insertions(+), 80 deletions(-)
hw/virtio/virtio-pci.h +54 -0
@@ -417,4 +417,58 @@ struct VirtIOCryptoPCI {/* Virtio ABI version, if we increment this, we break the guest driver. */ #define VIRTIO_PCI_ABI_VERSION 0 +/* Input for virtio_pci_types_register() */ +typedef struct VirtioPCIDeviceTypeInfo { +/* +* Common base class for the subclasses below. +* +* Required only if transitional_name or non_transitional_name is set. +* +* We need a separate base type instead of making all types +* inherit from generic_name for two reasons: +* 1) generic_name implements INTERFACE_PCIE_DEVICE, but +* transitional_name does not. +* 2) generic_name has the "disable-legacy" and "disable-modern" +* properties, transitional_name and non_transitional name don't. +*/ +const char *base_name; +/* +* Generic device type. Optional. +* +* Supports both transitional and non-transitional modes, +* using the disable-legacy and disable-modern properties. +* If disable-legacy=auto, (non-)transitional mode is selected +* depending on the bus where the device is plugged. +* +* Implements both INTERFACE_PCIE_DEVICE and INTERFACE_CONVENTIONAL_PCI_DEVICE, +* but PCI Express is supported only in non-transitional mode. +* +* The only type implemented by QEMU 3.1 and older. +*/ +const char *generic_name; +/* +* The transitional device type. Optional. +* +* Implements both INTERFACE_PCIE_DEVICE and INTERFACE_CONVENTIONAL_PCI_DEVICE. +*/ +const char *transitional_name; +/* +* The non-transitional device type. Optional. +* +* Implements INTERFACE_CONVENTIONAL_PCI_DEVICE only. +*/ +const char *non_transitional_name; + +/* Parent type. If NULL, TYPE_VIRTIO_PCI is used */ +const char *parent; + +/* Same as TypeInfo fields: */ +size_t instance_size; +void (*instance_init)(Object *obj); +void (*class_init)(ObjectClass *klass,void *data); +}VirtioPCIDeviceTypeInfo ; + +/* Register virtio-pci type(s). @t must be static. */ +void virtio_pci_types_register (const VirtioPCIDeviceTypeInfo *t); +#endif
hw/display/virtio-gpu-pci.c +3 -4
@@ -69,9 +69,8 @@ static void virtio_gpu_initfn(Object *obj) TYPE_VIRTIO_GPU); } -static const TypeInfo virtio_gpu_pci_info = { - .name =TYPE_VIRTIO_GPU_PCI , - .parent =TYPE_VIRTIO_PCI , +static const VirtioPCIDeviceTypeInfo virtio_gpu_pci_info = { + .generic_name =TYPE_VIRTIO_GPU_PCI , .instance_size =sizeof (VirtIOGPUPCI), .instance_init = virtio_gpu_initfn, .class_init = virtio_gpu_pci_class_init,
@@ -79,6 +78,6 @@ static const TypeInfo virtio_gpu_pci_info = {static void virtio_gpu_pci_register_types (void ) { -type_register_static (&virtio_gpu_pci_info); +virtio_pci_types_register (&virtio_gpu_pci_info); }type_init (virtio_gpu_pci_register_types)
hw/display/virtio-vga.c +3 -4
@@ -207,9 +207,8 @@ static void virtio_vga_inst_initfn(Object *obj) TYPE_VIRTIO_GPU); } -static TypeInfo virtio_vga_info = { - .name =TYPE_VIRTIO_VGA , - .parent =TYPE_VIRTIO_PCI , +static VirtioPCIDeviceTypeInfo virtio_vga_info = { + .generic_name =TYPE_VIRTIO_VGA , .instance_size =sizeof (struct VirtIOVGA ), .instance_init = virtio_vga_inst_initfn, .class_init = virtio_vga_class_init,
@@ -217,7 +216,7 @@ static TypeInfo virtio_vga_info = {static void virtio_vga_register_types (void ) { -type_register_static (&virtio_vga_info); +virtio_pci_types_register (&virtio_vga_info); }type_init (virtio_vga_register_types)
hw/virtio/virtio-crypto-pci.c +3 -4
@@ -64,9 +64,8 @@ static void virtio_crypto_initfn(Object *obj) TYPE_VIRTIO_CRYPTO); } -static const TypeInfo virtio_crypto_pci_info = { - .name =TYPE_VIRTIO_CRYPTO_PCI , - .parent =TYPE_VIRTIO_PCI , +static const VirtioPCIDeviceTypeInfo virtio_crypto_pci_info = { + .generic_name =TYPE_VIRTIO_CRYPTO_PCI , .instance_size =sizeof (VirtIOCryptoPCI), .instance_init = virtio_crypto_initfn, .class_init = virtio_crypto_pci_class_init,
@@ -74,6 +73,6 @@ static const TypeInfo virtio_crypto_pci_info = {static void virtio_crypto_pci_register_types (void ) { -type_register_static (&virtio_crypto_pci_info); +virtio_pci_types_register (&virtio_crypto_pci_info); }type_init (virtio_crypto_pci_register_types)
hw/virtio/virtio-pci.c +167 -68
356 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 04/31] virtio: Provide version-specific variants of virtio PCI devices
In reply to Michael S. TsirkinFrom: Eduardo Habkost <[email protected]>
Many of the current virtio-*-pci device types actually represent 3 different types of devices:
* virtio 1.0 non-transitional devices
* virtio 1.0 transitional devices
* virtio 0.9 ("legacy device" in virtio 1.0 terminology)
That would be just an annoyance if it didn't break our device/bus compatibility QMP interfaces. With these multi-purpose device types, there's no way to tell management software that transitional devices and legacy devices require a Conventional PCI bus.
The multi-purpose device types would also prevent us from telling management software what's the PCI vendor/device ID for them, because their PCI IDs change at runtime depending on the bus where they were plugged.
This patch adds separate device types for each of those virtio device flavors:
- virtio-*-pci: the existing multi-purpose device types
- Configurable using disable-legacy and disable-modern properties
- Legacy driver support is automatically enabled/disabled depending on the bus where it is plugged
- Supports Conventional PCI and PCI Express buses
(but Conventional PCI is incompatible with disable-legacy=off)
- Changes PCI vendor/device IDs at runtime
- virtio-*-pci-transitional: virtio-1.0 device supporting legacy drivers
- Supports Conventional PCI buses only, because
it has a PIO BAR
- virtio-*-pci-non-transitional: modern-only
- Supports both Conventional PCI and PCI Express buses
The existing TYPE_* macros for these types will point to an abstract base type, so existing casts in the code will keep working for all variants.
A simple test script (tests/acceptance/virtio_version.py) is included, to check if the new device types are equivalent to using the disable-legacy and disable-modern options.
--- hw/virtio/virtio-pci.h | 24 ++-- hw/virtio/virtio-pci.c | 60 ++++++++-- tests/acceptance/virtio_version.py | 176 +++++++++++++++++++++++++++++ 3 files changed, 236 insertions(+), 24 deletions(-) create mode 100644 tests/acceptance/virtio_version.py
hw/virtio/virtio-pci.h +12 -12
@@ -216,7 +216,7 @@ static inline void virtio_pci_disable_modern(VirtIOPCIProxy *proxy)/* * virtio-scsi-pci: This extends VirtioPCIProxy. */ -#define TYPE_VIRTIO_SCSI_PCI "virtio-scsi-pci" +#define TYPE_VIRTIO_SCSI_PCI "virtio-scsi-pci-base"#define VIRTIO_SCSI_PCI (obj) \ OBJECT_CHECK(VirtIOSCSIPCI, (obj), TYPE_VIRTIO_SCSI_PCI)
@@ -229,7 +229,7 @@ struct VirtIOSCSIPCI {/* * vhost-scsi-pci: This extends VirtioPCIProxy. */ -#define TYPE_VHOST_SCSI_PCI "vhost-scsi-pci" +#define TYPE_VHOST_SCSI_PCI "vhost-scsi-pci-base"#define VHOST_SCSI_PCI (obj) \ OBJECT_CHECK(VHostSCSIPCI, (obj), TYPE_VHOST_SCSI_PCI)
@@ -239,7 +239,7 @@ struct VHostSCSIPCI { };#endif -#define TYPE_VHOST_USER_SCSI_PCI "vhost-user-scsi-pci" +#define TYPE_VHOST_USER_SCSI_PCI "vhost-user-scsi-pci-base"#define VHOST_USER_SCSI_PCI (obj) \ OBJECT_CHECK(VHostUserSCSIPCI, (obj), TYPE_VHOST_USER_SCSI_PCI)
@@ -252,7 +252,7 @@ struct VHostUserSCSIPCI {/* * vhost-user-blk-pci: This extends VirtioPCIProxy. */ -#define TYPE_VHOST_USER_BLK_PCI "vhost-user-blk-pci" +#define TYPE_VHOST_USER_BLK_PCI "vhost-user-blk-pci-base"#define VHOST_USER_BLK_PCI (obj) \ OBJECT_CHECK(VHostUserBlkPCI, (obj), TYPE_VHOST_USER_BLK_PCI)
@@ -265,7 +265,7 @@ struct VHostUserBlkPCI {/* * virtio-blk-pci: This extends VirtioPCIProxy. */ -#define TYPE_VIRTIO_BLK_PCI "virtio-blk-pci" +#define TYPE_VIRTIO_BLK_PCI "virtio-blk-pci-base"#define VIRTIO_BLK_PCI (obj) \ OBJECT_CHECK(VirtIOBlkPCI, (obj), TYPE_VIRTIO_BLK_PCI)
@@ -277,7 +277,7 @@ struct VirtIOBlkPCI {/* * virtio-balloon-pci: This extends VirtioPCIProxy. */ -#define TYPE_VIRTIO_BALLOON_PCI "virtio-balloon-pci" +#define TYPE_VIRTIO_BALLOON_PCI "virtio-balloon-pci-base"#define VIRTIO_BALLOON_PCI (obj) \ OBJECT_CHECK(VirtIOBalloonPCI, (obj), TYPE_VIRTIO_BALLOON_PCI)
@@ -289,7 +289,7 @@ struct VirtIOBalloonPCI {/* * virtio-serial-pci: This extends VirtioPCIProxy. */ -#define TYPE_VIRTIO_SERIAL_PCI "virtio-serial-pci" +#define TYPE_VIRTIO_SERIAL_PCI "virtio-serial-pci-base"#define VIRTIO_SERIAL_PCI (obj) \ OBJECT_CHECK(VirtIOSerialPCI, (obj), TYPE_VIRTIO_SERIAL_PCI)
@@ -301,7 +301,7 @@ struct VirtIOSerialPCI {/* * virtio-net-pci: This extends VirtioPCIProxy. */ -#define TYPE_VIRTIO_NET_PCI "virtio-net-pci" +#define TYPE_VIRTIO_NET_PCI "virtio-net-pci-base"#define VIRTIO_NET_PCI (obj) \ OBJECT_CHECK(VirtIONetPCI, (obj), TYPE_VIRTIO_NET_PCI)
@@ -316,7 +316,7 @@ struct VirtIONetPCI {#ifdef CONFIG_VIRTFS -#define TYPE_VIRTIO_9P_PCI "virtio-9p-pci" +#define TYPE_VIRTIO_9P_PCI "virtio-9p-pci-base"#define VIRTIO_9P_PCI (obj) \ OBJECT_CHECK(V9fsPCIState, (obj), TYPE_VIRTIO_9P_PCI)
@@ -330,7 +330,7 @@ typedef struct V9fsPCIState {/* * virtio-rng-pci: This extends VirtioPCIProxy. */ -#define TYPE_VIRTIO_RNG_PCI "virtio-rng-pci" +#define TYPE_VIRTIO_RNG_PCI "virtio-rng-pci-base"#define VIRTIO_RNG_PCI (obj) \ OBJECT_CHECK(VirtIORngPCI, (obj), TYPE_VIRTIO_RNG_PCI)
@@ -365,7 +365,7 @@ struct VirtIOInputHIDPCI {#ifdef CONFIG_LINUX -#define TYPE_VIRTIO_INPUT_HOST_PCI "virtio-input-host-pci" +#define TYPE_VIRTIO_INPUT_HOST_PCI "virtio-input-host-pci-base"#define VIRTIO_INPUT_HOST_PCI (obj) \ OBJECT_CHECK(VirtIOInputHostPCI, (obj), TYPE_VIRTIO_INPUT_HOST_PCI)
@@ -392,7 +392,7 @@ struct VirtIOGPUPCI {/* * vhost-vsock-pci: This extends VirtioPCIProxy. */ -#define TYPE_VHOST_VSOCK_PCI "vhost-vsock-pci" +#define TYPE_VHOST_VSOCK_PCI "vhost-vsock-pci-base"#define VHOST_VSOCK_PCI (obj) \ OBJECT_CHECK(VHostVSockPCI, (obj), TYPE_VHOST_VSOCK_PCI)
hw/virtio/virtio-pci.c +48 -12
132 lines not on this page · raw message
tests/acceptance/virtio_version.py new file +176 -0
176 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 05/31] tests: Remove unused include
In reply to Michael S. TsirkinFrom: Philippe Mathieu-Daudé <[email protected]>
The "hw/smbios/smbios.h" include is not used, remove it.
--- tests/acpi-utils.c | 1 - 1 file changed, 1 deletion(-)
tests/acpi-utils.c +0 -1
@@ -15,7 +15,6 @@#include "qemu/osdep.h" #include <glib/gstdio.h> #include "qemu-common.h" -#include "hw/smbios/smbios.h" #include "qemu/bitmap.h" #include "acpi-utils.h" #include "boot-sector.h"
Signature · 1 line
MST
[Qemu-devel] [PULL 06/31] hw/smbios: Restrict access to "hw/smbios/ipmi.h"
In reply to Michael S. TsirkinFrom: Philippe Mathieu-Daudé <[email protected]>
All the consumers of "hw/smbios/ipmi.h" are located in hw/smbios/. There is no need to have this include publicly exposed, reduce the visibility by moving it in hw/smbios/.
--- include/hw/smbios/ipmi.h => hw/smbios/smbios_ipmi.h | 0 hw/smbios/smbios.c | 2 +- hw/smbios/smbios_type_38-stub.c | 2 +- hw/smbios/smbios_type_38.c | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename include/hw/smbios/ipmi.h => hw/smbios/smbios_ipmi.h (100%)
hw/smbios/smbios_ipmi.h renamed from include/hw/smbios/ipmi.h +0 -0
hw/smbios/smbios.c +1 -1
@@ -28,7 +28,7 @@#include "hw/loader.h" #include "exec/cpu-common.h" #include "smbios_build.h" -#include "hw/smbios/ipmi.h" +#include "smbios_ipmi.h" /* legacy structures and constants for <= 2.0 machines */ struct smbios_header {
hw/smbios/smbios_type_38-stub.c +1 -1
@@ -8,7 +8,7 @@*/ #include "qemu/osdep.h" -#include "hw/smbios/ipmi.h" +#include "smbios_ipmi.h" void smbios_build_type_38_table (void ) {
hw/smbios/smbios_type_38.c +1 -1
@@ -9,10 +9,10 @@#include "qemu/osdep.h" #include "hw/ipmi/ipmi.h" -#include "hw/smbios/ipmi.h" #include "hw/smbios/smbios.h" #include "qemu/error-report.h" #include "smbios_build.h" +#include "smbios_ipmi.h" /* SMBIOS type 38 - IPMI */ struct smbios_type_38 {
Signature · 1 line
MST
[Qemu-devel] [PULL 07/31] hw/smbios: Remove "smbios_ipmi.h"
In reply to Michael S. TsirkinFrom: Philippe Mathieu-Daudé <[email protected]>
This header only declare a single function: smbios_build_type_38_table(). We already have a header that declares such functions: "smbios_build.h". Move the declaration and remove the header.
--- hw/smbios/smbios_build.h | 4 ++++ hw/smbios/smbios_ipmi.h | 15 --------------- hw/smbios/smbios.c | 1 - hw/smbios/smbios_type_38-stub.c | 2 +- hw/smbios/smbios_type_38.c | 1 - 5 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 hw/smbios/smbios_ipmi.h
hw/smbios/smbios_build.h +4 -0
@@ -3,6 +3,7 @@* * Copyright (C) 2009 Hewlett-Packard Development Company, L.P. * Copyright (C) 2013 Red Hat, Inc. +* Copyright (c) 2015,2016 Corey Minyard, MontaVista Software, LLC * * Authors: * Alex Williamson <[email protected]>
@@ -96,4 +97,7 @@ extern unsigned smbios_table_cnt; smbios_table_cnt++; \ } while (0) +/* IPMI SMBIOS firmware handling */ +void smbios_build_type_38_table(void); +#endif /* QEMU_SMBIOS_BUILD_H */
hw/smbios/smbios_ipmi.h deleted +0 -15
@@ -1,15 +0,0 @@ -/* -* IPMI SMBIOS firmware handling -* -* Copyright (c) 2015,2016 Corey Minyard, MontaVista Software, LLC -* -* This work is licensed under the terms of the GNU GPL, version 2 or later. -* See the COPYING file in the top-level directory. -*/ - -#ifndef QEMU_SMBIOS_IPMI_H -#define QEMU_SMBIOS_IPMI_H - -void smbios_build_type_38_table (void ); - -#endif /* QEMU_SMBIOS_IPMI_H */
hw/smbios/smbios.c +0 -1
@@ -28,7 +28,6 @@#include "hw/loader.h" #include "exec/cpu-common.h" #include "smbios_build.h" -#include "smbios_ipmi.h" /* legacy structures and constants for <= 2.0 machines */ struct smbios_header {
hw/smbios/smbios_type_38-stub.c +1 -1
@@ -8,7 +8,7 @@*/ #include "qemu/osdep.h" -#include "smbios_ipmi.h" +#include "smbios_build.h" void smbios_build_type_38_table (void ) {
hw/smbios/smbios_type_38.c +0 -1
@@ -12,7 +12,6 @@#include "hw/smbios/smbios.h" #include "qemu/error-report.h" #include "smbios_build.h" -#include "smbios_ipmi.h" /* SMBIOS type 38 - IPMI */ struct smbios_type_38 {
Signature · 1 line
MST
[Qemu-devel] [PULL 09/31] hw/pci-bridge: Fix invalid free()
In reply to Michael S. TsirkinFrom: Matthias Weckbecker <[email protected]>
When loadvm'ing a *running* snapshot qemu crashes due to an invalid free. It's fortunately caught early by glibc heap memory corruption protection and qemu gets killed with SIGABRT.
Steps to reproduce:
1) Create VM (e.g w/ virsh define)
2) Start the VM and take a snapshot while it's running and having a PCI bridge attached
3) Destroy the VM and revert the running snapshot.
This commit fixes the issue.
--- hw/pci/pci_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci/pci_bridge.c +1 -1
@@ -241,9 +241,9 @@ void pci_bridge_update_mappings(PCIBridge *br)* while another accesses an unaffected region. */ memory_region_transaction_begin ();pci_bridge_region_del (br, br->windows); +pci_bridge_region_cleanup (br, w); br->windows =pci_bridge_region_init (br);memory_region_transaction_commit (); -pci_bridge_region_cleanup (br, w); }/* default write_config function for PCI-to-PCI bridge */
Signature · 1 line
MST
[Qemu-arm] [PULL 08/31] hw/smbios: Move to the hw/firmware/ subdirectory
In reply to Michael S. TsirkinFrom: Philippe Mathieu-Daudé <[email protected]>
SMBIOS is just another firmware interface used by some QEMU models. We will later introduce more firmware interfaces in this subdirectory.
---
include/hw/{smbios => firmware}/smbios.h | 0
hw/arm/virt.c | 2 +-
hw/i386/pc.c | 2 +-
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 2 +-
hw/smbios/smbios-stub.c | 2 +-
hw/smbios/smbios.c | 2 +-
hw/smbios/smbios_type_38.c | 2 +-
tests/bios-tables-test.c | 2 +-
vl.c | 2 +-
MAINTAINERS | 2 +-
11 files changed, 10 insertions(+), 10 deletions(-)
rename include/hw/{smbios => firmware}/smbios.h (100%)include/hw/firmware/smbios.h renamed from include/hw/smbios/smbios.h +0 -0
hw/arm/virt.c +1 -1
@@ -55,7 +55,7 @@#include "hw/intc/arm_gic.h" #include "hw/intc/arm_gicv3_common.h" #include "kvm_arm.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "qapi/visitor.h" #include "standard-headers/linux/input.h" #include "hw/arm/smmuv3.h"
hw/i386/pc.c +1 -1
@@ -37,7 +37,7 @@#include "hw/pci/pci_bus.h" #include "hw/nvram/fw_cfg.h" #include "hw/timer/hpet.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/loader.h" #include "elf.h" #include "multiboot.h"
hw/i386/pc_piix.c +1 -1
@@ -30,7 +30,7 @@#include "hw/i386/pc.h" #include "hw/i386/apic.h" #include "hw/display/ramfb.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/pci/pci.h" #include "hw/pci/pci_ids.h" #include "hw/usb.h"
hw/i386/pc_q35.c +1 -1
@@ -47,7 +47,7 @@#include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" #include "hw/display/ramfb.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/ide/pci.h" #include "hw/ide/ahci.h" #include "hw/usb.h"
hw/smbios/smbios-stub.c +1 -1
@@ -23,7 +23,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" void smbios_entry_add (QemuOpts *opts,Error **errp) {
hw/smbios/smbios.c +1 -1
@@ -24,7 +24,7 @@#include "sysemu/sysemu.h" #include "qemu/uuid.h" #include "sysemu/cpus.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/loader.h" #include "exec/cpu-common.h" #include "smbios_build.h"
hw/smbios/smbios_type_38.c +1 -1
@@ -9,7 +9,7 @@#include "qemu/osdep.h" #include "hw/ipmi/ipmi.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "qemu/error-report.h" #include "smbios_build.h"
tests/bios-tables-test.c +1 -1
@@ -13,7 +13,7 @@#include "qemu/osdep.h" #include <glib/gstdio.h> #include "qemu-common.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "qemu/bitmap.h" #include "acpi-utils.h" #include "boot-sector.h"
vl.c +1 -1
@@ -61,7 +61,7 @@ int main(int argc, char **argv)#include "hw/display/vga.h" #include "hw/bt.h" #include "sysemu/watchdog.h" -#include "hw/smbios/smbios.h" +#include "hw/firmware/smbios.h" #include "hw/acpi/acpi.h" #include "hw/xen/xen.h" #include "hw/qdev.h"
MAINTAINERS +1 -1
@@ -1260,7 +1260,7 @@ M: Michael S. Tsirkin <[email protected]> M: Igor Mammedov <[email protected]> S: Supported F: include/hw/acpi/* -F: include/hw/smbios/* +F: include/hw/firmware/smbios.h F: hw/mem/* F: hw/acpi/* F: hw/smbios/*
Signature · 1 line
MST
[Qemu-devel] [PULL 10/31] pcie: Create enums for link speed and width
In reply to Michael S. TsirkinFrom: Alex Williamson <[email protected]>
In preparation for reporting higher virtual link speeds and widths, create enums and macros to help us manage them.
--- include/hw/pci/pcie_regs.h | 23 +++++++++++++++++++++-- hw/pci/pcie.c | 7 ++++--- hw/vfio/pci.c | 3 ++- 3 files changed, 27 insertions(+), 6 deletions(-)
include/hw/pci/pcie_regs.h +21 -2
@@ -34,10 +34,29 @@/* PCI_EXP_LINK{CAP, STA} */ /* link speed */ -#define PCI_EXP_LNK_LS_25 1 +typedef enum PCIExpLinkSpeed { +QEMU_PCI_EXP_LNK_2_5GT =1 , +QEMU_PCI_EXP_LNK_5GT , +QEMU_PCI_EXP_LNK_8GT , +QEMU_PCI_EXP_LNK_16GT , +}PCIExpLinkSpeed ; + +#define QEMU_PCI_EXP_LNKCAP_MLS (speed) (speed) +#define QEMU_PCI_EXP_LNKSTA_CLS QEMU_PCI_EXP_LNKCAP_MLS + +typedef enum PCIExpLinkWidth { +QEMU_PCI_EXP_LNK_X1 =1 , +QEMU_PCI_EXP_LNK_X2 =2 , +QEMU_PCI_EXP_LNK_X4 =4 , +QEMU_PCI_EXP_LNK_X8 =8 , +QEMU_PCI_EXP_LNK_X12 =12 , +QEMU_PCI_EXP_LNK_X16 =16 , +QEMU_PCI_EXP_LNK_X32 =32 , +}PCIExpLinkWidth ;#define PCI_EXP_LNK_MLW_SHIFT ctz32(PCI_EXP_LNKCAP_MLW) -#define PCI_EXP_LNK_MLW_1 (1 << PCI_EXP_LNK_MLW_SHIFT) +#define QEMU_PCI_EXP_LNKCAP_MLW (width) (width << PCI_EXP_LNK_MLW_SHIFT) +#define QEMU_PCI_EXP_LNKSTA_NLW QEMU_PCI_EXP_LNKCAP_MLW/* PCI_EXP_LINKCAP */ #define PCI_EXP_LNKCAP_ASPMS_SHIFT ctz32(PCI_EXP_LNKCAP_ASPMS)
hw/pci/pcie.c +4 -3
@@ -68,11 +68,12 @@ pcie_cap_v1_fill(PCIDevice *dev, uint8_t port, uint8_t type, uint8_t version)pci_set_long (exp_cap +PCI_EXP_LNKCAP , (port <<PCI_EXP_LNKCAP_PN_SHIFT ) |PCI_EXP_LNKCAP_ASPMS_0S | -PCI_EXP_LNK_MLW_1 | -PCI_EXP_LNK_LS_25 ); +QEMU_PCI_EXP_LNKCAP_MLW (QEMU_PCI_EXP_LNK_X1 ) | +QEMU_PCI_EXP_LNKCAP_MLS (QEMU_PCI_EXP_LNK_2_5GT ));pci_set_word (exp_cap +PCI_EXP_LNKSTA , -PCI_EXP_LNK_MLW_1 |PCI_EXP_LNK_LS_25 ); +QEMU_PCI_EXP_LNKSTA_NLW (QEMU_PCI_EXP_LNK_X1 ) | +QEMU_PCI_EXP_LNKSTA_CLS (QEMU_PCI_EXP_LNK_2_5GT ));if (dev->cap_present &QEMU_PCIE_LNKSTA_DLLLA ) { pci_word_test_and_set_mask(exp_cap + PCI_EXP_LNKSTA,
hw/vfio/pci.c +2 -1
@@ -1897,7 +1897,8 @@ static int vfio_setup_pcie_cap(VFIOPCIDevice *vdev, int pos, uint8_t size,PCI_EXP_TYPE_ENDPOINT <<4 , PCI_EXP_FLAGS_TYPE);vfio_add_emulated_long (vdev, pos +PCI_EXP_LNKCAP , -PCI_EXP_LNK_MLW_1 |PCI_EXP_LNK_LS_25 , ~0 ); +QEMU_PCI_EXP_LNKCAP_MLW (QEMU_PCI_EXP_LNK_X1 ) | +QEMU_PCI_EXP_LNKCAP_MLS (QEMU_PCI_EXP_LNK_2_5GT ), ~0 );vfio_add_emulated_word (vdev, pos +PCI_EXP_LNKCTL ,0 , ~0 ); }
Signature · 1 line
MST
[Qemu-devel] [PULL 13/31] pcie: Add link speed and width fields to PCIESlot
In reply to Michael S. TsirkinFrom: Alex Williamson <[email protected]>
Add fields allowing the PCIe link speed and width of a PCIESlot to be configured, with an instance_post_init callback on the root port parent class to set defaults. This allows child classes to set these via properties or via their own instance_init callback, without requiring all implementions to support arbitrary user selected values.
--- include/hw/pci/pcie_port.h | 4 ++++ hw/pci-bridge/pcie_root_port.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+)
include/hw/pci/pcie_port.h +4 -0
@@ -49,6 +49,10 @@ struct PCIESlot {/* pci express switch port with slot */ uint8_t chassis;uint16_t slot; + +PCIExpLinkSpeed speed; +PCIExpLinkWidth width; +QLIST_ENTRY (PCIESlot) next; };
hw/pci-bridge/pcie_root_port.c +14 -0
@@ -140,6 +140,19 @@ static Property rp_props[] = { DEFINE_PROP_END_OF_LIST() }; +static void rp_instance_post_init (Object *obj) +{ +PCIESlot *s =PCIE_SLOT (obj); + +if (!s->speed) { + s->speed =QEMU_PCI_EXP_LNK_2_5GT ; + } + +if (!s->width) { + s->width =QEMU_PCI_EXP_LNK_X1 ; + } +} +static void rp_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);
@@ -157,6 +170,7 @@ static void rp_class_init(ObjectClass *klass, void *data)static const TypeInfo rp_info = { .name =TYPE_PCIE_ROOT_PORT , .parent =TYPE_PCIE_SLOT , + .instance_post_init = rp_instance_post_init, .class_init = rp_class_init, .abstract = true, .class_size =sizeof (PCIERootPortClass),
Signature · 1 line
MST
[Qemu-devel] [PULL 11/31] pci: Sync PCIe downstream port LNKSTA on read
In reply to Michael S. TsirkinFrom: Alex Williamson <[email protected]>
The PCIe link speed and width between a downstream device and its upstream port is negotiated on real hardware and susceptible to dynamic changes due to signal issues and power management. In the emulated device case there is no real hardware link, but we still might wish to have some consistency between endpoint and downstream port via a virtual negotiation. There is of course a real link for assigned devices and this same virtual negotiation allows the downstream port to match the endpoint, synchronizing on every read to support underlying physical hardware dynamically adjusting the link.
This negotiation is intentionally unidirectional for compatibility. If the endpoint exceeds the capabilities of the downstream port or there is no endpoint device, the downstream port reports negotiation to its maximum speed and width, matching the previous case where negotiation was absent. De-tuning the endpoint to match a virtual link doesn't seem to benefit anyone and is a condition we've thus far reported without functional issues.
Note that PCI_EXP_LNKSTA is already ignored for migration compatibility via pcie_cap_v1_fill().
--- include/hw/pci/pci.h | 13 +++++++++++++ include/hw/pci/pcie.h | 1 + hw/pci/pci.c | 4 ++++ hw/pci/pcie.c | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+)
include/hw/pci/pci.h +13 -0
@@ -737,6 +737,19 @@ static inline int pci_is_express(const PCIDevice *d)return d->cap_present &QEMU_PCI_CAP_EXPRESS ; } +static inline int pci_is_express_downstream_port (const PCIDevice *d) +{ +uint8_t type; + +if (!pci_is_express (d) || !d->exp.exp_cap) { +return 0 ; + } + + type =pcie_cap_get_type (d); + +return type ==PCI_EXP_TYPE_DOWNSTREAM || type ==PCI_EXP_TYPE_ROOT_PORT ; +} +static inline uint32_t pci_config_size (const PCIDevice *d) {return pci_is_express (d) ?PCIE_CONFIG_SPACE_SIZE :PCI_CONFIG_SPACE_SIZE ;
include/hw/pci/pcie.h +1 -0
@@ -126,6 +126,7 @@ uint16_t pcie_find_capability(PCIDevice *dev, uint16_t cap_id);void pcie_add_capability (PCIDevice *dev,uint16_t cap_id,uint8_t cap_ver,uint16_t offset,uint16_t size); +void pcie_sync_bridge_lnk (PCIDevice *dev);void pcie_ari_init (PCIDevice *dev,uint16_t offset,uint16_t nextfn);void pcie_dev_ser_num_init (PCIDevice *dev,uint16_t offset,uint64_t ser_num);
hw/pci/pci.c +4 -0
@@ -1353,6 +1353,10 @@ uint32_t pci_default_read_config(PCIDevice *d, {uint32_t val =0 ; +if (pci_is_express_downstream_port (d) && +ranges_overlap (address, len, d->exp.exp_cap +PCI_EXP_LNKSTA ,2 )) { +pcie_sync_bridge_lnk (d); + }memcpy (&val, d->config + address, len);return le32_to_cpu (val); }
hw/pci/pcie.c +39 -0
@@ -741,6 +741,45 @@ void pcie_add_capability(PCIDevice *dev,memset (dev->cmask + offset,0xFF , size); } +/* +* Sync the PCIe Link Status negotiated speed and width of a bridge with the +* downstream device. If downstream device is not present, re-write with the +* Link Capability fields. Limit width and speed to bridge capabilities for +* compatibility. Use config_read to access the downstream device since it +* could be an assigned device with volatile link information. +*/ +void pcie_sync_bridge_lnk (PCIDevice *bridge_dev) +{ +PCIBridge *br =PCI_BRIDGE (bridge_dev); +PCIBus *bus =pci_bridge_get_sec_bus (br); +PCIDevice *target = bus->devices[0 ]; +uint8_t *exp_cap = bridge_dev->config + bridge_dev->exp.exp_cap; +uint16_t lnksta, lnkcap =pci_get_word (exp_cap +PCI_EXP_LNKCAP ); + +if (!target || !target->exp.exp_cap) { + lnksta = lnkcap; + }else { + lnksta = target->config_read (target, + target->exp.exp_cap +PCI_EXP_LNKSTA , +sizeof (lnksta)); + +if ((lnksta &PCI_EXP_LNKSTA_NLW ) > (lnkcap &PCI_EXP_LNKCAP_MLW )) { + lnksta &= ~PCI_EXP_LNKSTA_NLW ; + lnksta |= lnkcap &PCI_EXP_LNKCAP_MLW ; + } + +if ((lnksta &PCI_EXP_LNKSTA_CLS ) > (lnkcap &PCI_EXP_LNKCAP_SLS )) { + lnksta &= ~PCI_EXP_LNKSTA_CLS ; + lnksta |= lnkcap &PCI_EXP_LNKCAP_SLS ; + } + } + +pci_word_test_and_clear_mask (exp_cap +PCI_EXP_LNKSTA , +PCI_EXP_LNKSTA_CLS |PCI_EXP_LNKSTA_NLW ); +pci_word_test_and_set_mask (exp_cap +PCI_EXP_LNKSTA , lnksta & + (PCI_EXP_LNKSTA_CLS |PCI_EXP_LNKSTA_NLW )); +} +/************************************************************************** * pci express extended capability helper functions */
Signature · 1 line
MST
[Qemu-devel] [PULL 12/31] qapi: Define PCIe link speed and width properties
In reply to Michael S. TsirkinFrom: Alex Williamson <[email protected]>
Create properties to be able to define speeds and widths for PCIe links. The only tricky bit here is that our get and set callbacks translate from the fixed QAPI automagic enums to those we define in PCI code to represent the actual register segment value.
--- qapi/common.json | 42 +++++++++ include/hw/qdev-properties.h | 8 ++ hw/core/qdev-properties.c | 176 +++++++++++++++++++++++++++++++++++ 3 files changed, 226 insertions(+)
qapi/common.json +42 -0
@@ -127,6 +127,48 @@ { 'enum': 'OffAutoPCIBAR', 'data': [ 'off', 'auto', 'bar0', 'bar1', 'bar2', 'bar3', 'bar4', 'bar5' ] } +## +# @PCIELinkSpeed: +# +# An enumeration of PCIe link speeds in units of GT/s +# +# @2_5: 2.5GT/s +# +# @5: 5.0GT/s +# +# @8: 8.0GT/s +# +# @16: 16.0GT/s +# +# Since: 4.0 +## +{ 'enum': 'PCIELinkSpeed', + 'data': [ '2_5', '5', '8', '16' ] } + +## +# @PCIELinkWidth: +# +# An enumeration of PCIe link width +# +# @1: x1 +# +# @2: x2 +# +# @4: x4 +# +# @8: x8 +# +# @12: x12 +# +# @16: x16 +# +# @32: x32 +# +# Since: 4.0 +## +{ 'enum': 'PCIELinkWidth', + 'data': [ '1', '2', '4', '8', '12', '16', '32' ] } + ## # @SysEmuTarget: #
include/hw/qdev-properties.h +8 -0
@@ -36,6 +36,8 @@ extern const PropertyInfo qdev_prop_uuid;extern const PropertyInfo qdev_prop_arraylen;extern const PropertyInfo qdev_prop_link;extern const PropertyInfo qdev_prop_off_auto_pcibar; +extern const PropertyInfo qdev_prop_pcie_link_speed; +extern const PropertyInfo qdev_prop_pcie_link_width;#define DEFINE_PROP (_name, _state, _field, _prop, _type) { \ .name = (_name), \
@@ -217,6 +219,12 @@ extern const PropertyInfo qdev_prop_off_auto_pcibar;#define DEFINE_PROP_OFF_AUTO_PCIBAR (_n, _s, _f, _d) \ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_off_auto_pcibar, \ OffAutoPCIBAR) +#define DEFINE_PROP_PCIE_LINK_SPEED (_n, _s, _f, _d) \ + DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_pcie_link_speed, \ + PCIExpLinkSpeed) +#define DEFINE_PROP_PCIE_LINK_WIDTH (_n, _s, _f, _d) \ + DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_pcie_link_width, \ + PCIExpLinkWidth)#define DEFINE_PROP_UUID (_name, _state, _field) { \ .name = (_name), \
hw/core/qdev-properties.c +176 -0
179 lines not on this page · raw message
Signature · 1 line
MST
[Qemu-devel] [PULL 14/31] pcie: Fill PCIESlot link fields to support higher speeds and widths
In reply to Michael S. TsirkinFrom: Alex Williamson <[email protected]>
Make use of the PCIESlot speed and width fields to update link information beyond those configured in pcie_cap_v1_fill(). This is only called for devices supporting a version 2 capability and automatically skips any non-PCIESlot devices. Only devices with increased link values generate any visible config space differences.
--- hw/pci/pcie.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+)
hw/pci/pcie.c +74 -0
@@ -27,6 +27,7 @@#include "hw/pci/msi.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pcie_regs.h" +#include "hw/pci/pcie_port.h" #include "qemu/range.h" //#define DEBUG_PCIE
@@ -87,6 +88,76 @@ pcie_cap_v1_fill(PCIDevice *dev, uint8_t port, uint8_t type, uint8_t version)pci_set_word (cmask +PCI_EXP_LNKSTA ,0 ); } +static void pcie_cap_fill_slot_lnk (PCIDevice *dev) +{ +PCIESlot *s = (PCIESlot *)object_dynamic_cast (OBJECT (dev),TYPE_PCIE_SLOT ); +uint8_t *exp_cap = dev->config + dev->exp.exp_cap; + +/* Skip anything that isn't a PCIESlot */ +if (!s) { +return ; + } + +/* Clear and fill LNKCAP from what was configured above */ +pci_long_test_and_clear_mask (exp_cap +PCI_EXP_LNKCAP , +PCI_EXP_LNKCAP_MLW |PCI_EXP_LNKCAP_SLS ); +pci_long_test_and_set_mask (exp_cap +PCI_EXP_LNKCAP , +QEMU_PCI_EXP_LNKCAP_MLW (s->width) | +QEMU_PCI_EXP_LNKCAP_MLS (s->speed)); + +/* +* Link bandwidth notification is required for all root ports and +* downstream ports supporting links wider than x1 or multiple link +* speeds. +*/ +if (s->width >QEMU_PCI_EXP_LNK_X1 || + s->speed >QEMU_PCI_EXP_LNK_2_5GT ) { +pci_long_test_and_set_mask (exp_cap +PCI_EXP_LNKCAP , +PCI_EXP_LNKCAP_LBNC ); + } + +if (s->speed >QEMU_PCI_EXP_LNK_2_5GT ) { +/* +* Hot-plug capable downstream ports and downstream ports supporting +* link speeds greater than 5GT/s must hardwire PCI_EXP_LNKCAP_DLLLARC +* to 1b. PCI_EXP_LNKCAP_DLLLARC implies PCI_EXP_LNKSTA_DLLLA, which +* we also hardwire to 1b here. 2.5GT/s hot-plug slots should also +* technically implement this, but it's not done here for compatibility. +*/ +pci_long_test_and_set_mask (exp_cap +PCI_EXP_LNKCAP , +PCI_EXP_LNKCAP_DLLLARC ); +pci_word_test_and_set_mask (exp_cap +PCI_EXP_LNKSTA , +PCI_EXP_LNKSTA_DLLLA ); + +/* +* Target Link Speed defaults to the highest link speed supported by +* the component. 2.5GT/s devices are permitted to hardwire to zero. +*/ +pci_word_test_and_clear_mask (exp_cap +PCI_EXP_LNKCTL2 , +PCI_EXP_LNKCTL2_TLS ); +pci_word_test_and_set_mask (exp_cap +PCI_EXP_LNKCTL2 , +QEMU_PCI_EXP_LNKCAP_MLS (s->speed) & +PCI_EXP_LNKCTL2_TLS ); + } + +/* +* 2.5 & 5.0GT/s can be fully described by LNKCAP, but 8.0GT/s is +* actually a reference to the highest bit supported in this register. +* We assume the device supports all link speeds. +*/ +if (s->speed >QEMU_PCI_EXP_LNK_5GT ) { +pci_long_test_and_clear_mask (exp_cap +PCI_EXP_LNKCAP2 , ~0U ); +pci_long_test_and_set_mask (exp_cap +PCI_EXP_LNKCAP2 , +PCI_EXP_LNKCAP2_SLS_2_5GB | +PCI_EXP_LNKCAP2_SLS_5_0GB | +PCI_EXP_LNKCAP2_SLS_8_0GB ); +if (s->speed >QEMU_PCI_EXP_LNK_8GT ) { +pci_long_test_and_set_mask (exp_cap +PCI_EXP_LNKCAP2 , +PCI_EXP_LNKCAP2_SLS_16_0GB ); + } + } +} +int pcie_cap_init (PCIDevice *dev,uint8_t offset,uint8_t type,uint8_t port,Error **errp)
@@ -108,6 +179,9 @@ int pcie_cap_init(PCIDevice *dev, uint8_t offset,/* Filling values common with v1 */ pcie_cap_v1_fill (dev, port, type,PCI_EXP_FLAGS_VER2 ); +/* Fill link speed and width options */ +pcie_cap_fill_slot_lnk (dev); +/* Filling v2 specific values */ pci_set_long (exp_cap +PCI_EXP_DEVCAP2 ,PCI_EXP_DEVCAP2_EFF |PCI_EXP_DEVCAP2_EETLPP );
Signature · 1 line
MST
[Qemu-devel] [PULL 15/31] pcie: Allow generic PCIe root port to specify link speed and width
In reply to Michael S. TsirkinFrom: Alex Williamson <[email protected]>
Allow users to experimentally specify speed and width values for the generic PCIe root port. Defaults remain at 2.5GT/s & x1 for compatiblity with the intent to only support changing defaults via machine types for now.
Note for libvirt testing that pcie-root-port controllers are given default names like "pci.7" which don't play well with using the "-set device.$name.$prop=$value" options accessible to us via <qemu:commandline> options. The solution is to add an <alias> to the pcie-root-port <controller>, for example:
<controller type='pci' index='7' model='pcie-root-port'>
<model name='pcie-root-port'/>
<target chassis='7' port='0x15'/>
<alias name='ua-gfx0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
</controller>The "ua-" here is a mandatory prefix. We can then use:
<qemu:commandline>
<qemu:arg value='-set'/>
<qemu:arg value='device.ua-gfx0.x-speed=8'/>
<qemu:arg value='-set'/>
<qemu:arg value='device.ua-gfx0.x-width=16'/></qemu:commandline>
or, without an alias, set globals such as:
<qemu:commandline>
<qemu:arg value='-global'/>
<qemu:arg value='pcie-root-port.x-speed=8'/>
<qemu:arg value='-global'/>
<qemu:arg value='pcie-root-port.x-width=16'/></qemu:commandline>
--- hw/pci-bridge/gen_pcie_root_port.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/pci-bridge/gen_pcie_root_port.c +4 -0
@@ -124,6 +124,10 @@ static Property gen_rp_props[] = { res_reserve.mem_pref_32, -1),DEFINE_PROP_SIZE ("pref64-reserve" , GenPCIERootPort, res_reserve.mem_pref_64,-1 ), +DEFINE_PROP_PCIE_LINK_SPEED ("x-speed" , PCIESlot, + speed,PCIE_LINK_SPEED_2_5 ), +DEFINE_PROP_PCIE_LINK_WIDTH ("x-width" , PCIESlot, + width,PCIE_LINK_WIDTH_1 ), DEFINE_PROP_END_OF_LIST() };
Signature · 1 line
MST
[Qemu-devel] [PULL 16/31] vfio/pci: Remove PCIe Link Status emulation
In reply to Michael S. TsirkinFrom: Alex Williamson <[email protected]>
Now that the downstream port will virtually negotiate itself to the link status of the downstream device, we can remove this emulation. It's not clear that it was every terribly useful anyway.
--- hw/vfio/pci.c | 6 ------ 1 file changed, 6 deletions(-)
hw/vfio/pci.c +0 -6
@@ -1901,12 +1901,6 @@ static int vfio_setup_pcie_cap(VFIOPCIDevice *vdev, int pos, uint8_t size, QEMU_PCI_EXP_LNKCAP_MLS(QEMU_PCI_EXP_LNK_2_5GT), ~0);vfio_add_emulated_word (vdev, pos +PCI_EXP_LNKCTL ,0 , ~0 ); } - -/* Mark the Link Status bits as emulated to allow virtual negotiation */ -vfio_add_emulated_word (vdev, pos +PCI_EXP_LNKSTA , -pci_get_word (vdev->pdev.config + pos + -PCI_EXP_LNKSTA ), -PCI_EXP_LNKCAP_MLW |PCI_EXP_LNKCAP_SLS ); }/*
Signature · 1 line
MST
[Qemu-devel] [PULL 17/31] pcie: Fast PCIe root ports for new machines
In reply to Michael S. TsirkinFrom: Alex Williamson <[email protected]>
Change the default speed and width for new machine types to the fastest and widest currently supported. This should be compatible to the PCIe 4.0 spec. Pre-QEMU-4.0 machine types remain at 2.5GT/s, x1 width.
--- include/hw/compat.h | 10 +++++++++- hw/pci-bridge/gen_pcie_root_port.c | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-)
include/hw/compat.h +9 -1
@@ -2,7 +2,15 @@#define HW_COMPAT_H #define HW_COMPAT_3_1 \ -/* empty */ + {\ + .driver = "pcie-root-port",\ + .property = "x-speed",\ + .value = "2_5",\ + },{\ + .driver = "pcie-root-port",\ + .property = "x-width",\ + .value = "1",\ + },#define HW_COMPAT_3_0 \/* empty */
hw/pci-bridge/gen_pcie_root_port.c +2 -2
@@ -125,9 +125,9 @@ static Property gen_rp_props[] = {DEFINE_PROP_SIZE ("pref64-reserve" , GenPCIERootPort, res_reserve.mem_pref_64,-1 ),DEFINE_PROP_PCIE_LINK_SPEED ("x-speed" , PCIESlot, - speed,PCIE_LINK_SPEED_2_5 ), + speed,PCIE_LINK_SPEED_16 ),DEFINE_PROP_PCIE_LINK_WIDTH ("x-width" , PCIESlot, - width,PCIE_LINK_WIDTH_1 ), + width,PCIE_LINK_WIDTH_32 ), DEFINE_PROP_END_OF_LIST() };
Signature · 1 line
MST
[Qemu-devel] [PULL 18/31] intel_iommu: dump correct iova when failed
In reply to Michael S. TsirkinFrom: Peter Xu <[email protected]>
The iotlb.iova can be zero if failure really happened. Dump the addr instead.
--- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/intel_iommu.c +1 -1
@@ -2540,7 +2540,7 @@ static IOMMUTLBEntry vtd_iommu_translate(IOMMUMemoryRegion *iommu, hwaddr addr, __func__,pci_bus_num (vtd_as->bus),VTD_PCI_SLOT (vtd_as->devfn),VTD_PCI_FUNC (vtd_as->devfn), - iotlb.iova); + addr); }return iotlb;
Signature · 1 line
MST
[Qemu-devel] [PULL 19/31] intel_iommu: convert invalid traces into error reports
In reply to Michael S. TsirkinFrom: Peter Xu <[email protected]>
Report more *_invalid() tracepoints to error_report_once() so that we can detect issues even without tracing enabled. Drop those tracepoints.
--- hw/i386/intel_iommu.c | 58 ++++++++++++++++++++++++++++++++----------- hw/i386/trace-events | 6 ----- 2 files changed, 43 insertions(+), 21 deletions(-)
hw/i386/intel_iommu.c +43 -15
@@ -524,7 +524,6 @@ static int vtd_get_root_entry(IntelIOMMUState *s, uint8_t index, addr = s->root + index *sizeof (*re);if (dma_memory_read (&address_space_memory, addr, re,sizeof (*re))) { -trace_vtd_re_invalid (re->rsvd, re->val); re->val =0 ;return -VTD_FR_ROOT_TABLE_INV ; }
@@ -545,7 +544,6 @@ static int vtd_get_context_entry_from_root(VTDRootEntry *root, uint8_t index,/* we have checked that root entry is present */ addr = (root->val &VTD_ROOT_ENTRY_CTP ) + index *sizeof (*ce);if (dma_memory_read (&address_space_memory, addr, ce,sizeof (*ce))) { -trace_vtd_re_invalid (root->rsvd, root->val);return -VTD_FR_CONTEXT_TABLE_INV ; } ce->lo =le64_to_cpu (ce->lo);
@@ -630,16 +628,20 @@ static inline bool vtd_ce_type_check(X86IOMMUState *x86_iommu,break ;case VTD_CONTEXT_TT_DEV_IOTLB :if (!x86_iommu->dt_supported) { +error_report_once ("%s: DT specified but not supported" , __func__);return false; }break ;case VTD_CONTEXT_TT_PASS_THROUGH :if (!x86_iommu->pt_supported) { +error_report_once ("%s: PT specified but not supported" , __func__);return false; }break ;default :/* Unknwon type */ +error_report_once ("%s: unknown ce type: %" PRIu32, __func__, +vtd_ce_get_type (ce));return false; }return true;
@@ -1003,7 +1005,9 @@ static int vtd_dev_to_context_entry(IntelIOMMUState *s, uint8_t bus_num, }if (re.rsvd || (re.val &VTD_ROOT_ENTRY_RSVD (s->aw_bits))) { -trace_vtd_re_invalid (re.rsvd, re.val); +error_report_once ("%s: invalid root entry: rsvd=0x%" PRIx64 +", val=0x%" PRIx64" (reserved nonzero)" , + __func__, re.rsvd, re.val);return -VTD_FR_ROOT_ENTRY_RSVD ; }
@@ -1020,19 +1024,23 @@ static int vtd_dev_to_context_entry(IntelIOMMUState *s, uint8_t bus_num,if ((ce->hi &VTD_CONTEXT_ENTRY_RSVD_HI ) || (ce->lo &VTD_CONTEXT_ENTRY_RSVD_LO (s->aw_bits))) { -trace_vtd_ce_invalid (ce->hi, ce->lo); +error_report_once ("%s: invalid context entry: hi=%" PRIx64 +", lo=%" PRIx64" (reserved nonzero)" , + __func__, ce->hi, ce->lo);return -VTD_FR_CONTEXT_ENTRY_RSVD ; }/* Check if the programming of context-entry is valid */ if (!vtd_is_level_supported (s,vtd_ce_get_level (ce))) { -trace_vtd_ce_invalid (ce->hi, ce->lo); +error_report_once ("%s: invalid context entry: hi=%" PRIx64 +", lo=%" PRIx64" (level %d not supported)" , + __func__, ce->hi, ce->lo,vtd_ce_get_level (ce));return -VTD_FR_CONTEXT_ENTRY_INV ; }/* Do translation type check */ if (!vtd_ce_type_check (x86_iommu, ce)) { -trace_vtd_ce_invalid (ce->hi, ce->lo); +/* Errors dumped in vtd_ce_type_check() */ return -VTD_FR_CONTEXT_ENTRY_INV ; }
@@ -1878,7 +1886,9 @@ static bool vtd_process_wait_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc) {if ((inv_desc->hi &VTD_INV_DESC_WAIT_RSVD_HI ) || (inv_desc->lo &VTD_INV_DESC_WAIT_RSVD_LO )) { -trace_vtd_inv_desc_wait_invalid (inv_desc->hi, inv_desc->lo); +error_report_once ("%s: invalid wait desc: hi=%" PRIx64", lo=%" PRIx64 +" (reserved nonzero)" , __func__, inv_desc->hi, + inv_desc->lo);return false; }if (inv_desc->lo &VTD_INV_DESC_WAIT_SW ) {
@@ -1901,7 +1911,9 @@ static bool vtd_process_wait_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc)/* Interrupt flag */ vtd_generate_completion_event (s); }else { -trace_vtd_inv_desc_wait_invalid (inv_desc->hi, inv_desc->lo); +error_report_once ("%s: invalid wait desc: hi=%" PRIx64", lo=%" PRIx64 +" (unknown type)" , __func__, inv_desc->hi, + inv_desc->lo);return false; }return true;
@@ -1913,7 +1925,9 @@ static bool vtd_process_context_cache_desc(IntelIOMMUState *s,uint16_t sid, fmask;if ((inv_desc->lo &VTD_INV_DESC_CC_RSVD ) || inv_desc->hi) { -trace_vtd_inv_desc_cc_invalid (inv_desc->hi, inv_desc->lo); +error_report_once ("%s: invalid cc inv desc: hi=%" PRIx64", lo=%" PRIx64 +" (reserved nonzero)" , __func__, inv_desc->hi, + inv_desc->lo);return false; }switch (inv_desc->lo &VTD_INV_DESC_CC_G ) {
@@ -1932,7 +1946,9 @@ static bool vtd_process_context_cache_desc(IntelIOMMUState *s,break ;default : -trace_vtd_inv_desc_cc_invalid (inv_desc->hi, inv_desc->lo); +error_report_once ("%s: invalid cc inv desc: hi=%" PRIx64", lo=%" PRIx64 +" (invalid type)" , __func__, inv_desc->hi, + inv_desc->lo);return false; }return true;
@@ -1946,7 +1962,9 @@ static bool vtd_process_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc)if ((inv_desc->lo &VTD_INV_DESC_IOTLB_RSVD_LO ) || (inv_desc->hi &VTD_INV_DESC_IOTLB_RSVD_HI )) { -trace_vtd_inv_desc_iotlb_invalid (inv_desc->hi, inv_desc->lo); +error_report_once ("%s: invalid iotlb inv desc: hi=0x%" PRIx64 +", lo=0x%" PRIx64" (reserved bits unzero)\n" , + __func__, inv_desc->hi, inv_desc->lo);return false; }
@@ -1965,14 +1983,20 @@ static bool vtd_process_iotlb_desc(IntelIOMMUState *s, VTDInvDesc *inv_desc) addr =VTD_INV_DESC_IOTLB_ADDR (inv_desc->hi); am =VTD_INV_DESC_IOTLB_AM (inv_desc->hi);if (am >VTD_MAMV ) { -trace_vtd_inv_desc_iotlb_invalid (inv_desc->hi, inv_desc->lo); +error_report_once ("%s: invalid iotlb inv desc: hi=0x%" PRIx64 +", lo=0x%" PRIx64" (am=%u > VTD_MAMV=%u)\n" , + __func__, inv_desc->hi, inv_desc->lo, + am, (unsigned )VTD_MAMV );return false; }vtd_iotlb_page_invalidate (s, domain_id, addr, am);break ;default : -trace_vtd_inv_desc_iotlb_invalid (inv_desc->hi, inv_desc->lo); +error_report_once ("%s: invalid iotlb inv desc: hi=0x%" PRIx64 +", lo=0x%" PRIx64" (type mismatch: 0x%llx)\n" , + __func__, inv_desc->hi, inv_desc->lo, + inv_desc->lo &VTD_INV_DESC_IOTLB_G );return false; }return true;
@@ -2012,7 +2036,9 @@ static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s,if ((inv_desc->lo &VTD_INV_DESC_DEVICE_IOTLB_RSVD_LO ) || (inv_desc->hi &VTD_INV_DESC_DEVICE_IOTLB_RSVD_HI )) { -trace_vtd_inv_desc_iotlb_invalid (inv_desc->hi, inv_desc->lo); +error_report_once ("%s: invalid dev-iotlb inv desc: hi=%" PRIx64 +", lo=%" PRIx64" (reserved nonzero)" , __func__, + inv_desc->hi, inv_desc->lo);return false; }
@@ -2103,7 +2129,9 @@ static bool vtd_process_inv_desc(IntelIOMMUState *s)break ;default : -trace_vtd_inv_desc_invalid (inv_desc.hi, inv_desc.lo); +error_report_once ("%s: invalid inv desc: hi=%" PRIx64", lo=%" PRIx64 +" (unknown type)" , __func__, inv_desc.hi, + inv_desc.lo);return false; } s->iq_head++;
hw/i386/trace-events +0 -6
@@ -5,19 +5,15 @@ x86_iommu_iec_notify(bool global, uint32_t index, uint32_t mask) "Notify IEC inv # hw/i386/intel_iommu.c vtd_inv_desc(const char *type, uint64_t hi, uint64_t lo) "invalidate desc type %s high 0x%"PRIx64" low 0x%"PRIx64 -vtd_inv_desc_invalid(uint64_t hi, uint64_t lo) "invalid inv desc hi 0x%"PRIx64" lo 0x%"PRIx64 vtd_inv_desc_cc_domain(uint16_t domain) "context invalidate domain 0x%"PRIx16 vtd_inv_desc_cc_global(void) "context invalidate globally" vtd_inv_desc_cc_device(uint8_t bus, uint8_t dev, uint8_t fn) "context invalidate device %02"PRIx8":%02"PRIx8".%02"PRIx8 vtd_inv_desc_cc_devices(uint16_t sid, uint16_t fmask) "context invalidate devices sid 0x%"PRIx16" fmask 0x%"PRIx16 -vtd_inv_desc_cc_invalid(uint64_t hi, uint64_t lo) "invalid context-cache desc hi 0x%"PRIx64" lo 0x%"PRIx64 vtd_inv_desc_iotlb_global(void) "iotlb invalidate global" vtd_inv_desc_iotlb_domain(uint16_t domain) "iotlb invalidate whole domain 0x%"PRIx16 vtd_inv_desc_iotlb_pages(uint16_t domain, uint64_t addr, uint8_t mask) "iotlb invalidate domain 0x%"PRIx16" addr 0x%"PRIx64" mask 0x%"PRIx8 -vtd_inv_desc_iotlb_invalid(uint64_t hi, uint64_t lo) "invalid iotlb desc hi 0x%"PRIx64" lo 0x%"PRIx64 vtd_inv_desc_wait_sw(uint64_t addr, uint32_t data) "wait invalidate status write addr 0x%"PRIx64" data 0x%"PRIx32 vtd_inv_desc_wait_irq(const char *msg) "%s" -vtd_inv_desc_wait_invalid(uint64_t hi, uint64_t lo) "invalid wait desc hi 0x%"PRIx64" lo 0x%"PRIx64 vtd_inv_desc_wait_write_fail(uint64_t hi, uint64_t lo) "write fail for wait desc hi 0x%"PRIx64" lo 0x%"PRIx64 vtd_inv_desc_iec(uint32_t granularity, uint32_t index, uint32_t mask) "granularity 0x%"PRIx32" index 0x%"PRIx32" mask 0x%"PRIx32 vtd_inv_qi_enable(bool enable) "enabled %d"
@@ -27,9 +23,7 @@ vtd_inv_qi_tail(uint16_t head) "write tail %d" vtd_inv_qi_fetch(void) "" vtd_context_cache_reset(void) "" vtd_re_not_present(uint8_t bus) "Root entry bus %"PRIu8" not present" -vtd_re_invalid(uint64_t hi, uint64_t lo) "invalid root entry hi 0x%"PRIx64" lo 0x%"PRIx64 vtd_ce_not_present(uint8_t bus, uint8_t devfn) "Context entry bus %"PRIu8" devfn %"PRIu8" not present" -vtd_ce_invalid(uint64_t hi, uint64_t lo) "invalid context entry hi 0x%"PRIx64" lo 0x%"PRIx64 vtd_iotlb_page_hit(uint16_t sid, uint64_t addr, uint64_t slpte, uint16_t domain) "IOTLB page hit sid 0x%"PRIx16" iova 0x%"PRIx64" slpte 0x%"PRIx64" domain 0x%"PRIx16 vtd_iotlb_page_update(uint16_t sid, uint64_t addr, uint64_t slpte, uint16_t domain) "IOTLB page update sid 0x%"PRIx16" iova 0x%"PRIx64" slpte 0x%"PRIx64" domain 0x%"PRIx16 vtd_iotlb_cc_hit(uint8_t bus, uint8_t devfn, uint64_t high, uint64_t low, uint32_t gen) "IOTLB context hit bus 0x%"PRIx8" devfn 0x%"PRIx8" high 0x%"PRIx64" low 0x%"PRIx64" gen %"PRIu32
Signature · 1 line
MST
[Qemu-devel] [PULL 20/31] intel_iommu: dma read/write draining support
In reply to Michael S. TsirkinFrom: Peter Xu <[email protected]>
Support DMA read/write draining should be easy for existing VT-d emulation since the emulation itself does not have any request queue there so we don't need to do anything to flush the un-commited queue. What we need to do is to declare the support.
These capabilities are required to pass Windows SVVP test program. It is verified that when with parameters "x-aw-bits=48,caching-mode=off" we can pass the Windows SVVP test with this patch applied. Otherwise we'll fail with:
IOMMU[0] - DWD (DMA write draining) not supported IOMMU[0] - DWD (DMA read draining) not supported Segment 0 has no DMA remapping capable IOMMU units
However since these bits are not declared support for QEMU<=3.1, we'll need a compatibility bit for it and we turn this on by default only for QEMU>=4.0.
Please refer to VT-d spec 6.5.4 for more information.
--- hw/i386/intel_iommu_internal.h | 3 +++ include/hw/i386/intel_iommu.h | 1 + include/hw/i386/pc.h | 5 +++++ hw/i386/intel_iommu.c | 4 ++++ 4 files changed, 13 insertions(+)
hw/i386/intel_iommu_internal.h +3 -0
@@ -203,6 +203,9 @@#define VTD_CAP_MAMV (VTD_MAMV << 48)#define VTD_CAP_PSI (1ULL << 39)#define VTD_CAP_SLLPS ((1ULL << 34) | (1ULL << 35)) +#define VTD_CAP_DRAIN_WRITE (1ULL << 54) +#define VTD_CAP_DRAIN_READ (1ULL << 55) +#define VTD_CAP_DRAIN (VTD_CAP_DRAIN_READ | VTD_CAP_DRAIN_WRITE)#define VTD_CAP_CM (1ULL << 7)/* Supported Adjusted Guest Address Widths */
include/hw/i386/intel_iommu.h +1 -0
@@ -245,6 +245,7 @@ struct IntelIOMMUState {OnOffAuto intr_eim;/* Toggle for EIM cabability */ bool buggy_eim;/* Force buggy EIM unless eim=off */ uint8_t aw_bits;/* Host/IOVA address width (in bits) */ +bool dma_drain;/* Whether DMA r/w draining enabled */ /* * Protects IOMMU states in general. Currently it protects the
include/hw/i386/pc.h +5 -0
@@ -296,6 +296,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);#define PC_COMPAT_3_1 \ HW_COMPAT_3_1 \ + {\ + .driver = "intel-iommu",\ + .property = "dma-drain",\ + .value = "off",\ + },#define PC_COMPAT_3_0 \ HW_COMPAT_3_0 \
hw/i386/intel_iommu.c +4 -0
@@ -2659,6 +2659,7 @@ static Property vtd_properties[] = {DEFINE_PROP_UINT8 ("x-aw-bits" , IntelIOMMUState, aw_bits,VTD_HOST_ADDRESS_WIDTH ),DEFINE_PROP_BOOL ("caching-mode" , IntelIOMMUState, caching_mode, FALSE), +DEFINE_PROP_BOOL ("dma-drain" , IntelIOMMUState, dma_drain, true), DEFINE_PROP_END_OF_LIST(), };
@@ -3147,6 +3148,9 @@ static void vtd_init(IntelIOMMUState *s) s->cap =VTD_CAP_FRO |VTD_CAP_NFR |VTD_CAP_ND |VTD_CAP_MAMV |VTD_CAP_PSI |VTD_CAP_SLLPS | VTD_CAP_SAGAW_39bit |VTD_CAP_MGAW (s->aw_bits); +if (s->dma_drain) { + s->cap |=VTD_CAP_DRAIN ; + }if (s->aw_bits ==VTD_HOST_AW_48BIT ) { s->cap |= VTD_CAP_SAGAW_48bit; }
Signature · 1 line
MST
[Qemu-devel] [PULL 21/31] intel_iommu: remove "x-" prefix for "aw-bits"
In reply to Michael S. TsirkinFrom: Peter Xu <[email protected]>
We're going to have 57bits aw-bits support sooner. It's possibly time to remove the "x-" prefix.
--- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/intel_iommu.c +1 -1
@@ -2656,7 +2656,7 @@ static Property vtd_properties[] = {DEFINE_PROP_ON_OFF_AUTO ("eim" , IntelIOMMUState, intr_eim,ON_OFF_AUTO_AUTO ),DEFINE_PROP_BOOL ("x-buggy-eim" , IntelIOMMUState, buggy_eim, false), -DEFINE_PROP_UINT8 ("x-aw-bits" , IntelIOMMUState, aw_bits, +DEFINE_PROP_UINT8 ("aw-bits" , IntelIOMMUState, aw_bits,VTD_HOST_ADDRESS_WIDTH ),DEFINE_PROP_BOOL ("caching-mode" , IntelIOMMUState, caching_mode, FALSE), DEFINE_PROP_BOOL("dma-drain", IntelIOMMUState, dma_drain, true),
Signature · 1 line
MST
[Qemu-devel] [PULL 22/31] intel_iommu: turn on IR by default
In reply to Michael S. TsirkinFrom: Peter Xu <[email protected]>
IR has been there for a long time and long time no bug reported. Let's turn it on by default to match general hardwares. Providing compatibility bit for QEMU<=3.1.
--- include/hw/i386/pc.h | 4 ++++ hw/i386/x86-iommu.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
include/hw/i386/pc.h +4 -0
@@ -300,6 +300,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "intel-iommu",\ .property = "dma-drain",\ .value = "off",\ + },{\ + .driver = "x86-iommu",\ + .property = "intremap",\ + .value = "off",\ },#define PC_COMPAT_3_0 \
hw/i386/x86-iommu.c +1 -1
@@ -135,7 +135,7 @@ static void x86_iommu_realize(DeviceState *dev, Error **errp) }static Property x86_iommu_properties[] = { -DEFINE_PROP_BOOL ("intremap" , X86IOMMUState, intr_supported, false), +DEFINE_PROP_BOOL ("intremap" , X86IOMMUState, intr_supported, true),DEFINE_PROP_BOOL ("device-iotlb" , X86IOMMUState, dt_supported, false),DEFINE_PROP_BOOL ("pt" , X86IOMMUState, pt_supported, true),DEFINE_PROP_END_OF_LIST (),
Signature · 1 line
MST
[Qemu-devel] [PULL 25/31] hw: i386: Use correct RSDT length for checksum
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
AcpiRsdpDescriptor describes revision 2 RSDP table so using sizeof(*rsdp) for checksum calculation isn't correct since we are adding extra 16 bytes. But acpi_data_push() zeroes out table, so just by luck we are summing up exta zeros which still yelds correct checksum.
Fix it up by explicitly stating table size instead of using pointer arithmetics on stucture.
PS:
Extra 16 bytes are still wasted, but droping them will break migration for machines older than 2.3 due to size mismatch, for 2.3 and older it's not an issue since they are using resizable memory regions (a1666142d) for ACPI blobs. So keep wasting memory to avoid breaking old machines.
--- hw/i386/acpi-build.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
hw/i386/acpi-build.c +6 -1
@@ -2550,6 +2550,11 @@ build_amd_iommu(GArray *table_data, BIOSLinker *linker)static void build_rsdp (GArray *rsdp_table,BIOSLinker *linker,unsigned rsdt_tbl_offset) { +/* AcpiRsdpDescriptor describes revision 2 RSDP table and as result we +* allocate extra 16 bytes for pc/q35 RSDP rev1 as well. Keep extra 16 bytes +* wasted to make sure we won't breake migration for machine types older +* than 2.3 due to size mismatch. +*/ AcpiRsdpDescriptor *rsdp =acpi_data_push (rsdp_table,sizeof *rsdp);unsigned rsdt_pa_size =sizeof (rsdp->rsdt_physical_address); unsigned rsdt_pa_offset =
@@ -2567,7 +2572,7 @@ build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned rsdt_tbl_offset)/* Checksum to be filled by Guest linker */ bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , - (char *)rsdp - rsdp_table->data,sizeof *rsdp, + (char *)rsdp - rsdp_table->data,20 /* ACPI rev 1.0 RSDP size */ , (char *)&rsdp->checksum - rsdp_table->data); }
Signature · 1 line
MST
[Qemu-arm] [PULL 23/31] hw: acpi: The RSDP build API can return void
In reply to Michael S. TsirkinFrom: Samuel Ortiz <[email protected]>
For both x86 and ARM architectures, the internal RSDP build API can return void as the current return value is unused.
--- hw/arm/virt-acpi-build.c | 4 +--- hw/i386/acpi-build.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
hw/arm/virt-acpi-build.c +1 -3
@@ -367,7 +367,7 @@ static void acpi_dsdt_add_power_button(Aml *scope) }/* RSDP */ -static GArray * +static void build_rsdp (GArray *rsdp_table,BIOSLinker *linker,unsigned xsdt_tbl_offset) {AcpiRsdpDescriptor *rsdp =acpi_data_push (rsdp_table,sizeof *rsdp);
@@ -392,8 +392,6 @@ build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned xsdt_tbl_offset)bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , (char *)rsdp - rsdp_table->data,sizeof *rsdp, (char *)&rsdp->checksum - rsdp_table->data); - -return rsdp_table; } static void
hw/i386/acpi-build.c +1 -3
@@ -2547,7 +2547,7 @@ build_amd_iommu(GArray *table_data, BIOSLinker *linker) "IVRS", table_data->len - iommu_start, 1, NULL, NULL); } -static GArray * +static void build_rsdp (GArray *rsdp_table,BIOSLinker *linker,unsigned rsdt_tbl_offset) {AcpiRsdpDescriptor *rsdp =acpi_data_push (rsdp_table,sizeof *rsdp);
@@ -2569,8 +2569,6 @@ build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned rsdt_tbl_offset)bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , (char *)rsdp - rsdp_table->data,sizeof *rsdp, (char *)&rsdp->checksum - rsdp_table->data); - -return rsdp_table; } typedef
Signature · 1 line
MST
[Qemu-arm] [PULL 24/31] hw: arm: acpi: Fix incorrect checksums in RSDP
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
When RSDP table was introduced (d4bec5d87), we calculated only legacy checksum, and that was incorrect as it
- specified rev=2 and forgot about extended checksum.
- legacy checksum calculated on full table instead of the 1st 20 bytes
Fix it by adding extended checksum calculation and using correct size for legacy checksum.
While at it use explicit constants to specify sub/full tables
sizes instead of relying on AcpiRsdpDescriptor size and fields offsets. The follow up commits will convert this table to build_append_int_noprefix() API, will use constants anyway and remove unused AcpiRsdpDescriptor structure.
Based on "[PATCH v5 05/24] hw: acpi: Implement XSDT support for RSDP" by Samuel Ortiz, who did it right in his impl.
--- hw/arm/virt-acpi-build.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -1
@@ -390,8 +390,13 @@ build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned xsdt_tbl_offset)/* Checksum to be filled by Guest linker */ bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , - (char *)rsdp - rsdp_table->data,sizeof *rsdp, + (char *)rsdp - rsdp_table->data,20 /* ACPI rev 1.0 RSDP size */ , (char *)&rsdp->checksum - rsdp_table->data); + +/* Extended checksum to be filled by Guest linker */ +bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , + (char *)rsdp - rsdp_table->data,36 /* ACPI rev 2.0 RSDP size */ , + (char *)&rsdp->extended_checksum - rsdp_table->data); } static void
Signature · 1 line
MST
[Qemu-devel] [PULL 26/31] hw: arm: Carry RSDP specific data through AcpiRsdpData
In reply to Michael S. TsirkinFrom: Samuel Ortiz <[email protected]>
That will allow us to generalize the ARM build_rsdp() routine to support both legacy RSDP (The current i386 implementation) and extended RSDP (The ARM implementation).
--- include/hw/acpi/acpi-defs.h | 8 ++++++++ hw/arm/virt-acpi-build.c | 18 +++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-)
include/hw/acpi/acpi-defs.h +8 -0
@@ -53,6 +53,14 @@ struct AcpiRsdpDescriptor { /* Root System Descriptor Pointer */ }QEMU_PACKED ;typedef struct AcpiRsdpDescriptor AcpiRsdpDescriptor ; +typedef struct AcpiRsdpData { +uint8_t oem_id[6 ];/* OEM identification */ +uint8_t revision;/* Must be 0 for 1.0, 2 for 2.0 */ + +unsigned *rsdt_tbl_offset; +unsigned *xsdt_tbl_offset; +}AcpiRsdpData ; +/* Table structure from Linux kernel (the ACPI tables are under the BSD license) */
hw/arm/virt-acpi-build.c +13 -5
@@ -368,7 +368,7 @@ static void acpi_dsdt_add_power_button(Aml *scope)/* RSDP */ static void -build_rsdp (GArray *rsdp_table,BIOSLinker *linker,unsigned xsdt_tbl_offset) +build_rsdp (GArray *rsdp_table,BIOSLinker *linker,AcpiRsdpData *rsdp_data) {AcpiRsdpDescriptor *rsdp =acpi_data_push (rsdp_table,sizeof *rsdp);unsigned xsdt_pa_size =sizeof (rsdp->xsdt_physical_address);
@@ -379,14 +379,14 @@ build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned xsdt_tbl_offset) true /* fseg memory */);memcpy (&rsdp->signature,"RSD PTR " ,sizeof (rsdp->signature)); -memcpy (rsdp->oem_id,ACPI_BUILD_APPNAME6 ,sizeof (rsdp->oem_id)); +memcpy (rsdp->oem_id, rsdp_data->oem_id,sizeof (rsdp->oem_id)); rsdp->length =cpu_to_le32 (sizeof (*rsdp)); - rsdp->revision =0x02 ; + rsdp->revision = rsdp_data->revision;/* Address to be filled by Guest linker */ bios_linker_loader_add_pointer (linker,ACPI_BUILD_RSDP_FILE , xsdt_pa_offset, xsdt_pa_size, -ACPI_BUILD_TABLE_FILE , xsdt_tbl_offset); +ACPI_BUILD_TABLE_FILE , *rsdp_data->xsdt_tbl_offset);/* Checksum to be filled by Guest linker */ bios_linker_loader_add_checksum(linker, ACPI_BUILD_RSDP_FILE,
@@ -857,7 +857,15 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)build_xsdt (tables_blob, tables->linker, table_offsets,NULL ,NULL );/* RSDP is in FSEG memory, so allocate it separately */ -build_rsdp (tables->rsdp, tables->linker, xsdt); + { +AcpiRsdpData rsdp_data = { + .revision =2 , + .oem_id =ACPI_BUILD_APPNAME6 , + .xsdt_tbl_offset = &xsdt, + .rsdt_tbl_offset =NULL , + }; +build_rsdp (tables->rsdp, tables->linker, &rsdp_data); + }/* Cleanup memory that's no longer used. */ g_array_free (table_offsets, true);
Signature · 1 line
MST
[Qemu-devel] [PULL 27/31] hw: arm: Convert the RSDP build to the buid_append_foo() API
In reply to Michael S. TsirkinFrom: Samuel Ortiz <[email protected]>
Instead of filling a mapped and packed C structure field in random order and being careful about endianness and sizes, build_rsdp() now uses build_append_int_noprefix() to compose RSDP table.
This makes reviewing and maintaining code easier as this is almost matching 1:1 the ACPI spec itself.
--- hw/arm/virt-acpi-build.c | 42 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 19 deletions(-)
hw/arm/virt-acpi-build.c +23 -19
@@ -368,35 +368,39 @@ static void acpi_dsdt_add_power_button(Aml *scope)/* RSDP */ static void -build_rsdp (GArray *rsdp_table,BIOSLinker *linker,AcpiRsdpData *rsdp_data) +build_rsdp (GArray *tbl,BIOSLinker *linker,AcpiRsdpData *rsdp_data) { -AcpiRsdpDescriptor *rsdp =acpi_data_push (rsdp_table,sizeof *rsdp); -unsigned xsdt_pa_size =sizeof (rsdp->xsdt_physical_address); -unsigned xsdt_pa_offset = - (char *)&rsdp->xsdt_physical_address - rsdp_table->data; +int tbl_off = tbl->len;/* Table offset in the RSDP file */ -bios_linker_loader_alloc (linker,ACPI_BUILD_RSDP_FILE , rsdp_table,16 , +bios_linker_loader_alloc (linker,ACPI_BUILD_RSDP_FILE , tbl,16 , true/* fseg memory */ ); -memcpy (&rsdp->signature,"RSD PTR " ,sizeof (rsdp->signature)); -memcpy (rsdp->oem_id, rsdp_data->oem_id,sizeof (rsdp->oem_id)); - rsdp->length =cpu_to_le32 (sizeof (*rsdp)); - rsdp->revision = rsdp_data->revision; +g_array_append_vals (tbl,"RSD PTR " ,8 );/* Signature */ +build_append_int_noprefix (tbl,0 ,1 );/* Checksum */ +g_array_append_vals (tbl, rsdp_data->oem_id,6 );/* OEMID */ +build_append_int_noprefix (tbl, rsdp_data->revision,1 );/* Revision */ +build_append_int_noprefix (tbl,0 ,4 );/* RsdtAddress */ +build_append_int_noprefix (tbl,36 ,4 );/* Length */ -/* Address to be filled by Guest linker */ -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_RSDP_FILE , xsdt_pa_offset, xsdt_pa_size, -ACPI_BUILD_TABLE_FILE , *rsdp_data->xsdt_tbl_offset); +/* XSDT address to be filled by guest linker */ +build_append_int_noprefix (tbl,0 ,8 );/* XsdtAddress */ +bios_linker_loader_add_pointer (linker,ACPI_BUILD_RSDP_FILE , + tbl_off +24 ,8 , +ACPI_BUILD_TABLE_FILE , + *rsdp_data->xsdt_tbl_offset); -/* Checksum to be filled by Guest linker */ +build_append_int_noprefix (tbl,0 ,1 );/* Extended Checksum */ +build_append_int_noprefix (tbl,0 ,3 );/* Reserved */ + +/* Checksum to be filled by guest linker */ bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , - (char *)rsdp - rsdp_table->data,20 /* ACPI rev 1.0 RSDP size */ , - (char *)&rsdp->checksum - rsdp_table->data); + tbl_off,20 ,/* ACPI rev 1.0 RSDP size */ +8 );/* Extended checksum to be filled by Guest linker */ bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , - (char *)rsdp - rsdp_table->data,36 /* ACPI rev 2.0 RSDP size */ , - (char *)&rsdp->extended_checksum - rsdp_table->data); + tbl_off,36 ,/* ACPI rev 2.0 RSDP size */ +32 ); } static void
Signature · 1 line
MST
[Qemu-arm] [PULL 28/31] hw: arm: Support both legacy and current RSDP build
In reply to Michael S. TsirkinFrom: Samuel Ortiz <[email protected]>
We add the ability to build legacy or current RSDP tables, based on the AcpiRsdpData revision field passed to build_rsdp().
Although arm/virt only uses RSDP v2, adding that capability to build_rsdp will allow us to share the RSDP build code between ARM and x86.
--- hw/arm/virt-acpi-build.c | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-)
hw/arm/virt-acpi-build.c +33 -5
@@ -372,6 +372,20 @@ build_rsdp(GArray *tbl, BIOSLinker *linker, AcpiRsdpData *rsdp_data) {int tbl_off = tbl->len;/* Table offset in the RSDP file */ +switch (rsdp_data->revision) { +case 0 : +/* With ACPI 1.0, we must have an RSDT pointer */ +g_assert (rsdp_data->rsdt_tbl_offset); +break ; +case 2 : +/* With ACPI 2.0+, we must have an XSDT pointer */ +g_assert (rsdp_data->xsdt_tbl_offset); +break ; +default : +/* Only revisions 0 (ACPI 1.0) and 2 (ACPI 2.0+) are valid for RSDP */ +g_assert_not_reached (); + } +bios_linker_loader_alloc (linker,ACPI_BUILD_RSDP_FILE , tbl,16 , true/* fseg memory */ );
@@ -380,10 +394,29 @@ build_rsdp(GArray *tbl, BIOSLinker *linker, AcpiRsdpData *rsdp_data)g_array_append_vals (tbl, rsdp_data->oem_id,6 );/* OEMID */ build_append_int_noprefix (tbl, rsdp_data->revision,1 );/* Revision */ build_append_int_noprefix (tbl,0 ,4 );/* RsdtAddress */ +if (rsdp_data->rsdt_tbl_offset) { +/* RSDT address to be filled by guest linker */ +bios_linker_loader_add_pointer (linker,ACPI_BUILD_RSDP_FILE , + tbl_off +16 ,4 , +ACPI_BUILD_TABLE_FILE , + *rsdp_data->rsdt_tbl_offset); + } + +/* Checksum to be filled by guest linker */ +bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , + tbl_off,20 ,/* ACPI rev 1.0 RSDP size */ +8 ); + +if (rsdp_data->revision ==0 ) { +/* ACPI 1.0 RSDP, we're done */ +return ; + } +build_append_int_noprefix (tbl,36 ,4 );/* Length */ /* XSDT address to be filled by guest linker */ build_append_int_noprefix (tbl,0 ,8 );/* XsdtAddress */ +/* We already validated our xsdt pointer */ bios_linker_loader_add_pointer(linker, ACPI_BUILD_RSDP_FILE, tbl_off + 24, 8, ACPI_BUILD_TABLE_FILE,
@@ -392,11 +425,6 @@ build_rsdp(GArray *tbl, BIOSLinker *linker, AcpiRsdpData *rsdp_data)build_append_int_noprefix (tbl,0 ,1 );/* Extended Checksum */ build_append_int_noprefix (tbl,0 ,3 );/* Reserved */ -/* Checksum to be filled by guest linker */ -bios_linker_loader_add_checksum (linker,ACPI_BUILD_RSDP_FILE , - tbl_off,20 ,/* ACPI rev 1.0 RSDP size */ -8 ); -/* Extended checksum to be filled by Guest linker */ bios_linker_loader_add_checksum(linker, ACPI_BUILD_RSDP_FILE, tbl_off, 36, /* ACPI rev 2.0 RSDP size */
Signature · 1 line
MST
[Qemu-devel] [PULL 30/31] hw: acpi: Remove AcpiRsdpDescriptor and fix tests
In reply to Michael S. TsirkinFrom: Samuel Ortiz <[email protected]>
The only remaining AcpiRsdpDescriptor users are the ACPI utils for the BIOS table tests.
We remove that dependency and can thus remove the structure itself.
--- include/hw/acpi/acpi-defs.h | 13 ----------- tests/acpi-utils.h | 4 +++- tests/acpi-utils.c | 46 ++++++++++++++++++++++++++++++------- tests/bios-tables-test.c | 22 ++++++++++++++---- tests/vmgenid-test.c | 8 ++++--- 5 files changed, 63 insertions(+), 30 deletions(-)
include/hw/acpi/acpi-defs.h +0 -13
@@ -40,19 +40,6 @@ enum { ACPI_FADT_F_LOW_POWER_S0_IDLE_CAPABLE, }; -struct AcpiRsdpDescriptor {/* Root System Descriptor Pointer */ -uint64_t signature;/* ACPI signature, contains "RSD PTR " */ -uint8_t checksum;/* To make sum of struct == 0 */ -uint8_t oem_id [6 ];/* OEM identification */ -uint8_t revision;/* Must be 0 for 1.0, 2 for 2.0 */ -uint32_t rsdt_physical_address;/* 32-bit physical address of RSDT */ -uint32_t length;/* XSDT Length in bytes including hdr */ -uint64_t xsdt_physical_address;/* 64-bit physical address of XSDT */ -uint8_t extended_checksum;/* Checksum of entire table */ -uint8_t reserved [3 ];/* Reserved field must be 0 */ -}QEMU_PACKED ; -typedef struct AcpiRsdpDescriptor AcpiRsdpDescriptor ; - typedef struct AcpiRsdpData { uint8_t oem_id[6]; /* OEM identification */ uint8_t revision; /* Must be 0 for 1.0, 2 for 2.0 */
tests/acpi-utils.h +3 -1
@@ -82,6 +82,8 @@ typedef struct {uint8_t acpi_calc_checksum (const uint8_t *data,int len);uint32_t acpi_find_rsdp_address (void ); -void acpi_parse_rsdp_table (uint32_t addr,AcpiRsdpDescriptor *rsdp_table); +uint32_t acpi_get_rsdt_address (uint8_t *rsdp_table); +uint64_t acpi_get_xsdt_address (uint8_t *rsdp_table); +void acpi_parse_rsdp_table (uint32_t addr,uint8_t *rsdp_table);#endif /* TEST_ACPI_UTILS_H */
tests/acpi-utils.c +38 -8
52 lines not on this page · raw message
tests/bios-tables-test.c +17 -5
@@ -27,7 +27,7 @@ typedef struct {const char *machine;const char *variant;uint32_t rsdp_addr; -AcpiRsdpDescriptor rsdp_table; +uint8_t rsdp_table[36 /* ACPI 2.0+ RSDP size */ ];AcpiRsdtDescriptorRev1 rsdt_table;uint32_t dsdt_addr;uint32_t facs_addr;
@@ -85,19 +85,31 @@ static void test_acpi_rsdp_address(test_data *data)static void test_acpi_rsdp_table (test_data *data) { -AcpiRsdpDescriptor *rsdp_table = &data->rsdp_table; +uint8_t *rsdp_table = data->rsdp_table, revision;uint32_t addr = data->rsdp_addr;acpi_parse_rsdp_table (addr, rsdp_table); + revision = rsdp_table[15 /* Revision offset */ ]; -/* rsdp checksum is not for the whole table, but for the first 20 bytes */ -g_assert (!acpi_calc_checksum ((uint8_t *)rsdp_table,20 )); +switch (revision) { +case 0 :/* ACPI 1.0 RSDP */ +/* With rev 1, checksum is only for the first 20 bytes */ +g_assert (!acpi_calc_checksum (rsdp_table,20 )); +break ; +case 2 :/* ACPI 2.0+ RSDP */ +/* With revision 2, we have 2 checksums */ +g_assert (!acpi_calc_checksum (rsdp_table,20 )); +g_assert (!acpi_calc_checksum (rsdp_table,36 )); +break ; +default : +g_assert_not_reached (); + } }static void test_acpi_rsdt_table (test_data *data) {AcpiRsdtDescriptorRev1 *rsdt_table = &data->rsdt_table; -uint32_t addr =le32_to_cpu (data->rsdp_table.rsdt_physical_address); +uint32_t addr =acpi_get_rsdt_address (data->rsdp_table);uint32_t *tables;int tables_nr;uint8_t checksum;
tests/vmgenid-test.c +5 -3
@@ -35,7 +35,7 @@ static uint32_t acpi_find_vgia(void) {uint32_t rsdp_offset;uint32_t guid_offset =0 ; -AcpiRsdpDescriptor rsdp_table; +uint8_t rsdp_table[36 /* ACPI 2.0+ RSDP size */ ];uint32_t rsdt, rsdt_table_length;AcpiRsdtDescriptorRev1 rsdt_table;size_t tables_nr;
@@ -52,9 +52,11 @@ static uint32_t acpi_find_vgia(void) g_assert_cmphex(rsdp_offset, <, RSDP_ADDR_INVALID); -acpi_parse_rsdp_table (rsdp_offset, &rsdp_table); +acpi_parse_rsdp_table (rsdp_offset, rsdp_table); + + rsdt =acpi_get_rsdt_address (rsdp_table); +g_assert (rsdt); - rsdt =le32_to_cpu (rsdp_table.rsdt_physical_address);/* read the header */ ACPI_READ_TABLE_HEADER (&rsdt_table, rsdt);ACPI_ASSERT_CMP (rsdt_table.signature,"RSDT" );
Signature · 1 line
MST
[Qemu-devel] [PULL 31/31] hw/i386: Remove deprecated machines pc-0.10 and pc-0.11
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
They've been deprecated for two releases and nobody complained that they are still required anymore, so it's time to remove these now. And while we're at it, mark the other remaining old 0.x machine types as deprecated (since they can not properly be used for live-migration anyway).
--- hw/i386/pc_piix.c | 70 ++----------------------------------------- tests/cpu-plug-test.c | 4 +-- qemu-deprecated.texi | 2 +- 3 files changed, 4 insertions(+), 72 deletions(-)
hw/i386/pc_piix.c +2 -68
@@ -368,7 +368,7 @@ static void pc_compat_1_2(MachineState *machine)x86_cpu_change_kvm_default ("kvm-pv-eoi" ,NULL ); } -/* PC compat function for pc-0.10 to pc-0.13 */ +/* PC compat function for pc-0.12 and pc-0.13 */ static void pc_compat_0_13 (MachineState *machine) {pc_compat_1_2 (machine);
@@ -834,6 +834,7 @@ static void pc_i440fx_0_15_machine_options(MachineClass *m) {pc_i440fx_1_0_machine_options (m); m->hw_version ="0.15" ; + m->deprecation_reason ="use a newer machine type instead" ;SET_MACHINE_COMPAT (m,PC_COMPAT_0_15 ); }
@@ -951,73 +952,6 @@ static void pc_i440fx_0_12_machine_options(MachineClass *m)DEFINE_I440FX_MACHINE (v0_12,"pc-0.12" , pc_compat_0_13, pc_i440fx_0_12_machine_options); - -#define PC_COMPAT_0_11 \ - PC_CPU_MODEL_IDS("0.11") \ - {\ - .driver = "virtio-blk-pci",\ - .property = "vectors",\ - .value = stringify(0),\ - },{\ - .driver = TYPE_PCI_DEVICE,\ - .property = "rombar",\ - .value = stringify(0),\ - },{\ - .driver = "ide-drive",\ - .property = "ver",\ - .value = "0.11",\ - },{\ - .driver = "scsi-disk",\ - .property = "ver",\ - .value = "0.11",\ - }, - -static void pc_i440fx_0_11_machine_options (MachineClass *m) -{ -pc_i440fx_0_12_machine_options (m); - m->hw_version ="0.11" ; - m->deprecation_reason ="use a newer machine type instead" ; -SET_MACHINE_COMPAT (m,PC_COMPAT_0_11 ); -} - -DEFINE_I440FX_MACHINE (v0_11,"pc-0.11" , pc_compat_0_13, - pc_i440fx_0_11_machine_options); - - -#define PC_COMPAT_0_10 \ - PC_CPU_MODEL_IDS("0.10") \ - {\ - .driver = "virtio-blk-pci",\ - .property = "class",\ - .value = stringify(PCI_CLASS_STORAGE_OTHER),\ - },{\ - .driver = "virtio-serial-pci",\ - .property = "class",\ - .value = stringify(PCI_CLASS_DISPLAY_OTHER),\ - },{\ - .driver = "virtio-net-pci",\ - .property = "vectors",\ - .value = stringify(0),\ - },{\ - .driver = "ide-drive",\ - .property = "ver",\ - .value = "0.10",\ - },{\ - .driver = "scsi-disk",\ - .property = "ver",\ - .value = "0.10",\ - }, - -static void pc_i440fx_0_10_machine_options (MachineClass *m) -{ -pc_i440fx_0_11_machine_options (m); - m->hw_version ="0.10" ; -SET_MACHINE_COMPAT (m,PC_COMPAT_0_10 ); -} - -DEFINE_I440FX_MACHINE (v0_10,"pc-0.10" , pc_compat_0_13, - pc_i440fx_0_10_machine_options); - typedef struct { uint16_t gpu_device_id; uint16_t pch_device_id;
tests/cpu-plug-test.c +1 -3
@@ -157,9 +157,7 @@ static void add_pc_test_case(const char *mname) (strcmp(mname, "pc-0.15") == 0) || (strcmp(mname, "pc-0.14") == 0) || (strcmp(mname, "pc-0.13") == 0) || - (strcmp(mname, "pc-0.12") == 0) || - (strcmp(mname, "pc-0.11") == 0) || - (strcmp(mname, "pc-0.10") == 0)) { + (strcmp(mname, "pc-0.12") == 0)) { path =g_strdup_printf ("cpu-plug/%s/init/%ux%ux%u&maxcpus=%u" , mname, data->sockets, data->cores, data->threads, data->maxcpus);
qemu-deprecated.texi +1 -1
@@ -134,7 +134,7 @@ their usecases. @section System emulator machines -@subsection pc-0.10 and pc-0.11 (since 3.0) +@subsection pc-0.12, pc-0.13, pc-0.14 and pc-0.15 (since 4.0) These machine types are very old and likely can not be used for live migration from old QEMU versions anymore. A newer machine type should be used instead.
Signature · 1 line
MST
[Qemu-arm] [PULL 29/31] hw: acpi: Export and share the ARM RSDP build
In reply to Michael S. TsirkinFrom: Samuel Ortiz <[email protected]>
Now that build_rsdp() supports building both legacy and current RSDP tables, we can move it to a generic folder (hw/acpi) and have the i386 ACPI code reuse it in order to reduce code duplication.
--- include/hw/acpi/aml-build.h | 2 ++ hw/acpi/aml-build.c | 68 +++++++++++++++++++++++++++++++++++++ hw/arm/virt-acpi-build.c | 65 ----------------------------------- hw/i386/acpi-build.c | 49 +++++++++++--------------- 4 files changed, 89 insertions(+), 95 deletions(-)
include/hw/acpi/aml-build.h +2 -0
@@ -388,6 +388,8 @@ void acpi_add_table(GArray *table_offsets, GArray *table_data);void acpi_build_tables_init (AcpiBuildTables *tables);void acpi_build_tables_cleanup (AcpiBuildTables *tables,bool mfre);void +build_rsdp (GArray *tbl,BIOSLinker *linker,AcpiRsdpData *rsdp_data); +void build_rsdt (GArray *table_data,BIOSLinker *linker,GArray *table_offsets,const char *oem_id,const char *oem_table_id);void
hw/acpi/aml-build.c +68 -0
74 lines not on this page · raw message
hw/arm/virt-acpi-build.c +0 -65
71 lines not on this page · raw message
hw/i386/acpi-build.c +19 -30
61 lines not on this page · raw message
Signature · 1 line
MST
Quoted 11 lines · Michael S. Tsirkin
The following changes since commit
f163448536e5f7ae8905b14547eab37a41a75f6c:Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20181216' into staging (2018-12-17 13:04:25 +0000)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
562774d542e9be84411de0233308da380256f631:hw/i386: Remove deprecated machines pc-0.10 and pc-0.11 (2018-12-17 22:45:59 -0500)
oops issue found.
Pls ignore.
Will resend tomorrow.
Quoted 118 lines
----------------------------------------------------------------
pci, pc, virtio: fixes, featuresVTD fixes
ACPI refactoring
new names for virtio devices
multiple pcie link width/speedsSigned-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Alex Williamson (8):
pcie: Create enums for link speed and width
pci: Sync PCIe downstream port LNKSTA on read
qapi: Define PCIe link speed and width properties
pcie: Add link speed and width fields to PCIESlot
pcie: Fill PCIESlot link fields to support higher speeds and widths
pcie: Allow generic PCIe root port to specify link speed and width vfio/pci: Remove PCIe Link Status emulation
pcie: Fast PCIe root ports for new machinesCorey Minyard (1):
pc:piix4: Update smbus I/O space after a migrationEduardo Habkost (2):
virtio: Helper for registering virtio device types
virtio: Provide version-specific variants of virtio PCI devicesIgor Mammedov (2):
hw: arm: acpi: Fix incorrect checksums in RSDP
hw: i386: Use correct RSDT length for checksumMatthias Weckbecker (1):
hw/pci-bridge: Fix invalidfree()Peter Xu (5):
intel_iommu: dump correct iova when failed
intel_iommu: convert invalid traces into error reports
intel_iommu: dma read/write draining support
intel_iommu: remove "x-" prefix for "aw-bits"
intel_iommu: turn on IR by defaultPhilippe Mathieu-Daudé (4):
tests: Remove unused include
hw/smbios: Restrict access to "hw/smbios/ipmi.h" hw/smbios: Remove "smbios_ipmi.h" hw/smbios: Move to the hw/firmware/ subdirectorySamuel Ortiz (6):
hw: acpi: The RSDP build API can return void
hw: arm: Carry RSDP specific data through AcpiRsdpData
hw: arm: Convert the RSDP build to thebuid_append_foo()API
hw: arm: Support both legacy and current RSDP build
hw: acpi: Export and share the ARM RSDP build
hw: acpi: Remove AcpiRsdpDescriptor and fix testsThomas Huth (1):
hw/i386: Remove deprecated machines pc-0.10 and pc-0.11Zheng Xiang (1):
pcie: set link state inactive/active after hot unplug/plugqapi/common.json | 42 +++++ hw/i386/intel_iommu_internal.h | 3 + hw/smbios/smbios_build.h | 4 + hw/virtio/virtio-pci.h | 78 +++++++-- include/hw/acpi/acpi-defs.h | 19 +-- include/hw/acpi/aml-build.h | 2 + include/hw/compat.h | 10 +- include/hw/{smbios => firmware}/smbios.h | 0 include/hw/i386/intel_iommu.h | 1 + include/hw/i386/pc.h | 9 + include/hw/pci/pci.h | 13 ++ include/hw/pci/pcie.h | 1 + include/hw/pci/pcie_port.h | 4 + include/hw/pci/pcie_regs.h | 23 ++- include/hw/qdev-properties.h | 8 + include/hw/smbios/ipmi.h | 15 -- tests/acpi-utils.h | 4 +- hw/acpi/aml-build.c | 68 ++++++++ hw/acpi/piix4.c | 1 + hw/arm/virt-acpi-build.c | 40 +---- hw/arm/virt.c | 2 +- hw/core/qdev-properties.c | 176 ++++++++++++++++++++ hw/display/virtio-gpu-pci.c | 7 +- hw/display/virtio-vga.c | 7 +- hw/i386/acpi-build.c | 46 +++--- hw/i386/intel_iommu.c | 66 ++++++-- hw/i386/pc.c | 2 +- hw/i386/pc_piix.c | 72 +------- hw/i386/pc_q35.c | 2 +- hw/i386/x86-iommu.c | 2 +- hw/pci-bridge/gen_pcie_root_port.c | 4 + hw/pci-bridge/pcie_root_port.c | 14 ++ hw/pci/pci.c | 4 + hw/pci/pci_bridge.c | 2 +- hw/pci/pcie.c | 132 ++++++++++++++- hw/smbios/smbios-stub.c | 2 +- hw/smbios/smbios.c | 3 +- hw/smbios/smbios_type_38-stub.c | 2 +- hw/smbios/smbios_type_38.c | 3 +- hw/vfio/pci.c | 9 +- hw/virtio/virtio-crypto-pci.c | 7 +- hw/virtio/virtio-pci.c | 271 +++++++++++++++++++++++-------- tests/acpi-utils.c | 47 +++++- tests/bios-tables-test.c | 24 ++- tests/cpu-plug-test.c | 4 +- tests/vmgenid-test.c | 8 +- vl.c | 2 +- MAINTAINERS | 2 +- hw/i386/trace-events | 6 - qemu-deprecated.texi | 2 +- tests/acceptance/virtio_version.py | 176 ++++++++++++++++++++ 51 files changed, 1133 insertions(+), 318 deletions(-) rename include/hw/{smbios => firmware}/smbios.h (100%) delete mode 100644 include/hw/smbios/ipmi.h create mode 100644 tests/acceptance/virtio_version.py
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Type: series
Subject: [Qemu-devel] [PULL 00/31] pci, pc, virtio: fixes, features
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do
echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
a229850 hw/i386: Remove deprecated machines pc-0.10 and pc-0.11 37f4ed6 hw: acpi: Remove AcpiRsdpDescriptor and fix tests e3d6549 hw: acpi: Export and share the ARM RSDP build
823b080 hw: arm: Support both legacy and current RSDP build ab2b3d8 hw: arm: Convert the RSDP build to the buid_append_foo() API 476ed63 hw: arm: Carry RSDP specific data through AcpiRsdpData 4f784c9 hw: i386: Use correct RSDT length for checksum
922164f hw: arm: acpi: Fix incorrect checksums in RSDP
7374154 hw: acpi: The RSDP build API can return void
a542551 intel_iommu: turn on IR by default
fbd376b intel_iommu: remove "x-" prefix for "aw-bits"
dace78d intel_iommu: dma read/write draining support
31b4a13 intel_iommu: convert invalid traces into error reports d0ce98f intel_iommu: dump correct iova when failed
95aba03 pcie: Fast PCIe root ports for new machines
34233bd vfio/pci: Remove PCIe Link Status emulation
9734ad2 pcie: Allow generic PCIe root port to specify link speed and width b1c2b3a pcie: Fill PCIESlot link fields to support higher speeds and widths a0460df pcie: Add link speed and width fields to PCIESlot 33b6bc1 qapi: Define PCIe link speed and width properties 34b1004 pci: Sync PCIe downstream port LNKSTA on read
2f586c6 pcie: Create enums for link speed and width
50ec3b0 hw/pci-bridge: Fix invalid free()
725b6b8 hw/smbios: Move to the hw/firmware/ subdirectory 1ad07f1 hw/smbios: Remove "smbios_ipmi.h"
2c78a7e hw/smbios: Restrict access to "hw/smbios/ipmi.h" 4cb7e85 tests: Remove unused include
6d1ed7c virtio: Provide version-specific variants of virtio PCI devices 3ba33b5 virtio: Helper for registering virtio device types 4729a75 pc:piix4: Update smbus I/O space after a migration a060a84 pcie: set link state inactive/active after hot unplug/plug
=== OUTPUT BEGIN ===
Checking PATCH 1/31: pcie: set link state inactive/active after hot unplug/plug... Checking PATCH 2/31: pc:piix4: Update smbus I/O space after a migration... Checking PATCH 3/31: virtio: Helper for registering virtio device types...
WARNING: line over 80 characters
#498: FILE: hw/virtio/virtio-pci.h:443:
+ * Implements both INTERFACE_PCIE_DEVICE and INTERFACE_CONVENTIONAL_PCI_DEVICE,
WARNING: line over 80 characters
#507: FILE: hw/virtio/virtio-pci.h:452:
+ * Implements both INTERFACE_PCIE_DEVICE and INTERFACE_CONVENTIONAL_PCI_DEVICE.
total: 0 errors, 2 warnings, 469 lines checked
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 4/31: virtio: Provide version-specific variants of virtio PCI devices...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #318:
new file mode 100644
ERROR: line over 90 characters
#374: FILE: tests/acceptance/virtio_version.py:52:
+ return devtype in [d['name'] for d in vm.command('qom-list-types', implements=implements)]
WARNING: line over 80 characters
#429: FILE: tests/acceptance/virtio_version.py:107:
+ dev_1_0, nt_ifaces = self.run_device('%s-non-transitional' % (qemu_devtype))
WARNING: line over 80 characters
#453: FILE: tests/acceptance/virtio_version.py:131:
+ dev_trans, trans_ifaces = self.run_device('%s-transitional' % (qemu_devtype))
total: 1 errors, 3 warnings, 404 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 5/31: tests: Remove unused include...
Checking PATCH 6/31: hw/smbios: Restrict access to "hw/smbios/ipmi.h"...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #34:
rename from include/hw/smbios/ipmi.h
total: 0 errors, 1 warnings, 27 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 7/31: hw/smbios: Remove "smbios_ipmi.h"...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #53:
deleted file mode 100644
total: 0 errors, 1 warnings, 36 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 8/31: hw/smbios: Move to the hw/firmware/ subdirectory...
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #124:
rename from include/hw/smbios/smbios.h
total: 0 errors, 1 warnings, 80 lines checked
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 9/31: hw/pci-bridge: Fix invalid free()...
Checking PATCH 10/31: pcie: Create enums for link speed and width...
Checking PATCH 11/31: pci: Sync PCIe downstream port LNKSTA on read... Checking PATCH 12/31: qapi: Define PCIe link speed and width properties... Checking PATCH 13/31: pcie: Add link speed and width fields to PCIESlot... Checking PATCH 14/31: pcie: Fill PCIESlot link fields to support higher speeds and widths... Checking PATCH 15/31: pcie: Allow generic PCIe root port to specify link speed and width... Checking PATCH 16/31: vfio/pci: Remove PCIe Link Status emulation...
Checking PATCH 17/31: pcie: Fast PCIe root ports for new machines...
Checking PATCH 18/31: intel_iommu: dump correct iova when failed...
Checking PATCH 19/31: intel_iommu: convert invalid traces into error reports... Checking PATCH 20/31: intel_iommu: dma read/write draining support... Checking PATCH 21/31: intel_iommu: remove "x-" prefix for "aw-bits"... Checking PATCH 22/31: intel_iommu: turn on IR by default...
Checking PATCH 23/31: hw: acpi: The RSDP build API can return void... Checking PATCH 24/31: hw: arm: acpi: Fix incorrect checksums in RSDP...
WARNING: Block comments use a leading /* on a separate line
#42: FILE: hw/arm/virt-acpi-build.c:393:
+ (char *)rsdp - rsdp_table->data, 20 /* ACPI rev 1.0 RSDP size */,
WARNING: Block comments use a leading /* on a separate line #47: FILE: hw/arm/virt-acpi-build.c:398:
+ (char *)rsdp - rsdp_table->data, 36 /* ACPI rev 2.0 RSDP size */,
total: 0 errors, 2 warnings, 14 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 25/31: hw: i386: Use correct RSDT length for checksum...
WARNING: Block comments use a leading /* on a separate line #36: FILE: hw/i386/acpi-build.c:2553:
+ /* AcpiRsdpDescriptor describes revision 2 RSDP table and as result we
WARNING: Block comments use a leading /* on a separate line #49: FILE: hw/i386/acpi-build.c:2575:
+ (char *)rsdp - rsdp_table->data, 20 /* ACPI rev 1.0 RSDP size */,
total: 0 errors, 2 warnings, 19 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 26/31: hw: arm: Carry RSDP specific data through AcpiRsdpData... Checking PATCH 27/31: hw: arm: Convert the RSDP build to the buid_append_foo() API... Checking PATCH 28/31: hw: arm: Support both legacy and current RSDP build... Checking PATCH 29/31: hw: acpi: Export and share the ARM RSDP build...
WARNING: Block comments use a leading /* on a separate line
#49: FILE: hw/acpi/aml-build.c:1616:
+ true /* fseg memory */);
WARNING: Block comments use a leading /* on a separate line #226: FILE: hw/i386/acpi-build.c:2715:
+ /* We used to allocate some extra space for RSDP revision 2 but
total: 0 errors, 2 warnings, 214 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
Checking PATCH 30/31: hw: acpi: Remove AcpiRsdpDescriptor and fix tests...
WARNING: Block comments use a leading /* on a separate line #61: FILE: tests/acpi-utils.c:58:
+ memcpy(&rsdt_physical_address, &rsdp_table[16 /* RsdtAddress offset */], 4);
WARNING: Block comments use a leading /* on a separate line #68: FILE: tests/acpi-utils.c:65:
+ uint8_t revision = rsdp_table[15 /* Revision offset */];
WARNING: Block comments use a leading /* on a separate line #73: FILE: tests/acpi-utils.c:70:
+ memcpy(&xsdt_physical_address, &rsdp_table[24 /* XsdtAddress offset */], 8);
WARNING: Block comments use a leading /* on a separate line #83: FILE: tests/acpi-utils.c:80:
+ revision = rsdp_table[15 /* Revision offset */];
WARNING: Block comments use a leading /* on a separate line #121: FILE: tests/bios-tables-test.c:30:
+ uint8_t rsdp_table[36 /* ACPI 2.0+ RSDP size */];
WARNING: Block comments use a leading /* on a separate line #134: FILE: tests/bios-tables-test.c:92:
+ revision = rsdp_table[15 /* Revision offset */];
WARNING: Block comments use a leading /* on a separate line #170: FILE: tests/vmgenid-test.c:38:
+ uint8_t rsdp_table[36 /* ACPI 2.0+ RSDP size */];
total: 0 errors, 7 warnings, 144 lines checked
Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 31/31: hw/i386: Remove deprecated machines pc-0.10 and pc-0.11... === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]