summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * libvhost-user: replace qemu/memfd.h usageMarc-André Lureau2020-12-081-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Undo the damage from commit 5f9ff1eff3 ("libvhost-user: Support tracking inflight I/O in shared memory") which introduced glib dependency through osdep.h inclusion. libvhost-user.c tries to stay free from glib usage. Use glibc memfd_create directly when available (assumed so when MFD_ALLOW_SEALING is defined). A following commit will make the project standalone and check for memfd API at configure time, instead of a panic at runtime. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20201125100640.366523-3-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * libvhost-user: replace qemu/bswap.h with glibc endian.hMarc-André Lureau2020-12-081-37/+40
| | | | | | | | | | | | | | | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20201125100640.366523-2-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * hw: add compat machines for 6.0Cornelia Huck2020-12-089-6/+71
| | | | | | | | | | | | | | | | | | | | | | Add 6.0 machine types for arm/i440fx/q35/s390x/spapr. Signed-off-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <20201109173928.1001764-1-cohuck@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Remove primary_dev memberJuan Quintela2020-12-082-32/+24Star
| | | | | | | | | | | | | | | | | | Only three uses remained, and we can remove them on that case. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-28-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: simplify failover_unplug_primaryJuan Quintela2020-12-081-15/+10Star
| | | | | | | | | | | | | | | | | | We can calculate device just once. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-27-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Caller of this two functions already have primary_devJuan Quintela2020-12-081-13/+14
| | | | | | | | | | | | | | | | | | Pass it as an argument. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-26-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: We don't need to cache primary_device_id anymoreJuan Quintela2020-12-082-11/+10Star
| | | | | | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-25-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: split failover_find_primary_device_id()Juan Quintela2020-12-081-16/+47
| | | | | | | | | | | | | | | | | | So we can calculate the device id when we need it. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-24-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: remove failover_find_primary_device() error parameterJuan Quintela2020-12-081-6/+3Star
| | | | | | | | | | | | | | | | | | It can never give one error. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-23-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: make sure that id always existJuan Quintela2020-12-082-3/+4
| | | | | | | | | | | | | | | | | | | | We check that it exist at device creation time, so we don't have to check anywhere else. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-22-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: simplify qdev_device_add()Juan Quintela2020-12-081-26/+6Star
| | | | | | | | | | | | | | | | | | | | We don't need to walk the opts by hand. qmp_opt_get() already does that. And then we can remove the functions that did that walk. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-21-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: simplify qdev_device_add() failover caseJuan Quintela2020-12-081-5/+6
| | | | | | | | | | | | | | | | | | Just put allthe logic inside the same if. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-20-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Rename to failover_find_primary_device()Juan Quintela2020-12-081-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit: * Rename them to failover_find_primary_devices() so - it starts with failover_ - it don't connect anything, just find the primary device * Create documentation for the function Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-19-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: virtio_net_connect_failover_devices() does nothingJuan Quintela2020-12-081-15/+2Star
| | | | | | | | | | | | | | | | | | It just calls virtio_net_find_primary(), so just update the callers. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-18-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Rename function to hide_device()Juan Quintela2020-12-083-19/+20
| | | | | | | | | | | | | | | | | | You should not use pasive. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-17-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: should_be_hidden() should take a boolJuan Quintela2020-12-083-35/+13Star
| | | | | | | | | | | | | | | | | | | | | | | | | | We didn't use at all the -1 value, and we don't really care. It was only used for the cases when this is not the device that we are searching for. And in that case we should not hide the device. Once there, simplify virtio-Snet_primary_should_be_hidden. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-16-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: simplify virtio_net_find_primary()Juan Quintela2020-12-081-15/+3Star
| | | | | | | | | | | | | | | | | | | | a - is_my_primary() never sets one error b - If we return 1, primary_device_id is always set Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-15-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Remove memory leakJuan Quintela2020-12-081-3/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two things, at this point: * n->primary_device_id has to be set, otherwise virtio_net_find_primary don't work. So we have a leak here. * it has to be exactly the same that prim_dev->id because what qdev_find_recursive() does is just compare this two values. So remove the unneeded assignment and leaky bits. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-14-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Remove primary_device_dictJuan Quintela2020-12-082-14/+4Star
| | | | | | | | | | | | | | | | | | It was only used once. And we have there opts->id, so no need for it. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-13-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: remove standby_id variableJuan Quintela2020-12-082-9/+3Star
| | | | | | | | | | | | | | | | | | We can calculate it, and we only use it once anyways. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-12-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Remove primary_device_optsJuan Quintela2020-12-082-17/+5Star
| | | | | | | | | | | | | | | | | | | | It was really only used once, in failover_add_primary(). Just search for it on global opts when it is needed. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-11-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: g_strcmp0() knows how to handle NULLJuan Quintela2020-12-081-1/+1
| | | | | | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-10-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Rename bool to failover_primary_hiddenJuan Quintela2020-12-082-8/+9
| | | | | | | | | | | | | | | | | | | | You should not use passive naming variables. And once there, be able to search for them. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-9-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: qdev_device_add() returns err or dev setJuan Quintela2020-12-081-7/+0Star
| | | | | | | | | | | | | | | | | | Never both. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-8-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Remove external partially_hotplugged propertyJuan Quintela2020-12-081-4/+0Star
| | | | | | | | | | | | | | | | | | | | It was only set "once", and with the wrong value. As far as I can see, libvirt still don't use it. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-7-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Remove unused parameterJuan Quintela2020-12-081-5/+3Star
| | | | | | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-6-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: primary bus is only used once, and where it is setJuan Quintela2020-12-082-5/+4Star
| | | | | | | | | | | | | | | | | | Just remove the struct member. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-5-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: Use always atomics for primary_should_be_hiddenJuan Quintela2020-12-081-1/+1
| | | | | | | | | | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-4-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * failover: fix indentantionJuan Quintela2020-12-082-20/+17Star
| | | | | | | | | | | | | | | | | | Once there, remove not needed cast. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-3-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * unit-test: Add the binary file and clear diff.hYubo Miao2020-12-082-1/+0Star
| | | | | | | | | | | | | | | | | | | | Add the binary file DSDT.pxb and clear bios-tables-test-allowed-diff.h Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Message-Id: <20201119014841.7298-10-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * unit-test: Add testcase for pxbYubo Miao2020-12-081-6/+52
| | | | | | | | | | | | | | | | | | | | Add testcase for pxb to make sure the ACPI table is correct for guest. Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Message-Id: <20201119014841.7298-9-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * unit-test: The files changed.Yubo Miao2020-12-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unit-test is seperated into three patches: 1. The files changed and list in bios-tables-test-allowed-diff.h 2. The unit-test 3. The binary file and clear bios-tables-test-allowed-diff.h The ASL diff would also be listed. Sice there are 1000+lines diff, some changes would be omitted. * Original Table Header: * Signature "DSDT" - * Length 0x000014BB (5307) + * Length 0x00001E7A (7802) * Revision 0x02 - * Checksum 0xD1 + * Checksum 0x57 * OEM ID "BOCHS " * OEM Table ID "BXPCDSDT" * OEM Revision 0x00000001 (1) + Device (PC80) + { + Name (_HID, "PNP0A08" /* PCI Express Bus */) // _HID: Hardware ID + Name (_CID, "PNP0A03" /* PCI Bus */) // _CID: Compatible ID + Name (_ADR, Zero) // _ADR: Address + Name (_CCA, One) // _CCA: Cache Coherency Attribute + Name (_SEG, Zero) // _SEG: PCI Segment + Name (_BBN, 0x80) // _BBN: BIOS Bus Number + Name (_UID, 0x80) // _UID: Unique ID + Name (_STR, Unicode ("pxb Device")) // _STR: Description String + Name (_PRT, Package (0x80) // _PRT: PCI Routing Table + { + Package (0x04) + { + 0xFFFF, + Zero, + GSI0, + Zero + }, + Packages are omitted. + Package (0x04) + { + 0x001FFFFF, + 0x03, + GSI2, + Zero + } + }) + Device (GSI0) + { + Name (_HID, "PNP0C0F" /* PCI Interrupt Link Device */) // _HID: Hardware ID + Name (_UID, Zero) // _UID: Unique ID + Name (_PRS, ResourceTemplate () // _PRS: Possible Resource Settings + { + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) + { + 0x00000023, + } + }) + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) + { + 0x00000023, + } + }) + Method (_SRS, 1, NotSerialized) // _SRS: Set Resource Settings + { + } + } GSI1,2,3 are omitted. + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, + 0x0000, // Granularity + 0x0080, // Range Minimum + 0x0080, // Range Maximum + 0x0000, // Translation Offset + 0x0001, // Length + ,, ) + }) + Name (SUPP, Zero) + Name (CTRL, Zero) + Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities + { + CreateDWordField (Arg3, Zero, CDW1) + If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */)) + { + CreateDWordField (Arg3, 0x04, CDW2) + CreateDWordField (Arg3, 0x08, CDW3) + SUPP = CDW2 /* \_SB_.PC80._OSC.CDW2 */ + CTRL = CDW3 /* \_SB_.PC80._OSC.CDW3 */ + CTRL &= 0x1F + If ((Arg1 != One)) + { + CDW1 |= 0x08 + } + + If ((CDW3 != CTRL)) + { + CDW1 |= 0x10 + } + + CDW3 = CTRL /* \_SB_.PC80.CTRL */ + Return (Arg3) + } + Else + { + CDW1 |= 0x04 + Return (Arg3) + } + } DSM is are omitted Device (PCI0) { Name (_HID, "PNP0A08" /* PCI Express Bus */) // _HID: Hardware ID WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode, 0x0000, // Granularity 0x0000, // Range Minimum - 0x00FF, // Range Maximum + 0x007F, // Range Maximum 0x0000, // Translation Offset - 0x0100, // Length + 0x0080, // Length Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Message-Id: <20201119014841.7298-8-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * acpi: Align the size to 128kYubo Miao2020-12-081-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If table size is changed between virt_acpi_build and virt_acpi_build_update, the table size would not be updated to UEFI, therefore, just align the size to 128kb, which is enough and same with x86. It would warn if 64k is not enough and the align size should be updated. Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Message-Id: <20201119014841.7298-7-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * acpi/gpex: Build tables for pxbYubo Miao2020-12-083-2/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resources of pxbs are obtained by crs_build and the resources used by pxbs would be moved from the resources defined for host-bridge. The resources for pxb are composed of following two parts: 1. The bar space of the pci-bridge/pcie-root-port behined it 2. The config space of devices behind it. Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Message-Id: <20201119014841.7298-6-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * acpi: Extract crs build form acpi_build.cYubo Miao2020-12-083-293/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract crs build form acpi_build.c, the function could also be used to build the crs for pxbs for arm. The resources are composed by two parts: 1. The bar space of pci-bridge/pcie-root-ports 2. The resources needed by devices behind PXBs. The base and limit of memory/io are obtained from the config via two APIs: pci_bridge_get_base and pci_bridge_get_limit Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Message-Id: <20201119014841.7298-5-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * hw/arm/virt: Write extra pci roots into fw_cfgJiahui Cen2020-12-082-2/+6
| | | | | | | | | | | | | | | | | | | | | | Add bus property to virt machine for primary PCI root bus and use it to add extra pci roots behind it. Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Message-Id: <20201119014841.7298-4-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * fw_cfg: Refactor extra pci roots additionJiahui Cen2020-12-083-17/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract extra pci roots addition from pc machine, which could be used by other machines. In order to make uefi get the extra roots, it is necessary to write extra roots into fw_cfg. And only if the uefi knows there are extra roots, the config spaces of devices behind the root could be obtained. Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Message-Id: <20201119014841.7298-3-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * acpi/gpex: Extract two APIs from acpi_dsdt_add_pciYubo Miao2020-12-081-49/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract two APIs acpi_dsdt_add_pci_route_table and acpi_dsdt_add_pci_osc from acpi_dsdt_add_pci. The first API is used to specify the pci route table and the second API is used to declare the operation system capabilities. These two APIs would be used to specify the pxb-pcie in DSDT. Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Message-Id: <20201119014841.7298-2-cenjiahui@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio: reset device on bad guest index in virtio_load()John Levon2020-12-081-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we find a queue with an inconsistent guest index value, explicitly mark the device as needing a reset - and broken - via virtio_error(). There's at least one driver implementation - the virtio-win NetKVM driver - that is able to handle a VIRTIO_CONFIG_S_NEEDS_RESET notification and successfully restore the device to a working state. Other implementations do not correctly handle this, but as the VQ is not in a functional state anyway, this is still worth doing. Signed-off-by: John Levon <john.levon@nutanix.com> Message-Id: <20201120185103.GA442386@sent> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * memory: Skip bad range assertion if notifier is DEVIOTLB_UNMAP typeEugenio Pérez2020-12-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Device IOTLB invalidations can unmap arbitrary ranges, eiter outside of the memory region or even [0, ~0ULL] for all the space. The assertion could be hit by a guest, and rhel7 guest effectively hit it. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20201116165506.31315-6-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * intel_iommu: Skip page walking on device iotlb invalidationsEugenio Pérez2020-12-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although they didn't reach the notifier because of the filtering in memory_region_notify_iommu_one, the vt-d was still splitting huge memory invalidations in chunks. Skipping it. This improves performance in case of netperf with vhost-net: * TCP_STREAM: From 1923.6Mbit/s to 2175.13Mbit/s (13%) * TCP_RR: From 8464.73 trans/s to 8932.703333 trans/s (5.5%) * UDP_RR: From 8562.08 trans/s to 9005.62/s (5.1%) * UDP_STREAM: No change observed (insignificant 0.1% improvement) Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20201116165506.31315-5-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * memory: Add IOMMU_NOTIFIER_DEVIOTLB_UNMAP IOMMUTLBNotificationTypeEugenio Pérez2020-12-083-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to differentiate between regular IOMMU map/unmap events and DEVIOTLB unmap. Doing so, notifiers that only need device IOTLB invalidations will not receive regular IOMMU unmappings. Adapt intel and vhost to use it. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20201116165506.31315-4-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * memory: Add IOMMUTLBEventEugenio Pérez2020-12-089-122/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way we can tell between regular IOMMUTLBEntry (entry of IOMMU hardware) and notifications. In the notifications, we set explicitly if it is a MAPs or an UNMAP, instead of trusting in entry permissions to differentiate them. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20201116165506.31315-3-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
| * memory: Rename memory_region_notify_one to memory_region_notify_iommu_oneEugenio Pérez2020-12-085-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous name didn't reflect the iommu operation. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20201116165506.31315-2-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-user-scsi: Fix memleaks in vus_proc_req()Alex Chen2020-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'elem' is allocated memory in vu_queue_pop(), and its memory should be freed in all error branches after vu_queue_pop(). In addition, in order to free the 'elem' memory outside of while(1) loop, move the definition of 'elem' to the beginning of vus_proc_req(). Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Alex Chen <alex.chen@huawei.com> Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Message-Id: <20201125013055.34147-1-alex.chen@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Merge remote-tracking branch ↵Peter Maydell2020-12-097-63/+163
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/huth-gitlab/tags/pull-request-2020-12-09' into staging * Gitlab-CI improvement patches by Philippe * Some small fixes for tests * Fix coverity warning in the mcf5206 code # gpg: Signature made Wed 09 Dec 2020 07:13:12 GMT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/huth-gitlab/tags/pull-request-2020-12-09: hw/m68k/mcf5206: Don't leak IRQs in mcf5206_mbar_realize() gitlab-ci: Move coroutine tests across to gitlab gitlab-ci: Move user-static test across to gitlab gitlab-ci: Update 'build-disabled' to cover all configurable options gitlab-ci: Split CONFIGURE_ARGS one argument per line for build-disabled fuzz: avoid double-fetches by default tests/qtest/fuzz-test: Quit test_lp1878642 once done test-qga: fix a resource leak in test_qga_guest_get_osinfo() gitlab-ci: Add Xen cross-build jobs gitlab-ci: Add KVM s390x cross-build jobs gitlab-ci: Introduce 'cross_accel_build_job' template gitlab-ci: Replace YAML anchors by extends (cross_system_build_job) gitlab-ci: Document 'build-tcg-disabled' is a KVM X86 job Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | hw/m68k/mcf5206: Don't leak IRQs in mcf5206_mbar_realize()Peter Maydell2020-12-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity points out that the realize function for the TYPE_MCF5206_MBAR device leaks the IRQ array it allocates with qemu_allocate_irqs(). Keep a pointer to it in the device state struct to avoid the leak. (Since it needs to stay around for the life of the simulation there is no need to actually free it, and the leak was harmless.) Fixes: Coverity CID 1432412 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <huth@tuxfamily.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201120172314.14725-1-peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | gitlab-ci: Move coroutine tests across to gitlabPhilippe Mathieu-Daudé2020-12-092-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similarly to commit 8cdb2cef3f1, move the coroutine tests to GitLab. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201108204535.2319870-13-philmd@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> [thuth: Replaced Travis by Gitlab-CI in comment] Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | gitlab-ci: Move user-static test across to gitlabPhilippe Mathieu-Daudé2020-12-092-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Similarly to commit 8cdb2cef3f1, move the user-static test to GitLab. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201108204535.2319870-11-philmd@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * | gitlab-ci: Update 'build-disabled' to cover all configurable optionsPhilippe Mathieu-Daudé2020-12-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add these missing options to the 'build-disabled' job: --disable-auth-pam (commit 8953caf3cd38) --disable-gcrypt (commit 91bfcdb01d48) --disable-keyring (commit 54e7aac05624) --disable-libudev (commit 5c53015a480b) --disable-opengl (commit da076ffed6b9) --disable-sparse (commit 03b4fe7de226) Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> [thuth: Dropped the unnecessary hunk with --disable-vhost-user-blk-server] Message-Id: <20201108204535.2319870-7-philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>