hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
cover hw/i386/pc: Remove deprecated 2.6 and 2.7 PC machines
The versioned 'pc' and 'q35' machines up to 2.12 been marked as deprecated two releases ago, and are older than 6 years, so according to our support policy we can remove them.
This series only includes the 2.6 and 2.7 machines removal, as it is a big enough number of LoC removed. Rest will follow.
Based-on: <[email protected]>
Philippe Mathieu-Daudé (5):
hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field hw/intc/ioapic: Remove IOAPICCommonState::version field hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features
field
hw/char/virtio-serial: Do not expose the 'emergency-write' property hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition
hw/intc/ioapic_internal.h | 3 +-- include/hw/i386/intel_iommu.h | 1 - include/hw/virtio/virtio-pci.h | 2 -- hw/char/virtio-serial-bus.c | 10 ++++++++-- hw/display/virtio-vga.c | 10 ---------- hw/i386/intel_iommu.c | 5 ++--- hw/intc/ioapic.c | 18 ++---------------- hw/intc/ioapic_common.c | 2 +- hw/virtio/virtio-pci.c | 12 ++---------- 9 files changed, 16 insertions(+), 47 deletions(-)
Signature · 1 line
2.47.1
PATCH 1/5 hw/i386/intel_iommu: Remove IntelIOMMUState::buggy_eim field
The IntelIOMMUState::buggy_eim boolean was only set in the hw_compat_2_7[] array, via the 'x-buggy-eim=true' property. We removed all machines using that array, lets remove that property, simplifying vtd_decide_config().
--- include/hw/i386/intel_iommu.h | 1 - hw/i386/intel_iommu.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-)
include/hw/i386/intel_iommu.h +0 -1
@@ -303,7 +303,6 @@ struct IntelIOMMUState {uint32_t intr_size;/* Number of IR table entries */ bool intr_eime;/* Extended interrupt mode enabled */ 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 */ bool dma_translation;/* Whether DMA translation supported */
hw/i386/intel_iommu.c +2 -3
@@ -3823,7 +3823,6 @@ static const Property vtd_properties[] = {DEFINE_PROP_UINT32 ("version" , IntelIOMMUState, version,0 ),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 ("aw-bits" , IntelIOMMUState, aw_bits,VTD_HOST_ADDRESS_WIDTH ), DEFINE_PROP_BOOL("caching-mode", IntelIOMMUState, caching_mode, FALSE),
@@ -4731,11 +4730,11 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp) }if (s->intr_eim ==ON_OFF_AUTO_AUTO ) { - s->intr_eim = (kvm_irqchip_in_kernel () || s->buggy_eim) + s->intr_eim =kvm_irqchip_in_kernel () &&x86_iommu_ir_supported (x86_iommu) ?ON_OFF_AUTO_ON :ON_OFF_AUTO_OFF ; } -if (s->intr_eim ==ON_OFF_AUTO_ON && !s->buggy_eim) { +if (s->intr_eim ==ON_OFF_AUTO_ON ) {if (kvm_irqchip_is_split () && !kvm_enable_x2apic ()) {error_setg (errp,"eim=on requires support on the KVM side" "(X2APIC_API, first shipped in v4.7)" );
Signature · 1 line
2.47.1
PATCH 2/5 hw/intc/ioapic: Remove IOAPICCommonState::version field
In reply to Philippe Mathieu-DaudéThe IOAPICCommonState::version integer was only set in the hw_compat_2_7[] array, via the 'version=0x11' property. We removed all machines using that array, lets remove that property, simplify by only using the default version (defined as IOAPIC_VER_DEF).
--- hw/intc/ioapic_internal.h | 3 +-- hw/intc/ioapic.c | 18 ++---------------- hw/intc/ioapic_common.c | 2 +- 3 files changed, 4 insertions(+), 19 deletions(-)
hw/intc/ioapic_internal.h +1 -2
@@ -82,7 +82,7 @@#define IOAPIC_ID_MASK 0xf#define IOAPIC_VER_ENTRIES_SHIFT 16 - +#define IOAPIC_VER_DEF 0x20#define TYPE_IOAPIC_COMMON "ioapic-common"OBJECT_DECLARE_TYPE (IOAPICCommonState, IOAPICCommonClass,IOAPIC_COMMON )
@@ -104,7 +104,6 @@ struct IOAPICCommonState {uint32_t irr;uint64_t ioredtbl[IOAPIC_NUM_PINS ];Notifier machine_done; -uint8_t version;uint64_t irq_count[IOAPIC_NUM_PINS ];int irq_level[IOAPIC_NUM_PINS ];int irq_eoi[IOAPIC_NUM_PINS ];
hw/intc/ioapic.c +2 -16
@@ -315,7 +315,7 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size) val = s->id <<IOAPIC_ID_SHIFT ;break ;case IOAPIC_REG_VER : - val = s->version | + val =IOAPIC_VER_DEF | ((IOAPIC_NUM_PINS -1 ) <<IOAPIC_VER_ENTRIES_SHIFT );break ;default :
@@ -411,8 +411,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val, }break ;case IOAPIC_EOI : -/* Explicit EOI is only supported for IOAPIC version 0x20 */ -if (size !=4 || s->version !=0x20 ) { +if (size !=4 ) {break ; }ioapic_eoi_broadcast (val);
@@ -444,18 +443,10 @@ static void ioapic_machine_done_notify(Notifier *notifier, void *data)#endif } -#define IOAPIC_VER_DEF 0x20 -static void ioapic_realize (DeviceState *dev,Error **errp) {IOAPICCommonState *s =IOAPIC_COMMON (dev); -if (s->version !=0x11 && s->version !=0x20 ) { -error_setg (errp,"IOAPIC only supports version 0x11 or 0x20 " -"(default: 0x%x)." ,IOAPIC_VER_DEF ); -return ; - } -memory_region_init_io (&s->io_memory,OBJECT (s), &ioapic_io_ops, s,"ioapic" ,0x1000 );
@@ -476,10 +467,6 @@ static void ioapic_unrealize(DeviceState *dev)timer_free (s->delayed_ioapic_service_timer); } -static const Property ioapic_properties[] = { -DEFINE_PROP_UINT8 ("version" , IOAPICCommonState, version,IOAPIC_VER_DEF ), -}; -static void ioapic_class_init (ObjectClass *klass,const void *data) {IOAPICCommonClass *k =IOAPIC_COMMON_CLASS (klass);
@@ -493,7 +480,6 @@ static void ioapic_class_init(ObjectClass *klass, const void *data)*/ k->post_load = ioapic_update_kvm_routes;device_class_set_legacy_reset (dc, ioapic_reset_common); -device_class_set_props (dc, ioapic_properties); }static const TypeInfo ioapic_info = {
hw/intc/ioapic_common.c +1 -1
@@ -83,7 +83,7 @@ static void ioapic_print_redtbl(GString *buf, IOAPICCommonState *s)int i;g_string_append_printf (buf,"ioapic0: ver=0x%x id=0x%02x sel=0x%02x" , - s->version, s->id, s->ioregsel); +IOAPIC_VER_DEF , s->id, s->ioregsel);if (s->ioregsel) {g_string_append_printf (buf," (redir[%u])\n" , (s->ioregsel -IOAPIC_REG_REDTBL_BASE ) >>1 );
Signature · 1 line
2.47.1
PATCH 3/5 hw/virtio/virtio-pci: Remove VirtIOPCIProxy::ignore_backend_features field
In reply to Philippe Mathieu-DaudéThe VirtIOPCIProxy::ignore_backend_features boolean was only set in the hw_compat_2_7[] array, via the 'x-ignore-backend-features=on' property. We removed all machines using that array, lets remove that property, simplify by only using the default version.
--- include/hw/virtio/virtio-pci.h | 1 - hw/virtio/virtio-pci.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-)
include/hw/virtio/virtio-pci.h +0 -1
@@ -149,7 +149,6 @@ struct VirtIOPCIProxy {int config_cap;uint32_t flags;bool disable_modern; -bool ignore_backend_features;OnOffAuto disable_legacy;/* Transitional device id */ uint16_t trans_devid;
hw/virtio/virtio-pci.c +1 -4
@@ -1965,8 +1965,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)* Virtio capabilities present without * VIRTIO_F_VERSION_1 confuses guests */ -if (!proxy->ignore_backend_features && - !virtio_has_feature (vdev->host_features,VIRTIO_F_VERSION_1 )) { +if (!virtio_has_feature (vdev->host_features,VIRTIO_F_VERSION_1 )) {virtio_pci_disable_modern (proxy);if (!legacy) {
@@ -2351,8 +2350,6 @@ static const Property virtio_pci_properties[] = { VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT, false),DEFINE_PROP_BIT ("page-per-vq" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT , false), -DEFINE_PROP_BOOL ("x-ignore-backend-features" , VirtIOPCIProxy, - ignore_backend_features, false),DEFINE_PROP_BIT ("ats" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_ATS_BIT , false), DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags,
Signature · 1 line
2.47.1
PATCH 4/5 hw/char/virtio-serial: Do not expose the 'emergency-write' property
In reply to Philippe Mathieu-DaudéThe VIRTIO_CONSOLE_F_EMERG_WRITE feature bit was only set in the hw_compat_2_7[] array, via the 'emergency-write=off' property. We removed all machines using that array, lets remove that property. All instances have this feature bit set and it can not be disabled.
--- hw/char/virtio-serial-bus.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
hw/char/virtio-serial-bus.c +8 -2
@@ -1019,6 +1019,13 @@ static void virtser_port_device_unrealize(DeviceState *dev) } } +static void virtio_serial_instance_init (Object *obj) +{ +VirtIOSerial *vser =VIRTIO_SERIAL (obj); + + vser->host_features |=BIT_ULL (VIRTIO_CONSOLE_F_EMERG_WRITE ); +} +static void virtio_serial_device_realize (DeviceState *dev,Error **errp) {VirtIODevice *vdev =VIRTIO_DEVICE (dev);
@@ -1155,8 +1162,6 @@ static const VMStateDescription vmstate_virtio_console = {static const Property virtio_serial_properties[] = {DEFINE_PROP_UINT32 ("max_ports" , VirtIOSerial, serial.max_virtserial_ports,31 ), -DEFINE_PROP_BIT64 ("emergency-write" , VirtIOSerial, host_features, -VIRTIO_CONSOLE_F_EMERG_WRITE , true), };static void virtio_serial_class_init (ObjectClass *klass,const void *data)
@@ -1186,6 +1191,7 @@ static void virtio_serial_class_init(ObjectClass *klass, const void *data)static const TypeInfo virtio_device_info = { .name =TYPE_VIRTIO_SERIAL , .parent =TYPE_VIRTIO_DEVICE , + .instance_init = virtio_serial_instance_init, .instance_size =sizeof (VirtIOSerial), .class_init = virtio_serial_class_init, .interfaces = (const InterfaceInfo []) {
Signature · 1 line
2.47.1
PATCH 5/5 hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_PAGE_PER_VQ definition
In reply to Philippe Mathieu-DaudéVIRTIO_PCI_FLAG_PAGE_PER_VQ was only used by the hw_compat_2_7[] array, via the 'page-per-vq=on' property. We removed all machines using that array, lets remove all the code around VIRTIO_PCI_FLAG_PAGE_PER_VQ (see commit 9a4c0e220d8 for similar VIRTIO_PCI_FLAG_* enum removal).
--- include/hw/virtio/virtio-pci.h | 1 - hw/display/virtio-vga.c | 10 ---------- hw/virtio/virtio-pci.c | 7 +------ 3 files changed, 1 insertion(+), 17 deletions(-)
include/hw/virtio/virtio-pci.h +0 -1
@@ -33,7 +33,6 @@ enum {VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT ,VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT ,VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT , -VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT ,VIRTIO_PCI_FLAG_ATS_BIT ,VIRTIO_PCI_FLAG_INIT_DEVERR_BIT , VIRTIO_PCI_FLAG_INIT_LNKCTL_BIT,
hw/display/virtio-vga.c +0 -10
@@ -141,16 +141,6 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp) VIRTIO_GPU_SHM_ID_HOST_VISIBLE); } -if (!(vpci_dev->flags &VIRTIO_PCI_FLAG_PAGE_PER_VQ )) { -/* -* with page-per-vq=off there is no padding space we can use -* for the stdvga registers. Make the common and isr regions -* smaller then. -*/ - vpci_dev->common.size /=2 ; - vpci_dev->isr.size /=2 ; - } - offset =memory_region_size (&vpci_dev->modern_bar); offset -= vpci_dev->notify.size; vpci_dev->notify.offset = offset;
hw/virtio/virtio-pci.c +1 -6
@@ -314,12 +314,9 @@ static bool virtio_pci_ioeventfd_enabled(DeviceState *d)return (proxy->flags &VIRTIO_PCI_FLAG_USE_IOEVENTFD ) !=0 ; } -#define QEMU_VIRTIO_PCI_QUEUE_MEM_MULT 0x1000 -static inline int virtio_pci_queue_mem_mult (struct VirtIOPCIProxy *proxy) { -return (proxy->flags &VIRTIO_PCI_FLAG_PAGE_PER_VQ ) ? -QEMU_VIRTIO_PCI_QUEUE_MEM_MULT :4 ; +return 4 ; } static int virtio_pci_ioeventfd_assign(DeviceState *d, EventNotifier *notifier,
@@ -2348,8 +2345,6 @@ static const Property virtio_pci_properties[] = { VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT, false),DEFINE_PROP_BIT ("modern-pio-notify" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT , false), -DEFINE_PROP_BIT ("page-per-vq" , VirtIOPCIProxy, flags, -VIRTIO_PCI_FLAG_PAGE_PER_VQ_BIT , false),DEFINE_PROP_BIT ("ats" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_ATS_BIT , false), DEFINE_PROP_BIT("x-ats-page-aligned", VirtIOPCIProxy, flags,
Signature · 1 line
2.47.1
Quoted 10 lines · Philippe Mathieu-Daudé
The versioned 'pc' and 'q35' machines up to 2.12 been marked as deprecated two releases ago, and are older than 6 years, so according to our support policy we can remove them.
This series only includes the 2.6 and 2.7 machines removal, as it is a big enough number of LoC removed. Rest will follow.
Based-on: <[email protected]>
Quoted 7 lines
Philippe Mathieu-Daudé (5):
hw/i386/intel_iommu: RemoveIntelIOMMUState::buggy_eimfield hw/intc/ioapic: RemoveIOAPICCommonState::versionfield hw/virtio/virtio-pci: RemoveVirtIOPCIProxy::ignore_backend_features
field
hw/char/virtio-serial: Do not expose the 'emergency-write' property hw/virtio/virtio-pci: RemoveVIRTIO_PCI_FLAG_PAGE_PER_VQdefinition
Shouldn't there be a patch in this series that removes the machines first? ... or did I just miss this?
Thomas
Quoted 19 lines · Thomas Huth
Quoted 10 lines · Philippe Mathieu-Daudé
The versioned 'pc' and 'q35' machines up to 2.12 been marked as deprecated two releases ago, and are older than 6 years, so according to our support policy we can remove them.
This series only includes the 2.6 and 2.7 machines removal, as it is a big enough number of LoC removed. Rest will follow.
Based-on: <[email protected]>
Quoted 7 lines
Philippe Mathieu-Daudé (5):
hw/i386/intel_iommu: RemoveIntelIOMMUState::buggy_eimfield hw/intc/ioapic: RemoveIOAPICCommonState::versionfield hw/virtio/virtio-pci: RemoveVirtIOPCIProxy::ignore_backend_featuresfield
hw/char/virtio-serial: Do not expose the 'emergency-write' property hw/virtio/virtio-pci: RemoveVIRTIO_PCI_FLAG_PAGE_PER_VQdefinition
Quoted 1 line
Shouldn't there be a patch in this series that removes the machines first? ... or did I just miss this?
Doh, I picked the wrong base commit =)