Commit Graph

82703 Commits

Author SHA1 Message Date
Juan Quintela
518eda9fda failover: g_strcmp0() knows how to handle NULL
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>
2020-12-08 13:48:57 -05:00
Juan Quintela
e2bde83e23 failover: Rename bool to failover_primary_hidden
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>
2020-12-08 13:48:57 -05:00
Juan Quintela
3d1c7a9782 failover: qdev_device_add() returns err or dev set
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>
2020-12-08 13:48:57 -05:00
Juan Quintela
594d308b93 failover: Remove external partially_hotplugged property
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>
2020-12-08 13:48:57 -05:00
Juan Quintela
82ceb65799 failover: Remove unused parameter
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>
2020-12-08 13:48:57 -05:00
Juan Quintela
78274682b7 failover: primary bus is only used once, and where it is set
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>
2020-12-08 13:48:57 -05:00
Juan Quintela
587f2fcb93 failover: Use always atomics for primary_should_be_hidden
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>
2020-12-08 13:48:57 -05:00
Juan Quintela
1c775d65d4 failover: fix indentantion
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>
2020-12-08 13:48:57 -05:00
Yubo Miao
fe1127da11 unit-test: Add the binary file and clear diff.h
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>
2020-12-08 13:48:57 -05:00
Yubo Miao
1da638b165 unit-test: Add testcase for pxb
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>
2020-12-08 13:48:57 -05:00
Yubo Miao
128e232281 unit-test: The files changed.
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>
2020-12-08 13:48:57 -05:00
Yubo Miao
451b157041 acpi: Align the size to 128k
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>
2020-12-08 13:48:57 -05:00
Yubo Miao
6f9765fbad acpi/gpex: Build tables for pxb
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>
2020-12-08 13:48:57 -05:00
Yubo Miao
37d5c0a8ff acpi: Extract crs build form acpi_build.c
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>
2020-12-08 13:48:57 -05:00
Jiahui Cen
09fad16744 hw/arm/virt: Write extra pci roots into fw_cfg
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>
2020-12-08 13:48:57 -05:00
Jiahui Cen
0abd38885a fw_cfg: Refactor extra pci roots addition
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>
2020-12-08 13:48:57 -05:00
Yubo Miao
a0e2905b41 acpi/gpex: Extract two APIs from acpi_dsdt_add_pci
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>
2020-12-08 13:48:57 -05:00
John Levon
4aedda25e8 virtio: reset device on bad guest index in virtio_load()
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>
2020-12-08 13:48:57 -05:00
Eugenio Pérez
1804857f19 memory: Skip bad range assertion if notifier is DEVIOTLB_UNMAP type
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>
2020-12-08 13:48:57 -05:00
Eugenio Pérez
f7701e2c79 intel_iommu: Skip page walking on device iotlb invalidations
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>
2020-12-08 13:48:57 -05:00
Eugenio Pérez
b68ba1ca57 memory: Add IOMMU_NOTIFIER_DEVIOTLB_UNMAP IOMMUTLBNotificationType
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>
2020-12-08 13:48:57 -05:00
Eugenio Pérez
5039caf3c4 memory: Add IOMMUTLBEvent
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>
2020-12-08 13:48:57 -05:00
Eugenio Pérez
3b5ebf8532 memory: Rename memory_region_notify_one to memory_region_notify_iommu_one
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>
2020-12-08 13:48:57 -05:00
Alex Chen
81ee17aa46 vhost-user-scsi: Fix memleaks in vus_proc_req()
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>
2020-12-08 13:48:57 -05:00
Peter Maydell
553032db17 Update version for v5.2.0 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-12-08 15:55:19 +00:00
Peter Maydell
d73c46e4a8 Update version for v5.2.0-rc4 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-12-01 16:21:01 +00:00
Paolo Bonzini
8132122889 ide: atapi: assert that the buffer pointer is in range
A case was reported where s->io_buffer_index can be out of range.
The report skimped on the details but it seems to be triggered
by s->lba == -1 on the READ/READ CD paths (e.g. by sending an
ATAPI command with LBA = 0xFFFFFFFF).  For now paper over it
with assertions.  The first one ensures that there is no overflow
when incrementing s->io_buffer_index, the second checks for the
buffer overrun.

Note that the buffer overrun is only a read, so I am not sure
if the assertion failure is actually less harmful than the overrun.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20201201120926.56559-1-pbonzini@redhat.com
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-12-01 15:23:05 +00:00
Mauro Matteo Cascella
915976bd98 hw/net/dp8393x: fix integer underflow in dp8393x_do_transmit_packets()
An integer underflow could occur during packet transmission due to 'tx_len' not
being updated if SONIC_TFC register is set to zero. Check for negative 'tx_len'
when removing existing FCS.

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1899722
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Reported-by: Gaoning Pan <pgn@zju.edu.cn>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-id: 20201124092445.658647-1-mcascell@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-12-01 10:34:08 +00:00
Peter Maydell
944fdc5e27 -----BEGIN PGP SIGNATURE-----
iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAl/BMhQcHG1hcmNhbmRy
 ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5QhIEACyy8qMD6U7CgIiv4g5
 nP+57Eit2YFaOPcy+X6juqY9ATz9BgYkWNFNJWTPx1D7vLfop0LG82iD23Ijs0mz
 dFVz87LM4RzO58t93ggMOAntbCkFPWKUe8ay0PqRcIcP61ZXBgIXbbIUu1Jcd3FE
 VenlOumy4RsRBHyW69UzAtfRSxK+XtxMzOOoqS7BuyP9AfdZ4tT7z54lKSXSenN/
 yNLXZhTo0vt7RdeEezXk6zuHna17bvUUhsPdMqBtgjabyXaOZu0BBuDtPiE707/C
 ZPdajmrCG3A5jXxyV0UplhaEnixd4c+pxc5iyvjCQinbOlVyVg0wJ+DoqH958X74
 UyH07Hng4JPqyRWeTn5Y9UYSzk2XnSinj933JGVZQXlo359Erd031WQ6zPi+1BWJ
 EzVlHxWgjz8JffDJZIs7/eBMFzQFkvSMsS4RpenTz6mJ0y38OszjLc1a2RZyKvw/
 39mqJ1ANm0emU/u1emM5k0pXCf32cykKusB5rq/gnlYrh892jmz1KYWX2uzkI8xc
 BOSPcvgqZaVg3jr2iceUNvQtPnarhhS+QITrX0xL0kz0o4Kyh7j4zVptEtYWQ8bM
 iNVXxEA5ERmWdSR6tooUiY1RefHyy6SA5WAlXRFuj6B05HVvQMju1NWC544VvxGI
 FS/FInMpmV+JvYKMW3rrS1ghGw==
 =sVLW
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/elmarco/tags/libslirp-pull-request' into staging

# gpg: Signature made Fri 27 Nov 2020 17:06:28 GMT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/libslirp-pull-request:
  slirp: update to fix CVE-2020-29129 CVE-2020-29130

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-27 17:09:55 +00:00
Marc-André Lureau
37c0c885d1 slirp: update to fix CVE-2020-29129 CVE-2020-29130
An out-of-bounds access issue was found in the SLIRP user networking
implementation of QEMU. It could occur while processing ARP/NCSI
packets, if the packet length was shorter than required to accommodate
respective protocol headers and payload. A privileged guest user may use
this flaw to potentially leak host information bytes.

Marc-André Lureau (1):
      Merge branch 'stable-4.2' into 'stable-4.2'

Prasad J Pandit (1):
      slirp: check pkt_len before reading protocol header

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-11-27 20:57:11 +04:00
Peter Maydell
ea8208249d qxl: fix segfault
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCgAGBQJfwKWLAAoJEEy22O7T6HE4KfUP/i4wrtxb3wm5OqL+VAzY+3kE
 pLkIS8CVcJhmBTWZ119H3F94s8ToHi/zZj9Y7hNKKljt0UWH46OUTS549XFv+o9g
 MaB0aawoq81TjbbyCSbEMWgQ95a4YPiTmN2aACxbqF8CIeefHD0y/wBy71zlAhN7
 Skc9vtiyH64RMvncR1Tr/9NnciEiVBqtgppL/1hUdkejH11pMddAwDcEK0TztobH
 Z+2etWfXzVI059wnYt/Z5F5Yg1UdO+s8UKVER63irB2hUQsYC6BsS7u1wOxxMQJ5
 9u5KNTpLU5l1cpiEnoMspkzVUJxq+4wuCE3tsUQdgj/xZGJXECXcLhav0Lv5OlGd
 IRZaROA6cpxZzJBJuZqtGgGgOmfhw233CjrF8QtIND1YTFM3nYQjbBCQpRDQI4eW
 V9Vn8vDVyE5+Nf2GMamL+4ev707nakc5ypymax5qUsy3Bl1RYhge68nxNjyhRtP+
 RwmsGxM1lEBfWgXiGVxjZuZXytlj58WO4kX8anx62mbLpcEKgE7HCROCUPcLVdG1
 u1iF2gF1nEY8U3+xYDPP0XIxt6MBeThs0KVQHzXfgGApMLhIQUL3haWUjXcElyIx
 Hj+dQY2wAS0Xy0Ma/U9XSJq2GHJ9arU7qqBGO0MTrYXF8grKKuq0PCxonsYPRWJr
 cj3NLQzJTyfhwdvCDLdd
 =kNZa
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20201127-pull-request' into staging

qxl: fix segfault

# gpg: Signature made Fri 27 Nov 2020 07:06:51 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/fixes-20201127-pull-request:
  qxl: fix segfault

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-27 11:11:43 +00:00
Peter Maydell
6cfdaa88cf Remove obsolete setuptools dependency and fix Stefan's
Win32 builds.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAl+/uegUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroPMiwgAj6VB/lZP10CmKfNCIC6s9TjONP2I
 ruI3ZMYBrmeiLMf/WZTDI0kRY/mmYMtn4nN+RlEHlBE9a9hSCmHWvQyZDgEIJUOA
 1bTAdl4jFAbBv4knKVVuPSu/kMDHVIkwdktEEmPhkMHunIxrI7Yobe4r0GMXXZJm
 Vu4dNtskzERu/fc+lgbdMjRU+xlXT/zYHy98L5mu+VRgKgmtY/6aF1et4t+EfM9f
 tu3vd/WEOn/HiYvOsVj55SNSR6IiXTGq0LS5d4fI2Q9B477qoO+x3QJDzjbHBo+u
 u58QkbqJa5OfO0ZoUAi+SvOjE0EhJFPL5ihVODjkTSbORpfWz3ULyAK1nQ==
 =Mdqh
 -----END PGP SIGNATURE-----

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

Remove obsolete setuptools dependency and fix Stefan's
Win32 builds.

# gpg: Signature made Thu 26 Nov 2020 14:21:28 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-gitlab/tags/for-upstream:
  nsis: Fix build for 64 bit installer
  tests/docker, tests/vm: remove setuptools from images
  configure: remove python pkg_resources check
  meson: use dependency() to find libjpeg

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-26 14:25:47 +00:00
Stefan Weil
24bdcc9608 nsis: Fix build for 64 bit installer
Pass cpu instead of cpu_family to the NSIS installer script.

That script checks for "x86_64" which is the cpu value,
while cpu_family is "x86".

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201125191833.964753-1-sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-26 09:20:48 -05:00
Paolo Bonzini
92ea027017 tests/docker, tests/vm: remove setuptools from images
Setuptools is not needed anymore by the bundled copy of meson,
remove it.

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-25 12:50:48 -05:00
Olaf Hering
8e84bf984a configure: remove python pkg_resources check
Since meson.git#0240d760c7699a059cc89e584363c6431cdd2b61 setuptools is not required anymore.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201124211925.4194-1-olaf@aepfle.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-25 12:49:40 -05:00
Gerd Hoffmann
6fc5183a65 qxl: fix segfault
Add missing sanity check.
Reproducer: run qemu with "-device qxl" but without "-spice ..."

Fixes: 0d9b90ce5c ("console: make QMP/HMP screendump run in coroutine")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20201124122936.30588-1-kraxel@redhat.com
2020-11-25 12:33:21 +01:00
Peter Maydell
dd3d2340c4 Update version for v5.2.0-rc3 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-24 22:13:30 +00:00
Peter Maydell
1a6ab01d3f PCI host devaddr property fix for 5.2
-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCAAyFiEEWjIv1avE09usz9GqKAeTb5hNxaYFAl+9IzAUHGVoYWJrb3N0
 QHJlZGhhdC5jb20ACgkQKAeTb5hNxaaqihAAuabU0FZ6Y9Fpt0CvfOrDb7pE2JPg
 JlvuSymXHB6RA/G29UqtszjVfEHvOgr0PsxooXRRbbG9Tr2S/KuiBP+x9qZiesVE
 3Pn5YRcAVz6NpY5ajPCnxqOFnVBGHkEysBi5rsVvhEtXfuDHc4Xc/OL4qDaC2WLP
 Ep8vS4SUlnCpTohchrZYV9GpbItBpTy+G+s/BEWSwixzml06LraE682+HBCQ+LiI
 d0AWSvIKmF/DMceg3ATNOcVkTikfvv7qxTOn0IWfxP+xCjRjMBrsG5SHdxJghFMB
 boFH3R9dIpbLGBRQaPdgzN8tmSU+w6N8ViFyX6a2dv3tGFVIgH4CxmQR/64hxM7w
 3b9nCr51jV03My8HwtqGoPNOm1HjNTXm0RbVn749kxVZdeO56C2uBZB5fp2CakrG
 xpR7rbM9DPk9pFcYB9N8CrpBA6C0CqP61KSPxSKnweSlbnBI2019AjAIWWchqALf
 mhMFGFiXfJMQQipXdI+szxmtzG90CVi0GKhZZixe/S7jT+6JFSokfYqpEMznC7lu
 +d88bJ/kHTQEKRYvD5bE8SSqevHlSASYMR7ZcHZVcWUCmPAxpRba+sM2tebF1Pp5
 iCaOGU3ZzrrBgNTDoNn1u4bnmtkNjiHJja57Rp1pX8ldG2lF8GYohYzkHcyvRbk0
 xK8t0XaQTMwAwS0=
 =pVMm
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-for-5.2-pull-request' into staging

PCI host devaddr property fix for 5.2

# gpg: Signature made Tue 24 Nov 2020 15:13:52 GMT
# gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg:                issuer "ehabkost@redhat.com"
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/machine-next-for-5.2-pull-request:
  Revert "hw/core/qdev-properties: Use qemu_strtoul() in set_pci_host_devaddr()"

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-24 21:08:29 +00:00
Peter Maydell
c0e0a9b131 Patches for 5.2.0-rc3:
- qcow2: Fix corruption on write_zeroes with MAY_UNMAP
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAl+9F2gRHGt3b2xmQHJl
 ZGhhdC5jb20ACgkQfwmycsiPL9ZN2RAAsBd7Q+U3wMpq7RSqHz3/j8MV9kqWge1G
 KjYMQfGIzyxdu/qk5PEtr1nrjOzhJWc1sCfYY+HltfzZDEZtg1z51PBW+WyakLkT
 DWKjsFfZgALU2/dM8mX1o0SYVuqFZ8ccE3W0Z/3KeVyNl50oZFmC7GF33lWpD7Zm
 tGeSAregjNyGnLdp3//Rv11M52XUXzdg7eY4t3Hginw/VX9La4NU8LJ3LPykRw4f
 gg4VImzZLkNLlxW5Kx5wvD9q1SQkRewEZn5RPGuGShQpZU8QKoKyu1f4/t5aDKaI
 eVnLQh2UQY2wj8W3VRaf7qHeHN662JCGXA9oziSVA3FmQcDeOOzxq9onnLeZ+5Gk
 5fvn97iXdx5BTAZHutY6bhNt4Jf0DoYLO4yYD91VvjrpM6TOg7nUYFwo3/a4yr5+
 jfIalGPpOqKlmtb+/ZMbLWrO5iQouw+KnbUnMceoK8QifG6YQJtIqjtu0vCvkbQC
 edoCcEiWcm3ul1vhbnOp0m42qaui9DKN5jTWpFsthRiTU7BcSyiUeZYZmiSNL85k
 LOwSeKXXCNpVUqujUDHQ+aDVYOFdaFankdkFX+kqJ4jZEYbN1+2GZI9PXwRsW5KD
 rELvYNct26IUSaAEgCSfmS1tfxiCrWrqoIPk9Syll3oY/IG5kMhPLs/+eDYpNa0W
 zdE69VtLg+k=
 =chuO
 -----END PGP SIGNATURE-----

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

Patches for 5.2.0-rc3:

- qcow2: Fix corruption on write_zeroes with MAY_UNMAP

# gpg: Signature made Tue 24 Nov 2020 14:23:36 GMT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  qcow2: Fix corruption on write_zeroes with MAY_UNMAP

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-24 17:40:00 +00:00
Peter Maydell
cef64a0b34 Mark "local" qtests as slow to avoid unwanted breakage of "make check"
with some configurations (eg. Fedora's Copr automatic build system).
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEtIKLr5QxQM7yo0kQcdTV5YIvc9YFAl+88koACgkQcdTV5YIv
 c9b7RA//fP+8Wl80zG/ya7G5C2teCoQhlCSfXAB4SpB5TQhV1m1/4ugd7ml7jpXc
 wyQD4REhqvUkQnIiSVeSDGKUkAoPThC8VY5AZmwAeRna4rC55mXn+JdP9B8AU5j5
 AgEhJm84yzgYKQGLdHhLjGRXfFm4uzmWN/Ma3OIs7aO9Wd371AySfMbJurxe2kKb
 tAUwmFW+0iLiXHqyFgZlcMrzIKQKN0MkwGzF+Vky6Nt0JR7OLObXnUwn02gok8eO
 d5vp+BpR2ecORZkJAJ7M/vifTzZ/FFLJxRQSOC7PNNT/S7q+kKeZHZlEo6Xo29Ji
 E09sodxU7GAuX4Xn7a+YdSME6bLdPRMuDhj0Cn9ql5MBB6kNfLQEWtLu8nBdpNHn
 ZOwL8RndeDuxx+Gu07KYQDdLDhL0nDKVusOVdWfMrl6234FNwLXIZaqLiMjim/7C
 0Sa9plSwlo/rSQPHdluh8tynPZJgDhM+FCdvBeaIGBN3p1FvM1YbVc0WuILfO+08
 8omEmoduC/N37PabOwfKPelMXyJyyxkmSAAbJkYbRtP/8LLGb9s/sg0uZ8FCiMaG
 bIDIl96tqyLPlQkS/0fPW2ribyLB9w7ZS+ptWvjXjoXAViE5v0241nTEhmaLpXjT
 Zow04oT3MOJdkXnrpvsSgGGqgUa4/BafHIbo6TYP0FlK3N3E1S0=
 =KESj
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/gkurz-gitlab/tags/9p-fix-2020-11-24' into staging

Mark "local" qtests as slow to avoid unwanted breakage of "make check"
with some configurations (eg. Fedora's Copr automatic build system).

# gpg: Signature made Tue 24 Nov 2020 11:45:14 GMT
# gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <groug@kaod.org>" [full]
# gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>" [full]
# gpg:                 aka "[jpeg image of size 3330]" [full]
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6

* remotes/gkurz-gitlab/tags/9p-fix-2020-11-24:
  tests/9pfs: Mark "local" tests as "slow"

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-24 15:50:11 +00:00
Michael S. Tsirkin
28afbc1f11 Revert "hw/core/qdev-properties: Use qemu_strtoul() in set_pci_host_devaddr()"
This reverts commit bccb20c49d as it
introduced a regression blocking bus addresses > 0x1f or higher.
Legal bus numbers go up to 0xff.

Fixes: bccb20c49d ("Use qemu_strtoul() in set_pci_host_devaddr()")
Reported-by: Klaus Herman <kherman@inbox.lv>
Reported-by: Geoffrey McRae <geoff@hostfission.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Message-Id: <20201120130409.956956-1-mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-11-24 10:06:54 -05:00
Peter Maydell
82d469e139 ppc patch queue for 2020-11-24
One final update for qemu-5.2, implementing an instruction that we
 already should have, given the ISA version we claim to support.  Sorry
 for the lateness, I've been on holiday.
 
 This isn't a regression, obviously, so if it misses qemu-5.2 it's not
 a disaster, but it would be nice to have.  The risk is low that it
 would break any existing instructions.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl+8nyUACgkQbDjKyiDZ
 s5IFqQ//RWK+sGqntwwwfJEgkLqol19CtlxZ4CdMSAitIHkJFjrI9ljxiJW/ZrQq
 rtM1x2/jYJfFf2B17QelRp4HNBtwlT5DhDBM/WdGX8ghczM3Y6cq8KItXFo9qEjY
 BFDT6Pts7Vw2+M6tEvvivxvP+Cy+DnqQZDDuFHvVHjvj3kPI895RiobzlZEfR1Uj
 RY0/EvyTpLV85LzprGvWKc5E82zg530Qv9kVvhucJa9BDKOa/9uMC7UY01tAvTy6
 Hdit2Jlpc98E6r7QUJqG/yIxDdCaVYlLHeHj/XHZ8+VUJgRvVSD9zYVMAEDXLLhn
 f+49g7crNbWplLLFBGC2jxSMvTDsSMFOazVce3N5DBPTkw+LA+qcT8xgXuD/3gLd
 49EjfUBavtqJ5mrmdC/5r8DH5lKCCBGxzmguwZUHChL03F3HJKRtZHeMeO45vlVp
 pMfOHZIuDD8+DXDAB+tbWQ9daHybPaxdjBMsTc+85wdKRM0FnEvBzTy6kdj06cMl
 iH+kfpapi6lOc467rAxQZBbOla5Aqdt+mhcKp7MGSyve/6ptYipRY9Lome37+GXT
 uftuXTRBkQQ4EF7g+htj/OPpDK5F4UPbg7ZJbEqpc/YTQ8GxJNvLSi2LRHgEQRt7
 DKN3zendMJb76c3yTFUJg7my9dQtViFdQ9mqxa/KW1CcgjDZScE=
 =ifIE
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-5.2-20201124' into staging

ppc patch queue for 2020-11-24

One final update for qemu-5.2, implementing an instruction that we
already should have, given the ISA version we claim to support.  Sorry
for the lateness, I've been on holiday.

This isn't a regression, obviously, so if it misses qemu-5.2 it's not
a disaster, but it would be nice to have.  The risk is low that it
would break any existing instructions.

# gpg: Signature made Tue 24 Nov 2020 05:50:29 GMT
# gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
# gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dg-gitlab/tags/ppc-for-5.2-20201124:
  ppc/translate: Implement lxvwsx opcode

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-24 13:33:43 +00:00
Greg Kurz
558f5c42ef tests/9pfs: Mark "local" tests as "slow"
The "local" tests can fail on some automated build systems as
reported here:

https://lists.nongnu.org/archive/html/qemu-devel/2020-11/msg05510.html

This will need to be investigated and addressed later. Let's go for a
workaround in the meantime : mark the "local" tests as "slow" so that
they aren't executed with a simple "make check" like in the case above.

Reported-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <160620382310.1423262.7364287092069513483.stgit@bahia.lan>
Signed-off-by: Greg Kurz <groug@kaod.org>
2020-11-24 12:44:25 +01:00
Peter Maydell
d536d9578e -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
 
 iQEcBAABAgAGBQJfvHK9AAoJEO8Ells5jWIR5V0H+wX5bciJyPlOm1H5y8xIewuO
 GagUisjouvPsGTyRDIfotvj9sjai4ebdpP7R9eC8ulGkSN/Zg2FoSRw2v6eTI/GT
 lAZ5s1ZGUyWFQWpSDuH3BU4x9czmhdutr8uej5Wp/Vt+hzGpm0VWnXKiwIy3a62/
 IsJrIBd6VkCzDkKaeY/41otoKDexmklKPgTB1QoHylNIX0O9mfRuhNWcysaf9Qt7
 dd0516aOMIb4LKJja3KlupvgWmFf0dXXpMiT5mfJ3sqLYvHCAmnnAIBKXcbg6WGg
 zI2uL3zL2sKoyePC1/RBCCOY9fzTltQcBQhxn1XXkbuhfvuCyHDqO1ic1aBmsgQ=
 =7hkd
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging

# gpg: Signature made Tue 24 Nov 2020 02:41:01 GMT
# gpg:                using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  net: Use correct default-path macro for downscript
  tap: fix a memory leak
  net: purge queued rx packets on queue deletion
  net: do not exit on "netdev_add help" monitor command
  hw/net/e1000e: advance desc_offset in case of null descriptor

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-24 10:59:12 +00:00
Maxim Levitsky
c8bf9a9169 qcow2: Fix corruption on write_zeroes with MAY_UNMAP
Commit 205fa50750 ("qcow2: Add subcluster support to zero_in_l2_slice()")
introduced a subtle change to code in zero_in_l2_slice:

It swapped the order of

1. qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice);
2. set_l2_entry(s, l2_slice, l2_index + i, QCOW_OFLAG_ZERO);
3. qcow2_free_any_clusters(bs, old_offset, 1, QCOW2_DISCARD_REQUEST);

To

1. qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice);
2. qcow2_free_any_clusters(bs, old_offset, 1, QCOW2_DISCARD_REQUEST);
3. set_l2_entry(s, l2_slice, l2_index + i, QCOW_OFLAG_ZERO);

It seems harmless, however the call to qcow2_free_any_clusters can
trigger a cache flush which can mark the L2 table as clean, and
assuming that this was the last write to it, a stale version of it
will remain on the disk.

Now we have a valid L2 entry pointing to a freed cluster. Oops.

Fixes: 205fa50750 ("qcow2: Add subcluster support to zero_in_l2_slice()")
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
[ kwolf: Fixed to restore the correct original order from before
  205fa50750; added comments like in discard_in_l2_slice(). ]
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201124092815.39056-1-kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2020-11-24 11:29:41 +01:00
Keqian Zhu
9925990d01 net: Use correct default-path macro for downscript
Fixes: 63c4db4c2e (net: relocate paths to helpers and scripts)
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2020-11-24 10:40:17 +08:00
yuanjungong
f012bec890 tap: fix a memory leak
Close fd before returning.

Buglink: https://bugs.launchpad.net/qemu/+bug/1904486

Signed-off-by: yuanjungong <ruc_gongyuanjun@163.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2020-11-24 10:40:17 +08:00
Yuri Benditovich
d2abc563e4 net: purge queued rx packets on queue deletion
https://bugzilla.redhat.com/show_bug.cgi?id=1829272
When deleting queue pair, purge pending RX packets if any.
Example of problematic flow:
1. Bring up q35 VM with tap (vhost off) and virtio-net or e1000e
2. Run ping flood to the VM NIC ( 1 ms interval)
3. Hot unplug the NIC device (device_del)
   During unplug process one or more packets come, the NIC
   can't receive, tap disables read_poll
4. Hot plug the device (device_add) with the same netdev
The tap stays with read_poll disabled and does not receive
any packets anymore (tap_send never triggered)

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2020-11-24 10:40:17 +08:00
Paolo Bonzini
ad6f932fe8 net: do not exit on "netdev_add help" monitor command
"netdev_add help" is causing QEMU to exit because the code that
invokes show_netdevs is shared between CLI and HMP processing.
Move the check to the callers so that exit(0) remains only
in the CLI flow.

"netdev_add help" is not fixed by this patch; that is left for
later work.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2020-11-24 10:40:17 +08:00
Prasad J Pandit
c2cb511634 hw/net/e1000e: advance desc_offset in case of null descriptor
While receiving packets via e1000e_write_packet_to_guest() routine,
'desc_offset' is advanced only when RX descriptor is processed. And
RX descriptor is not processed if it has NULL buffer address.
This may lead to an infinite loop condition. Increament 'desc_offset'
to process next descriptor in the ring to avoid infinite loop.

Reported-by: Cheol-woo Myung <330cjfdn@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2020-11-24 10:40:17 +08:00