]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
3 weeks agotests/functional/arm: Split the ast2600 tests in two files
Cédric Le Goater [Tue, 7 Oct 2025 09:00:31 +0000 (11:00 +0200)] 
tests/functional/arm: Split the ast2600 tests in two files

The ast2600 test file currently includes tests for both the Buildroot
and SDK images. Since the SDK image tests can take long to run, split
them into a separate file to clearly distinguish the two sets of
tests, improve parallelism and allow for different CI timeouts.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Jamin Lin <jamin_lin@aspeedtech.com>
Link: https://lore.kernel.org/qemu-devel/20251007090031.679003-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
3 weeks agotests/functional/aarch64/test_aspeed_ast2700: Move eth2 IP check into common function
Jamin Lin [Fri, 3 Oct 2025 07:21:06 +0000 (15:21 +0800)] 
tests/functional/aarch64/test_aspeed_ast2700: Move eth2 IP check into common function

The eth2 IP address check was previously only performed in
test_aarch64_ast2700a1_evb_sdk_vbootrom_v09_08. This patch moves the
check into do_ast2700_pcie_test(), ensuring it is executed consistently
across all AST2700 PCIe test runs. This avoids code duplication.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251003072107.3530642-6-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
3 weeks agotests/functional/aarch64/test_aspeed_ast2700: Update test ASPEED SDK v09.08 for A1
Jamin Lin [Fri, 3 Oct 2025 07:21:05 +0000 (15:21 +0800)] 
tests/functional/aarch64/test_aspeed_ast2700: Update test ASPEED SDK v09.08 for A1

Support for AST2700 A0 was dropped starting from SDK v09.07.
The new SDK v09.08 only updates support for AST2700 A1.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251003072107.3530642-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
3 weeks agotests/functional/arm/test_aspeed_ast2600: Update test ASPEED SDK v09.08
Jamin Lin [Fri, 3 Oct 2025 07:21:04 +0000 (15:21 +0800)] 
tests/functional/arm/test_aspeed_ast2600: Update test ASPEED SDK v09.08

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251003072107.3530642-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
3 weeks agotests/functional/arm/test_aspeed_ast2500: Update test ASPEED SDK v09.08
Jamin Lin [Fri, 3 Oct 2025 07:21:03 +0000 (15:21 +0800)] 
tests/functional/arm/test_aspeed_ast2500: Update test ASPEED SDK v09.08

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251003072107.3530642-3-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
3 weeks agotests/functional/arm/test_aspeed_ast1030: Update test ASPEED SDK v03.03
Jamin Lin [Fri, 3 Oct 2025 07:21:02 +0000 (15:21 +0800)] 
tests/functional/arm/test_aspeed_ast1030: Update test ASPEED SDK v03.03

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251003072107.3530642-2-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
3 weeks agoaspeed: Don't set 'auto_create_sdcard'
Cédric Le Goater [Fri, 3 Oct 2025 10:30:24 +0000 (12:30 +0200)] 
aspeed: Don't set 'auto_create_sdcard'

The Aspeed machines inherited from a 'no_sdcard' attribute when first
introduced in QEMU. This attribute was later renamed to
'auto_create_sdcard' by commit cdc8d7cadaac ("hw/boards: Rename
no_sdcard -> auto_create_sdcard") and set to 'true'. This has the
indesirable efect to automatically create SD cards at init time.

Remove 'auto_create_sdcard' to avoid creating a SD card device.

Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251003103024.1863551-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
3 weeks agotests/functional/aarch64/aspeed_ast2700: Add PCIe and network tests
Jamin Lin [Fri, 19 Sep 2025 09:30:13 +0000 (17:30 +0800)] 
tests/functional/aarch64/aspeed_ast2700: Add PCIe and network tests

Extend the AST2700 and AST2700fc functional tests with PCIe and network
checks.

This patch introduces a helper "do_ast2700_pcie_test()" that runs "lspci"
on the emulated system and verifies the expected PCIe devices:

- 0002:00:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge
- 0002:01:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

Additional changes:
- Add `-device e1000e,netdev=net1,bus=pcie.2 -netdev user,id=net1` to the
  AST2700 and AST2700fc test machines.
- In the AST2700 vbootrom test, assign an IP address to the e1000e
  interface and verify it using `ip addr`.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250919093017.338309-15-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
3 weeks agoMerge tag 'pull-target-arm-20251010' of https://gitlab.com/pm215/qemu into staging
Richard Henderson [Fri, 10 Oct 2025 15:26:09 +0000 (08:26 -0700)] 
Merge tag 'pull-target-arm-20251010' of https://gitlab.com/pm215/qemu into staging

target-arm queue:
 * Implement FEAT_GCS
 * Implement FEAT_MEC

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmjpBGAZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3nyaEACV1f4oBSn/rzEgX0PYmYzj
# jW3tGbEk1i1QFApjkOSbjqNRBKEYLj1LsaeNOVqixRswATe1mMx9ZNWHqJnSd/tw
# 7XLr7dN+YsVvYViILL4VLrHipYcLrgyC1Vlg+UK5RsuVPV2O4PZw6T0LoV32CSF6
# r/LbEGKH4VKHOVMRIR7SJlajmkFbHQvTTj3jjXCgQCUQaKfMzkEGK/UGOt2D3H54
# oSrGLif9nRg0o6Ce9NzfC2xb4XSvdwyT3RE84vkuSSlRcmjt9zQEE+kds4yHhAAi
# D6w1m+Aq8zh4sKJbqVRp9M7ymb5465xv6p/4Av2r3Gxy3v4d0ADgQahel+AYh8Sp
# urzqZWAR66RLrWSEj51K5nbW8yUM6OYNC/VXrtcMBXgBRMeCYVLgZF3hCrqVyDtv
# fP61xJBHPd2+nlcJNFEE5yqazFkcpUsoE/gm2lDPPsdPF5DFKky4VkVqJIGreain
# 25zGj44q9vDY7slMJMW38rbB3f1pxbxlcljG93N8+2ZzPLKz+7ezvgXFpY2lij0r
# qNn7eFEG80roh+lykTe7BroQSQ+pIAxOXM/ouwr+59fsXtnCKrdFG+96WdS+yhsC
# 4ss24hvHUvVMGnEGiYbUL/tIwFJku1wBq+a745DiwJwqyVGbavOGApVbrv/9xuWN
# s2MWF0xy8CnhPBJwyK4iOg==
# =yKgg
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 10 Oct 2025 06:04:32 AM PDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [unknown]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [unknown]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [unknown]
# gpg:                 aka "Peter Maydell <peter@archaic.org.uk>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* tag 'pull-target-arm-20251010' of https://gitlab.com/pm215/qemu: (76 commits)
  target/arm: Enable FEAT_MEC in -cpu max
  target/arm: Implement FEAT_MEC registers
  target/arm: Add a cpreg flag to indicate no trap in NV
  tests/tcg/aarch64: Add gcsss
  tests/tcg/aarch64: Add gcspushm
  tests/tcg/aarch64: Add gcsstr
  linux-user/aarch64: Enable GCS in HWCAP
  linux-user/aarch64: Generate GCS signal records
  linux-user/aarch64: Inject SIGSEGV for GCS faults
  target/arm: Enable GCSPR_EL0 for read in user-mode
  linux-user/aarch64: Implement map_shadow_stack syscall
  linux-user/aarch64: Release gcs stack on thread exit
  linux-user/aarch64: Allocate new gcs stack on clone
  linux-user/aarch64: Implement prctls for GCS
  target/arm: Enable FEAT_GCS with -cpu max
  target/arm: Implement EXLOCK check during exception return
  target/arm: Copy EXLOCKEn to EXLOCK on exception to the same EL
  target/arm: Load gcs record for RET with PAuth
  target/arm: Load gcs record for RET
  target/arm: Add gcs record for BLR with PAuth
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 weeks agoMerge tag 'pull-request-2025-10-10' of https://gitlab.com/thuth/qemu into staging
Richard Henderson [Fri, 10 Oct 2025 15:25:09 +0000 (08:25 -0700)] 
Merge tag 'pull-request-2025-10-10' of https://gitlab.com/thuth/qemu into staging

* Improves s390x virtio-pci performance when using kvm
* Fix a problem with losing interrupts on s390x in certain cases
* Replace legacy cpu_physical_memory_[un]map() calls in s390x code

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCgAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmjowaoRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbWoIQ//ZgWUv/RXX4kX6WUM3DYkx702ytAo37EH
# f46NondN8nzhU3prhoAkSm9hKy+zDLJjMbWGXRioCuuVCbJily+C5pjqpg7a4VCr
# AEX2t/aU1fnxGtbgm3r4jQyKFm96Q0t7f/cue7ZLEJlgI5+PGeFcs11mlFn04Nr5
# 3V1aXWPCPKnH9tRoxl5YzWDyXI/jLWaOZIRBhWQ5LzQFUNnmYlBDQcgVwmoh8YzB
# 1Wn9ibJq2qDtu3W7t3YOZKk8D7+j0O26r2p6phvkk+mAIPeygrZNaVr4eG5prnzU
# OxcnpN3xkMFjHwIHf1UTz1bhpwhGLn+bdvBdodIM5T7AKI8+x/mcrIU4xBymllFI
# lCg7n+TSvyac1XNUxtmQCDEQ0shqSoMNjXSCQQSX54zdBn/swrhtw9ht6pRwrpsU
# da2uZf+x5IC+0P+uMXuXmNx++r25DqsD/EUmv+m5/eKNrPDaimj+gRlKDbi8iCpj
# lSrTmUMZ0BsVu7BOyNEsJh4n7KNZQW0E7SO5IE7xYcejHA3K9e3aWg5O8vP+IeHx
# NGut/Vr0SjzLhK6WQ5Z53GrY7Mx7BTC7eE8DYGLU9JKhZU/5t2mjnXXMDzEPzE8w
# KKVJbbIYy7SHcAMi1wgq/5Ap55wlTvAaB8kQZs/ePaBqcq0COkEqhQQC4jddtYwN
# lcfkr7iPzDs=
# =41ql
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 10 Oct 2025 01:19:54 AM PDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [unknown]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [unknown]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2025-10-10' of https://gitlab.com/thuth/qemu:
  s390x/pci: set kvm_msi_via_irqfd_allowed
  target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (3/3)
  target/s390x: Reduce s390_store_status() scope
  target/s390x: Reduce s390_store_adtl_status() scope
  target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3)
  target/s390x: Propagate CPUS390XState to cpu_unmap_lowcore()
  target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (1/3)
  s390x/pci: fix interrupt blocking by returning only the device's summary bit
  tests/functional: Drop the "Attempting to cache ..." log text

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 weeks agoblock/curl.c: Use explicit long constants in curl_easy_setopt calls
Richard W.M. Jones [Thu, 9 Oct 2025 14:08:31 +0000 (15:08 +0100)] 
block/curl.c: Use explicit long constants in curl_easy_setopt calls

curl_easy_setopt takes a variable argument that depends on what
CURLOPT you are setting.  Some require a long constant.  Passing a
plain int constant is potentially wrong on some platforms.

With warnings enabled, multiple warnings like this were printed:

../block/curl.c: In function ‘curl_init_state’:
../block/curl.c:474:13: warning: call to ‘_curl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
  474 |             curl_easy_setopt(state->curl, CURLOPT_AUTOREFERER, 1) ||
      |             ^

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Chenxi Mao <maochenxi@bosc.ac.cn>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20251009141026.4042021-2-rjones@redhat.com>

3 weeks agotarget/arm: Enable FEAT_MEC in -cpu max
Gustavo Romero [Mon, 6 Oct 2025 00:10:18 +0000 (00:10 +0000)] 
target/arm: Enable FEAT_MEC in -cpu max

Advertise FEAT_MEC in AA64MMFR3 ID register for the Arm64 cpu max as a
first step to fully support FEAT_MEC.

The FEAT_MEC is an extension to FEAT_RME that implements multiple
Memory Encryption Contexts (MEC) so the memory in a realm can be
encrypted and accessing it from the wrong encryption context is not
possible. An encryption context allow the selection of a memory
encryption engine.

At this point, no real memory encryption is supported, but software
stacks that rely on FEAT_MEC should work properly.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-id: 20251006001018.219756-4-gustavo.romero@linaro.org
Message-ID: <20250711140828.1714666-7-gustavo.romero@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement FEAT_MEC registers
Gustavo Romero [Mon, 6 Oct 2025 00:10:17 +0000 (00:10 +0000)] 
target/arm: Implement FEAT_MEC registers

Add all FEAT_MEC registers.  Enable access to the registers via the
SCTLR2 and TCR2 control bits.  Add the two new cache management
instructions, which are nops in QEMU because we do not model caches.

Message-ID: <20250711140828.1714666-3-gustavo.romero@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-id: 20251006001018.219756-3-gustavo.romero@linaro.org
[rth: Squash 3 patches to add all registers at once.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add a cpreg flag to indicate no trap in NV
Gustavo Romero [Mon, 6 Oct 2025 00:10:16 +0000 (00:10 +0000)] 
target/arm: Add a cpreg flag to indicate no trap in NV

Add a new flag, ARM_CP_NV_NO_TRAP, to indicate that a CP register, even
though it has opc1 == 4 or 5, does not trap when nested virtualization
is enabled (FEAT_NV/FEAT_NV2).

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-id: 20251006001018.219756-2-gustavo.romero@linaro.org
[PMM: tweaked comment text]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotests/tcg/aarch64: Add gcsss
Richard Henderson [Wed, 8 Oct 2025 21:56:13 +0000 (14:56 -0700)] 
tests/tcg/aarch64: Add gcsss

Validate stack switching and recursion depth.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-74-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotests/tcg/aarch64: Add gcspushm
Richard Henderson [Wed, 8 Oct 2025 21:56:12 +0000 (14:56 -0700)] 
tests/tcg/aarch64: Add gcspushm

Validate successful and trapped executions of GCSPUSHM, GCSPOPM.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-73-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotests/tcg/aarch64: Add gcsstr
Richard Henderson [Wed, 8 Oct 2025 21:56:11 +0000 (14:56 -0700)] 
tests/tcg/aarch64: Add gcsstr

Add some infrastructure for testing gcs in userspace.
Validate successful and trapped executions of GCSSTR.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-72-richard.henderson@linaro.org
[PMM: fixed hardcoded tabs]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agolinux-user/aarch64: Enable GCS in HWCAP
Richard Henderson [Wed, 8 Oct 2025 21:56:10 +0000 (14:56 -0700)] 
linux-user/aarch64: Enable GCS in HWCAP

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-71-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agolinux-user/aarch64: Generate GCS signal records
Richard Henderson [Wed, 8 Oct 2025 21:56:09 +0000 (14:56 -0700)] 
linux-user/aarch64: Generate GCS signal records

Here we must push and pop a cap on the GCS stack as
well as the gcs record on the normal stack.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-70-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agolinux-user/aarch64: Inject SIGSEGV for GCS faults
Richard Henderson [Wed, 8 Oct 2025 21:56:08 +0000 (14:56 -0700)] 
linux-user/aarch64: Inject SIGSEGV for GCS faults

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-69-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Enable GCSPR_EL0 for read in user-mode
Richard Henderson [Wed, 8 Oct 2025 21:56:07 +0000 (14:56 -0700)] 
target/arm: Enable GCSPR_EL0 for read in user-mode

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-68-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agolinux-user/aarch64: Implement map_shadow_stack syscall
Richard Henderson [Wed, 8 Oct 2025 21:56:06 +0000 (14:56 -0700)] 
linux-user/aarch64: Implement map_shadow_stack syscall

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-67-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agolinux-user/aarch64: Release gcs stack on thread exit
Richard Henderson [Wed, 8 Oct 2025 21:56:05 +0000 (14:56 -0700)] 
linux-user/aarch64: Release gcs stack on thread exit

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-66-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agolinux-user/aarch64: Allocate new gcs stack on clone
Richard Henderson [Wed, 8 Oct 2025 21:56:04 +0000 (14:56 -0700)] 
linux-user/aarch64: Allocate new gcs stack on clone

Allocate the new stack early, so that error reporting need
not clean up other objects.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-65-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agolinux-user/aarch64: Implement prctls for GCS
Richard Henderson [Wed, 8 Oct 2025 21:56:03 +0000 (14:56 -0700)] 
linux-user/aarch64: Implement prctls for GCS

This is PR_GET_SHADOW_STACK_STATUS, PR_SET_SHADOW_STACK_STATUS,
and PR_LOCK_SHADOW_STACK_STATUS.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-64-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Enable FEAT_GCS with -cpu max
Richard Henderson [Wed, 8 Oct 2025 21:56:02 +0000 (14:56 -0700)] 
target/arm: Enable FEAT_GCS with -cpu max

Tested-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20251008215613.300150-63-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement EXLOCK check during exception return
Richard Henderson [Wed, 8 Oct 2025 21:56:01 +0000 (14:56 -0700)] 
target/arm: Implement EXLOCK check during exception return

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-62-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Copy EXLOCKEn to EXLOCK on exception to the same EL
Richard Henderson [Wed, 8 Oct 2025 21:56:00 +0000 (14:56 -0700)] 
target/arm: Copy EXLOCKEn to EXLOCK on exception to the same EL

Per R_WTXBY, PSTATE.EXLOCK is 0 on an exception to a higher EL,
and copied from EXLOCKEn otherwise.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-61-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Load gcs record for RET with PAuth
Richard Henderson [Wed, 8 Oct 2025 21:55:59 +0000 (14:55 -0700)] 
target/arm: Load gcs record for RET with PAuth

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-60-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Load gcs record for RET
Richard Henderson [Wed, 8 Oct 2025 21:55:58 +0000 (14:55 -0700)] 
target/arm: Load gcs record for RET

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-59-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add gcs record for BLR with PAuth
Richard Henderson [Wed, 8 Oct 2025 21:55:57 +0000 (14:55 -0700)] 
target/arm: Add gcs record for BLR with PAuth

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-58-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add gcs record for BLR
Richard Henderson [Wed, 8 Oct 2025 21:55:56 +0000 (14:55 -0700)] 
target/arm: Add gcs record for BLR

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-57-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add gcs record for BL
Richard Henderson [Wed, 8 Oct 2025 21:55:55 +0000 (14:55 -0700)] 
target/arm: Add gcs record for BL

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-56-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSSS2
Richard Henderson [Wed, 8 Oct 2025 21:55:54 +0000 (14:55 -0700)] 
target/arm: Implement GCSSS2

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-55-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSSS1
Richard Henderson [Wed, 8 Oct 2025 21:55:53 +0000 (14:55 -0700)] 
target/arm: Implement GCSSS1

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-54-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSPOPCX
Richard Henderson [Wed, 8 Oct 2025 21:55:52 +0000 (14:55 -0700)] 
target/arm: Implement GCSPOPCX

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-53-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSPOPX
Richard Henderson [Wed, 8 Oct 2025 21:55:51 +0000 (14:55 -0700)] 
target/arm: Implement GCSPOPX

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-52-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSPUSHX
Richard Henderson [Wed, 8 Oct 2025 21:55:50 +0000 (14:55 -0700)] 
target/arm: Implement GCSPUSHX

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-51-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSPOPM
Richard Henderson [Wed, 8 Oct 2025 21:55:49 +0000 (14:55 -0700)] 
target/arm: Implement GCSPOPM

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-50-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSPUSHM
Richard Henderson [Wed, 8 Oct 2025 21:55:48 +0000 (14:55 -0700)] 
target/arm: Implement GCSPUSHM

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-49-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSB
Richard Henderson [Wed, 8 Oct 2025 21:55:47 +0000 (14:55 -0700)] 
target/arm: Implement GCSB

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-48-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement GCSSTR, GCSSTTR
Richard Henderson [Wed, 8 Oct 2025 21:55:46 +0000 (14:55 -0700)] 
target/arm: Implement GCSSTR, GCSSTTR

Note that CreateAccDescGCS() does not enable tagchecked,
and Data Aborts from GCS instructions do not set iss.isv.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-47-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Emit v7m LTPSIZE exception out of line
Richard Henderson [Wed, 8 Oct 2025 21:55:45 +0000 (14:55 -0700)] 
target/arm: Emit v7m LTPSIZE exception out of line

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-46-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Emit HSTR trap exception out of line
Richard Henderson [Wed, 8 Oct 2025 21:55:44 +0000 (14:55 -0700)] 
target/arm: Emit HSTR trap exception out of line

Use delay_exception_el to move the exception out of line.
Use TCG_COND_TSTNE instead of separate AND+NE.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-45-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Introduce delay_exception{_el}
Richard Henderson [Wed, 8 Oct 2025 21:55:43 +0000 (14:55 -0700)] 
target/arm: Introduce delay_exception{_el}

Add infrastructure to raise an exception out of line.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-44-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Split {full,core}_a64_user_mem_index
Richard Henderson [Wed, 8 Oct 2025 21:55:42 +0000 (14:55 -0700)] 
target/arm: Split {full,core}_a64_user_mem_index

Separate get_a64_user_mem_index into two separate functions, one which
returns the full ARMMMUIdx and one which returns the core mmu_idx.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20251008215613.300150-43-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement EXLOCKException for ELR_ELx and SPSR_ELx
Richard Henderson [Wed, 8 Oct 2025 21:55:41 +0000 (14:55 -0700)] 
target/arm: Implement EXLOCKException for ELR_ELx and SPSR_ELx

If PSTATE.EXLOCK is set, and the GCS EXLOCK enable bit is set,
and nested virt is in the appropriate state, then we need to
raise an EXLOCK exception.

Since PSTATE.EXLOCK cannot be set without GCS being present
and enabled, no explicit check for GCS is required.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-42-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Split out access_nv1_with_nvx
Richard Henderson [Wed, 8 Oct 2025 21:55:40 +0000 (14:55 -0700)] 
target/arm: Split out access_nv1_with_nvx

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20251008215613.300150-41-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Use arm_hcr_el2_nvx_eff in access_nv1
Richard Henderson [Wed, 8 Oct 2025 21:55:39 +0000 (14:55 -0700)] 
target/arm: Use arm_hcr_el2_nvx_eff in access_nv1

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20251008215613.300150-40-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add arm_hcr_el2_nvx_eff
Richard Henderson [Wed, 8 Oct 2025 21:55:38 +0000 (14:55 -0700)] 
target/arm: Add arm_hcr_el2_nvx_eff

Implement the pseudocode function EffectiveHCR_EL2_NVx.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20251008215613.300150-39-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add syndrome data for EC_GCS
Richard Henderson [Wed, 8 Oct 2025 21:55:37 +0000 (14:55 -0700)] 
target/arm: Add syndrome data for EC_GCS

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-38-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Expand pstate to 64 bits
Richard Henderson [Wed, 8 Oct 2025 21:55:36 +0000 (14:55 -0700)] 
target/arm: Expand pstate to 64 bits

The ARM now defines 36 bits in SPSR_ELx in aarch64 mode, so
it's time to bite the bullet and extend PSTATE to match.

Most changes are straightforward, adjusting printf formats,
changing local variable types.  More complex is migration,
where to maintain backward compatibility a new pstate64
record is introduced, and only when one of the extensions
that sets bits 32-35 are active.

The fate of gdbstub is left undecided for the moment.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-37-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Export cpsr_{read_for, write_from}_spsr_elx
Richard Henderson [Wed, 8 Oct 2025 21:55:35 +0000 (14:55 -0700)] 
target/arm: Export cpsr_{read_for, write_from}_spsr_elx

Move cpsr_write_from_spsr_elx from tcg/helper-a64.c to
helper.c, so that it's present with --disable-tcg.
Declare both in internals.h.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20251008215613.300150-36-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Make helper_exception_return system-only
Richard Henderson [Wed, 8 Oct 2025 21:55:34 +0000 (14:55 -0700)] 
target/arm: Make helper_exception_return system-only

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20251008215613.300150-35-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement FEAT_CHK
Richard Henderson [Wed, 8 Oct 2025 21:55:33 +0000 (14:55 -0700)] 
target/arm: Implement FEAT_CHK

This feature contains only the CHKFEAT instruction.  It has
no ID enable, being back-allocated into the hint nop space.

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-34-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add GCS enable and trap levels to DisasContext
Richard Henderson [Wed, 8 Oct 2025 21:55:32 +0000 (14:55 -0700)] 
target/arm: Add GCS enable and trap levels to DisasContext

Pipe GCSEnabled, GCSReturnValueCheckEnabled, and CheckGCSSTREnabled
through hflags to the translator.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-33-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add GCS cpregs
Richard Henderson [Wed, 8 Oct 2025 21:55:31 +0000 (14:55 -0700)] 
target/arm: Add GCS cpregs

Add isar_feature_aa64_gcs.
Enable SCR_GCSEN in scr_write.
Enable HCRX_GCSEN in hcrx_write.
Default HCRX_GCSEN on if EL2 disabled.
Add the GCSCR* and GCSPR* registers.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-32-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement gcs bit for data abort
Richard Henderson [Wed, 8 Oct 2025 21:55:30 +0000 (14:55 -0700)] 
target/arm: Implement gcs bit for data abort

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-31-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Support page protections for GCS mmu indexes
Richard Henderson [Wed, 8 Oct 2025 21:55:29 +0000 (14:55 -0700)] 
target/arm: Support page protections for GCS mmu indexes

Take read and write from the s1perms.gcs bit computed
by the Arm pseudocode.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-30-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Introduce regime_to_gcs
Richard Henderson [Wed, 8 Oct 2025 21:55:28 +0000 (14:55 -0700)] 
target/arm: Introduce regime_to_gcs

Add a lookup from any a64 mmu index to the gcs mmu index
within the same translation regime.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-29-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Introduce mmu indexes for GCS
Richard Henderson [Wed, 8 Oct 2025 21:55:27 +0000 (14:55 -0700)] 
target/arm: Introduce mmu indexes for GCS

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-28-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Convert regime_is_stage2 to table
Richard Henderson [Wed, 8 Oct 2025 21:55:26 +0000 (14:55 -0700)] 
target/arm: Convert regime_is_stage2 to table

This wasn't using a switch, but two comparisons.
Convert it to arm_mmuidx_table for consistency.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-27-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Convert arm_mmu_idx_is_stage1_of_2 from switch to table
Richard Henderson [Wed, 8 Oct 2025 21:55:25 +0000 (14:55 -0700)] 
target/arm: Convert arm_mmu_idx_is_stage1_of_2 from switch to table

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-26-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Convert regime_is_user from switch to table
Richard Henderson [Wed, 8 Oct 2025 21:55:24 +0000 (14:55 -0700)] 
target/arm: Convert regime_is_user from switch to table

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-25-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Remove unused env argument from regime_is_user
Richard Henderson [Wed, 8 Oct 2025 21:55:23 +0000 (14:55 -0700)] 
target/arm: Remove unused env argument from regime_is_user

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-24-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Convert regime_is_pan from switch to table
Richard Henderson [Wed, 8 Oct 2025 21:55:22 +0000 (14:55 -0700)] 
target/arm: Convert regime_is_pan from switch to table

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-23-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Remove unused env argument from regime_is_pan
Richard Henderson [Wed, 8 Oct 2025 21:55:21 +0000 (14:55 -0700)] 
target/arm: Remove unused env argument from regime_is_pan

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-22-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Convert regime_has_2_ranges from switch to table
Richard Henderson [Wed, 8 Oct 2025 21:55:20 +0000 (14:55 -0700)] 
target/arm: Convert regime_has_2_ranges from switch to table

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-21-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Convert regime_el from switch to table
Richard Henderson [Wed, 8 Oct 2025 21:55:19 +0000 (14:55 -0700)] 
target/arm: Convert regime_el from switch to table

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-20-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Remove unused env argument from regime_el
Richard Henderson [Wed, 8 Oct 2025 21:55:18 +0000 (14:55 -0700)] 
target/arm: Remove unused env argument from regime_el

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-19-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Convert arm_mmu_idx_to_el from switch to table
Richard Henderson [Wed, 8 Oct 2025 21:55:17 +0000 (14:55 -0700)] 
target/arm: Convert arm_mmu_idx_to_el from switch to table

In an effort to keep all ARMMMUIdx data in one place, begin construction
of an info table describing all of the properties of the mmu_idx.  Begin
with the access EL.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-18-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Split out mmuidx.h from cpu.h
Richard Henderson [Wed, 8 Oct 2025 21:55:16 +0000 (14:55 -0700)] 
target/arm: Split out mmuidx.h from cpu.h

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-17-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agoinclude/hw/core/cpu: Widen MMUIdxMap
Richard Henderson [Wed, 8 Oct 2025 21:55:15 +0000 (14:55 -0700)] 
include/hw/core/cpu: Widen MMUIdxMap

Widen MMUIdxMap to 32 bits.  Do not yet expand NB_MMU_MODES,
but widen the map type in preparation.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-16-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agoinclude/exec/memopidx: Adjust for 32 mmu indexes
Richard Henderson [Wed, 8 Oct 2025 21:55:14 +0000 (14:55 -0700)] 
include/exec/memopidx: Adjust for 32 mmu indexes

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20251008215613.300150-15-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Enable FEAT_S1PIE and FEAT_S2PIE on -cpu max
Richard Henderson [Wed, 8 Oct 2025 21:55:13 +0000 (14:55 -0700)] 
target/arm: Enable FEAT_S1PIE and FEAT_S2PIE on -cpu max

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-14-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement dirtybit check for PIE
Richard Henderson [Wed, 8 Oct 2025 21:55:12 +0000 (14:55 -0700)] 
target/arm: Implement dirtybit check for PIE

Both S1PIE and S2PIE have a bit to make software tracking
of dirty pages easier.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-13-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Expand syndrome parameter to raise_exception*
Richard Henderson [Wed, 8 Oct 2025 21:55:11 +0000 (14:55 -0700)] 
target/arm: Expand syndrome parameter to raise_exception*

Prepare for raising exceptions with 64-bit syndromes.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-12-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Expand CPUARMState.exception.syndrome to 64 bits
Richard Henderson [Wed, 8 Oct 2025 21:55:10 +0000 (14:55 -0700)] 
target/arm: Expand CPUARMState.exception.syndrome to 64 bits

This will be used for storing the ISS2 portion of the
ESR_ELx registers in aarch64 state.  Re-order the fsr
member to eliminate two structure holes.

Drop the comment about "if we implement EL2" since we
have already done so.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-11-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement get_S2prot_indirect
Richard Henderson [Wed, 8 Oct 2025 21:55:09 +0000 (14:55 -0700)] 
target/arm: Implement get_S2prot_indirect

Move the stage2 permissions for normal accesses to
GetPhysAddrResult.s2prot.  Put the stage2 permissions
for page table walking in CPUTLBEntryFull.prot.
This allows the permission checks in S1_ptw_translate
and arm_casq_ptw to see the right permission.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-10-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement get_S1prot_indirect
Richard Henderson [Wed, 8 Oct 2025 21:55:08 +0000 (14:55 -0700)] 
target/arm: Implement get_S1prot_indirect

This approximately corresponds to AArch64.S1IndirectBasePermissions
and the tail of AArch64.S1ComputePermissions which applies WXN.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-9-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Populate PIE in aa64_va_parameters
Richard Henderson [Wed, 8 Oct 2025 21:55:07 +0000 (14:55 -0700)] 
target/arm: Populate PIE in aa64_va_parameters

Select the PIE bit for the translation regime.
With PIE, the PTE layout changes, forcing HPD.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-8-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Cache NV1 early in get_phys_addr_lpae
Richard Henderson [Wed, 8 Oct 2025 21:55:06 +0000 (14:55 -0700)] 
target/arm: Cache NV1 early in get_phys_addr_lpae

We were not using the correct security space in the existing call
to nv_nv1_enabled, because it may have been modified for NSTable.

Cache it early, as we will shortly need it elsewhere as well.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-7-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Force HPD for stage2 translations
Richard Henderson [Wed, 8 Oct 2025 21:55:05 +0000 (14:55 -0700)] 
target/arm: Force HPD for stage2 translations

Stage2 translations do not have hierarchial permissions.
Setting HPD means we can eliminate an extra check against
regime_is_stage2.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-6-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Implement PIR_ELx, PIRE0_ELx, S2PIR_EL2 registers
Richard Henderson [Wed, 8 Oct 2025 21:55:04 +0000 (14:55 -0700)] 
target/arm: Implement PIR_ELx, PIRE0_ELx, S2PIR_EL2 registers

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-5-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Enable TCR2_ELx.PIE
Richard Henderson [Wed, 8 Oct 2025 21:55:03 +0000 (14:55 -0700)] 
target/arm: Enable TCR2_ELx.PIE

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-4-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: Add isar feature test for FEAT_S1PIE, FEAT_S2PIE
Richard Henderson [Wed, 8 Oct 2025 21:55:02 +0000 (14:55 -0700)] 
target/arm: Add isar feature test for FEAT_S1PIE, FEAT_S2PIE

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotests/functional: update tests using TF-A/TF-RMM to support FEAT_GCS
Pierrick Bouvier [Wed, 8 Oct 2025 21:55:01 +0000 (14:55 -0700)] 
tests/functional: update tests using TF-A/TF-RMM to support FEAT_GCS

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agos390x/pci: set kvm_msi_via_irqfd_allowed
Matthew Rosato [Wed, 8 Oct 2025 20:33:50 +0000 (16:33 -0400)] 
s390x/pci: set kvm_msi_via_irqfd_allowed

Allow irqfd to be used for virtio-pci on s390x if the kernel supports
it.  This improves s390x virtio-pci performance when using kvm
acceleration by allowing kvm to deliver interrupts instead of QEMU.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Message-ID: <20251008203350.354121-1-mjrosato@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 weeks agotarget/s390x: Replace legacy cpu_physical_memory_[un]map() calls (3/3)
Philippe Mathieu-Daudé [Thu, 2 Oct 2025 09:11:32 +0000 (11:11 +0200)] 
target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (3/3)

Commit b7ecba0f6f6 ("docs/devel/loads-stores.rst: Document our
various load and store APIs") mentioned cpu_physical_memory_*()
methods are legacy, the replacement being address_space_*().

Replace the *_map() / *_unmap() methods in s390_store_status()
and s390_store_adtl_status(). In s390_store_status(), replace
cpu_physical_memory_write() by address_space_stb(), restricting
@ar_id scope. No behavioral change expected.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251002091132.65703-10-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 weeks agotarget/s390x: Reduce s390_store_status() scope
Philippe Mathieu-Daudé [Thu, 2 Oct 2025 09:11:31 +0000 (11:11 +0200)] 
target/s390x: Reduce s390_store_status() scope

s390_store_status() is only called within sigp.c,
move it and the SigpSaveArea structure definition
there where it belongs, with other SIGP handling
code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251002091132.65703-9-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 weeks agotarget/s390x: Reduce s390_store_adtl_status() scope
Philippe Mathieu-Daudé [Thu, 2 Oct 2025 09:11:30 +0000 (11:11 +0200)] 
target/s390x: Reduce s390_store_adtl_status() scope

s390_store_adtl_status() is only called within sigp.c,
move it and the SigpAdtlSaveArea structure definition
there where it belongs, with other SIGP handling code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251002091132.65703-8-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 weeks agotarget/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3)
Philippe Mathieu-Daudé [Thu, 2 Oct 2025 09:11:29 +0000 (11:11 +0200)] 
target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3)

Commit b7ecba0f6f6 ("docs/devel/loads-stores.rst: Document our
various load and store APIs") mentioned cpu_physical_memory_*()
methods are legacy, the replacement being address_space_*().

Replace the *_map() / *_unmap() methods in cpu_[un]map_lowcore().
No behavioral change expected.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251002091132.65703-7-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 weeks agotarget/s390x: Propagate CPUS390XState to cpu_unmap_lowcore()
Philippe Mathieu-Daudé [Thu, 2 Oct 2025 09:11:28 +0000 (11:11 +0200)] 
target/s390x: Propagate CPUS390XState to cpu_unmap_lowcore()

To be able to access the CPU state in cpu_unmap_lowcore()
in the next commit, propagate it as argument.
cpu_map_lowcore() already takes it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251002091132.65703-6-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 weeks agotarget/s390x: Replace legacy cpu_physical_memory_[un]map() calls (1/3)
Philippe Mathieu-Daudé [Thu, 2 Oct 2025 09:11:27 +0000 (11:11 +0200)] 
target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (1/3)

Commit b7ecba0f6f6 ("docs/devel/loads-stores.rst: Document our
various load and store APIs") mentioned cpu_physical_memory_*()
methods are legacy, the replacement being address_space_*().

Replace the *_map() / *_unmap() methods in mchk_store_vregs().
No behavioral change expected.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251002091132.65703-5-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 weeks agos390x/pci: fix interrupt blocking by returning only the device's summary bit
Jaehoon Kim [Wed, 1 Oct 2025 15:39:38 +0000 (10:39 -0500)] 
s390x/pci: fix interrupt blocking by returning only the device's summary bit

Previously, set_ind_atomic() returned the entire byte containing
multiple summary bits. This meant that if any other summary bit in the
byte was set, interrupt injection could be incorrectly blocked, even
when the current device's summary bit was not set. As a result, the
guest could remain blocked after I/O completion during FIO tests.

This patch replaces set_ind_atomic() with set_ind_bit_atomic(), which
returns true if the bit was set by this function, and false if it was
already set or mapping failed. Interrupts are now blocked only when
the device's own summary bit was not previously set, avoiding
unintended blocking when multiple PCI summary bits exist within the
same byte.

Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20251001154004.71917-1-jhkim@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
3 weeks agotests/functional: Drop the "Attempting to cache ..." log text
Thomas Huth [Mon, 6 Oct 2025 17:03:04 +0000 (19:03 +0200)] 
tests/functional: Drop the "Attempting to cache ..." log text

The fetch() function already either prints "Using cached asset ..."
or "Downloading ... to ..." with the same file name to the log,
so the "Attempting to cache ..." message does not provide any
additional valuable information. Thus let's drop it to limit the
length of the logging output to a more reasonable size.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251006170304.197387-1-thuth@redhat.com>

3 weeks agoMerge tag 'pull-loongarch-20251009' of https://github.com/gaosong715/qemu into staging
Richard Henderson [Thu, 9 Oct 2025 14:59:29 +0000 (07:59 -0700)] 
Merge tag 'pull-loongarch-20251009' of https://github.com/gaosong715/qemu into staging

pull-loongarch-20251009

# -----BEGIN PGP SIGNATURE-----
#
# iLMEAAEIAB0WIQTKRzxE1qCcGJoZP81FK5aFKyaCFgUCaOeiawAKCRBFK5aFKyaC
# FlFZA/4uTme7RNIpDkcTW37ZieeRkFJXxO6EDvy/684EXUBMcJmhslXxb2vbtDUZ
# Mi2SCt4iB3oewYdDDe9glCGhRSNpARCMQp0rLivOBGWAguEld+M0sZ/Aqpk6Ovub
# zSHZKODKAADNt1lgzQ9iJx3uUBeUMdFKagIOrURPeCItLpoaKA==
# =OnvQ
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 09 Oct 2025 04:54:19 AM PDT
# gpg:                using RSA key CA473C44D6A09C189A193FCD452B96852B268216
# gpg: Good signature from "Song Gao <gaosong@loongson.cn>" [unknown]
# 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: CA47 3C44 D6A0 9C18 9A19  3FCD 452B 9685 2B26 8216

* tag 'pull-loongarch-20251009' of https://github.com/gaosong715/qemu:
  target/loongarch: Define loongarch_exception_name() as static
  target/loongarch: Move function do_raise_exception() to tcg_cpu.c
  target/loongarch: Move TCG specified functions to tcg_cpu.c
  tests/data/acpi/loongarch64: Update expected DSDT.*
  hw/loongarch/virt: Align VIRT_GED_CPUHP_ADDR to 4 bytes
  bios-tables-test-allowed-diff.h: Allow LoongArch DSDT.*

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 weeks agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Richard Henderson [Thu, 9 Oct 2025 14:59:00 +0000 (07:59 -0700)] 
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* i386: fix migration issues in 10.1
* target/i386/mshv: new accelerator
* rust: use glib-sys-rs
* rust: fixes for docker tests

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmjnaOwUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroNsFQf/WXKxZLLnItHwDz3UdwjzewPWpz5N
# fpS0E4C03J8pACDgyfl7PQl47P7NlJ08Ig2Lc5l3Z9KiAKgh0orR7Cqd0BY5f9lo
# uk4FgXfXpQyApywAlctadrTfcH8sRv2tMaP6EJ9coLtJtHW9RUGFPaZeMsqrjpAl
# TpwAXPYNDDvvy1ih1LPh5DzOPDXE4pin2tDa94gJei56gY95auK4zppoNYLdB3kR
# GOyR4QK43/yhuxPHOmQCZOE3HK2XrKgMZHWIjAovjZjZFiJs49FaHBOpRfFpsUlG
# PB3UbIMtu69VY20LqbbyInPnyATRQzqIGnDGTErP6lfCGTKTy2ulQYWvHA==
# =KM5O
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 09 Oct 2025 12:49:00 AM PDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [unknown]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [unknown]
# gpg: WARNING: The key's User ID 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: (35 commits)
  rust: fix path to rust_root_crate.sh
  tests/docker: make --enable-rust overridable with EXTRA_CONFIGURE_OPTS
  MAINTAINERS: Add maintainers for mshv accelerator
  docs: Add mshv to documentation
  target/i386/mshv: Use preallocated page for hvcall
  qapi/accel: Allow to query mshv capabilities
  accel/mshv: Handle overlapping mem mappings
  target/i386/mshv: Implement mshv_vcpu_run()
  target/i386/mshv: Write MSRs to the hypervisor
  target/i386/mshv: Integrate x86 instruction decoder/emulator
  target/i386/mshv: Register MSRs with MSHV
  target/i386/mshv: Register CPUID entries with MSHV
  target/i386/mshv: Set local interrupt controller state
  target/i386/mshv: Implement mshv_arch_put_registers()
  target/i386/mshv: Implement mshv_get_special_regs()
  target/i386/mshv: Implement mshv_get_standard_regs()
  target/i386/mshv: Implement mshv_store_regs()
  target/i386/mshv: Add CPU create and remove logic
  accel/mshv: Add vCPU signal handling
  accel/mshv: Add vCPU creation and execution loop
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 weeks agotarget/loongarch: Define loongarch_exception_name() as static
Bibo Mao [Mon, 29 Sep 2025 03:53:38 +0000 (11:53 +0800)] 
target/loongarch: Define loongarch_exception_name() as static

Function loongarch_exception_name() is only called in defined file
target/loongarch/tcg/tcg_cpu.c, set this function as static.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250929035338.2320419-4-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
3 weeks agotarget/loongarch: Move function do_raise_exception() to tcg_cpu.c
Bibo Mao [Mon, 29 Sep 2025 03:53:37 +0000 (11:53 +0800)] 
target/loongarch: Move function do_raise_exception() to tcg_cpu.c

Function do_raise_exception() is specified with TCG mode, so move
it to file target/loongarch/tcg/tcg_cpu.c

It is only code movement and there is no any function change.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250929035338.2320419-3-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>