qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] fb00aa: target/i386: EPYC-Rome model without


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] fb00aa: target/i386: EPYC-Rome model without XSAVES
Date: Thu, 25 May 2023 08:36:44 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: fb00aa61267c8b9c57a2d1a1fa1e336d02e3bcd1
      
https://github.com/qemu/qemu/commit/fb00aa61267c8b9c57a2d1a1fa1e336d02e3bcd1
  Author: Maksim Davydov <davydov-max@yandex-team.ru>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M target/i386/cpu.c

  Log Message:
  -----------
  target/i386: EPYC-Rome model without XSAVES

Based on the kernel commit "b0563468ee x86/CPU/AMD: Disable XSAVES on
AMD family 0x17", host system with EPYC-Rome can clear XSAVES capability
bit. In another words, EPYC-Rome host without XSAVES can occur. Thus, we
need an EPYC-Rome cpu model (without this feature) that matches the
solution of fixing this erratum

Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
Message-Id: <20230524213748.8918-1-davydov-max@yandex-team.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: f49d883d4de4011365ca3644fcd1914df5193227
      
https://github.com/qemu/qemu/commit/f49d883d4de4011365ca3644fcd1914df5193227
  Author: Nicolas Saenz Julienne <nsaenz@amazon.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M meson.build

  Log Message:
  -----------
  meson.build: Fix glib -Wno-unused-function workaround

We want to only enable '-Wno-unused-function' if glib's version is
smaller than '2.57.2' and has a G_DEFINE_AUTOPTR_CLEANUP_FUNC()
implementation that doesn't take into account unused functions. But the
compilation test isn't working as intended as '-Wunused-function' isn't
enabled while running it.

Let's enable it.

Fixes: fc9a809e0d28 ("build: move glib detection and workarounds to meson")
Signed-off-by: Nicolas Saenz Julienne <nsaenz@amazon.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230524173123.66483-1-nsaenz@amazon.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 91a2e6882a788f270b6d9bc168128cd252812808
      
https://github.com/qemu/qemu/commit/91a2e6882a788f270b6d9bc168128cd252812808
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M qga/meson.build

  Log Message:
  -----------
  meson: fix rule for qemu-ga installer

The bindir variable is not available in the "glib" variable, which is an 
internal
dependency (created with "declare_dependency").  Use glib_pc instead, which 
contains
the variable as it is instantiated from glib-2.0.pc.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: b03fcd6818f690d168860f895bc9e8eab971d6de
      
https://github.com/qemu/qemu/commit/b03fcd6818f690d168860f895bc9e8eab971d6de
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M meson.build

  Log Message:
  -----------
  meson: move -no-pie from linker to compiler

The large comment in the patch says it all; the -no-pie flag is broken and
this is why it was not included in QEMU_LDFLAGS before commit a988b4c5614
("build: move remaining compiler flag tests to meson", 2023-05-18).  And
some distros made things even worse, so we have to add it to the compiler
command line.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1664
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 6301460ce9f59885e8feb65185bcfb6b128c8eff
      
https://github.com/qemu/qemu/commit/6301460ce9f59885e8feb65185bcfb6b128c8eff
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M hw/usb/hcd-ohci.c

  Log Message:
  -----------
  usb/ohci: Set pad to 0 after frame update

When the OHCI controller's framenumber is incremented, HccaPad1 register
should be set to zero (Ref OHCI Spec 4.4)

ReactOS uses hccaPad1 to determine if the OHCI hardware is running,
consequently it fails this check in current qemu master.

Signed-off-by: Ryan Wendland <wendland@live.com.au>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1048
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: d2f07b75aea5f49533c169592f951fd09f77037b
      
https://github.com/qemu/qemu/commit/d2f07b75aea5f49533c169592f951fd09f77037b
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M softmmu/ioport.c

  Log Message:
  -----------
  softmmu/ioport.c: allocate MemoryRegionPortioList ports on the heap

In order to facilitate a conversion of MemoryRegionPortioList to a QOM object
move the allocation of MemoryRegionPortioList ports to the heap instead of
using a variable-length member at the end of the MemoryRegionPortioList
structure.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230419151652.362717-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 28770689c5ff53195410fec407a0af7a2d4ac03a
      
https://github.com/qemu/qemu/commit/28770689c5ff53195410fec407a0af7a2d4ac03a
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M softmmu/ioport.c

  Log Message:
  -----------
  softmmu/ioport.c: QOMify MemoryRegionPortioList

The aim of QOMification is so that the lifetime of the MemoryRegionPortioList
structure can be managed using QOM's in-built refcounting instead of having to
handle this manually.

Due to the use of an opaque pointer it isn't possible to model the new
TYPE_MEMORY_REGION_PORTIO_LIST directly using QOM properties, however since
use of the new object is restricted to the portio API we can simply set the
opaque pointer (and the heap-allocated port list) internally.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230419151652.362717-3-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 690705ca0b0f1ed24a34ccd14c9866fbe47c69a6
      
https://github.com/qemu/qemu/commit/690705ca0b0f1ed24a34ccd14c9866fbe47c69a6
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M softmmu/ioport.c

  Log Message:
  -----------
  softmmu/ioport.c: make MemoryRegionPortioList owner of portio_list 
MemoryRegions

Currently when portio_list MemoryRegions are freed using portio_list_destroy() 
the RCU
thread segfaults generating a backtrace similar to that below:

    #0 0x5555599a34b6 in phys_section_destroy ../softmmu/physmem.c:996
    #1 0x5555599a37a3 in phys_sections_free ../softmmu/physmem.c:1011
    #2 0x5555599b24aa in address_space_dispatch_free ../softmmu/physmem.c:2430
    #3 0x55555996a283 in flatview_destroy ../softmmu/memory.c:292
    #4 0x55555a2cb9fb in call_rcu_thread ../util/rcu.c:284
    #5 0x55555a29b71d in qemu_thread_start ../util/qemu-thread-posix.c:541
    #6 0x7ffff4a0cea6 in start_thread nptl/pthread_create.c:477
    #7 0x7ffff492ca2e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xfca2e)

The problem here is that portio_list_destroy() unparents the portio_list
MemoryRegions causing them to be freed immediately, however the flatview
still has a reference to the MemoryRegion and so causes a use-after-free
segfault when the RCU thread next updates the flatview.

Solve the lifetime issue by making MemoryRegionPortioList the owner of the
portio_list MemoryRegions, and then reparenting them to the portio_list
owner. This ensures that they can be accessed as QOM children via the
portio_list owner, yet the MemoryRegionPortioList owns the refcount.

Update portio_list_destroy() to unparent the MemoryRegion from the
portio_list owner (while keeping mrpio->mr live until finalization of the
MemoryRegionPortioList), so that the portio_list MemoryRegions remain
allocated until flatview_destroy() removes the final refcount upon the
next flatview update.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230419151652.362717-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: e37548ef13dcbe158662c8dc9797c15c052c3a81
      
https://github.com/qemu/qemu/commit/e37548ef13dcbe158662c8dc9797c15c052c3a81
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M monitor/monitor.c

  Log Message:
  -----------
  monitor: use QEMU_LOCK_GUARD a bit more

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: c5d0c55f1ac402327235e4046f3921d16bc7b529
      
https://github.com/qemu/qemu/commit/c5d0c55f1ac402327235e4046f3921d16bc7b529
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M monitor/monitor.c

  Log Message:
  -----------
  monitor: allow calling monitor_resume under mon_lock

Move monitor_resume()'s call to readline_show_prompt() outside the
potentially locked section.  Reuse the existing monitor_accept_input()
bottom half for this purpose.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 4cb96b974265f97a9902b4458e50d01082572a16
      
https://github.com/qemu/qemu/commit/4cb96b974265f97a9902b4458e50d01082572a16
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M include/monitor/monitor.h
    M monitor/monitor.c

  Log Message:
  -----------
  monitor: add more *_locked() functions

Allow flushing and printing to the monitor while mon->mon_lock is
held.  This will help cleaning up the locking of mon->mux_out and
mon->suspend_cnt.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 6ee7c82d0df9bb6e972a8ea689b935df3ba37486
      
https://github.com/qemu/qemu/commit/6ee7c82d0df9bb6e972a8ea689b935df3ba37486
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M monitor/hmp.c
    M monitor/monitor-internal.h
    M monitor/monitor.c
    M tests/qemu-iotests/051.out
    M tests/qemu-iotests/051.pc.out

  Log Message:
  -----------
  monitor: do not use mb_read/mb_set for suspend_cnt

Clean up monitor_event to just use monitor_suspend/monitor_resume,
using mon->mux_out to protect against incorrect nesting (especially
on startup).

The only remaining case of reading suspend_cnt is in the can_read
callback, which is just advisory and can use qatomic_read.

As an extra benefit, mux_out is now simply protected by mon_lock.
Also, moving the prompt to the beginning of the main loop removes
it from the output in some error cases where QEMU does not actually
start successfully.  It is not a full fix and it would be nice to
also remove the monitor heading, but this is already a small (though
unintentional) improvement.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 3e6bed619a1d13858e540e01aae275abdf9146ae
      
https://github.com/qemu/qemu/commit/3e6bed619a1d13858e540e01aae275abdf9146ae
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M monitor/monitor.c
    M monitor/qmp.c

  Log Message:
  -----------
  monitor: cleanup detection of qmp_dispatcher_co shutting down

Instead of overloading qmp_dispatcher_co_busy, make the coroutine
pointer NULL.  This will make things break spectacularly if somebody
tries to start a request after monitor_cleanup().

AIO_WAIT_WHILE_UNLOCKED() does not need qatomic_mb_read(), because
the macro contains all the necessary memory barriers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 0ff25537018c0939919a35886265c38db28b2a8a
      
https://github.com/qemu/qemu/commit/0ff25537018c0939919a35886265c38db28b2a8a
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M monitor/monitor.c
    M monitor/qmp.c

  Log Message:
  -----------
  monitor: cleanup fetching of QMP requests

Use a continue statement so that "after going to sleep" is treated the same
way as "after processing a request".  Pull the monitor_lock critical
section out of monitor_qmp_requests_pop_any_with_lock() and protect
qmp_dispatcher_co_shutdown with the monitor_lock.

The two changes are complex to separate because monitor_qmp_dispatcher_co()
previously had a complicated logic to check for shutdown both before
and after going to sleep.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 9f2d58546e8cc83b1b033c4f89dcb188e7b05c0c
      
https://github.com/qemu/qemu/commit/9f2d58546e8cc83b1b033c4f89dcb188e7b05c0c
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M monitor/monitor-internal.h
    M monitor/monitor.c
    M monitor/qmp.c

  Log Message:
  -----------
  monitor: introduce qmp_dispatcher_co_wake

This makes it possible to turn qmp_dispatcher_co_busy into a static
variable.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 60f4f62efeb174fe7433ce9ebc37836e70ec9b75
      
https://github.com/qemu/qemu/commit/60f4f62efeb174fe7433ce9ebc37836e70ec9b75
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M monitor/qmp.c

  Log Message:
  -----------
  monitor: extract request dequeuing to a new function

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: eea7cd3fc5139d7523f3c7a67d9c864b944dfacd
      
https://github.com/qemu/qemu/commit/eea7cd3fc5139d7523f3c7a67d9c864b944dfacd
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M monitor/qmp.c

  Log Message:
  -----------
  monitor: do not use mb_read/mb_set

Instead of relying on magic memory barriers, document the pattern that
is being used.  It is the one based on Dekker's algorithm, and in this
case it is embodied as follows:

    enqueue request;              sleeping = true;
    smp_mb();                     smp_mb();
    if (sleeping) kick();         if (!have a request) yield();

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


  Commit: 6ad2c71c238183437c91bb9fa0c8d87a9559eca3
      
https://github.com/qemu/qemu/commit/6ad2c71c238183437c91bb9fa0c8d87a9559eca3
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M hw/usb/hcd-ohci.c
    M include/monitor/monitor.h
    M meson.build
    M monitor/hmp.c
    M monitor/monitor-internal.h
    M monitor/monitor.c
    M monitor/qmp.c
    M qga/meson.build
    M softmmu/ioport.c
    M target/i386/cpu.c
    M tests/qemu-iotests/051.out
    M tests/qemu-iotests/051.pc.out

  Log Message:
  -----------
  Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* hot-unplug fixes for ioport
* purge qatomic_mb_read/set from monitor
* build system fixes
* OHCI fix from gitlab
* provide EPYC-Rome CPU model not susceptible to XSAVES erratum

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmRvGpEUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroOa/Af/WS5/tmIlEYgH7UOPERQXNqf7+Jwj
# bA2wgqv3ZoQwcgp5f4EVjfA8ABfpGxLZy6xIdUSbWANb8lDJNuh/nPd/em3rWUAU
# LnJGGdo1vF31gfsVQnlzb7hJi3ur+e2f8JqkRVskDCk3a7YY44OCN42JdKWLrN9u
# CFf2zYqxMqXHjrYrY0Kx2oTkfGDZrfwUlx0vM4dHb8IEoxaplfDd8lJXQzjO4htr
# 3nPBPjQ+h08EeC7mObH4XoJE0omzovR10GkBo8K4q952xGOQ041Y/2YY7JwLfx0D
# na7IanVo+ZAmvTJZoJFSBwNnXkTMHvDH5+Hc45NSTsDBtz0YJhRxPw/z/A==
# =A5Lp
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 25 May 2023 01:21:37 AM PDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [undefined]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# 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

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
  monitor: do not use mb_read/mb_set
  monitor: extract request dequeuing to a new function
  monitor: introduce qmp_dispatcher_co_wake
  monitor: cleanup fetching of QMP requests
  monitor: cleanup detection of qmp_dispatcher_co shutting down
  monitor: do not use mb_read/mb_set for suspend_cnt
  monitor: add more *_locked() functions
  monitor: allow calling monitor_resume under mon_lock
  monitor: use QEMU_LOCK_GUARD a bit more
  softmmu/ioport.c: make MemoryRegionPortioList owner of portio_list 
MemoryRegions
  softmmu/ioport.c: QOMify MemoryRegionPortioList
  softmmu/ioport.c: allocate MemoryRegionPortioList ports on the heap
  usb/ohci: Set pad to 0 after frame update
  meson: move -no-pie from linker to compiler
  meson: fix rule for qemu-ga installer
  meson.build: Fix glib -Wno-unused-function workaround
  target/i386: EPYC-Rome model without XSAVES

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/b300c1344654...6ad2c71c2381



reply via email to

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