[Qemu-commits] [qemu/qemu] 9173d5: gitlab-ci: add manual job to run Coverity

2024-03-05 Thread Paolo Bonzini via Qemu-commits
  Branch: refs/heads/coverity
  Home:   https://github.com/qemu/qemu
  Commit: 9173d5d084182d2d7c65bfc00f9a687ade90b938
  
https://github.com/qemu/qemu/commit/9173d5d084182d2d7c65bfc00f9a687ade90b938
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M .gitlab-ci.d/base.yml
M .gitlab-ci.d/buildtest.yml
M .gitlab-ci.d/opensbi.yml

  Log Message:
  ---
  gitlab-ci: add manual job to run Coverity

Add a job that can be run, either manually or on a schedule, to upload
a build to Coverity Scan.  The job uses the run-coverity-scan script
in multiple phases of check, download tools and upload, in order to
avoid both wasting time (skip everything if you are above the upload
quota) and avoid filling the log with the progress of downloading
the tools.

The job is intended to run on a scheduled pipeline run, and scheduled
runs will not get any other job.  It requires two variables to be in
GitLab CI, COVERITY_TOKEN and COVERITY_EMAIL.  Those are already set up
in qemu-project's configuration as protected and masked variables.

Signed-off-by: Paolo Bonzini 



To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



[Qemu-commits] [qemu/qemu] 9cf3bc: hw/i2c: Implement Broadcom Serial Controller (BSC)

2024-03-05 Thread Peter Maydell via Qemu-commits
ntual value, failed or not

This is somewhere between cryptic and wrong, since the value actually
returned is the value that was in memory before the cmpxchg.  Reword
to match how we describe these macros in atomics.rst.

Signed-off-by: Peter Maydell 
Reviewed-by: Richard Henderson 
Reviewed-by: Jonathan Cameron 
Reviewed-by: Zhao Liu 
Message-id: 20240223182035.1048541-1-peter.mayd...@linaro.org


  Commit: 7558300c53057126514ee0fd5cf629c65ccc20e1
  
https://github.com/qemu/qemu/commit/7558300c53057126514ee0fd5cf629c65ccc20e1
  Author: Steven Shen 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M qemu-options.hx

  Log Message:
  ---
  qemu-options.hx: Don't claim "-serial" has limit of 4 serial ports

Before v2.12, the implementation of serial ports was limited to
a value of MAX_SERIAL_PORTS = 4. We now dynamically allocate
the data structures for serial ports, so this limit is no longer
present, but the documentation for the -serial options still reads:

 "This option can be used several times to simulate up to 4 serial ports."

Update to "This option can be used several times to simulate
multiple serial ports." to avoid misleading.

Signed-off-by: Steven Shen 
Message-id: 20240305013016.2268-1-steven.s...@jaguarmicro.com
Reviewed-by: Peter Maydell 
[PMM: tweaked commit message]
Signed-off-by: Peter Maydell 


  Commit: db596ae19040574e41d086e78469014191d7d7fc
  
https://github.com/qemu/qemu/commit/db596ae19040574e41d086e78469014191d7d7fc
  Author: Peter Maydell 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M MAINTAINERS
M accel/tcg/cputlb.c
M docs/system/arm/b-l475e-iot01a.rst
M docs/system/arm/raspi.rst
M hw/arm/Kconfig
M hw/arm/b-l475e-iot01a.c
M hw/arm/bcm2835_peripherals.c
M hw/arm/stm32l4x5_soc.c
M hw/char/pl011.c
M hw/i2c/Kconfig
A hw/i2c/bcm2835_i2c.c
M hw/i2c/meson.build
M hw/misc/Kconfig
M hw/misc/meson.build
A hw/misc/stm32l4x5_rcc.c
M hw/misc/trace-events
M include/exec/cpu-all.h
M include/exec/memattrs.h
M include/hw/arm/bcm2835_peripherals.h
M include/hw/arm/stm32l4x5_soc.h
M include/hw/core/cpu.h
A include/hw/i2c/bcm2835_i2c.h
A include/hw/misc/stm32l4x5_rcc.h
A include/hw/misc/stm32l4x5_rcc_internals.h
M include/qemu/atomic.h
M qemu-options.hx
M target/arm/ptw.c
M target/arm/tcg/hflags.c
M target/arm/tcg/translate.c
M target/sparc/mmu_helper.c
A tests/qtest/bcm2835-i2c-test.c
M tests/qtest/meson.build
A tests/qtest/stm32l4x5_rcc-test.c

  Log Message:
  ---
  Merge tag 'pull-target-arm-20240305' of 
https://git.linaro.org/people/pmaydell/qemu-arm into staging

target-arm queue:
 * raspi: Implement Broadcom Serial Controller (BSC) for BCM2835 boards
 * hw/char/pl011: Add support for loopback
 * STM32L4x5: Implement RCC clock control device
 * target/arm: Do memory type alignment checks
 * atomic.h: Reword confusing comment for qatomic_cmpxchg
 * qemu-options.hx: Don't claim "-serial" has limit of 4 serial ports

# -BEGIN PGP SIGNATURE-
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmXnI4gZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3p5ED/wOtAHA3PK+WbQhVhnji3+k
# gdhvVcldf+HLaI2v4tfaW152xjY80/j3PQFNkzptoXENA9U51F47oNYOIfULLZZX
# FTKmw/mjTBc2LqJ8gLpS8Wkr/PFtDq9JJzDwZd0MwguXpzIJp31JJpESvXlAqjjv
# FhuAcqNNuGwI2SXCBmp2lPoEMn8ExLDoG9rmzjxVZeZCyzUjVnJYM61ykhC4ByvK
# j5+/a7pUcpgHSX5cbq7kFloPOx3JXI5lS6xUKhGXXk75qHRwiQIsxMcPq8PD1+ok
# yrmp7cySwK8I7AlIPdDjpJmhU0OiBu+PkYiXmHlF2nvaUy6M0nVX2lSTzqj6VpVV
# 7yYhvWXHrtIA9AUspqTRsX7tP7iMJkco7qWfKSzYl+3pTbxS4+rEoee4jNR3hqsU
# lbWC47sNVtTN507qIL1dcsu+BaeSsYVftfxtFql3odTqRB+ticsjDfKg69dRSFyk
# SS0t8Zy3TdomcEoQkAv/ZSpkQnQUGavbRumCG58lJdiTwTuJUmGi1ufKBrD/GeKj
# IlDEl9yvKiR8uvdjj6EQqr5kOj09mmN5nvokNsq5a4aNXBYoesszWK2xodzXE2x5
# M9DHJ3S8xnN++p1idS2bikwEklG1XVQ/q52bDXQkUmQSNerVS1PCvg9hzYqA+x53
# ihJtMcsmGVfxY8aQHyHweA==
# =isAe
# -END PGP SIGNATURE-
# gpg: Signature made Tue 05 Mar 2024 13:52:08 GMT
# gpg:using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:issuer "peter.mayd...@linaro.org"
# gpg: Good signature from "Peter Maydell " [ultimate]
# gpg: aka "Peter Maydell " [ultimate]
# gpg: aka "Peter Maydell " 
[ultimate]
# gpg: aka "Peter Maydell " [ultimate]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20240305' of 
https://git.linaro.org/people/pmaydell/qemu-arm:
  qemu-options.hx: Don't claim "-serial" has limit of 4 serial ports
  atomic.h: Reword confusing comment for qatomic_cmpxchg
  target/arm: Do memory type alignment check when translation enabled
  target/arm: Do memory type alignment check when translation disabled
  accel/tcg: Add TLB_CHECK_ALIGNED
  accel/tcg: Add t

[Qemu-commits] [qemu/qemu] 9cf3bc: hw/i2c: Implement Broadcom Serial Controller (BSC)

2024-03-05 Thread Peter Maydell via Qemu-commits
ntual value, failed or not

This is somewhere between cryptic and wrong, since the value actually
returned is the value that was in memory before the cmpxchg.  Reword
to match how we describe these macros in atomics.rst.

Signed-off-by: Peter Maydell 
Reviewed-by: Richard Henderson 
Reviewed-by: Jonathan Cameron 
Reviewed-by: Zhao Liu 
Message-id: 20240223182035.1048541-1-peter.mayd...@linaro.org


  Commit: 7558300c53057126514ee0fd5cf629c65ccc20e1
  
https://github.com/qemu/qemu/commit/7558300c53057126514ee0fd5cf629c65ccc20e1
  Author: Steven Shen 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M qemu-options.hx

  Log Message:
  ---
  qemu-options.hx: Don't claim "-serial" has limit of 4 serial ports

Before v2.12, the implementation of serial ports was limited to
a value of MAX_SERIAL_PORTS = 4. We now dynamically allocate
the data structures for serial ports, so this limit is no longer
present, but the documentation for the -serial options still reads:

 "This option can be used several times to simulate up to 4 serial ports."

Update to "This option can be used several times to simulate
multiple serial ports." to avoid misleading.

Signed-off-by: Steven Shen 
Message-id: 20240305013016.2268-1-steven.s...@jaguarmicro.com
Reviewed-by: Peter Maydell 
[PMM: tweaked commit message]
Signed-off-by: Peter Maydell 


  Commit: db596ae19040574e41d086e78469014191d7d7fc
  
https://github.com/qemu/qemu/commit/db596ae19040574e41d086e78469014191d7d7fc
  Author: Peter Maydell 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M MAINTAINERS
M accel/tcg/cputlb.c
M docs/system/arm/b-l475e-iot01a.rst
M docs/system/arm/raspi.rst
M hw/arm/Kconfig
M hw/arm/b-l475e-iot01a.c
M hw/arm/bcm2835_peripherals.c
M hw/arm/stm32l4x5_soc.c
M hw/char/pl011.c
M hw/i2c/Kconfig
A hw/i2c/bcm2835_i2c.c
M hw/i2c/meson.build
M hw/misc/Kconfig
M hw/misc/meson.build
A hw/misc/stm32l4x5_rcc.c
M hw/misc/trace-events
M include/exec/cpu-all.h
M include/exec/memattrs.h
M include/hw/arm/bcm2835_peripherals.h
M include/hw/arm/stm32l4x5_soc.h
M include/hw/core/cpu.h
A include/hw/i2c/bcm2835_i2c.h
A include/hw/misc/stm32l4x5_rcc.h
A include/hw/misc/stm32l4x5_rcc_internals.h
M include/qemu/atomic.h
M qemu-options.hx
M target/arm/ptw.c
M target/arm/tcg/hflags.c
M target/arm/tcg/translate.c
M target/sparc/mmu_helper.c
A tests/qtest/bcm2835-i2c-test.c
M tests/qtest/meson.build
A tests/qtest/stm32l4x5_rcc-test.c

  Log Message:
  ---
  Merge tag 'pull-target-arm-20240305' of 
https://git.linaro.org/people/pmaydell/qemu-arm into staging

target-arm queue:
 * raspi: Implement Broadcom Serial Controller (BSC) for BCM2835 boards
 * hw/char/pl011: Add support for loopback
 * STM32L4x5: Implement RCC clock control device
 * target/arm: Do memory type alignment checks
 * atomic.h: Reword confusing comment for qatomic_cmpxchg
 * qemu-options.hx: Don't claim "-serial" has limit of 4 serial ports

# -BEGIN PGP SIGNATURE-
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmXnI4gZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3p5ED/wOtAHA3PK+WbQhVhnji3+k
# gdhvVcldf+HLaI2v4tfaW152xjY80/j3PQFNkzptoXENA9U51F47oNYOIfULLZZX
# FTKmw/mjTBc2LqJ8gLpS8Wkr/PFtDq9JJzDwZd0MwguXpzIJp31JJpESvXlAqjjv
# FhuAcqNNuGwI2SXCBmp2lPoEMn8ExLDoG9rmzjxVZeZCyzUjVnJYM61ykhC4ByvK
# j5+/a7pUcpgHSX5cbq7kFloPOx3JXI5lS6xUKhGXXk75qHRwiQIsxMcPq8PD1+ok
# yrmp7cySwK8I7AlIPdDjpJmhU0OiBu+PkYiXmHlF2nvaUy6M0nVX2lSTzqj6VpVV
# 7yYhvWXHrtIA9AUspqTRsX7tP7iMJkco7qWfKSzYl+3pTbxS4+rEoee4jNR3hqsU
# lbWC47sNVtTN507qIL1dcsu+BaeSsYVftfxtFql3odTqRB+ticsjDfKg69dRSFyk
# SS0t8Zy3TdomcEoQkAv/ZSpkQnQUGavbRumCG58lJdiTwTuJUmGi1ufKBrD/GeKj
# IlDEl9yvKiR8uvdjj6EQqr5kOj09mmN5nvokNsq5a4aNXBYoesszWK2xodzXE2x5
# M9DHJ3S8xnN++p1idS2bikwEklG1XVQ/q52bDXQkUmQSNerVS1PCvg9hzYqA+x53
# ihJtMcsmGVfxY8aQHyHweA==
# =isAe
# -END PGP SIGNATURE-
# gpg: Signature made Tue 05 Mar 2024 13:52:08 GMT
# gpg:using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:issuer "peter.mayd...@linaro.org"
# gpg: Good signature from "Peter Maydell " [ultimate]
# gpg: aka "Peter Maydell " [ultimate]
# gpg: aka "Peter Maydell " 
[ultimate]
# gpg: aka "Peter Maydell " [ultimate]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20240305' of 
https://git.linaro.org/people/pmaydell/qemu-arm:
  qemu-options.hx: Don't claim "-serial" has limit of 4 serial ports
  atomic.h: Reword confusing comment for qatomic_cmpxchg
  target/arm: Do memory type alignment check when translation enabled
  target/arm: Do memory type alignment check when translation disabled
  accel/tcg: Add TLB_CHECK_ALIGNED
  accel/tcg: Add t

[Qemu-commits] [qemu/qemu] 87a284: migration: massage cpr-reboot documentation

2024-03-05 Thread Peter Maydell via Qemu-commits
  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 87a2848715f5fc4fa114574dbbf7a5564cb4cdd7
  
https://github.com/qemu/qemu/commit/87a2848715f5fc4fa114574dbbf7a5564cb4cdd7
  Author: Steve Sistare 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M qapi/migration.json

  Log Message:
  ---
  migration: massage cpr-reboot documentation

Re-wrap the cpr-reboot documentation to 70 columns, use '@' for
cpr-reboot references, capitalize COLO and VFIO, and tweak the
wording.

Suggested-by: Markus Armbruster 
Signed-off-by: Steve Sistare 
Link: 
https://lore.kernel.org/r/1709218462-3640-1-git-send-email-steven.sist...@oracle.com
[peterx: s/qemu/QEMU per Markus's suggestion]
Reviewed-by: Markus Armbruster 
Signed-off-by: Peter Xu 


  Commit: b4014a2bf57ce08e2f6458cd82e9f968facf25c8
  
https://github.com/qemu/qemu/commit/b4014a2bf57ce08e2f6458cd82e9f968facf25c8
  Author: Bryan Zhang 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M migration/options.c

  Log Message:
  ---
  migration: Properly apply migration compression level parameters

Some glue code was missing, so that using `qmp_migrate_set_parameters`
to set `multifd-zstd-level` or `multifd-zlib-level` did not work. This
commit adds the glue code to fix that.

Signed-off-by: Bryan Zhang 
Link: 
https://lore.kernel.org/r/20240301035901.4006936-2-bryan.zh...@bytedance.com
Signed-off-by: Peter Xu 


  Commit: 2b571432314ab42da742fbb578f4174166ecd7f5
  
https://github.com/qemu/qemu/commit/2b571432314ab42da742fbb578f4174166ecd7f5
  Author: Bryan Zhang 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M tests/qtest/migration-test.c

  Log Message:
  ---
  tests/migration: Set compression level in migration tests

Adds calls to set compression level for `zstd` and `zlib` migration
tests, just to make sure that the calls work.

Signed-off-by: Bryan Zhang 
Link: 
https://lore.kernel.org/r/20240301035901.4006936-3-bryan.zh...@bytedance.com
Signed-off-by: Peter Xu 


  Commit: 4aac6b1e9bd48677c4f24518fe86ffd34c677d5a
  
https://github.com/qemu/qemu/commit/4aac6b1e9bd48677c4f24518fe86ffd34c677d5a
  Author: Fabiano Rosas 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M migration/multifd.c
M migration/trace-events

  Log Message:
  ---
  migration/multifd: Cleanup multifd_recv_sync_main

Some minor cleanups and documentation for multifd_recv_sync_main.

Use thread_count as done in other parts of the code. Remove p->id from
the multifd_recv_state sync, since that is global and not tied to a
channel. Add documentation for the sync steps.

Reviewed-by: Peter Xu 
Signed-off-by: Fabiano Rosas 
Link: https://lore.kernel.org/r/20240229153017.2221-2-faro...@suse.de
Signed-off-by: Peter Xu 


  Commit: 401e311ff72e0a62c834bfe466de68a82cfd90cb
  
https://github.com/qemu/qemu/commit/401e311ff72e0a62c834bfe466de68a82cfd90cb
  Author: Nikolay Borisov 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M include/io/channel.h
M io/channel-file.c

  Log Message:
  ---
  io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file

Add a generic QIOChannel feature SEEKABLE which would be used by the
qemu_file* apis. For the time being this will be only implemented for
file channels.

Signed-off-by: Nikolay Borisov 
Reviewed-by: "Daniel P. Berrangé" 
Reviewed-by: Peter Xu 
Signed-off-by: Fabiano Rosas 
Link: https://lore.kernel.org/r/20240229153017.2221-3-faro...@suse.de
Signed-off-by: Peter Xu 


  Commit: f1cfe39418a837e8dd52a7e75331f1606949deff
  
https://github.com/qemu/qemu/commit/f1cfe39418a837e8dd52a7e75331f1606949deff
  Author: Nikolay Borisov 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M include/io/channel.h
M io/channel.c

  Log Message:
  ---
  io: Add generic pwritev/preadv interface

Introduce basic pwritev/preadv support in the generic channel layer.
Specific implementation will follow for the file channel as this is
required in order to support migration streams with fixed location of
each ram page.

Signed-off-by: Nikolay Borisov 
Reviewed-by: "Daniel P. Berrangé" 
Reviewed-by: Peter Xu 
Signed-off-by: Fabiano Rosas 
Link: https://lore.kernel.org/r/20240229153017.2221-4-faro...@suse.de
Signed-off-by: Peter Xu 


  Commit: 0478b030fa2530cbbfc4d6432e8e39a16d06865b
  
https://github.com/qemu/qemu/commit/0478b030fa2530cbbfc4d6432e8e39a16d06865b
  Author: Nikolay Borisov 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M io/channel-file.c

  Log Message:
  ---
  io: implement io_pwritev/preadv for QIOChannelFile

The upcoming 'mapped-ram' feature will require qemu to write data to
(and restore from) specific offsets of the migration file.

Add a minimal implementation of pwritev/preadv and expose them via the
io_pwritev and io_preadv interfaces.

Signed-off-by: Nikolay Borisov 
Reviewed-by: "Daniel P. Berrangé" 
Reviewed-by: Peter Xu 
Signed-off-by: Fa

[Qemu-commits] [qemu/qemu] 1a9a66: gitlab-ci: add manual job to run Coverity

2024-03-05 Thread Paolo Bonzini via Qemu-commits
  Branch: refs/heads/coverity
  Home:   https://github.com/qemu/qemu
  Commit: 1a9a667d6f64027bc28ade2039fc1d77753b2f74
  
https://github.com/qemu/qemu/commit/1a9a667d6f64027bc28ade2039fc1d77753b2f74
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M .gitlab-ci.d/base.yml
M .gitlab-ci.d/buildtest.yml
M .gitlab-ci.d/opensbi.yml

  Log Message:
  ---
  gitlab-ci: add manual job to run Coverity

Add a job that can be run, either manually or on a schedule, to upload
a build to Coverity Scan.  The job uses the run-coverity-scan script
in multiple phases of check, download tools and upload, in order to
avoid both wasting time (skip everything if you are above the upload
quota) and avoid filling the log with the progress of downloading
the tools.

The job is intended to run on a scheduled pipeline run, and scheduled
runs will not get any other job.  It requires two variables to be in
GitLab CI, COVERITY_TOKEN and COVERITY_EMAIL.  Those are already set up
in qemu-project's configuration as protected and masked variables.

Signed-off-by: Paolo Bonzini 



To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



[Qemu-commits] [qemu/qemu] 6526fc: test rules

2024-03-05 Thread Paolo Bonzini via Qemu-commits
  Branch: refs/heads/coverity
  Home:   https://github.com/qemu/qemu
  Commit: 6526fcb7f77adc52a249835e2b89fe7c8f2d3c6c
  
https://github.com/qemu/qemu/commit/6526fcb7f77adc52a249835e2b89fe7c8f2d3c6c
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M .gitlab-ci.d/buildtest.yml

  Log Message:
  ---
  test rules



To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



[Qemu-commits] [qemu/qemu] a81083: test rules

2024-03-05 Thread Paolo Bonzini via Qemu-commits
  Branch: refs/heads/coverity
  Home:   https://github.com/qemu/qemu
  Commit: a8108319bc21151b79eff5c79e1666d774efad16
  
https://github.com/qemu/qemu/commit/a8108319bc21151b79eff5c79e1666d774efad16
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M .gitlab-ci.d/buildtest.yml

  Log Message:
  ---
  test rules



To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



[Qemu-commits] [qemu/qemu] 0170f3: hw/intc/apic: fix memory leak

2024-03-05 Thread Paolo Bonzini via Qemu-commits
  Branch: refs/heads/coverity
  Home:   https://github.com/qemu/qemu
  Commit: 0170f3ea3daab19d8acdc824692ebc1b35b39f1b
  
https://github.com/qemu/qemu/commit/0170f3ea3daab19d8acdc824692ebc1b35b39f1b
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M hw/intc/apic.c

  Log Message:
  ---
  hw/intc/apic: fix memory leak

deliver_bitmask is allocated on the heap in apic_deliver(), but there
are many paths in the function that return before the corresponding
g_free() is reached.  Fix this by switching to g_autofree and, while at
it, also switch to g_new.  Do the same in apic_deliver_irq() as well
for consistency.

Fixes: b5ee0468e9d ("apic: add support for x2APIC mode", 2024-02-14)
Reviewed-by: Philippe Mathieu-Daudé 
Reviewed-by: Bui Quang Minh 
Signed-off-by: Paolo Bonzini 


  Commit: f0060d46918baf02dd679b53725426f7b15c50bf
  
https://github.com/qemu/qemu/commit/f0060d46918baf02dd679b53725426f7b15c50bf
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M util/oslib-posix.c

  Log Message:
  ---
  oslib-posix: fix memory leak in touch_all_pages

touch_all_pages() can return early, before creating threads.  In this case,
however, it leaks the MemsetContext that it has allocated at the
beginning of the function.

Reported by Coverity as CID 1534922.

Fixes: 04accf43df8 ("oslib-posix: initialize backend memory objects in 
parallel", 2024-02-06)
Reviewed-by: Mark Kanda 
Signed-off-by: Paolo Bonzini 


  Commit: ac056cbb54e7629792abc8067680d107beb65a8b
  
https://github.com/qemu/qemu/commit/ac056cbb54e7629792abc8067680d107beb65a8b
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M .gitlab-ci.d/buildtest.yml
M configs/devices/mips-softmmu/common.mak
M configs/devices/mips64el-softmmu/default.mak
M hw/display/Kconfig
M hw/mips/Kconfig

  Log Message:
  ---
  mips: do not list individual devices from configs/

Add new "select" and "imply" directives if needed.  The resulting
config-devices.mak files are the same as before.
Builds without default devices will become much smaller
than before, and qtests fail (as expected, though suboptimal)
for mips64-softmmu because most tests do not use -nodefaults,
so remove it from build-without-defaults

Signed-off-by: Paolo Bonzini 


  Commit: 395d5d09c7ac1b4a39c62eb0704ead120ea071ca
  
https://github.com/qemu/qemu/commit/395d5d09c7ac1b4a39c62eb0704ead120ea071ca
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M target/i386/tcg/emit.c.inc
M target/i386/tcg/translate.c

  Log Message:
  ---
  target/i386: use TSTEQ/TSTNE to test low bits

When testing the sign bit or equality to zero of a partial register, it
is useful to use a single TSTEQ or TSTNE operation.  It can also be used
to test the parity flag, using bit 0 of the population count.

Do not do this for target_ulong-sized values however; the optimizer would
produce a comparison against zero anyway, and it avoids shifts by 64
which are undefined behavior.

Reviewed-by: Richard Henderson 
Signed-off-by: Paolo Bonzini 


  Commit: af870441278a8a1e986001e29dfd314d4a0aa68c
  
https://github.com/qemu/qemu/commit/af870441278a8a1e986001e29dfd314d4a0aa68c
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M target/i386/tcg/translate.c

  Log Message:
  ---
  target/i386: use TSTEQ/TSTNE to check flags

The new conditions obviously come in handy when testing individual bits
of EFLAGS, and they make it possible to remove the .mask field of
CCPrepare.

Lowering to shift+and is done by the optimizer if necessary.

Reviewed-by: Richard Henderson 
Signed-off-by: Paolo Bonzini 


  Commit: c80a048f383cebdefbf6a7a325e5fc74b1900bca
  
https://github.com/qemu/qemu/commit/c80a048f383cebdefbf6a7a325e5fc74b1900bca
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M target/i386/tcg/translate.c

  Log Message:
  ---
  target/i386: remove mask from CCPrepare

With the introduction of TSTEQ and TSTNE the .mask field is always -1,
so remove all the now-unnecessary code.

Reviewed-by: Richard Henderson 
Signed-off-by: Paolo Bonzini 


  Commit: d8f4a7a80e76cc28ccf9d2912fbf0643ba232917
  
https://github.com/qemu/qemu/commit/d8f4a7a80e76cc28ccf9d2912fbf0643ba232917
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M scripts/coverity-scan/run-coverity-scan

  Log Message:
  ---
  run-coverity-scan: add --check-upload-only option

Add an option to check if upload is permitted without actually
attempting a build.  This can be useful to add a third outcome
beyond success and failure---namely, a CI job can self-cancel
if the uploading quota has been reached.

Signed-off-by: Paolo Bonzini 


  Commit: 8f2860a14fa16be2d39f118ab5bf86fbc8f97d64
  
https://github.com/qemu/qemu/commit/8f2860a14fa16b

[Qemu-commits] [qemu/qemu] 87a284: migration: massage cpr-reboot documentation

2024-03-05 Thread Peter Maydell via Qemu-commits
  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 87a2848715f5fc4fa114574dbbf7a5564cb4cdd7
  
https://github.com/qemu/qemu/commit/87a2848715f5fc4fa114574dbbf7a5564cb4cdd7
  Author: Steve Sistare 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M qapi/migration.json

  Log Message:
  ---
  migration: massage cpr-reboot documentation

Re-wrap the cpr-reboot documentation to 70 columns, use '@' for
cpr-reboot references, capitalize COLO and VFIO, and tweak the
wording.

Suggested-by: Markus Armbruster 
Signed-off-by: Steve Sistare 
Link: 
https://lore.kernel.org/r/1709218462-3640-1-git-send-email-steven.sist...@oracle.com
[peterx: s/qemu/QEMU per Markus's suggestion]
Reviewed-by: Markus Armbruster 
Signed-off-by: Peter Xu 


  Commit: b4014a2bf57ce08e2f6458cd82e9f968facf25c8
  
https://github.com/qemu/qemu/commit/b4014a2bf57ce08e2f6458cd82e9f968facf25c8
  Author: Bryan Zhang 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M migration/options.c

  Log Message:
  ---
  migration: Properly apply migration compression level parameters

Some glue code was missing, so that using `qmp_migrate_set_parameters`
to set `multifd-zstd-level` or `multifd-zlib-level` did not work. This
commit adds the glue code to fix that.

Signed-off-by: Bryan Zhang 
Link: 
https://lore.kernel.org/r/20240301035901.4006936-2-bryan.zh...@bytedance.com
Signed-off-by: Peter Xu 


  Commit: 2b571432314ab42da742fbb578f4174166ecd7f5
  
https://github.com/qemu/qemu/commit/2b571432314ab42da742fbb578f4174166ecd7f5
  Author: Bryan Zhang 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M tests/qtest/migration-test.c

  Log Message:
  ---
  tests/migration: Set compression level in migration tests

Adds calls to set compression level for `zstd` and `zlib` migration
tests, just to make sure that the calls work.

Signed-off-by: Bryan Zhang 
Link: 
https://lore.kernel.org/r/20240301035901.4006936-3-bryan.zh...@bytedance.com
Signed-off-by: Peter Xu 


  Commit: 4aac6b1e9bd48677c4f24518fe86ffd34c677d5a
  
https://github.com/qemu/qemu/commit/4aac6b1e9bd48677c4f24518fe86ffd34c677d5a
  Author: Fabiano Rosas 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M migration/multifd.c
M migration/trace-events

  Log Message:
  ---
  migration/multifd: Cleanup multifd_recv_sync_main

Some minor cleanups and documentation for multifd_recv_sync_main.

Use thread_count as done in other parts of the code. Remove p->id from
the multifd_recv_state sync, since that is global and not tied to a
channel. Add documentation for the sync steps.

Reviewed-by: Peter Xu 
Signed-off-by: Fabiano Rosas 
Link: https://lore.kernel.org/r/20240229153017.2221-2-faro...@suse.de
Signed-off-by: Peter Xu 


  Commit: 401e311ff72e0a62c834bfe466de68a82cfd90cb
  
https://github.com/qemu/qemu/commit/401e311ff72e0a62c834bfe466de68a82cfd90cb
  Author: Nikolay Borisov 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M include/io/channel.h
M io/channel-file.c

  Log Message:
  ---
  io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file

Add a generic QIOChannel feature SEEKABLE which would be used by the
qemu_file* apis. For the time being this will be only implemented for
file channels.

Signed-off-by: Nikolay Borisov 
Reviewed-by: "Daniel P. Berrangé" 
Reviewed-by: Peter Xu 
Signed-off-by: Fabiano Rosas 
Link: https://lore.kernel.org/r/20240229153017.2221-3-faro...@suse.de
Signed-off-by: Peter Xu 


  Commit: f1cfe39418a837e8dd52a7e75331f1606949deff
  
https://github.com/qemu/qemu/commit/f1cfe39418a837e8dd52a7e75331f1606949deff
  Author: Nikolay Borisov 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M include/io/channel.h
M io/channel.c

  Log Message:
  ---
  io: Add generic pwritev/preadv interface

Introduce basic pwritev/preadv support in the generic channel layer.
Specific implementation will follow for the file channel as this is
required in order to support migration streams with fixed location of
each ram page.

Signed-off-by: Nikolay Borisov 
Reviewed-by: "Daniel P. Berrangé" 
Reviewed-by: Peter Xu 
Signed-off-by: Fabiano Rosas 
Link: https://lore.kernel.org/r/20240229153017.2221-4-faro...@suse.de
Signed-off-by: Peter Xu 


  Commit: 0478b030fa2530cbbfc4d6432e8e39a16d06865b
  
https://github.com/qemu/qemu/commit/0478b030fa2530cbbfc4d6432e8e39a16d06865b
  Author: Nikolay Borisov 
  Date:   2024-03-01 (Fri, 01 Mar 2024)

  Changed paths:
M io/channel-file.c

  Log Message:
  ---
  io: implement io_pwritev/preadv for QIOChannelFile

The upcoming 'mapped-ram' feature will require qemu to write data to
(and restore from) specific offsets of the migration file.

Add a minimal implementation of pwritev/preadv and expose them via the
io_pwritev and io_preadv interfaces.

Signed-off-by: Nikolay Borisov 
Reviewed-by: "Daniel P. Berrangé" 
Reviewed-by: Peter Xu 
Signed-off-by: F

[Qemu-commits] [qemu/qemu] f93b99: linux-user/elfload: Disable core dump if getrlimit...

2024-03-05 Thread Peter Maydell via Qemu-commits
  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: f93b9953703be41408d5f0e09a871775d4be3c36
  
https://github.com/qemu/qemu/commit/f93b9953703be41408d5f0e09a871775d4be3c36
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Disable core dump if getrlimit fails

Do not dump core at all if getrlimit fails; this ensures
that dumpsize is valid throughout the function, not just
for the initial test vs rlim_cur.

Reviewed-by: Alex Bennée 
Signed-off-by: Richard Henderson 


  Commit: b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2
  
https://github.com/qemu/qemu/commit/b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Merge init_note_info and fill_note_info

Reviewed-by: Alex Bennée 
Signed-off-by: Richard Henderson 


  Commit: 6a202944354d077141bb97a21d35f8ab16b6a127
  
https://github.com/qemu/qemu/commit/6a202944354d077141bb97a21d35f8ab16b6a127
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Tidy fill_note_info and struct elf_note_info

In fill_note_info, there were unnecessary checks for
success of g_new/g_malloc.  But these structures do not
need to be dyamically allocated at all, and can in fact
be statically allocated within the parent structure.

This removes all error paths from fill_note_info, so
change the return type to void.

Change type of signr to match both caller (elf_core_dump)
and callee (fill_prstatus), which both use int for signr.

Signed-off-by: Richard Henderson 


  Commit: 0af22a6abf8397f966701f120eee8a5bdf22ab19
  
https://github.com/qemu/qemu/commit/0af22a6abf8397f966701f120eee8a5bdf22ab19
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Stack allocate struct mm_struct

Ignoring the fact that g_malloc cannot fail, the structure
is quite small and might as well be allocated locally.

Signed-off-by: Richard Henderson 


  Commit: ccb6f3eee0f746961f95e9956fa20decd1f46da3
  
https://github.com/qemu/qemu/commit/ccb6f3eee0f746961f95e9956fa20decd1f46da3
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Latch errno before cleanup in elf_core_dump

On the off-chance that one of the cleanup functions changes
errno, latch the errno that we want to return beforehand.

Flush errno to 0 upon success, rather than at the beginning.
No need to avoid negation of 0.

Signed-off-by: Richard Henderson 


  Commit: 106f8da6643634f141b39198576156a4c5bd6e60
  
https://github.com/qemu/qemu/commit/106f8da6643634f141b39198576156a4c5bd6e60
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Open core file after vma_init

Swap the ordering of vma_init and open.  This will be necessary
for further changes, and adjusts the error cleanup path.  Narrow
the scope of corefile, as the variable can be freed immediately
after use in open().

Signed-off-by: Richard Henderson 


  Commit: e0add9a835c6259df211eb4874d3d00d9d016796
  
https://github.com/qemu/qemu/commit/e0add9a835c6259df211eb4874d3d00d9d016796
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Truncate core file on open

While we usually create a new corefile, truncate otherwise.

Signed-off-by: Richard Henderson 


  Commit: b5262077655ab586d90f80a0f1b9a536bbc999ba
  
https://github.com/qemu/qemu/commit/b5262077655ab586d90f80a0f1b9a536bbc999ba
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Lock cpu list and mmap during elf_core_dump

Do not allow changes to the set of cpus and memory regions
while we are dumping core.

Reviewed-by: Alex Bennée 
Signed-off-by: Richard Henderson 


  Commit: 2410d28dc992082ec3348d6544ef30c1f950c8b9
  
https://github.com/qemu/qemu/commit/2410d28dc992082ec3348d6544ef30c1f950c8b9
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Size corefile before opening

Verify the size of the corefile vs the rlimit before
opening and creating the core file at all.

Signed-off-by: Richard Henderson 


  Commit: 243c47066253c4236b8792ee158f9971d1c27bf9
  
https://github.com/qemu/qemu/commit/243c47066253c4236b8792ee158f997

[Qemu-commits] [qemu/qemu] efb1c1: hw/scsi/lsi53c895a: add timer to scripts processing

2024-03-05 Thread Paolo Bonzini via Qemu-commits
  Branch: refs/heads/coverity
  Home:   https://github.com/qemu/qemu
  Commit: efb1c1d294a097507acdd9f1c725d140f347bf02
  
https://github.com/qemu/qemu/commit/efb1c1d294a097507acdd9f1c725d140f347bf02
  Author: Sven Schnelle 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M hw/scsi/lsi53c895a.c
M hw/scsi/trace-events

  Log Message:
  ---
  hw/scsi/lsi53c895a: add timer to scripts processing

HP-UX 10.20 seems to make the lsi53c895a spinning on a memory location
under certain circumstances. As the SCSI controller and CPU are not
running at the same time this loop will never finish. After some
time, the check loop interrupts with a unexpected device disconnect.
This works, but is slow because the kernel resets the scsi controller.
Instead of signaling UDC, start a timer and exit the loop. Until the
timer fires, the CPU can process instructions which might changes the
memory location.

The limit of instructions is also reduced because scripts running on
the SCSI processor are usually very short. This keeps the time until
the loop is exit short.

Suggested-by: Peter Maydell 
Signed-off-by: Sven Schnelle 
Message-ID: <20240229204407.1699260-1-sv...@stackframe.org>
Signed-off-by: Paolo Bonzini 


  Commit: 50a715c77c23d963bb5196caaedcf555833c1f24
  
https://github.com/qemu/qemu/commit/50a715c77c23d963bb5196caaedcf555833c1f24
  Author: Dmitrii Gavrilov 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M system/qdev-monitor.c

  Log Message:
  ---
  system/qdev-monitor: move drain_call_rcu call under if (!dev) in 
qmp_device_add()

Original goal of addition of drain_call_rcu to qmp_device_add was to cover
the failure case of qdev_device_add. It seems call of drain_call_rcu was
misplaced in 7bed89958bfbf40df what led to waiting for pending RCU callbacks
under happy path too. What led to overall performance degradation of
qmp_device_add.

In this patch call of drain_call_rcu moved under handling of failure of
qdev_device_add.

Signed-off-by: Dmitrii Gavrilov 
Message-ID: <20231103105602.90475-1-ds-g...@yandex-team.ru>
Fixes: 7bed89958bf ("device_core: use drain_call_rcu in in qmp_device_add", 
2020-10-12)
Cc: qemu-sta...@nongnu.org
Signed-off-by: Paolo Bonzini 


  Commit: 6ed0b8431ca71d14a1f73947b5303f96524ca339
  
https://github.com/qemu/qemu/commit/6ed0b8431ca71d14a1f73947b5303f96524ca339
  Author: Akihiko Odaki 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M meson.build

  Log Message:
  ---
  meson: Remove --warn-common ldflag

--warn-common ldflag causes warnings for multiple definitions of
___asan_globals_registered when enabling AddressSanitizer with clang.
The warning is somewhat obsolete so just remove it.

The common block is used to allow duplicate definitions of uninitialized
global variables. In the past, GCC and clang used to place such
variables in a common block by default, which prevented programmers for
noticing accidental duplicate definitions. Commit 49237acdb725 ("Enable
ld flag --warn-common") added --warn-common ldflag so that ld warns in
such a case.

Today, both of GCC and clang don't use common blocks by default[1][2] so
any remaining use of common blocks should be intentional. Remove
--warn-common ldflag to suppress warnings for intentional use of
common blocks.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678
[2]: https://reviews.llvm.org/D75056

Signed-off-by: Akihiko Odaki 
Message-ID: <20240304-common-v1-1-1a2005d1f...@daynix.com>
Signed-off-by: Paolo Bonzini 


  Commit: 9ae56d2e469629858b14a8976b2de77cf154d40f
  
https://github.com/qemu/qemu/commit/9ae56d2e469629858b14a8976b2de77cf154d40f
  Author: Sven Schnelle 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M hw/scsi/lsi53c895a.c

  Log Message:
  ---
  hw/scsi/lsi53c895a: stop script on phase mismatch

Netbsd isn't happy with qemu lsi53c895a emulation:

cd0(esiop0:0:2:0): command with tag id 0 reset
esiop0: autoconfiguration error: phase mismatch without command
esiop0: autoconfiguration error: unhandled scsi interrupt, sist=0x80 sstat1=0x0 
DSA=0x23a64b1 DSP=0x50

This is because lsi_bad_phase() triggers a phase mismatch, which
stops SCRIPT processing. However, after returning to
lsi_command_complete(), SCRIPT is restarted with lsi_resume_script().
Fix this by adding a return value to lsi_bad_phase(), and only resume
script processing when lsi_bad_phase() didn't trigger a host interrupt.

Signed-off-by: Sven Schnelle 
Tested-by: Helge Deller 
Message-ID: <20240302214453.2071388-1-sv...@stackframe.org>
Signed-off-by: Paolo Bonzini 


  Commit: ec2c2fce769234cc7298bc9a78b999fffa46d497
  
https://github.com/qemu/qemu/commit/ec2c2fce769234cc7298bc9a78b999fffa46d497
  Author: Paolo Bonzini 
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
M scripts/coverity-scan/run-coverity-scan

  Log Message:
  ---
  run-coverity-scan: add --check-upload-only option

Add an option to check if upload is pe

[Qemu-commits] [qemu/qemu] f93b99: linux-user/elfload: Disable core dump if getrlimit...

2024-03-05 Thread Peter Maydell via Qemu-commits
  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: f93b9953703be41408d5f0e09a871775d4be3c36
  
https://github.com/qemu/qemu/commit/f93b9953703be41408d5f0e09a871775d4be3c36
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Disable core dump if getrlimit fails

Do not dump core at all if getrlimit fails; this ensures
that dumpsize is valid throughout the function, not just
for the initial test vs rlim_cur.

Reviewed-by: Alex Bennée 
Signed-off-by: Richard Henderson 


  Commit: b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2
  
https://github.com/qemu/qemu/commit/b1beea6ba5c3eb9938897ae1c4042515c3e4b0c2
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Merge init_note_info and fill_note_info

Reviewed-by: Alex Bennée 
Signed-off-by: Richard Henderson 


  Commit: 6a202944354d077141bb97a21d35f8ab16b6a127
  
https://github.com/qemu/qemu/commit/6a202944354d077141bb97a21d35f8ab16b6a127
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Tidy fill_note_info and struct elf_note_info

In fill_note_info, there were unnecessary checks for
success of g_new/g_malloc.  But these structures do not
need to be dyamically allocated at all, and can in fact
be statically allocated within the parent structure.

This removes all error paths from fill_note_info, so
change the return type to void.

Change type of signr to match both caller (elf_core_dump)
and callee (fill_prstatus), which both use int for signr.

Signed-off-by: Richard Henderson 


  Commit: 0af22a6abf8397f966701f120eee8a5bdf22ab19
  
https://github.com/qemu/qemu/commit/0af22a6abf8397f966701f120eee8a5bdf22ab19
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Stack allocate struct mm_struct

Ignoring the fact that g_malloc cannot fail, the structure
is quite small and might as well be allocated locally.

Signed-off-by: Richard Henderson 


  Commit: ccb6f3eee0f746961f95e9956fa20decd1f46da3
  
https://github.com/qemu/qemu/commit/ccb6f3eee0f746961f95e9956fa20decd1f46da3
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Latch errno before cleanup in elf_core_dump

On the off-chance that one of the cleanup functions changes
errno, latch the errno that we want to return beforehand.

Flush errno to 0 upon success, rather than at the beginning.
No need to avoid negation of 0.

Signed-off-by: Richard Henderson 


  Commit: 106f8da6643634f141b39198576156a4c5bd6e60
  
https://github.com/qemu/qemu/commit/106f8da6643634f141b39198576156a4c5bd6e60
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Open core file after vma_init

Swap the ordering of vma_init and open.  This will be necessary
for further changes, and adjusts the error cleanup path.  Narrow
the scope of corefile, as the variable can be freed immediately
after use in open().

Signed-off-by: Richard Henderson 


  Commit: e0add9a835c6259df211eb4874d3d00d9d016796
  
https://github.com/qemu/qemu/commit/e0add9a835c6259df211eb4874d3d00d9d016796
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Truncate core file on open

While we usually create a new corefile, truncate otherwise.

Signed-off-by: Richard Henderson 


  Commit: b5262077655ab586d90f80a0f1b9a536bbc999ba
  
https://github.com/qemu/qemu/commit/b5262077655ab586d90f80a0f1b9a536bbc999ba
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Lock cpu list and mmap during elf_core_dump

Do not allow changes to the set of cpus and memory regions
while we are dumping core.

Reviewed-by: Alex Bennée 
Signed-off-by: Richard Henderson 


  Commit: 2410d28dc992082ec3348d6544ef30c1f950c8b9
  
https://github.com/qemu/qemu/commit/2410d28dc992082ec3348d6544ef30c1f950c8b9
  Author: Richard Henderson 
  Date:   2024-02-29 (Thu, 29 Feb 2024)

  Changed paths:
M linux-user/elfload.c

  Log Message:
  ---
  linux-user/elfload: Size corefile before opening

Verify the size of the corefile vs the rlimit before
opening and creating the core file at all.

Signed-off-by: Richard Henderson 


  Commit: 243c47066253c4236b8792ee158f9971d1c27bf9
  
https://github.com/qemu/qemu/commit/243c47066253c4236b8792ee158f99

[Qemu-commits] [qemu/qemu] a9bdc4: target: hppa: Fix unaligned double word accesses f...

2024-03-05 Thread Peter Maydell via Qemu-commits
  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: a9bdc4c95e402599e4184d4814800668479adb2b
  
https://github.com/qemu/qemu/commit/a9bdc4c95e402599e4184d4814800668479adb2b
  Author: Guenter Roeck 
  Date:   2024-03-03 (Sun, 03 Mar 2024)

  Changed paths:
M target/hppa/helper.c

  Log Message:
  ---
  target: hppa: Fix unaligned double word accesses for hppa64

Unaligned 64-bit accesses were found in Linux to clobber carry bits,
resulting in bad results if an arithmetic operation involving a
carry bit was executed after an unaligned 64-bit operation.

hppa 2.0 defines additional carry bits in PSW register bits 32..39.
When restoring PSW after executing an unaligned instruction trap, those
bits were not cleared and ended up to be active all the time. Since there
are no bits other than the upper carry bits needed in the upper 32 bit of
env->psw and since those are stored in env->psw_cb, just clear the entire
upper 32 bit when storing psw to solve the problem unconditionally.

Fixes: 931adff31478 ("target/hppa: Update cpu_hppa_get/put_psw for hppa64")
Cc: Richard Henderson 
Cc: Charlie Jenkins 
Cc: Helge Deller 
Reviewed-by: Richard Henderson 
Signed-off-by: Guenter Roeck 
Signed-off-by: Helge Deller 


  Commit: 5ccd50172a80ef9fe695714744b0747d7419b2c4
  
https://github.com/qemu/qemu/commit/5ccd50172a80ef9fe695714744b0747d7419b2c4
  Author: Helge Deller 
  Date:   2024-03-03 (Sun, 03 Mar 2024)

  Changed paths:
M target/hppa/cpu.c
M target/hppa/mem_helper.c
M target/hppa/op_helper.c

  Log Message:
  ---
  target/hppa: Restore unwind_breg before calculating ior

When calculating the IOR for the exception handlers, the current
unwind_breg value is needed on 64-bit hppa machines.
Restore that value by calling cpu_restore_state() earlier, which in turn
calls hppa_restore_state_to_opc() which restores the unwind_breg for the
current instruction.

Signed-off-by: Helge Deller 
Fixes: 3824e0d643f3 ("target/hppa: Export function hppa_set_ior_and_isr()")
Reviewed-by: Richard Henderson 


  Commit: 19f9c0442ebf28acf96d0e12ab500afbe53c8fa3
  
https://github.com/qemu/qemu/commit/19f9c0442ebf28acf96d0e12ab500afbe53c8fa3
  Author: Helge Deller 
  Date:   2024-03-03 (Sun, 03 Mar 2024)

  Changed paths:
M pc-bios/meson.build

  Log Message:
  ---
  pc-bios/meson: Add hppa-firmware64.img blob

Add the missing 64-bit hppa firmware blob so that it gets installed.

Signed-off-by: Helge Deller 
Fixes: 7c0dfcf9395e ("target/hppa: Update SeaBIOS-hppa to version 16")
Reviewed-by: Richard Henderson 


  Commit: 2536c15adcf6232e5f649405db76876620610652
  
https://github.com/qemu/qemu/commit/2536c15adcf6232e5f649405db76876620610652
  Author: Helge Deller 
  Date:   2024-03-03 (Sun, 03 Mar 2024)

  Changed paths:
M pc-bios/README

  Log Message:
  ---
  pc-bios/README: Add information about hppa-firmware

Signed-off-by: Helge Deller 
Reviewed-by: Richard Henderson 


  Commit: 839a88e8bd1a1efe05844c39a59985482894f4de
  
https://github.com/qemu/qemu/commit/839a88e8bd1a1efe05844c39a59985482894f4de
  Author: Helge Deller 
  Date:   2024-03-03 (Sun, 03 Mar 2024)

  Changed paths:
M roms/Makefile

  Log Message:
  ---
  roms/hppa: Add build rules for hppa-firmware

Signed-off-by: Helge Deller 
Suggested-by: Michael Tokarev 
Reviewed-by: Richard Henderson 


  Commit: eb844330bd36ebdd4959053da08069d1e5d49119
  
https://github.com/qemu/qemu/commit/eb844330bd36ebdd4959053da08069d1e5d49119
  Author: Thomas Huth 
  Date:   2024-03-04 (Mon, 04 Mar 2024)

  Changed paths:
M docs/conf.py

  Log Message:
  ---
  docs/conf.py: Remove usage of distutils

The macOS jobs in our CI recently started failing, complaining that
the distutils module is not available anymore. And indeed, according to
https://peps.python.org/pep-0632/ it's been deprecated since a while
and now likely got removed in recent Python versions.

Fortunately, we only use it for a version check via LooseVersion here
which we don't really need anymore - according to Repology.org, these
are the versions of sphinx-rtd-theme that are currently used by the
various distros:

 centos_stream_8: 0.3.1
 centos_stream_9: 0.5.1
 fedora_38: 1.1.1
 fedora_39: 1.2.2
 freebsd: 1.0.0
 haikuports_master: 1.2.1
 openbsd: 1.2.2
 opensuse_leap_15_5: 0.5.1
 pkgsrc_current: 2.0.0
 debian_11: 0.5.1
 debian_12: 1.2.0
 ubuntu_20_04: 0.4.3
 ubuntu_22_04: 1.0.0
 ubuntu_24_04: 2.0.0

So except for CentOS 8, all distros are using a newer version of
sphinx-rtd-theme, and for CentOS 8 we don't support compiling with
the Sphinx of the distro anymore anyway, since it's based on the
Python 3.6 interpreter there. For compiling on CentOS 8, you have
to use the alternative Python 3.8 interpreter which comes without
Sphinx, so that needs the Sphinx installed via pip in the venv
instead, and that is using a newer version, too, according to our
pythondeps.toml file.

Thus we can simply drop the vers