Branch: refs/heads/staging-7.2
  Home:   https://github.com/qemu/qemu
  Commit: d07885efd149af17a3ad4beb2a1cea2a02875531
      
https://github.com/qemu/qemu/commit/d07885efd149af17a3ad4beb2a1cea2a02875531
  Author: Kevin Wolf <kw...@redhat.com>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: Drop out of coroutine context in virtio_load()

virtio_load() as a whole should run in coroutine context because it
reads from the migration stream and we don't want this to block.

However, it calls virtio_set_features_nocheck() and devices don't
expect their .set_features callback to run in a coroutine and therefore
call functions that may not be called in coroutine context. To fix this,
drop out of coroutine context for calling virtio_set_features_nocheck().

Without this fix, the following crash was reported:

  #0  __pthread_kill_implementation (threadid=<optimized out>, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
  #1  0x00007efc738c05d3 in __pthread_kill_internal (signo=6, 
threadid=<optimized out>) at pthread_kill.c:78
  #2  0x00007efc73873d26 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
  #3  0x00007efc738477f3 in __GI_abort () at abort.c:79
  #4  0x00007efc7384771b in __assert_fail_base (fmt=0x7efc739dbcb8 "", 
assertion=assertion@entry=0x560aebfbf5cf "!qemu_in_coroutine()",
     file=file@entry=0x560aebfcd2d4 "../block/graph-lock.c", 
line=line@entry=275, function=function@entry=0x560aebfcd34d "void 
bdrv_graph_rdlock_main_loop(void)") at assert.c:92
  #5  0x00007efc7386ccc6 in __assert_fail (assertion=0x560aebfbf5cf 
"!qemu_in_coroutine()", file=0x560aebfcd2d4 "../block/graph-lock.c", line=275,
     function=0x560aebfcd34d "void bdrv_graph_rdlock_main_loop(void)") at 
assert.c:101
  #6  0x0000560aebcd8dd6 in bdrv_register_buf ()
  #7  0x0000560aeb97ed97 in ram_block_added.llvm ()
  #8  0x0000560aebb8303f in ram_block_add.llvm ()
  #9  0x0000560aebb834fa in qemu_ram_alloc_internal.llvm ()
  #10 0x0000560aebb2ac98 in vfio_region_mmap ()
  #11 0x0000560aebb3ea0f in vfio_bars_register ()
  #12 0x0000560aebb3c628 in vfio_realize ()
  #13 0x0000560aeb90f0c2 in pci_qdev_realize ()
  #14 0x0000560aebc40305 in device_set_realized ()
  #15 0x0000560aebc48e07 in property_set_bool.llvm ()
  #16 0x0000560aebc46582 in object_property_set ()
  #17 0x0000560aebc4cd58 in object_property_set_qobject ()
  #18 0x0000560aebc46ba7 in object_property_set_bool ()
  #19 0x0000560aeb98b3ca in qdev_device_add_from_qdict ()
  #20 0x0000560aebb1fbaf in virtio_net_set_features ()
  #21 0x0000560aebb46b51 in virtio_set_features_nocheck ()
  #22 0x0000560aebb47107 in virtio_load ()
  #23 0x0000560aeb9ae7ce in vmstate_load_state ()
  #24 0x0000560aeb9d2ee9 in qemu_loadvm_state_main ()
  #25 0x0000560aeb9d45e1 in qemu_loadvm_state ()
  #26 0x0000560aeb9bc32c in process_incoming_migration_co.llvm ()
  #27 0x0000560aebeace56 in coroutine_trampoline.llvm ()

Cc: qemu-sta...@nongnu.org
Buglink: https://issues.redhat.com/browse/RHEL-832
Signed-off-by: Kevin Wolf <kw...@redhat.com>
Message-ID: <20230905145002.46391-3-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
Signed-off-by: Kevin Wolf <kw...@redhat.com>
(cherry picked from commit 92e2e6a867334a990f8d29f07ca34e3162fdd6ec)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: 0524a2d56a9bf96051e5787ddc058f817885ddec
      
https://github.com/qemu/qemu/commit/0524a2d56a9bf96051e5787ddc058f817885ddec
  Author: Colton Lewis <coltonle...@google.com>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M target/arm/kvm64.c

  Log Message:
  -----------
  arm64: Restore trapless ptimer access

Due to recent KVM changes, QEMU is setting a ptimer offset resulting
in unintended trap and emulate access and a consequent performance
hit. Filter out the PTIMER_CNT register to restore trapless ptimer
access.

Quoting Andrew Jones:

Simply reading the CNT register and writing back the same value is
enough to set an offset, since the timer will have certainly moved
past whatever value was read by the time it's written.  QEMU
frequently saves and restores all registers in the get-reg-list array,
unless they've been explicitly filtered out (with Linux commit
680232a94c12, KVM_REG_ARM_PTIMER_CNT is now in the array). So, to
restore trapless ptimer accesses, we need a QEMU patch to filter out
the register.

See
https://lore.kernel.org/kvmarm/gsntttsonus5....@coltonlewis-kvm.c.googlers.com/T/#m0770023762a821db2a3f0dd0a7dc6aa54e0d0da9
for additional context.

Cc: qemu-sta...@nongnu.org
Signed-off-by: Andrew Jones <andrew.jo...@linux.dev>
Signed-off-by: Colton Lewis <coltonle...@google.com>
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
Tested-by: Colton Lewis <coltonle...@google.com>
Message-id: 20230831190052.129045-1-coltonle...@google.com
Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
(cherry picked from commit 682814e2a3c883b27f24b9e7cab47313c49acbd4)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: 2d5e9c9d0fd1a1334e494944c236bcc57f02d054
      
https://github.com/qemu/qemu/commit/2d5e9c9d0fd1a1334e494944c236bcc57f02d054
  Author: Bin Meng <bm...@tinylab.org>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M hw/char/riscv_htif.c

  Log Message:
  -----------
  hw/char: riscv_htif: Avoid using magic numbers

The Spike HTIF is poorly documented. The only relevant info we can
get from the internet is from Andrew Waterman at [1].

Add a comment block before htif_handle_tohost_write() to explain
the tohost register format, and use meaningful macros instead of
magic numbers in the codes.

While we are here, correct 2 multi-line comment blocks that have
wrong format.

Link: 
https://github.com/riscv-software-src/riscv-isa-sim/issues/364#issuecomment-607657754
 [1]
Signed-off-by: Bin Meng <bm...@tinylab.org>
Reviewed-by: Daniel Henrique Barboza <dbarb...@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.fran...@wdc.com>
Message-Id: <20221229091828.1945072-2-bm...@tinylab.org>
Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
(cherry picked from commit 753ae97abc7459e69d48712355118fb54268f8cb)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: c85b26d5f96e35dee1e94da9039068c5cd8d67a8
      
https://github.com/qemu/qemu/commit/c85b26d5f96e35dee1e94da9039068c5cd8d67a8
  Author: Bin Meng <bm...@tinylab.org>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M hw/char/riscv_htif.c

  Log Message:
  -----------
  hw/char: riscv_htif: Use conventional 's' for HTIFState

QEMU source codes tend to use 's' to represent the hardware state.
Let's use it for HTIFState.

Signed-off-by: Bin Meng <bm...@tinylab.org>
Reviewed-by: Daniel Henrique Barboza <dbarb...@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.fran...@wdc.com>
Message-Id: <20221229091828.1945072-5-bm...@tinylab.org>
Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
(cherry picked from commit dadee9e3ce6ee6aad36fe3027eaa0f947358f812)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: c0e8e5e44185193b1db52a0109464958bd4652a5
      
https://github.com/qemu/qemu/commit/c0e8e5e44185193b1db52a0109464958bd4652a5
  Author: Thomas Huth <th...@redhat.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M hw/char/riscv_htif.c

  Log Message:
  -----------
  hw/char/riscv_htif: Fix printing of console characters on big endian hosts

The character that should be printed is stored in the 64 bit "payload"
variable. The code currently tries to print it by taking the address
of the variable and passing this pointer to qemu_chr_fe_write(). However,
this only works on little endian hosts where the least significant bits
are stored on the lowest address. To do this in a portable way, we have
to store the value in an uint8_t variable instead.

Fixes: 5033606780 ("RISC-V HTIF Console")
Signed-off-by: Thomas Huth <th...@redhat.com>
Reviewed-by: Alistair Francis <alistair.fran...@wdc.com>
Reviewed-by: Bin Meng <bm...@tinylab.org>
Reviewed-by: Daniel Henrique Barboza <dbarb...@ventanamicro.com>
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Message-Id: <20230721094720.902454-2-th...@redhat.com>
Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
(cherry picked from commit c255946e3df4d9660e4f468a456633c24393d468)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: 550d490811ec2ca8be9601845c5e138c983cf3b5
      
https://github.com/qemu/qemu/commit/550d490811ec2ca8be9601845c5e138c983cf3b5
  Author: Jason Chien <jason.ch...@sifive.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M hw/intc/riscv_aclint.c

  Log Message:
  -----------
  hw/intc: Fix upper/lower mtime write calculation

When writing the upper mtime, we should keep the original lower mtime
whose value is given by cpu_riscv_read_rtc() instead of
cpu_riscv_read_rtc_raw(). The same logic applies to writes to lower mtime.

Signed-off-by: Jason Chien <jason.ch...@sifive.com>
Reviewed-by: Alistair Francis <alistair.fran...@wdc.com>
Message-ID: <20230728082502.26439-1-jason.ch...@sifive.com>
Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
(cherry picked from commit e0922b73baf00c4c19d4ad30d09bb94f7ffea0f4)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: 10696f6e0c37f095d354ca56bbfaa5a58767289f
      
https://github.com/qemu/qemu/commit/10696f6e0c37f095d354ca56bbfaa5a58767289f
  Author: Jason Chien <jason.ch...@sifive.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M hw/intc/riscv_aclint.c

  Log Message:
  -----------
  hw/intc: Make rtc variable names consistent

The variables whose values are given by cpu_riscv_read_rtc() should be named
"rtc". The variables whose value are given by cpu_riscv_read_rtc_raw()
should be named "rtc_r".

Signed-off-by: Jason Chien <jason.ch...@sifive.com>
Reviewed-by: Alistair Francis <alistair.fran...@wdc.com>
Message-ID: <20230728082502.26439-2-jason.ch...@sifive.com>
Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
(cherry picked from commit 9382a9eafccad8dc6a487ea3a8d2bed03dc35db9)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: 189d5bddaa4ced9887aa0897843bde39abb7a8d5
      
https://github.com/qemu/qemu/commit/189d5bddaa4ced9887aa0897843bde39abb7a8d5
  Author: LIU Zhiwei <zhiwei_...@linux.alibaba.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M linux-user/riscv/signal.c

  Log Message:
  -----------
  linux-user/riscv: Use abi type for target_ucontext

We should not use types dependend on host arch for target_ucontext.
This bug is found when run rv32 applications.

Signed-off-by: LIU Zhiwei <zhiwei_...@linux.alibaba.com>
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
Reviewed-by: Daniel Henrique Barboza <dbarb...@ventanamicro.com>
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Message-ID: <20230811055438.1945-1-zhiwei_...@linux.alibaba.com>
Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
(cherry picked from commit ae7d4d625cab49657b9fc2be09d895afb9bcdaf0)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: 8d779e51a4ca32524ad3e19628d5f00b74707511
      
https://github.com/qemu/qemu/commit/8d779e51a4ca32524ad3e19628d5f00b74707511
  Author: Conor Dooley <conor.doo...@microchip.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M hw/riscv/virt.c

  Log Message:
  -----------
  hw/riscv: virt: Fix riscv,pmu DT node path

On a dtb dumped from the virt machine, dt-validate complains:
soc: pmu: {'riscv,event-to-mhpmcounters': [[1, 1, 524281], [2, 2, 524284], 
[65561, 65561, 524280], [65563, 65563, 524280], [65569, 65569, 524280]], 
'compatible': ['riscv,pmu']} should not be valid under {'type': 'object'}
        from schema $id: http://devicetree.org/schemas/simple-bus.yaml#
That's pretty cryptic, but running the dtb back through dtc produces
something a lot more reasonable:
Warning (simple_bus_reg): /soc/pmu: missing or empty reg/ranges property

Moving the riscv,pmu node out of the soc bus solves the problem.

Signed-off-by: Conor Dooley <conor.doo...@microchip.com>
Acked-by: Alistair Francis <alistair.fran...@wdc.com>
Reviewed-by: Daniel Henrique Barboza <dbarb...@ventanamicro.com>
Message-ID: <20230727-groom-decline-2c57ce42841c@spud>
Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
(cherry picked from commit 9ff31406312500053ecb5f92df01dd9ce52e635d)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>
(Mjt: context adjustment due to 568e0614d09 "hw/riscv/virt.c: rename 
MachineState 'mc' pointers to 'ms'")


  Commit: 71709aae90da3102c567a1dfa50373be79a2f2c4
      
https://github.com/qemu/qemu/commit/71709aae90da3102c567a1dfa50373be79a2f2c4
  Author: Leon Schuermann <le...@opentitan.org>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M target/riscv/pmp.c

  Log Message:
  -----------
  target/riscv/pmp.c: respect mseccfg.RLB for pmpaddrX changes

When the rule-lock bypass (RLB) bit is set in the mseccfg CSR, the PMP
configuration lock bits must not apply. While this behavior is
implemented for the pmpcfgX CSRs, this bit is not respected for
changes to the pmpaddrX CSRs. This patch ensures that pmpaddrX CSR
writes work even on locked regions when the global rule-lock bypass is
enabled.

Signed-off-by: Leon Schuermann <le...@opentitan.org>
Reviewed-by: Mayuresh Chitale <mchit...@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.fran...@wdc.com>
Message-ID: <20230829215046.1430463-1-leon@is.currently.online>
Signed-off-by: Alistair Francis <alistair.fran...@wdc.com>
(cherry picked from commit 4e3adce1244e1ca30ec05874c3eca14911dc0825)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


  Commit: d256f730cd98450bdece301f41d7767039d44967
      
https://github.com/qemu/qemu/commit/d256f730cd98450bdece301f41d7767039d44967
  Author: Stefan Berger <stef...@linux.ibm.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M hw/tpm/tpm_tis_sysbus.c

  Log Message:
  -----------
  hw/tpm: TIS on sysbus: Remove unsupport ppi command line option

The ppi command line option for the TIS device on sysbus never worked
and caused an immediate segfault. Remove support for it since it also
needs support in the firmware and needs testing inside the VM.

Reproducer with the ppi=on option passed:

qemu-system-aarch64 \
   -machine virt,gic-version=3 \
   -m 4G  \
   -nographic -no-acpi \
   -chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \
   -tpmdev emulator,id=tpm0,chardev=chrtpm \
   -device tpm-tis-device,tpmdev=tpm0,ppi=on
[...]
Segmentation fault (core dumped)

Signed-off-by: Stefan Berger <stef...@linux.ibm.com>
Reviewed-by: Eric Auger <eric.au...@redhat.com>
Message-id: 20230713171955.149236-1-stef...@linux.ibm.com
(cherry picked from commit 4c46fe2ed492f35f411632c8b5a8442f322bc3f0)
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>


Compare: https://github.com/qemu/qemu/compare/3c99de0aa7f3...d256f730cd98

Reply via email to