* Remove legacy KVM PCI device assignment

* Fix qemu-pr-helper.c compilation on older compilers
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAln/F6QUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroM1Nwf/WY/pAgBHX7uST5422O0saVmWLDSf
 knFkm5rLf5OhJ0GXluyk8S4x5lD1sqQfGJPHcr6DCnZHFTznA93UeMa+1IPxYd3X
 gr5J4ANFyHwKZ7jNB/64EuckTMSVyGrbtb4B40FJSyQ3aWvIx09VO7ev4I/Yz89M
 xxbeTM0Y0jNGF87bAnOvZLR42vx6lp/9Z0/mxRMC/CyxHcAk8nCbwh9NhzA4OnPg
 bj2c+pGRa4NCbdK7JE7FgwnM7MQGGiIULuQRf45le1Ybt60fAS/S9kdgqFXNnlyJ
 8MB5Y2IEyarEDu6h6h/CFA2Dvo4PSfktEyICL0QZXtSFZE0kbKvrQxWWyg==
 =1CGc
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* Remove legacy KVM PCI device assignment
* Fix qemu-pr-helper.c compilation on older compilers

# gpg: Signature made Sun 05 Nov 2017 13:52:36 GMT
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  build: disable -Wmissing-braces on older compilers
  pci-assign: Remove

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-11-06 10:04:16 +00:00
commit ec7a8bf0b8
10 changed files with 19 additions and 1931 deletions

13
configure vendored
View File

@ -1669,6 +1669,19 @@ EOF
fi
fi
# Disable -Wmissing-braces on older compilers that warn even for
# the "universal" C zero initializer {0}.
cat > $TMPC << EOF
struct {
int a[2];
} x = {0};
EOF
if compile_object "-Werror" "" ; then
:
else
QEMU_CFLAGS="$QEMU_CFLAGS -Wno-missing-braces"
fi
# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and
# large functions that use global variables. The bug is in all releases of
# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in

View File

@ -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

View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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(dev, "%s\n", "Failed to disable pci-sysfs rom file");
}
fclose(fp);

View File

@ -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 */

View File

@ -46,7 +46,6 @@ typedef struct QDevAlias
static 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 },

View File

@ -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},