qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 5d31e1: amd_iommu: Fix pte_override_page_mask


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 5d31e1: amd_iommu: Fix pte_override_page_mask()
Date: Sun, 16 May 2021 09:28:42 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 5d31e1e59a21bafb57842313dd41f0b0ff11a4ff
      
https://github.com/qemu/qemu/commit/5d31e1e59a21bafb57842313dd41f0b0ff11a4ff
  Author: Jean-Philippe Brucker <jean-philippe@linaro.org>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M hw/i386/amd_iommu.c

  Log Message:
  -----------
  amd_iommu: Fix pte_override_page_mask()

AMD IOMMU PTEs have a special mode allowing to specify an arbitrary page
size. Quoting the AMD IOMMU specification: "When the Next Level bits [of
a pte] are 7h, the size of the page is determined by the first zero bit
in the page address, starting from bit 12."

So if the lowest bits of the page address is 0, the page is 8kB. If the
lowest bits are 011, the page is 32kB. Currently pte_override_page_mask()
doesn't compute the right value for this page size and amdvi_translate()
can return the wrong guest-physical address. With a Linux guest, DMA
from SATA devices accesses the wrong memory and causes probe failure:

qemu-system-x86_64 ... -device amd-iommu -drive id=hd1,file=foo.bin,if=none \
                -device ahci,id=ahci -device ide-hd,drive=hd1,bus=ahci.0
[    6.613093] ata1.00: qc timeout (cmd 0xec)
[    6.615062] ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)

Fix the page mask.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Message-Id: <20210421084007.1190546-1-jean-philippe@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: bb9feea43179ef8aba2c0a9cc1e670cb049ba90e
      
https://github.com/qemu/qemu/commit/bb9feea43179ef8aba2c0a9cc1e670cb049ba90e
  Author: Igor Mammedov <imammedo@redhat.com>
  Date:   2021-05-04 (Tue, 04 May 2021)

  Changed paths:
    M hw/acpi/aml-build.c
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  x86: acpi: use offset instead of pointer when using build_header()

Do the same as in commit
 (4d027afeb3a97 Virt: ACPI: fix qemu assert due to re-assigned table data 
address)
for remaining tables that happen to use saved at
the beginning pointer to build header to avoid assert
when table_data is relocated due to implicit re-size.

In this case user is trying to start Windows 10 and getting assert at
 hw/acpi/bios-linker-loader.c:239:
  bios_linker_loader_add_checksum: Assertion `start_offset < file->blob->len' 
failed.

Fixes: https://bugs.launchpad.net/bugs/1923497
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20210414084356.3792113-1-imammedo@redhat.com>
Cc: mst@redhat.com, qemu-stable@nongnu.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 4c21e3534a0b0373258d559f50a65d0e5385b7c4
      
https://github.com/qemu/qemu/commit/4c21e3534a0b0373258d559f50a65d0e5385b7c4
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/virtio/virtio.c
    M include/hw/virtio/virtio.h

  Log Message:
  -----------
  hw/virtio: Pass virtio_feature_get_config_size() a const argument

The VirtIOFeature structure isn't modified, mark it const.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210511104157.2880306-2-philmd@redhat.com>


  Commit: 01ce7724a17521083d70114e9f24fb9d2d51e29c
      
https://github.com/qemu/qemu/commit/01ce7724a17521083d70114e9f24fb9d2d51e29c
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/block/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: Constify VirtIOFeature feature_sizes[]

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210511104157.2880306-3-philmd@redhat.com>


  Commit: ad6461ad6eb3cf36c5d535da5f036f75dd145bcd
      
https://github.com/qemu/qemu/commit/ad6461ad6eb3cf36c5d535da5f036f75dd145bcd
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: Constify VirtIOFeature feature_sizes[]

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210511104157.2880306-4-philmd@redhat.com>


  Commit: e526ab61e95059e4eaec636bfdedbf6695347cb2
      
https://github.com/qemu/qemu/commit/e526ab61e95059e4eaec636bfdedbf6695347cb2
  Author: Roman Kapl <rka@sysgo.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/i386/amd_iommu.c

  Log Message:
  -----------
  amd_iommu: fix wrong MMIO operations

Address was swapped with value when writing MMIO registers, so the user
saw garbage in lot of cases. The interrupt status was not correctly set.

Signed-off-by: Roman Kapl <rka@sysgo.com>
Message-Id: <20210427110504.10878-1-rka@sysgo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 8a49487c654a6150615d758e0816314b00cb481e
      
https://github.com/qemu/qemu/commit/8a49487c654a6150615d758e0816314b00cb481e
  Author: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/mem/pc-dimm.c
    M include/hw/mem/pc-dimm.h

  Log Message:
  -----------
  pc-dimm: remove unnecessary get_vmstate_memory_region() method

The get_vmstate_memory_region() method from PCDIMMDeviceClass is only
ever called from this class and is never overridden, so it can be converted
into an ordinary function.
This saves us from having to do an indirect call in order to reach it.

Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: 
<f42da25471dc4b967796642388294e61e6587047.1619303649.git.maciej.szmigiero@oracle.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 570fe439e5d1b8626cf344c6bc97d90cfcaf0c79
      
https://github.com/qemu/qemu/commit/570fe439e5d1b8626cf344c6bc97d90cfcaf0c79
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/block/dataplane/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: Fix rollback path in virtio_blk_data_plane_start()

When dataplane multiqueue support was added in QEMU 2.7, the path
that would rollback guest notifiers assignment in case of error
simply got dropped.

Later on, when Error was added to blk_set_aio_context() in QEMU 4.1,
another error path was introduced, but it ommits to rollback both
host and guest notifiers.

It seems cleaner to fix the rollback path in one go. The patch is
simple enough that it can be adjusted if backported to a pre-4.1
QEMU.

Fixes: 51b04ac5c6a6 ("virtio-blk: dataplane multiqueue support")
Cc: stefanha@redhat.com
Fixes: 97896a4887a0 ("block: Add Error to blk_set_aio_context()")
Cc: kwolf@redhat.com
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210407143501.244343-2-groug@kaod.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: d0267da614890b8f817364ae25850cdbb580a569
      
https://github.com/qemu/qemu/commit/d0267da614890b8f817364ae25850cdbb580a569
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/block/dataplane/virtio-blk.c

  Log Message:
  -----------
  virtio-blk: Configure all host notifiers in a single MR transaction

This allows the virtio-blk-pci device to batch the setup of all its
host notifiers. This significantly improves boot time of VMs with a
high number of vCPUs, e.g. from 3m26.186s down to 0m58.023s for a
pseries machine with 384 vCPUs.

Note that memory_region_transaction_commit() must be called before
virtio_bus_cleanup_host_notifier() because the latter might close
ioeventfds that the transaction still assumes to be around when it
commits.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20210407143501.244343-3-groug@kaod.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 61fc57bfc464c3584bd7ab810c86833661f0188c
      
https://github.com/qemu/qemu/commit/61fc57bfc464c3584bd7ab810c86833661f0188c
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/scsi/virtio-scsi-dataplane.c

  Log Message:
  -----------
  virtio-scsi: Set host notifiers and callbacks separately

Host notifiers are guaranteed to be idle until the callbacks are
hooked up with virtio_queue_aio_set_host_notifier_handler(). They
thus don't need to be set or unset with the AioContext lock held.

Do this outside the critical section, like virtio-blk already
does : basically downgrading virtio_scsi_vring_init() to only
setup the host notifier and set the callback in the caller.

This will allow to batch addition/deletion of ioeventds in
a single memory transaction, which is expected to greatly
improve initialization time.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20210407143501.244343-4-groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: c4f5dcc4360a02085a633fd7a90b7ac395ca1ba4
      
https://github.com/qemu/qemu/commit/c4f5dcc4360a02085a633fd7a90b7ac395ca1ba4
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/scsi/virtio-scsi-dataplane.c

  Log Message:
  -----------
  virtio-scsi: Configure all host notifiers in a single MR transaction

This allows the virtio-scsi-pci device to batch the setup of all its
host notifiers. This significantly improves boot time of VMs with a
high number of vCPUs, e.g. from 6m5.563s down to 1m2.884s for a
pseries machine with 384 vCPUs.

Note that memory_region_transaction_commit() must be called before
virtio_bus_cleanup_host_notifier() because the latter might close
ioeventfds that the transaction still assumes to be around when it
commits.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20210407143501.244343-5-groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 43bea443575772bdabd13781be043468c205d6cf
      
https://github.com/qemu/qemu/commit/43bea443575772bdabd13781be043468c205d6cf
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M scripts/checkpatch.pl

  Log Message:
  -----------
  checkpatch: Fix use of uninitialized value

checkfilename() doesn't always set $acpi_testexpected. Fix the following
warning:

Use of uninitialized value $acpi_testexpected in string eq at
 ./scripts/checkpatch.pl line 1529.

Fixes: d2f1af0e4120 ("checkpatch: don't emit warning on newly created acpi data 
files")
Cc: isaku.yamahata@intel.com
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <161786467973.295167.5612704777283969903.stgit@bahia.lan>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 05dfb447a4e11b32d4ed94f73629c497235fc3dc
      
https://github.com/qemu/qemu/commit/05dfb447a4e11b32d4ed94f73629c497235fc3dc
  Author: Vincent Bernat <vincent@bernat.ch>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/arm/virt.c
    M hw/i386/fw_cfg.c
    M hw/smbios/smbios.c
    M include/hw/firmware/smbios.h
    M qemu-options.hx

  Log Message:
  -----------
  hw/smbios: support for type 41 (onboard devices extended information)

Type 41 defines the attributes of devices that are onboard. The
original intent was to imply the BIOS had some level of control over
the enablement of the associated devices.

If network devices are present in this table, by default, udev will
name the corresponding interfaces enoX, X being the instance number.
Without such information, udev will fallback to using the PCI ID and
this usually gives ens3 or ens4. This can be a bit annoying as the
name of the network card may depend on the order of options and may
change if a new PCI device is added earlier on the commande line.
Being able to provide SMBIOS type 41 entry ensure the name of the
interface won't change and helps the user guess the right name without
booting a first time.

This can be invoked with:

    $QEMU -netdev user,id=internet
          -device 
virtio-net-pci,mac=50:54:00:00:00:42,netdev=internet,id=internet-dev \
          -smbios type=41,designation='Onboard 
LAN',instance=1,kind=ethernet,pcidev=internet-dev

The PCI segment is assumed to be 0. This should hold true for most
cases.

    $ dmidecode -t 41
    # dmidecode 3.3
    Getting SMBIOS data from sysfs.
    SMBIOS 2.8 present.

    Handle 0x2900, DMI type 41, 11 bytes
    Onboard Device
            Reference Designation: Onboard LAN
            Type: Ethernet
            Status: Enabled
            Type Instance: 1
            Bus Address: 0000:00:09.0

    $ ip -brief a
    lo               UNKNOWN        127.0.0.1/8 ::1/128
    eno1             UP             10.0.2.14/24 fec0::5254:ff:fe00:42/64 
fe80::5254:ff:fe00:42/64

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
Message-Id: <20210401171138.62970-1-vincent@bernat.ch>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: b8893a3c862111fa1c530c4be6f7426e7f07bf1e
      
https://github.com/qemu/qemu/commit/b8893a3c862111fa1c530c4be6f7426e7f07bf1e
  Author: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/virtio/virtio-mmio.c
    M include/hw/virtio/virtio-mmio.h

  Log Message:
  -----------
  hw/virtio: enable ioeventfd configuring for mmio

This patch adds ioeventfd flag for virtio-mmio configuration.
It allows switching ioeventfd on and off.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-Id: <161700379211.1135943.8859209566937991305.stgit@pasha-ThinkPad-X280>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: c232b8f45375bbffe7c6941968309400a59a893c
      
https://github.com/qemu/qemu/commit/c232b8f45375bbffe7c6941968309400a59a893c
  Author: Zenghui Yu <yuzenghui@huawei.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M hw/virtio/vhost-vdpa.c
    M include/hw/virtio/vhost-vdpa.h

  Log Message:
  -----------
  vhost-vdpa: Make vhost_vdpa_get_device_id() static

As it's only used inside hw/virtio/vhost-vdpa.c.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Message-Id: <20210413133737.1574-1-yuzenghui@huawei.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f7a6df5f5bf3acc219352a1b25573ae2082d7e42
      
https://github.com/qemu/qemu/commit/f7a6df5f5bf3acc219352a1b25573ae2082d7e42
  Author: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M contrib/vhost-user-input/main.c
    M hw/input/virtio-input-host.c

  Log Message:
  -----------
  Fix build with 64 bits time_t

time element is deprecated on new input_event structure in kernel's
input.h [1]

This will avoid the following build failure:

hw/input/virtio-input-host.c: In function 'virtio_input_host_handle_status':
hw/input/virtio-input-host.c:198:28: error: 'struct input_event' has no member 
named 'time'
  198 |     if (gettimeofday(&evdev.time, NULL)) {
      |                            ^

Fixes:
 - 
http://autobuild.buildroot.org/results/a538167e288c14208d557cd45446df86d3d599d5
 - 
http://autobuild.buildroot.org/results/efd4474fb4b6c0ce0ab3838ce130429c51e43bbb

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Message-Id: <20201203195819.583626-1-fontaine.fabrice@gmail.com>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/246
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 6005ee07c380cbde44292f5f6c96e7daa70f4f7d
      
https://github.com/qemu/qemu/commit/6005ee07c380cbde44292f5f6c96e7daa70f4f7d
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-05-16 (Sun, 16 May 2021)

  Changed paths:
    M contrib/vhost-user-input/main.c
    M hw/acpi/aml-build.c
    M hw/arm/virt.c
    M hw/block/dataplane/virtio-blk.c
    M hw/block/virtio-blk.c
    M hw/i386/acpi-build.c
    M hw/i386/amd_iommu.c
    M hw/i386/fw_cfg.c
    M hw/input/virtio-input-host.c
    M hw/mem/pc-dimm.c
    M hw/net/virtio-net.c
    M hw/scsi/virtio-scsi-dataplane.c
    M hw/smbios/smbios.c
    M hw/virtio/vhost-vdpa.c
    M hw/virtio/virtio-mmio.c
    M hw/virtio/virtio.c
    M include/hw/firmware/smbios.h
    M include/hw/mem/pc-dimm.h
    M include/hw/virtio/vhost-vdpa.h
    M include/hw/virtio/virtio-mmio.h
    M include/hw/virtio/virtio.h
    M qemu-options.hx
    M scripts/checkpatch.pl

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc,pci,virtio: bugfixes, improvements

Fixes all over the place. Faster boot for virtio. ioeventfd support for
mmio.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Fri 14 May 2021 15:27:13 BST
# gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg:                issuer "mst@redhat.com"
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  Fix build with 64 bits time_t
  vhost-vdpa: Make vhost_vdpa_get_device_id() static
  hw/virtio: enable ioeventfd configuring for mmio
  hw/smbios: support for type 41 (onboard devices extended information)
  checkpatch: Fix use of uninitialized value
  virtio-scsi: Configure all host notifiers in a single MR transaction
  virtio-scsi: Set host notifiers and callbacks separately
  virtio-blk: Configure all host notifiers in a single MR transaction
  virtio-blk: Fix rollback path in virtio_blk_data_plane_start()
  pc-dimm: remove unnecessary get_vmstate_memory_region() method
  amd_iommu: fix wrong MMIO operations
  virtio-net: Constify VirtIOFeature feature_sizes[]
  virtio-blk: Constify VirtIOFeature feature_sizes[]
  hw/virtio: Pass virtio_feature_get_config_size() a const argument
  x86: acpi: use offset instead of pointer when using build_header()
  amd_iommu: Fix pte_override_page_mask()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

# Conflicts:
#       hw/arm/virt.c


Compare: https://github.com/qemu/qemu/compare/9b1e81d1c231...6005ee07c380



reply via email to

[Prev in Thread] Current Thread [Next in Thread]