qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] bf5dcf: backends/tpm: Replace qemu_mutex_lock


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] bf5dcf: backends/tpm: Replace qemu_mutex_lock calls with Q...
Date: Mon, 17 May 2021 08:45:26 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: bf5dcf8f2cf61283a46aea14867adbec1a20fe3d
      
https://github.com/qemu/qemu/commit/bf5dcf8f2cf61283a46aea14867adbec1a20fe3d
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M backends/tpm/tpm_emulator.c

  Log Message:
  -----------
  backends/tpm: Replace qemu_mutex_lock calls with QEMU_LOCK_GUARD

Simplify the tpm_emulator_ctrlcmd() handler by replacing a pair of
qemu_mutex_lock/qemu_mutex_unlock calls by the WITH_QEMU_LOCK_GUARD
macro.

Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Christophe de Dinechin <dinechin@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210512070713.3286188-1-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 989f622d418a81051ee8a2cb3942d18fcf5e3937
      
https://github.com/qemu/qemu/commit/989f622d418a81051ee8a2cb3942d18fcf5e3937
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-05-13 (Thu, 13 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>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20210511104157.2880306-2-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: f212f3e7f868cb0e82fdf2d68e83adcad4e33730
      
https://github.com/qemu/qemu/commit/f212f3e7f868cb0e82fdf2d68e83adcad4e33730
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-05-13 (Thu, 13 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>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20210511104157.2880306-3-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 28cbc87be58b490a31f5c2697c79cf0534cd3fea
      
https://github.com/qemu/qemu/commit/28cbc87be58b490a31f5c2697c79cf0534cd3fea
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-05-13 (Thu, 13 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>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20210511104157.2880306-4-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 4962b312cd2a09902efdf34d91f529164e321b8d
      
https://github.com/qemu/qemu/commit/4962b312cd2a09902efdf34d91f529164e321b8d
  Author: Greg Kurz <groug@kaod.org>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M tools/virtiofsd/fuse_virtio.c

  Log Message:
  -----------
  virtiofsd: Fix check of chown()'s return value

Otherwise you always get this warning when using --socket-group=users

 vhost socket failed to set group to users (100)

While here, print out the error if chown() fails.

Fixes: f6698f2b03b0 ("tools/virtiofsd: add support for --socket-group")
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <162040394890.714971.15502455176528384778.stgit@bahia.lan>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 09ceb33091ab50ea632727d105057f2bd6324672
      
https://github.com/qemu/qemu/commit/09ceb33091ab50ea632727d105057f2bd6324672
  Author: Michael Tokarev <mjt@tls.msk.ru>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M qapi/qom.json

  Log Message:
  -----------
  qapi: spelling fix (addtional)

Fixes: 3d0d3c30ae3a259bff176f85a3efa2d0816695af
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210508093315.393274-1-mjt@msgid.tls.msk.ru>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: bcfec3763e44b6996384272bf43fbcfce7f45c57
      
https://github.com/qemu/qemu/commit/bcfec3763e44b6996384272bf43fbcfce7f45c57
  Author: Michael Tokarev <mjt@tls.msk.ru>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M hw/gpio/aspeed_gpio.c

  Log Message:
  -----------
  hw/gpio/aspeed: spelling fix (addtional)

Fixes: 36d737ee82b2972167e97901c5271ba3f904ba71
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210508093615.411920-1-mjt@msgid.tls.msk.ru>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 72fe4742c6e7fa3d237b5cb5866dfaf7733141e9
      
https://github.com/qemu/qemu/commit/72fe4742c6e7fa3d237b5cb5866dfaf7733141e9
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M hw/timer/etraxfs_timer.c

  Log Message:
  -----------
  hw/timer/etraxfs_timer: Convert to 3-phase reset (Resettable interface)

TYPE_ETRAX_FS_TIMER is a sysbus device, so its DeviceClass::reset()
handler is called automatically when its qbus parent is reset
(we don't need to register it manually).

Convert the generic reset to a enter/hold resettable ones, and
remove the qemu_register_reset() call.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-Id: <20210502163931.552675-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: fae5a0420754453beca3407250899254fb6745a1
      
https://github.com/qemu/qemu/commit/fae5a0420754453beca3407250899254fb6745a1
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M hw/rtc/mc146818rtc.c

  Log Message:
  -----------
  hw/rtc/mc146818rtc: Convert to 3-phase reset (Resettable interface)

TYPE_MC146818_RTC is an ISA device, so its DeviceClass::reset()
handler is called automatically when its qbus parent is reset
(we don't need to register it manually).

We have 2 reset() methods: a generic one and the qdev one.
Merge them into a reset_enter handler (keeping the IRQ lowering
to a reset_hold one), and remove the qemu_register_reset() call.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-Id: <20210502163931.552675-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: b6d003dbee81f1bf419c7cceec0c4c358184a601
      
https://github.com/qemu/qemu/commit/b6d003dbee81f1bf419c7cceec0c4c358184a601
  Author: Stefano Garzarella <sgarzare@redhat.com>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M util/cutils.c

  Log Message:
  -----------
  cutils: fix memory leak in get_relocated_path()

get_relocated_path() allocates a GString object and returns the
character data (C string) to the caller without freeing the memory
allocated for that object as reported by valgrind:

  24 bytes in 1 blocks are definitely lost in loss record 2,805 of 6,532
     at 0x4839809: malloc (vg_replace_malloc.c:307)
     by 0x55AABB8: g_malloc (in /usr/lib64/libglib-2.0.so.0.6600.8)
     by 0x55C2481: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.6600.8)
     by 0x55C4827: g_string_sized_new (in /usr/lib64/libglib-2.0.so.0.6600.8)
     by 0x55C4CEA: g_string_new (in /usr/lib64/libglib-2.0.so.0.6600.8)
     by 0x906314: get_relocated_path (cutils.c:1036)
     by 0x6E1F77: qemu_read_default_config_file (vl.c:2122)
     by 0x6E1F77: qemu_init (vl.c:2687)
     by 0x3E3AF8: main (main.c:49)

Let's use g_string_free(gstring, false) to free only the GString object
and transfer the ownership of the character data to the caller.

Fixes: f4f5ed2cbd ("cutils: introduce get_relocated_path")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210412170255.231406-1-sgarzare@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


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

  Changed paths:
    M hw/mem/meson.build

  Log Message:
  -----------
  hw/mem/meson: Fix linking sparse-mem device with fuzzer

sparse-mem.c is added to the 'mem_ss' source set, which itself
is conditionally added to softmmu_ss if CONFIG_MEM_DEVICE is
selected.
But if CONFIG_MEM_DEVICE isn't selected, we get a link failure
even if CONFIG_FUZZ is selected:

  /usr/bin/ld: tests_qtest_fuzz_generic_fuzz.c.o: in function 
`generic_pre_fuzz':
  tests/qtest/fuzz/generic_fuzz.c:826: undefined reference to `sparse_mem_init'
  clang-10: error: linker command failed with exit code 1 (use -v to see 
invocation)

Fix by adding sparse-mem.c directly to the softmmu_ss set.

Fixes: 230376d285b ("memory: add a sparse memory device for fuzzing")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20210406133944.4193691-1-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 4872fdf71b52288105ae5513f892f39633bec28c
      
https://github.com/qemu/qemu/commit/4872fdf71b52288105ae5513f892f39633bec28c
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M hw/pci-host/meson.build

  Log Message:
  -----------
  hw/pci-host: Do not build gpex-acpi.c if GPEX is not selected

Since its introduction in commit 5b85eabe68f ("acpi: add
acpi_dsdt_add_gpex") we build gpex-acpi.c if ACPI is selected,
even if the GPEX_HOST device isn't build. Add the missing
Kconfig dependency.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20210425182124.3735214-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: dcf20655ffca2b0219d2914db4aadcce4b61fa0a
      
https://github.com/qemu/qemu/commit/dcf20655ffca2b0219d2914db4aadcce4b61fa0a
  Author: Jagannathan Raman <jag.raman@oracle.com>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M hw/remote/mpqemu-link.c

  Log Message:
  -----------
  multi-process: Avoid logical AND of mutually exclusive tests

Fixes an if statement that performs a logical AND of mutually exclusive
tests

Buglink: https://bugs.launchpad.net/qemu/+bug/1926995
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <1620402803-9237-1-git-send-email-jag.raman@oracle.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 52a1c621f9d56d18212273c64b4119513a2db1f1
      
https://github.com/qemu/qemu/commit/52a1c621f9d56d18212273c64b4119513a2db1f1
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M target/sh4/helper.c

  Log Message:
  -----------
  target/sh4: Return error if CPUClass::get_phys_page_debug() fails

If the get_physical_address() call fails, the SH4 get_phys_page_debug()
handler returns an uninitialized address. Instead return -1, which
correspond to "no page found" (see cpu_get_phys_page_debug() doc
string).

This fixes a warning emitted when building with CFLAGS=-O3
(using GCC 10.2.1 20201125):

  target/sh4/helper.c: In function ‘superh_cpu_get_phys_page_debug’:
  target/sh4/helper.c:446:12: warning: ‘physical’ may be used uninitialized in 
this function [-Wmaybe-uninitialized]
    446 |     return physical;
        |            ^~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Message-Id: <20210505161046.1397608-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 6cd04a88fa3fc5941fcd3677355e1b75efe9c7a8
      
https://github.com/qemu/qemu/commit/6cd04a88fa3fc5941fcd3677355e1b75efe9c7a8
  Author: Frederic Konrad <konrad@adacore.com>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M hw/avr/atmega.c

  Log Message:
  -----------
  hw/avr/atmega.c: use the avr51 cpu for atmega1280

According to the as documentation:
 (https://sourceware.org/binutils/docs-2.36/as/AVR-Options.html)

"Instruction set avr51 is for the enhanced AVR core with exactly 128K
 program memory space (MCU types: atmega128, atmega128a, atmega1280,
 atmega1281, atmega1284, atmega1284p, atmega128rfa1, atmega128rfr2,
 atmega1284rfr2, at90can128, at90usb1286, at90usb1287, m3000)."

But when compiling a program for atmega1280 or avr51 and trying to execute
it:

$ cat > test.S << EOF
> loop:
>     rjmp loop
> EOF
$ avr-gcc -nostdlib -nostartfiles -mmcu=atmega1280 test.S -o test.elf
$ qemu-system-avr -serial mon:stdio -nographic -no-reboot -M mega \
                  -bios test.elf
qemu-system-avr: Current machine: Arduino Mega (ATmega1280) with 'avr6' CPU
qemu-system-avr: ELF image 'test.elf' is for 'avr51' CPU

So this fixes the atmega1280 class to use an avr51 CPU.

Signed-off-by: Frederic Konrad <frederic.konrad@adacore.com>
Reviewed-by: Joaquin de Andres <me@xcancerberox.com.ar>
Message-Id: <1619637319-22299-1-git-send-email-frederic.konrad@adacore.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 29f9c636894c462fa54fad08049e51877905e93b
      
https://github.com/qemu/qemu/commit/29f9c636894c462fa54fad08049e51877905e93b
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M target/avr/helper.c

  Log Message:
  -----------
  target/avr: Ignore unimplemented WDR opcode

Running the WDR opcode triggers a segfault:

  $ cat > foo.S << EOF
  > __start:
  >     wdr
  > EOF
  $ avr-gcc -nostdlib -nostartfiles -mmcu=avr6 foo.S -o foo.elf
  $ qemu-system-avr -serial mon:stdio -nographic -no-reboot \
    -M mega -bios foo.elf -d in_asm --singlestep
  IN:
  0x00000000:  WDR
  Segmentation fault (core dumped)

  (gdb) bt
     #0  0x00005555add0b23a in gdb_get_cpu_pid (cpu=0x5555af5a4af0) at 
../gdbstub.c:718
     #1  0x00005555add0b2dd in gdb_get_cpu_process (cpu=0x5555af5a4af0) at 
../gdbstub.c:743
     #2  0x00005555add0e477 in gdb_set_stop_cpu (cpu=0x5555af5a4af0) at 
../gdbstub.c:2742
     #3  0x00005555adc99b96 in cpu_handle_guest_debug (cpu=0x5555af5a4af0) at 
../softmmu/cpus.c:306
     #4  0x00005555adcc66ab in rr_cpu_thread_fn (arg=0x5555af5a4af0) at 
../accel/tcg/tcg-accel-ops-rr.c:224
     #5  0x00005555adefaf12 in qemu_thread_start (args=0x5555af5d9870) at 
../util/qemu-thread-posix.c:521
     #6  0x00007f692d940ea5 in start_thread () from /lib64/libpthread.so.0
     #7  0x00007f692d6699fd in clone () from /lib64/libc.so.6

Since the watchdog peripheral is not implemented, simply
log the opcode as unimplemented and keep going.

Reported-by: Fred Konrad <konrad@adacore.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Message-Id: <20210502190900.604292-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 367196caa07ac31443bc360145cc10fbef4fdf92
      
https://github.com/qemu/qemu/commit/367196caa07ac31443bc360145cc10fbef4fdf92
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-05-17 (Mon, 17 May 2021)

  Changed paths:
    M backends/tpm/tpm_emulator.c
    M hw/avr/atmega.c
    M hw/gpio/aspeed_gpio.c
    M hw/mem/meson.build
    M hw/pci-host/meson.build
    M hw/remote/mpqemu-link.c
    M hw/rtc/mc146818rtc.c
    M hw/timer/etraxfs_timer.c
    M qapi/qom.json
    M target/avr/helper.c
    M target/sh4/helper.c
    M tools/virtiofsd/fuse_virtio.c
    M util/cutils.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/vivier2/tags/trivial-branch-for-6.1-pull-request' into staging

Pull request trivial-branch 20210515

# gpg: Signature made Sat 15 May 2021 11:02:59 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" 
[full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-for-6.1-pull-request:
  target/avr: Ignore unimplemented WDR opcode
  hw/avr/atmega.c: use the avr51 cpu for atmega1280
  target/sh4: Return error if CPUClass::get_phys_page_debug() fails
  multi-process: Avoid logical AND of mutually exclusive tests
  hw/pci-host: Do not build gpex-acpi.c if GPEX is not selected
  hw/mem/meson: Fix linking sparse-mem device with fuzzer
  cutils: fix memory leak in get_relocated_path()
  hw/rtc/mc146818rtc: Convert to 3-phase reset (Resettable interface)
  hw/timer/etraxfs_timer: Convert to 3-phase reset (Resettable interface)
  hw/gpio/aspeed: spelling fix (addtional)
  qapi: spelling fix (addtional)
  virtiofsd: Fix check of chown()'s return value
  virtio-net: Constify VirtIOFeature feature_sizes[]
  virtio-blk: Constify VirtIOFeature feature_sizes[]
  hw/virtio: Pass virtio_feature_get_config_size() a const argument
  backends/tpm: Replace qemu_mutex_lock calls with QEMU_LOCK_GUARD

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


Compare: https://github.com/qemu/qemu/compare/32de74a1ac18...367196caa07a



reply via email to

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