* Kconfig improvements (msi_nonbroken, imply for default PCI devices)
* intel-iommu: sharing passthrough FlatViews (Peter) * Fix for SEV with VFIO (Brijesh) * Allow compilation without CONFIG_PARALLEL (Thomas) -----BEGIN PGP SIGNATURE----- iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAlyTvvAUHHBib256aW5p QHJlZGhhdC5jb20ACgkQv/vSX3jHroNNwwf/RrtjBoqu8Ulu6k+HJczdpkhO44c5 R7sidGaOBHVjT+EsaYZxanXQlsbpDPiXCRoMRMln+O3Kgso/UlVTLBfctIjuf5kp P8Amp8rw843yl3TQ+Xaqat1qtfVVN2xjRDoyRwWrTU5w52MVVsan2j1/XzGX/7Bb Y3gXRxsN7MyjDCXxhxVwQCxKU2ue3ytvnfdCnu1SNZxZEaFAyGprTNCCTXYugehl bVauAs/0qOZWEyvElinNEz+zbqMTm07ULAWBRXgCDcOudsidZFtu0Xl62dXlp1Ou 0zkaoGiOdMM6OXZkLd6vOK8mY9XDuqaUZE3zAeFMJsK1wSnZdGUVCJO1Hw== =Pkcj -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging * Kconfig improvements (msi_nonbroken, imply for default PCI devices) * intel-iommu: sharing passthrough FlatViews (Peter) * Fix for SEV with VFIO (Brijesh) * Allow compilation without CONFIG_PARALLEL (Thomas) # gpg: Signature made Thu 21 Mar 2019 16:42:24 GMT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # 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: (23 commits) virtio-vga: only enable for specific boards config-all-devices.mak: rebuild on reconfigure minikconf: fix parser typo intel-iommu: optimize nodmar memory regions test-announce-self: convert to qgraph hw/alpha/Kconfig: DP264 hardware requires e1000 network card hw/hppa/Kconfig: Dino board requires e1000 network card hw/sh4/Kconfig: r2d machine requires the rtl8139 network card hw/ppc/Kconfig: e500 based machines require virtio-net-pci device hw/ppc/Kconfig: Bamboo machine requires e1000 network card hw/mips/Kconfig: Fulong 2e board requires ati-vga/rtl8139 PCI devices hw/mips/Kconfig: Malta machine requires the pcnet network card hw/i386/Kconfig: enable devices that can be created by default hw/isa/Kconfig: PIIX4 southbridge requires USB UHCI hw/isa/Kconfig: i82378 SuperIO requires PC speaker device prep: do not select I82374 hw/i386/Kconfig: PC uses I8257, not I82374 hw/char/parallel: Make it possible to compile also without CONFIG_PARALLEL target/i386: sev: Do not pin the ram device memory region memory: Fix the memory region type assignment order ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> # Conflicts: # hw/rdma/Makefile.objs # hw/riscv/sifive_plic.c
This commit is contained in:
commit
84bdc58c06
@ -31,3 +31,6 @@ config XEN
|
||||
|
||||
config VIRTFS
|
||||
bool
|
||||
|
||||
config PVRDMA
|
||||
bool
|
||||
|
7
Makefile
7
Makefile
@ -331,10 +331,10 @@ SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(filter %-softmmu, $(TAR
|
||||
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %.d, $(SUBDIR_DEVICES_MAK))
|
||||
|
||||
ifeq ($(SUBDIR_DEVICES_MAK),)
|
||||
config-all-devices.mak:
|
||||
config-all-devices.mak: config-host.mak
|
||||
$(call quiet-command,echo '# no devices' > $@,"GEN","$@")
|
||||
else
|
||||
config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
|
||||
config-all-devices.mak: $(SUBDIR_DEVICES_MAK) config-host.mak
|
||||
$(call quiet-command, sed -n \
|
||||
's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
|
||||
$(SUBDIR_DEVICES_MAK) | sort -u > $@, \
|
||||
@ -356,7 +356,8 @@ MINIKCONF_ARGS = \
|
||||
CONFIG_X11=$(CONFIG_X11) \
|
||||
CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \
|
||||
CONFIG_VIRTFS=$(CONFIG_VIRTFS) \
|
||||
CONFIG_LINUX=$(CONFIG_LINUX)
|
||||
CONFIG_LINUX=$(CONFIG_LINUX) \
|
||||
CONFIG_PVRDMA=$(CONFIG_PVRDMA)
|
||||
|
||||
MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
|
||||
MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
|
||||
|
@ -35,6 +35,7 @@ CONFIG_MIPS_CPS=y
|
||||
CONFIG_MIPS_ITU=y
|
||||
CONFIG_R4K=y
|
||||
CONFIG_MALTA=y
|
||||
CONFIG_PCNET_PCI=y
|
||||
CONFIG_MIPSSIM=y
|
||||
CONFIG_ACPI_SMBUS=y
|
||||
CONFIG_SMBUS_EEPROM=y
|
||||
|
@ -6,6 +6,8 @@ CONFIG_RC4030=y
|
||||
CONFIG_DP8393X=y
|
||||
CONFIG_DS1225Y=y
|
||||
CONFIG_FULONG=y
|
||||
CONFIG_ATI_VGA=y
|
||||
CONFIG_RTL8139_PCI=y
|
||||
CONFIG_JAZZ=y
|
||||
CONFIG_G364FB=y
|
||||
CONFIG_JAZZ_LED=y
|
||||
|
@ -26,6 +26,7 @@ source pci-bridge/Kconfig
|
||||
source pci-host/Kconfig
|
||||
source pcmcia/Kconfig
|
||||
source pci/Kconfig
|
||||
source rdma/Kconfig
|
||||
source scsi/Kconfig
|
||||
source sd/Kconfig
|
||||
source smbios/Kconfig
|
||||
|
@ -2,6 +2,7 @@ config DP264
|
||||
bool
|
||||
imply PCI_DEVICES
|
||||
imply TEST_DEVICES
|
||||
imply E1000_PCI
|
||||
select I82374
|
||||
select I8254
|
||||
select I8259
|
||||
|
@ -2,7 +2,7 @@ common-obj-$(CONFIG_IPACK) += ipoctal232.o
|
||||
common-obj-$(CONFIG_ESCC) += escc.o
|
||||
common-obj-$(CONFIG_NRF51_SOC) += nrf51_uart.o
|
||||
common-obj-$(CONFIG_PARALLEL) += parallel.o
|
||||
common-obj-$(CONFIG_PARALLEL) += parallel-isa.o
|
||||
common-obj-$(CONFIG_ISA_BUS) += parallel-isa.o
|
||||
common-obj-$(CONFIG_PL011) += pl011.o
|
||||
common-obj-$(CONFIG_SERIAL) += serial.o
|
||||
common-obj-$(CONFIG_SERIAL_ISA) += serial-isa.o
|
||||
|
@ -1,6 +1,9 @@
|
||||
/*
|
||||
* QEMU Parallel PORT (ISA bus helpers)
|
||||
*
|
||||
* These functions reside in a separate file since they also might be
|
||||
* required for linking when compiling QEMU without CONFIG_PARALLEL.
|
||||
*
|
||||
* Copyright (c) 2003 Fabrice Bellard
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
|
@ -100,7 +100,7 @@ config VIRTIO_GPU
|
||||
|
||||
config VIRTIO_VGA
|
||||
bool
|
||||
default y if PCI_DEVICES
|
||||
# defaults to "N", enabled by specific boards
|
||||
depends on VIRTIO_PCI
|
||||
select VGA
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
config DINO
|
||||
bool
|
||||
imply PCI_DEVICES
|
||||
imply E1000_PCI
|
||||
imply VIRTIO_VGA
|
||||
select PCI
|
||||
select SERIAL
|
||||
select ISA_BUS
|
||||
|
@ -9,6 +9,7 @@ config PC
|
||||
imply ISA_IPMI_KCS
|
||||
imply ISA_IPMI_BT
|
||||
imply ISA_DEBUG
|
||||
imply PARALLEL
|
||||
imply PCI_DEVICES
|
||||
imply PVPANIC
|
||||
imply QXL
|
||||
@ -17,16 +18,15 @@ config PC
|
||||
imply TEST_DEVICES
|
||||
imply TPM_CRB
|
||||
imply TPM_TIS
|
||||
imply VGA_PCI
|
||||
imply VIRTIO_VGA
|
||||
select FDC
|
||||
select I8259
|
||||
select I8254
|
||||
select PCKBD
|
||||
select PCSPK
|
||||
select I82374
|
||||
select I8257
|
||||
select MC146818RTC
|
||||
# Needed by the board code:
|
||||
select PARALLEL
|
||||
# For ACPI builder:
|
||||
select SERIAL_ISA
|
||||
select ACPI_VMGENID
|
||||
@ -49,6 +49,7 @@ config PC_ACPI
|
||||
|
||||
config I440FX
|
||||
bool
|
||||
imply E1000_PCI
|
||||
select PC_PCI
|
||||
select PC_ACPI
|
||||
select ACPI_SMBUS
|
||||
@ -74,6 +75,7 @@ config Q35
|
||||
bool
|
||||
imply VTD
|
||||
imply AMD_IOMMU
|
||||
imply E1000E_PCI_EXPRESS
|
||||
select PC_PCI
|
||||
select PC_ACPI
|
||||
select PCI_EXPRESS_Q35
|
||||
|
@ -1485,11 +1485,11 @@ static bool vtd_switch_address_space(VTDAddressSpace *as)
|
||||
|
||||
/* Turn off first then on the other */
|
||||
if (use_iommu) {
|
||||
memory_region_set_enabled(&as->sys_alias, false);
|
||||
memory_region_set_enabled(&as->nodmar, false);
|
||||
memory_region_set_enabled(MEMORY_REGION(&as->iommu), true);
|
||||
} else {
|
||||
memory_region_set_enabled(MEMORY_REGION(&as->iommu), false);
|
||||
memory_region_set_enabled(&as->sys_alias, true);
|
||||
memory_region_set_enabled(&as->nodmar, true);
|
||||
}
|
||||
|
||||
if (take_bql) {
|
||||
@ -3286,7 +3286,8 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, int devfn)
|
||||
vtd_dev_as = vtd_bus->dev_as[devfn];
|
||||
|
||||
if (!vtd_dev_as) {
|
||||
snprintf(name, sizeof(name), "intel_iommu_devfn_%d", devfn);
|
||||
snprintf(name, sizeof(name), "vtd-%02x.%x", PCI_SLOT(devfn),
|
||||
PCI_FUNC(devfn));
|
||||
vtd_bus->dev_as[devfn] = vtd_dev_as = g_malloc0(sizeof(VTDAddressSpace));
|
||||
|
||||
vtd_dev_as->bus = bus;
|
||||
@ -3295,44 +3296,53 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, int devfn)
|
||||
vtd_dev_as->context_cache_entry.context_cache_gen = 0;
|
||||
vtd_dev_as->iova_tree = iova_tree_new();
|
||||
|
||||
memory_region_init(&vtd_dev_as->root, OBJECT(s), name, UINT64_MAX);
|
||||
address_space_init(&vtd_dev_as->as, &vtd_dev_as->root, "vtd-root");
|
||||
|
||||
/*
|
||||
* Memory region relationships looks like (Address range shows
|
||||
* only lower 32 bits to make it short in length...):
|
||||
*
|
||||
* |-----------------+-------------------+----------|
|
||||
* | Name | Address range | Priority |
|
||||
* |-----------------+-------------------+----------+
|
||||
* | vtd_root | 00000000-ffffffff | 0 |
|
||||
* | intel_iommu | 00000000-ffffffff | 1 |
|
||||
* | vtd_sys_alias | 00000000-ffffffff | 1 |
|
||||
* | intel_iommu_ir | fee00000-feefffff | 64 |
|
||||
* |-----------------+-------------------+----------|
|
||||
*
|
||||
* We enable/disable DMAR by switching enablement for
|
||||
* vtd_sys_alias and intel_iommu regions. IR region is always
|
||||
* enabled.
|
||||
* Build the DMAR-disabled container with aliases to the
|
||||
* shared MRs. Note that aliasing to a shared memory region
|
||||
* could help the memory API to detect same FlatViews so we
|
||||
* can have devices to share the same FlatView when DMAR is
|
||||
* disabled (either by not providing "intel_iommu=on" or with
|
||||
* "iommu=pt"). It will greatly reduce the total number of
|
||||
* FlatViews of the system hence VM runs faster.
|
||||
*/
|
||||
memory_region_init_alias(&vtd_dev_as->nodmar, OBJECT(s),
|
||||
"vtd-nodmar", &s->mr_nodmar, 0,
|
||||
memory_region_size(&s->mr_nodmar));
|
||||
|
||||
/*
|
||||
* Build the per-device DMAR-enabled container.
|
||||
*
|
||||
* TODO: currently we have per-device IOMMU memory region only
|
||||
* because we have per-device IOMMU notifiers for devices. If
|
||||
* one day we can abstract the IOMMU notifiers out of the
|
||||
* memory regions then we can also share the same memory
|
||||
* region here just like what we've done above with the nodmar
|
||||
* region.
|
||||
*/
|
||||
strcat(name, "-dmar");
|
||||
memory_region_init_iommu(&vtd_dev_as->iommu, sizeof(vtd_dev_as->iommu),
|
||||
TYPE_INTEL_IOMMU_MEMORY_REGION, OBJECT(s),
|
||||
"intel_iommu_dmar",
|
||||
UINT64_MAX);
|
||||
memory_region_init_alias(&vtd_dev_as->sys_alias, OBJECT(s),
|
||||
"vtd_sys_alias", get_system_memory(),
|
||||
0, memory_region_size(get_system_memory()));
|
||||
memory_region_init_io(&vtd_dev_as->iommu_ir, OBJECT(s),
|
||||
&vtd_mem_ir_ops, s, "intel_iommu_ir",
|
||||
VTD_INTERRUPT_ADDR_SIZE);
|
||||
memory_region_init(&vtd_dev_as->root, OBJECT(s),
|
||||
"vtd_root", UINT64_MAX);
|
||||
memory_region_add_subregion_overlap(&vtd_dev_as->root,
|
||||
name, UINT64_MAX);
|
||||
memory_region_init_alias(&vtd_dev_as->iommu_ir, OBJECT(s), "vtd-ir",
|
||||
&s->mr_ir, 0, memory_region_size(&s->mr_ir));
|
||||
memory_region_add_subregion_overlap(MEMORY_REGION(&vtd_dev_as->iommu),
|
||||
VTD_INTERRUPT_ADDR_FIRST,
|
||||
&vtd_dev_as->iommu_ir, 64);
|
||||
address_space_init(&vtd_dev_as->as, &vtd_dev_as->root, name);
|
||||
memory_region_add_subregion_overlap(&vtd_dev_as->root, 0,
|
||||
&vtd_dev_as->sys_alias, 1);
|
||||
&vtd_dev_as->iommu_ir, 1);
|
||||
|
||||
/*
|
||||
* Hook both the containers under the root container, we
|
||||
* switch between DMAR & noDMAR by enable/disable
|
||||
* corresponding sub-containers
|
||||
*/
|
||||
memory_region_add_subregion_overlap(&vtd_dev_as->root, 0,
|
||||
MEMORY_REGION(&vtd_dev_as->iommu),
|
||||
1);
|
||||
0);
|
||||
memory_region_add_subregion_overlap(&vtd_dev_as->root, 0,
|
||||
&vtd_dev_as->nodmar, 0);
|
||||
|
||||
vtd_switch_address_space(vtd_dev_as);
|
||||
}
|
||||
return vtd_dev_as;
|
||||
@ -3676,6 +3686,21 @@ static void vtd_realize(DeviceState *dev, Error **errp)
|
||||
memset(s->vtd_as_by_bus_num, 0, sizeof(s->vtd_as_by_bus_num));
|
||||
memory_region_init_io(&s->csrmem, OBJECT(s), &vtd_mem_ops, s,
|
||||
"intel_iommu", DMAR_REG_SIZE);
|
||||
|
||||
/* Create the shared memory regions by all devices */
|
||||
memory_region_init(&s->mr_nodmar, OBJECT(s), "vtd-nodmar",
|
||||
UINT64_MAX);
|
||||
memory_region_init_io(&s->mr_ir, OBJECT(s), &vtd_mem_ir_ops,
|
||||
s, "vtd-ir", VTD_INTERRUPT_ADDR_SIZE);
|
||||
memory_region_init_alias(&s->mr_sys_alias, OBJECT(s),
|
||||
"vtd-sys-alias", get_system_memory(), 0,
|
||||
memory_region_size(get_system_memory()));
|
||||
memory_region_add_subregion_overlap(&s->mr_nodmar, 0,
|
||||
&s->mr_sys_alias, 0);
|
||||
memory_region_add_subregion_overlap(&s->mr_nodmar,
|
||||
VTD_INTERRUPT_ADDR_FIRST,
|
||||
&s->mr_ir, 1);
|
||||
|
||||
sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->csrmem);
|
||||
/* No corresponding destroy */
|
||||
s->iotlb = g_hash_table_new_full(vtd_uint64_hash, vtd_uint64_equal,
|
||||
|
@ -12,12 +12,15 @@ config IOAPIC
|
||||
|
||||
config ARM_GIC
|
||||
bool
|
||||
select MSI_NONBROKEN
|
||||
|
||||
config OPENPIC
|
||||
bool
|
||||
select MSI_NONBROKEN
|
||||
|
||||
config APIC
|
||||
bool
|
||||
select MSI_NONBROKEN
|
||||
|
||||
config ARM_GIC_KVM
|
||||
bool
|
||||
|
@ -11,6 +11,7 @@ config I82378
|
||||
select I8254
|
||||
select I82374
|
||||
select MC146818RTC
|
||||
select PCSPK
|
||||
|
||||
config PC87312
|
||||
bool
|
||||
@ -29,6 +30,7 @@ config PIIX4
|
||||
# For historical reasons, SuperIO devices are created in the board
|
||||
# for PIIX4.
|
||||
select ISA_BUS
|
||||
select USB_UHCI
|
||||
|
||||
config VT82C686
|
||||
bool
|
||||
|
@ -34,7 +34,7 @@ config PCI_TESTDEV
|
||||
config EDU
|
||||
bool
|
||||
default y if TEST_DEVICES
|
||||
depends on PCI
|
||||
depends on PCI && MSI_NONBROKEN
|
||||
|
||||
config PCA9552
|
||||
bool
|
||||
@ -67,7 +67,7 @@ config MACIO
|
||||
config IVSHMEM_DEVICE
|
||||
bool
|
||||
default y if PCI_DEVICES
|
||||
depends on PCI && LINUX && IVSHMEM
|
||||
depends on PCI && LINUX && IVSHMEM && MSI_NONBROKEN
|
||||
|
||||
config ECCMEMCTL
|
||||
bool
|
||||
|
@ -28,7 +28,7 @@ config E1000_PCI
|
||||
config E1000E_PCI_EXPRESS
|
||||
bool
|
||||
default y if PCI_DEVICES
|
||||
depends on PCI_EXPRESS
|
||||
depends on PCI_EXPRESS && MSI_NONBROKEN
|
||||
|
||||
config RTL8139_PCI
|
||||
bool
|
||||
@ -107,7 +107,7 @@ config ETSEC
|
||||
config ROCKER
|
||||
bool
|
||||
default y if PCI_DEVICES
|
||||
depends on PCI
|
||||
depends on PCI && MSI_NONBROKEN
|
||||
|
||||
config CAN_BUS
|
||||
bool
|
||||
|
@ -1,7 +1,7 @@
|
||||
config PCIE_PORT
|
||||
bool
|
||||
default y if PCI_DEVICES
|
||||
depends on PCI_EXPRESS
|
||||
depends on PCI_EXPRESS && MSI_NONBROKEN
|
||||
|
||||
config PXB
|
||||
bool
|
||||
@ -10,12 +10,12 @@ config PXB
|
||||
config XIO3130
|
||||
bool
|
||||
default y if PCI_DEVICES
|
||||
depends on PCI_EXPRESS
|
||||
depends on PCI_EXPRESS && MSI_NONBROKEN
|
||||
|
||||
config IOH3420
|
||||
bool
|
||||
default y if PCI_DEVICES
|
||||
depends on PCI_EXPRESS
|
||||
depends on PCI_EXPRESS && MSI_NONBROKEN
|
||||
|
||||
config I82801B11
|
||||
bool
|
||||
|
@ -49,3 +49,4 @@ config PCI_EXPRESS_XILINX
|
||||
config PCI_EXPRESS_DESIGNWARE
|
||||
bool
|
||||
select PCI_EXPRESS
|
||||
select MSI_NONBROKEN
|
||||
|
@ -7,3 +7,9 @@ config PCI_EXPRESS
|
||||
|
||||
config PCI_DEVICES
|
||||
bool
|
||||
|
||||
config MSI_NONBROKEN
|
||||
# selected by interrupt controllers that do not support MSI,
|
||||
# or support it and have a good implementation. See commit
|
||||
# 47d2b0f33c664533b8dbd5cb17faa8e6a01afe1f.
|
||||
bool
|
||||
|
@ -2,12 +2,14 @@ config PSERIES
|
||||
bool
|
||||
imply PCI_DEVICES
|
||||
imply TEST_DEVICES
|
||||
imply VIRTIO_VGA
|
||||
select DIMM
|
||||
select PCI
|
||||
select SPAPR_VSCSI
|
||||
select VFIO if LINUX # needed by spapr_pci_vfio.c
|
||||
select XICS_SPAPR
|
||||
select XIVE_SPAPR
|
||||
select MSI_NONBROKEN
|
||||
|
||||
config SPAPR_RNG
|
||||
bool
|
||||
@ -36,6 +38,7 @@ config PPC440
|
||||
bool
|
||||
imply PCI_DEVICES
|
||||
imply TEST_DEVICES
|
||||
imply E1000_PCI
|
||||
select PCI_EXPRESS
|
||||
select PPC4XX
|
||||
select SERIAL
|
||||
@ -63,7 +66,6 @@ config PREP
|
||||
imply TEST_DEVICES
|
||||
select CS4231A
|
||||
select PREP_PCI
|
||||
select I82374
|
||||
select I82378
|
||||
select LSI_SCSI_PCI
|
||||
select M48T59
|
||||
@ -97,6 +99,7 @@ config MAC_NEWWORLD
|
||||
config E500
|
||||
bool
|
||||
imply AT24C
|
||||
imply VIRTIO_PCI
|
||||
select ETSEC
|
||||
select OPENPIC
|
||||
select PLATFORM_BUS
|
||||
|
3
hw/rdma/Kconfig
Normal file
3
hw/rdma/Kconfig
Normal file
@ -0,0 +1,3 @@
|
||||
config VMW_PVRDMA
|
||||
default y if PCI_DEVICES
|
||||
depends on PVRDMA && PCI && MSI_NONBROKEN
|
@ -1,5 +1,3 @@
|
||||
ifeq ($(CONFIG_PVRDMA),y)
|
||||
obj-$(CONFIG_PCI) += rdma_utils.o rdma_backend.o rdma_rm.o rdma.o
|
||||
obj-$(CONFIG_PCI) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \
|
||||
obj-$(CONFIG_VMW_PVRDMA) += rdma_utils.o rdma_backend.o rdma_rm.o rdma.o
|
||||
obj-$(CONFIG_VMW_PVRDMA) += vmw/pvrdma_dev_ring.o vmw/pvrdma_cmd.o \
|
||||
vmw/pvrdma_qp_ops.o vmw/pvrdma_main.o
|
||||
endif
|
||||
|
@ -6,6 +6,7 @@ config HART
|
||||
|
||||
config SIFIVE
|
||||
bool
|
||||
select MSI_NONBROKEN
|
||||
|
||||
config SIFIVE_E
|
||||
bool
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "qemu/log.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/pci/msi.h"
|
||||
#include "target/riscv/cpu.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "hw/riscv/sifive_plic.h"
|
||||
@ -458,6 +459,8 @@ static void sifive_plic_realize(DeviceState *dev, Error **errp)
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
msi_nonbroken = true;
|
||||
}
|
||||
|
||||
static void sifive_plic_class_init(ObjectClass *klass, void *data)
|
||||
|
@ -9,3 +9,4 @@ config S390_CCW_VIRTIO
|
||||
select S390_FLIC
|
||||
select SCLPCONSOLE
|
||||
select VIRTIO_CCW
|
||||
select MSI_NONBROKEN
|
||||
|
@ -2,6 +2,7 @@ config R2D
|
||||
bool
|
||||
imply PCI_DEVICES
|
||||
imply TEST_DEVICES
|
||||
imply RTL8139_PCI
|
||||
select I82378 if TEST_DEVICES
|
||||
select IDE_MMIO
|
||||
select PFLASH_CFI02
|
||||
|
@ -3,13 +3,13 @@ config SUN4U
|
||||
imply PCI_DEVICES
|
||||
imply SUNHME
|
||||
imply TEST_DEVICES
|
||||
imply PARALLEL
|
||||
select M48T59
|
||||
select ISA_BUS
|
||||
select FDC
|
||||
select SERIAL_ISA
|
||||
select PCI_SABRE
|
||||
select IDE_CMD646
|
||||
select PARALLEL
|
||||
select PCKBD
|
||||
select SIMBA
|
||||
|
||||
|
@ -105,8 +105,8 @@ struct VTDAddressSpace {
|
||||
uint8_t devfn;
|
||||
AddressSpace as;
|
||||
IOMMUMemoryRegion iommu;
|
||||
MemoryRegion root;
|
||||
MemoryRegion sys_alias;
|
||||
MemoryRegion root; /* The root container of the device */
|
||||
MemoryRegion nodmar; /* The alias of shared nodmar MR */
|
||||
MemoryRegion iommu_ir; /* Interrupt region: 0xfeeXXXXX */
|
||||
IntelIOMMUState *iommu_state;
|
||||
VTDContextCacheEntry context_cache_entry;
|
||||
@ -221,6 +221,9 @@ union VTD_IR_MSIAddress {
|
||||
struct IntelIOMMUState {
|
||||
X86IOMMUState x86_iommu;
|
||||
MemoryRegion csrmem;
|
||||
MemoryRegion mr_nodmar;
|
||||
MemoryRegion mr_ir;
|
||||
MemoryRegion mr_sys_alias;
|
||||
uint8_t csr[DMAR_REG_SIZE]; /* register values */
|
||||
uint8_t wmask[DMAR_REG_SIZE]; /* R/W bytes */
|
||||
uint8_t w1cmask[DMAR_REG_SIZE]; /* RW1C(Write 1 to Clear) bytes */
|
||||
|
9
memory.c
9
memory.c
@ -1649,10 +1649,17 @@ void memory_region_init_ram_device_ptr(MemoryRegion *mr,
|
||||
uint64_t size,
|
||||
void *ptr)
|
||||
{
|
||||
memory_region_init_ram_ptr(mr, owner, name, size, ptr);
|
||||
memory_region_init(mr, owner, name, size);
|
||||
mr->ram = true;
|
||||
mr->terminates = true;
|
||||
mr->ram_device = true;
|
||||
mr->ops = &ram_device_mem_ops;
|
||||
mr->opaque = mr;
|
||||
mr->destructor = memory_region_destructor_ram;
|
||||
mr->dirty_log_mask = tcg_enabled() ? (1 << DIRTY_MEMORY_CODE) : 0;
|
||||
/* qemu_ram_alloc_from_ptr cannot fail with ptr != NULL. */
|
||||
assert(ptr != NULL);
|
||||
mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal);
|
||||
}
|
||||
|
||||
void memory_region_init_alias(MemoryRegion *mr,
|
||||
|
@ -592,7 +592,7 @@ class KconfigParser:
|
||||
if not self.src.startswith(rest, self.cursor):
|
||||
return False
|
||||
length = len(rest)
|
||||
if self.src[self.cursor + length].isalnum() or self.src[self.cursor + length] == '|':
|
||||
if self.src[self.cursor + length].isalnum() or self.src[self.cursor + length] == '_':
|
||||
return False
|
||||
self.cursor += length
|
||||
return True
|
||||
|
@ -131,6 +131,17 @@ sev_ram_block_added(RAMBlockNotifier *n, void *host, size_t size)
|
||||
{
|
||||
int r;
|
||||
struct kvm_enc_region range;
|
||||
ram_addr_t offset;
|
||||
MemoryRegion *mr;
|
||||
|
||||
/*
|
||||
* The RAM device presents a memory region that should be treated
|
||||
* as IO region and should not be pinned.
|
||||
*/
|
||||
mr = memory_region_from_host(host, &offset);
|
||||
if (mr && memory_region_is_ram_device(mr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
range.addr = (__u64)(unsigned long)host;
|
||||
range.size = size;
|
||||
|
@ -195,7 +195,6 @@ check-qtest-i386-$(CONFIG_SLIRP) += tests/test-netfilter$(EXESUF)
|
||||
check-qtest-i386-$(CONFIG_POSIX) += tests/test-filter-mirror$(EXESUF)
|
||||
check-qtest-i386-$(CONFIG_RTL8139_PCI) += tests/test-filter-redirector$(EXESUF)
|
||||
check-qtest-i386-y += tests/migration-test$(EXESUF)
|
||||
check-qtest-i386-y += tests/test-announce-self$(EXESUF)
|
||||
check-qtest-i386-y += tests/test-x86-cpuid-compat$(EXESUF)
|
||||
check-qtest-i386-y += tests/numa-test$(EXESUF)
|
||||
check-qtest-x86_64-y += $(check-qtest-i386-y)
|
||||
@ -232,7 +231,6 @@ check-qtest-ppc64-y += $(check-qtest-ppc-y)
|
||||
check-qtest-ppc64-$(CONFIG_PSERIES) += tests/device-plug-test$(EXESUF)
|
||||
check-qtest-ppc64-$(CONFIG_POWERNV) += tests/pnv-xscom-test$(EXESUF)
|
||||
check-qtest-ppc64-y += tests/migration-test$(EXESUF)
|
||||
check-qtest-ppc64-y += tests/test-announce-self$(EXESUF)
|
||||
check-qtest-ppc64-$(CONFIG_PSERIES) += tests/rtas-test$(EXESUF)
|
||||
check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF)
|
||||
check-qtest-ppc64-$(CONFIG_USB_UHCI) += tests/usb-hcd-uhci-test$(EXESUF)
|
||||
@ -817,7 +815,6 @@ tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y)
|
||||
tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
|
||||
tests/cpu-plug-test$(EXESUF): tests/cpu-plug-test.o
|
||||
tests/migration-test$(EXESUF): tests/migration-test.o
|
||||
tests/test-announce-self$(EXESUF): tests/test-announce-self.o
|
||||
tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
|
||||
tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y)
|
||||
tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y)
|
||||
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
* QTest testcase for qemu_announce_self
|
||||
*
|
||||
* Copyright (c) 2017 Red hat, Inc.
|
||||
* Copyright (c) 2014 SUSE LINUX Products GmbH
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "libqtest.h"
|
||||
#include "qapi/qmp/qdict.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "qemu/iov.h"
|
||||
#include "libqos/libqos-pc.h"
|
||||
#include "libqos/libqos-spapr.h"
|
||||
|
||||
#ifndef ETH_P_RARP
|
||||
#define ETH_P_RARP 0x8035
|
||||
#endif
|
||||
|
||||
|
||||
static void test_announce(QTestState *qs, int socket)
|
||||
{
|
||||
char buffer[60];
|
||||
int len;
|
||||
QDict *rsp;
|
||||
int ret;
|
||||
uint16_t *proto = (uint16_t *)&buffer[12];
|
||||
|
||||
rsp = qtest_qmp(qs, "{ 'execute' : 'announce-self', "
|
||||
" 'arguments': {"
|
||||
" 'initial': 50, 'max': 550,"
|
||||
" 'rounds': 10, 'step': 50 } }");
|
||||
assert(!qdict_haskey(rsp, "error"));
|
||||
qobject_unref(rsp);
|
||||
|
||||
/* Catch the packet and make sure it's a RARP */
|
||||
ret = qemu_recv(socket, &len, sizeof(len), 0);
|
||||
g_assert_cmpint(ret, ==, sizeof(len));
|
||||
len = ntohl(len);
|
||||
|
||||
ret = qemu_recv(socket, buffer, len, 0);
|
||||
g_assert_cmpint(*proto, ==, htons(ETH_P_RARP));
|
||||
}
|
||||
|
||||
static void setup(gconstpointer data)
|
||||
{
|
||||
QTestState *qs;
|
||||
void (*func) (QTestState *qs, int socket) = data;
|
||||
int sv[2], ret;
|
||||
|
||||
ret = socketpair(PF_UNIX, SOCK_STREAM, 0, sv);
|
||||
g_assert_cmpint(ret, !=, -1);
|
||||
|
||||
qs = qtest_initf("-netdev socket,fd=%d,id=hs0 -device "
|
||||
"virtio-net-pci,netdev=hs0", sv[1]);
|
||||
func(qs, sv[0]);
|
||||
|
||||
/* End test */
|
||||
close(sv[0]);
|
||||
qtest_quit(qs);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
g_test_init(&argc, &argv, NULL);
|
||||
qtest_add_data_func("/virtio/net/test_announce_self", test_announce, setup);
|
||||
|
||||
return g_test_run();
|
||||
}
|
@ -15,6 +15,10 @@
|
||||
#include "libqos/qgraph.h"
|
||||
#include "libqos/virtio-net.h"
|
||||
|
||||
#ifndef ETH_P_RARP
|
||||
#define ETH_P_RARP 0x8035
|
||||
#endif
|
||||
|
||||
#define PCI_SLOT_HP 0x06
|
||||
#define PCI_SLOT 0x04
|
||||
|
||||
@ -168,6 +172,31 @@ static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc)
|
||||
}
|
||||
}
|
||||
|
||||
static void announce_self(void *obj, void *data, QGuestAllocator *t_alloc)
|
||||
{
|
||||
int *sv = data;
|
||||
char buffer[60];
|
||||
int len;
|
||||
QDict *rsp;
|
||||
int ret;
|
||||
uint16_t *proto = (uint16_t *)&buffer[12];
|
||||
|
||||
rsp = qmp("{ 'execute' : 'announce-self', "
|
||||
" 'arguments': {"
|
||||
" 'initial': 50, 'max': 550,"
|
||||
" 'rounds': 10, 'step': 50 } }");
|
||||
assert(!qdict_haskey(rsp, "error"));
|
||||
qobject_unref(rsp);
|
||||
|
||||
/* Catch the packet and make sure it's a RARP */
|
||||
ret = qemu_recv(sv[0], &len, sizeof(len), 0);
|
||||
g_assert_cmpint(ret, ==, sizeof(len));
|
||||
len = ntohl(len);
|
||||
|
||||
ret = qemu_recv(sv[0], buffer, len, 0);
|
||||
g_assert_cmpint(*proto, ==, htons(ETH_P_RARP));
|
||||
}
|
||||
|
||||
static void virtio_net_test_cleanup(void *sockets)
|
||||
{
|
||||
int *sv = sockets;
|
||||
@ -233,6 +262,7 @@ static void register_virtio_net_test(void)
|
||||
qos_add_test("basic", "virtio-net", send_recv_test, &opts);
|
||||
qos_add_test("rx_stop_cont", "virtio-net", stop_cont_test, &opts);
|
||||
#endif
|
||||
qos_add_test("announce-self", "virtio-net", announce_self, &opts);
|
||||
|
||||
/* These tests do not need a loopback backend. */
|
||||
opts.before = virtio_net_test_setup_nosocket;
|
||||
|
Loading…
Reference in New Issue
Block a user