pci-assign: Remove
PATCH 1/1 pci-assign: Remove
Legacy PCI device assignment has been removed from Linux in 4.12, and had been deprecated 2 years ago there. We can remove it from QEMU as well.
The ROM loading code was shared with Xen PCI passthrough, so move it to hw/xen.
---
Xen parts only compile-tested.
docs/qdev-device-use.txt | 12 +-
hw/i386/Makefile.objs | 1 -
hw/i386/kvm/Makefile.objs | 2 +-
hw/i386/kvm/pci-assign.c | 1883 --------------------
hw/xen/Makefile.objs | 1 +
.../xen_pt_load_rom.c} | 4 +-
include/hw/pci/pci-assign.h | 27 -
qdev-monitor.c | 1 -
scripts/device-crash-test | 2 -
9 files changed, 6 insertions(+), 1927 deletions(-)
delete mode 100644 hw/i386/kvm/pci-assign.c
rename hw/{i386/pci-assign-load-rom.c => xen/xen_pt_load_rom.c} (96%)
delete mode 100644 include/hw/pci/pci-assign.hdocs/qdev-device-use.txt +2 -10
@@ -366,17 +366,9 @@ bus=PCI-BUS,addr=DEVFN to control the PCI device address, as usual. === Host Device Assignment === QEMU supports assigning host PCI devices (qemu-kvm only at this time) -and host USB devices. +and host USB devices. PCI devices can only be assigned with -device: -The old way to assign a host PCI device is - - -pcidevice host=ADDR,dma=none,id=ID - -The new way is - - -device pci-assign,host=ADDR,iommu=IOMMU,id=ID - -The old dma=none becomes iommu=off with -device. + -device vfio-pci,host=ADDR,id=ID The old way to assign a host USB device is
hw/i386/Makefile.objs +0 -1
@@ -8,4 +8,3 @@ obj-$(CONFIG_XEN) += ../xenpv/ xen/ obj-y += kvmvapic.o obj-y += acpi-build.o -obj-y += pci-assign-load-rom.o
hw/i386/kvm/Makefile.objs +1 -1
@@ -1 +1 @@ -obj-y += clock.o apic.o i8259.o ioapic.o i8254.o pci-assign.o +obj-y += clock.o apic.o i8259.o ioapic.o i8254.o
hw/xen/Makefile.objs +1 -0
@@ -3,3 +3,4 @@ common-obj-$(CONFIG_XEN) += xen_backend.o xen_devconfig.o xen_pvdev.o xen-common obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o +obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt_load_rom.o
hw/xen/xen_pt_load_rom.c renamed from hw/i386/pci-assign-load-rom.c +2 -2
@@ -12,7 +12,7 @@#include "qemu/range.h" #include "sysemu/sysemu.h" #include "hw/pci/pci.h" -#include "hw/pci/pci-assign.h" +#include "xen_pt.h" /* * Scan the assigned devices for the devices that have an option ROM, and then
@@ -80,7 +80,7 @@ close_rom:fseek (fp,0 ,SEEK_SET ); val =0 ;if (!fwrite (&val,1 ,1 , fp)) { -DEBUG ("%s\n" ,"Failed to disable pci-sysfs rom file" ); +XEN_PT_WARN ("%s\n" ,"Failed to disable pci-sysfs rom file" ); }fclose (fp);
include/hw/pci/pci-assign.h deleted +0 -27
@@ -1,27 +0,0 @@ -/* -* This work is licensed under the terms of the GNU GPL, version 2. See -* the COPYING file in the top-level directory. -* -* Just split from hw/i386/kvm/pci-assign.c. -*/ -#ifndef PCI_ASSIGN_H -#define PCI_ASSIGN_H - -#include "hw/pci/pci.h" - -//#define DEVICE_ASSIGNMENT_DEBUG - -#ifdef DEVICE_ASSIGNMENT_DEBUG -#define DEBUG (fmt, ...) \ - do { \ - fprintf(stderr, "%s: " fmt, __func__ , __VA_ARGS__); \ - } while (0) -#else -#define DEBUG (fmt, ...) -#endif - -void *pci_assign_dev_load_option_rom (PCIDevice *dev,struct Object *owner, -int *size,unsigned int domain, -unsigned int bus,unsigned int slot, -unsigned int function); -#endif /* PCI_ASSIGN_H */
qdev-monitor.c +0 -1
@@ -46,7 +46,6 @@ typedef struct QDevAliasstatic const QDevAlias qdev_alias_table[] = { {"e1000" ,"e1000-82540em" }, {"ich9-ahci" ,"ahci" }, - {"kvm-pci-assign" ,"pci-assign" }, {"lsi53c895a" ,"lsi" }, {"virtio-9p-ccw" ,"virtio-9p" ,QEMU_ARCH_S390X }, {"virtio-9p-pci" ,"virtio-9p" ,QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
scripts/device-crash-test +0 -2
@@ -102,7 +102,6 @@ ERROR_WHITELIST = [ {'device':'ivshmem', 'expected':True}, # You must specify either 'shm' or 'chardev' {'device':'ivshmem-doorbell', 'expected':True}, # You must specify a 'chardev' {'device':'ivshmem-plain', 'expected':True}, # You must specify a 'memdev' - {'device':'kvm-pci-assign', 'expected':True}, # no host device specified {'device':'loader', 'expected':True}, # please include valid arguments {'device':'nand', 'expected':True}, # Unsupported NAND block size 0x1 {'device':'nvdimm', 'expected':True}, # 'memdev' property is not set
@@ -165,7 +164,6 @@ ERROR_WHITELIST = [ # KVM-specific devices shouldn't be tried without accel=kvm: {'accel':'(?!kvm).*', 'device':'kvmclock', 'expected':True}, - {'accel':'(?!kvm).*', 'device':'kvm-pci-assign', 'expected':True}, # xen-specific machines and devices: {'accel':'(?!xen).*', 'machine':'xen.*', 'expected':True},
hw/i386/kvm/pci-assign.c deleted +0 -1883
1,883 lines not on this page · raw message
Signature · 7 lines
2.14.2 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 45 lines · Paolo Bonzini
Legacy PCI device assignment has been removed from Linux in 4.12, and had been deprecated 2 years ago there. We can remove it from QEMU as well.
The ROM loading code was shared with Xen PCI passthrough, so move it to hw/xen.
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>---
Xen parts only compile-tested.docs/qdev-device-use.txt | 12 +- hw/i386/Makefile.objs | 1 - hw/i386/kvm/Makefile.objs | 2 +- hw/i386/kvm/pci-assign.c | 1883 -------------------- hw/xen/Makefile.objs | 1 + .../xen_pt_load_rom.c} | 4 +- include/hw/pci/pci-assign.h | 27 - qdev-monitor.c | 1 - scripts/device-crash-test | 2 - 9 files changed, 6 insertions(+), 1927 deletions(-) delete mode 100644 hw/i386/kvm/pci-assign.c rename hw/{i386/pci-assign-load-rom.c => xen/xen_pt_load_rom.c} (96%) delete mode 100644 include/hw/pci/pci-assign.hhw/xen/xen_pt_load_rom.c renamed from hw/i386/pci-assign-load-rom.c +1
-1@@ -12,7 +12,7 @@#include "qemu/range.h" #include "sysemu/sysemu.h" #include "hw/pci/pci.h" -#include "hw/pci/pci-assign.h" +#include "xen_pt.h" /* * Scan the assigned devices for the devices that have an option ROM, and then
hw/xen/xen_pt_load_rom.c close_rom: · line 83
Quoted 5 lines
hw/xen/xen_pt_load_rom.c renamed from hw/i386/pci-assign-load-rom.c +1
-1@@ -80,7 +80,7 @@ close_rom:fseek (fp,0 ,SEEK_SET ); val =0 ;if (!fwrite (&val,1 ,1 , fp)) { -DEBUG ("%s\n" ,"Failed to disable pci-sysfs rom file" ); +XEN_PT_WARN ("%s\n" ,"Failed to disable pci-sysfs rom file" );
XEN_PT_WARN takes an extra argument, it should read:XEN_PT_WARN(dev, "%s\n", "Failed to disable pci-sysfs rom file");
With that fixed:
Signature · 6 lines
Anthony PERARD _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Philippe Mathieu-Daudé
Reviewed-byQuoted 15 lines · Paolo Bonzini
Quoted 14 lines
Legacy PCI device assignment has been removed from Linux in 4.12, and had been deprecated 2 years ago there. We can remove it from QEMU as well.
The ROM loading code was shared with Xen PCI passthrough, so move it to hw/xen.
Cc Stefano Stabellini <[email protected]>Cc Anthony Perard <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>---
Xen parts only compile-tested.
Quoted 4 lines
Quoted 4 lines
docs/qdev-device-use.txt | 12 +- hw/i386/Makefile.objs | 1 - hw/i386/kvm/Makefile.objs | 2 +- hw/i386/kvm/pci-assign.c | 1883 --------------------
nice cleanup <3
Quoted 36 lines
Quoted 27 lines
hw/xen/Makefile.objs | 1 + .../xen_pt_load_rom.c} | 4 +- include/hw/pci/pci-assign.h | 27 - qdev-monitor.c | 1 - scripts/device-crash-test | 2 - 9 files changed, 6 insertions(+), 1927 deletions(-) delete mode 100644 hw/i386/kvm/pci-assign.c rename hw/{i386/pci-assign-load-rom.c => xen/xen_pt_load_rom.c} (96%) delete mode 100644 include/hw/pci/pci-assign.hhw/xen/xen_pt_load_rom.c renamed from hw/i386/pci-assign-load-rom.c +1
-1@@ -12,7 +12,7 @@#include "qemu/range.h" #include "sysemu/sysemu.h" #include "hw/pci/pci.h" -#include "hw/pci/pci-assign.h" +#include "xen_pt.h" /* * Scan the assigned devices for the devices that have an option ROM, and then hw/xen/xen_pt_load_rom.c close_rom: · line 83
Quoted 5 lines
hw/xen/xen_pt_load_rom.c renamed from hw/i386/pci-assign-load-rom.c +1
-1@@ -80,7 +80,7 @@ close_rom:fseek (fp,0 ,SEEK_SET ); val =0 ;if (!fwrite (&val,1 ,1 , fp)) { -DEBUG ("%s\n" ,"Failed to disable pci-sysfs rom file" ); +XEN_PT_WARN ("%s\n" ,"Failed to disable pci-sysfs rom file" );
XEN_PT_WARNtakes an extra argument, it should read:XEN_PT_WARN(dev, "%s\n", "Failed to disable pci-sysfs rom file");
Quoted 2 lines
With that fixed:
Acked-by Anthony PERARD <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel