Commit Graph
19660 Commits
Author SHA1 Message Date
Amit Machhiwal 2a15a5d2f2 linux-headers: Update to include KVM_CAP_PPC_COMPAT_CAPS
Sync linux headers from Linux kernel commit 1200d84f4c0a
("Merge tag 'powerpc-7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux").

This picks up the new KVM_CAP_PPC_COMPAT_CAPS capability for powerpc,
which introduces:
- struct kvm_ppc_compat_caps: reports processor compatibility modes
  supported by the host (POWER9, POWER10, POWER11)
- KVM_PPC_GET_COMPAT_CAPS ioctl (KVMIO 0xb8)
- KVM_CAP_PPC_COMPAT_CAPS (cap #250) in linux/kvm.h

The sync is needed to get the corresponding Qemu series[1] merged.

[1]: https://lore.kernel.org/all/20260812170854.58709-1-amachhiw@linux.ibm.com/

Signed-off-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260819045924.11732-1-amachhiw@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
2026-08-28 11:00:37 +05:30
Richard Henderson 7570234d11 Merge tag 'classprop-hw-acpi-upstream-20260827' of https://gitlab.com/mcayland-ntx/qemu into staging
classprop-hw-acpi-upstream queue

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQT1gm3ws3USUB3fevcsojbiRimx9AUCapBJCQAKCRAsojbiRimx
# 9CCxAQC0Xhdof9kWmmKmZPQSqdZvFIKHYN2CLkHVGPd7y/w83QEA6Jx0ogIGvXrt
# JeWrW5xCz3aYd5nSxjHRo6SFOkb52ws=
# =PLJk
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 27 Aug 2026 07:26:17 AM PDT
# gpg:                using EDDSA key F5826DF0B37512501DDF7AF72CA236E24629B1F4
# gpg: Good signature from "Mark Cave-Ayland (Nutanix) <mark.caveayland@nutanix.com>" [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: F582 6DF0 B375 1250 1DDF  7AF7 2CA2 36E2 4629 B1F4

* tag 'classprop-hw-acpi-upstream-20260827' of https://gitlab.com/mcayland-ntx/qemu:
  hw/acpi/piix4.c: convert ACPI_PM_PROP_PM_IO_BASE to a class prop
  hw/acpi/piix4.c: convert static variables to static class properties
  hw/acpi/pcihp.c: convert ACPI_PCIHP_PROP_BSEL from object prop to class prop
  hw/acpi/pcihp.c: convert ACPI_PCIHP_IO_BASE_PROP and ACPI_PCIHP_IO_BASE_PROP to class props
  qom/object.c: add object_class_property_add_uint16_ptr()
  hw/acpi/ich9.c: convert object props in ICH9_LPC_DEVICE to class props
  qom/object.c: add object_class_property_add_bool_ptr()
  hw/acpi/ich9.c: convert ACPI_PM_PROP_GPE0_BLK_LEN to a static class property
  qom/object.c: add object_class_property_add_uint32_ptr()
  hw/acpi/ich9.c: don't pass ICH9LPCPMRegs via opaque for ACPI_PM_PROP_GPE0_BLK prop
  hw/isa/lpc_ich9.c: convert ich9_lpc_initfn() object props to class props
  qom/object.c: add object_class_property_add_uint64_ptr()
  qom/object.c: add object_class_property_add_uint8_ptr()
  qom/object.c: introduce DEFINE_OBJECT_CLASS_PROPERTY_SCALAR_METHODS() macro
  qom/object.c: introduce OBJECT_CLASS_PROPERTY_SCALAR_SETTER(type) macro
  qom/object.c: introduce OBJECT_CLASS_PROPERTY_SCALAR_GETTER(type) macro

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-08-27 11:03:19 -07:00
Richard Henderson 415436d9d2 Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* rust: introduce script to update crates
* rust: update dependent crates
* target/i386: tcg: small cleanups
* target/i386: tcg: decoder cleanups around VEX prefix
* scsi-disk: disable MODE SELECT block size change by default
* scsi-disk: fix out-of-bounds read in WRITE SAME
* hw/i386: harden vapic against mapping the writable region over SMRAM

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmqQJ3UUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroMi4Qf/VAU1w0HCCABIuoiQ0soUO3vmvx71
# 9p16Ogdxbw/8UUq7gWAJ1i5CXBOPuIf9WnHjYjcmOR5Ktu6i7s6FN+OaUiJzLbZE
# GJvhq0JR0jDSUJ46bmEzBsXOjwOTQCxZe+5CKXtrIo5QW0XS2q63OOJPyp+ba7Gq
# Qea6LDncaUzIm/VgdbSiEJ33sti3uHWqWmDCLVldz2pVbvYjm1PmYdZUoHIGJwqC
# UPFohdtZaJomFfQBlPaifPjnYdzfwRAEJKfgfzDp7Xm1vD3+3WTDW/oV1eyGSwJA
# Nz7/FB5Oakk2DBllpVWuTUIEBm3gFfgt2oyuuQaE7wJASrtpmMusM+psfQ==
# =sET5
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 27 Aug 2026 05:03:01 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: (23 commits)
  i386/vapic: unref MemoryRegion if vapic_map_rom_writable fails
  vapic: confine the VAPIC region to 0xc0000..0xe0000
  scsi: hide MODE SELECT block size change behind a quirk
  scsi-disk: fix out-of-bound read in WRITE SAME
  target/i386/tcg: move VEX validation early
  target/i386/tcg: fetch modrm early
  target/i386/tcg: treat VEX as disabling high-byte registers
  target/i386/tcg: move check bits out of validate_vex
  target/i386/tcg: simplify return value of gen_prepare_cc
  target/i386/tcg: inline gen_ext_tl
  target/i386/tcg: do not reuse cc_srcT
  scripts/feature_to_c: avoid SyntaxWarning
  rust: hpet: fix clippy needless_range_loop
  rust: update crates
  scripts: rename get-wraps-from-cargo-registry.py
  scripts: add the possibility of a quick update of the pacakge
  scripts: add functionality to update wrap files from Cargo.lock
  scripts: introduce CrateSource abstract class
  scripts: prepare for introduction of CrateSource class
  scripts: do not assume the new version of the crate is present
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-08-27 11:02:46 -07:00
Mark Cave-Ayland 9ef643bbc8 hw/acpi/pcihp.c: convert ACPI_PCIHP_PROP_BSEL from object prop to class prop
Move the ACPI_PCIHP_PROP_BSEL property to the PCIBus object and update all
callers accordingly.

Since the existing logic checks for the existence of the ACPI_PCIHP_PROP_BSEL
property to enable the relevant ACPI changes, set the type of the underlying
variable to uint32_t with a default value of UINT32_MAX indicating that the
property has not been set.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260825134320.1039012-15-mark.caveayland@nutanix.com>
2026-08-27 15:22:11 +01:00
Mark Cave-Ayland 5182d78050 qom/object.c: add object_class_property_add_uint16_ptr()
This adds a class property that references a uint16_t within the object instance
and is intended to be a replacement for object_property_add_uint16_ptr().

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20260825134320.1039012-13-mark.caveayland@nutanix.com>
2026-08-27 15:22:11 +01:00
Mark Cave-Ayland 4b998857a9 hw/acpi/ich9.c: convert object props in ICH9_LPC_DEVICE to class props
ACPI_PM_PROP_TCO_ENABLED, ACPI_PM_PROP_ACPI_PCIHP_BRIDGE and x-keep-pci-slot-hpc
properties can be converted to use object_class_property_add_bool_ptr(). Remove
the now unused ich9_pm_add_properties() function.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260825134320.1039012-12-mark.caveayland@nutanix.com>
2026-08-27 15:22:11 +01:00
Mark Cave-Ayland 57df0759c8 qom/object.c: add object_class_property_add_bool_ptr()
This adds a class property that references a bool within the object instance
and is intended to be used as a replacement for object_class_property_add_bool()
where possible. Since bool is a macro then it is necessary to implement
property_class_get_bool_ptr() and property_class_set_bool_ptr() manually instead
of using the existing OBJECT_CLASS_PROPERTY_SCALAR_GETTER() and
OBJECT_CLASS_PROPERTY_SCALAR_SETTER() macros.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260825134320.1039012-11-mark.caveayland@nutanix.com>
2026-08-27 15:22:11 +01:00
Mark Cave-Ayland 39c77172cf hw/acpi/ich9.c: convert ACPI_PM_PROP_GPE0_BLK_LEN to a static class property
The ACPI_PM_PROP_GPE0_BLK_LEN property is assigned to a static variable and so
can be converted to a static class property. Introduce
ich9_pm_add_class_properties() to hold the ACPI_PM_PROP_GPE0_BLK_LEN property
and soon all other class props after they have been converted from object props.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20260825134320.1039012-10-mark.caveayland@nutanix.com>
2026-08-27 15:22:11 +01:00
Mark Cave-Ayland 99da68c06f qom/object.c: add object_class_property_add_uint32_ptr()
This adds a class property that references a uint32_t within the object instance
and is intended to be a replacement for object_property_add_uint32_ptr().

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20260825134320.1039012-9-mark.caveayland@nutanix.com>
2026-08-27 15:22:10 +01:00
Mark Cave-Ayland 6c4f6b5934 qom/object.c: add object_class_property_add_uint64_ptr()
This adds a class property that references a uint8_t within the object instance
and is intended to be a replacement for object_property_add_uint64_ptr().

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20260825134320.1039012-6-mark.caveayland@nutanix.com>
2026-08-27 15:20:10 +01:00
Mark Cave-Ayland d817fa0c2e qom/object.c: add object_class_property_add_uint8_ptr()
This adds a class property that references a uint8_t within the object instance
and is intended to be a replacement for object_property_add_uint8_ptr().

This commit also removes the __attribute__((unused)) annotation from
object_class_prop_ptr() which is no longer required now that the previous defined
DEFINE_OBJECT_CLASS_PROPERTY_SCALAR_METHODS() is now being used.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20260825134320.1039012-5-mark.caveayland@nutanix.com>
2026-08-27 15:20:10 +01:00
Paolo Bonzini 0f410adf6b scsi: hide MODE SELECT block size change behind a quirk
This is a dangerous operation in that the block size is not
protected by a lock, but it can be written concurrently if
you have a multi-queue virtio-scsi HBA.  Put it behind a quirk
that is only enabled by the Q800 machine, since the MODE
SELECT feature was added for A/UX.

Cc: qemu-stable@nongnu.org
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-08-27 14:01:16 +02:00
Richard Henderson 562bae590f Merge tag 's390x-20260826' of https://gitlab.com/efarman/qemu into staging
New s390x features for 11.2
 - hardening fixes in css/sclp code
 - enable secure IPL
 - regenerate s390-ccw.img

# -----BEGIN PGP SIGNATURE-----
#
# iIsEABYKADMWIQQB3Dhbwk4ZE3uUN6KmTx4R4Fx3tAUCao7epBUcZmFybWFuQGxp
# bnV4LmlibS5jb20ACgkQpk8eEeBcd7RWCgEA4IEg3vbJTOPAxRzi/nEZKh83ZSkJ
# tO+OuqkaJ1cbYfsA/289NUJHlvdV31ZXxbt4hnD2O/67Oo+B01FRtgvRwjQN
# =mB3y
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 26 Aug 2026 05:40:04 AM PDT
# gpg:                using EDDSA key 01DC385BC24E19137B9437A2A64F1E11E05C77B4
# gpg:                issuer "farman@linux.ibm.com"
# gpg: Good signature from "Eric Farman <farman@linux.ibm.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: D2C6 0504 C9E8 F568 CFE5  87B5 3827 B212 71BF 9562
#      Subkey fingerprint: 01DC 385B C24E 1913 7B94  37A2 A64F 1E11 E05C 77B4

* tag 's390x-20260826' of https://gitlab.com/efarman/qemu: (37 commits)
  pc-bios/s390-ccw.img: update s390x bios
  MAINTAINERS: Add secure IPL files to S390-ccw boot group
  docs/system/s390x: Add secure IPL documentation
  docs/specs: Add secure IPL documentation
  tests/functional/s390x: Add secure IPL functional test
  hw/s390x/ipl: Handle secure boot with multiple boot devices
  pc-bios/s390-ccw: Handle true secure IPL mode
  hw/s390x/ipl: Set IPIB flags for secure IPL
  Add secure-boot to s390-ccw-virtio machine type option
  pc-bios/s390-ccw: Add additional security checks for secure boot
  s390x: Guest support for Secure-IPL Code Loading Attributes Facility (SCLAF)
  pc-bios/s390-ccw: Add signed component address overlap checks
  pc-bios/s390-ccw: Add signature verification for secure IPL in audit mode
  pc-bios/s390-ccw: Introduce ZiplBootMode enum for IPL mode selection
  pc-bios/s390-ccw: Rework zipl_load_segment function
  pc-bios/s390-ccw: Refactor zipl_run()
  s390x: Guest support for Secure-IPL Facility
  hw/s390x/ipl: Rework s390_ipl_map_iplb_chain for certificate storage
  hw/s390x/ipl: Add IPIB flags to IPL Parameter Block
  pc-bios/s390-ccw: Define memory for IPLB and convert IPLB to pointers
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-08-26 13:40:41 -07:00
Denis V. Lunev d7f16bad8f hw/ide/ahci: refuse a PIO transfer with no command header
ahci_map_clb_address() already clears cur_cmd, so every consumer of it
has to cope with there being no current command. ahci_pio_transfer(),
ahci_commit_buf() and ahci_populate_sglist() all dereference it
unconditionally instead.

Give the three of them a NULL check. Declaring the data transferred
anyway is not enough: ide_transfer_start() goes on to call the end
transfer function, and for a multi-sector write that is
ide_sector_write(), which commits an io_buffer the guest never
refilled. Clearing PxCMD.ST during a WRITE SECTOR(S) of two sectors
therefore writes the first sector's contents over the second, at a
sector the guest chose.

Let pio_transfer report that nothing was transferred and halt there, so
no callback acts on a buffer that was never filled. Only the AHCI HBA
implements the callback, so the signature change is local to it.

Cc: John Snow <jsnow@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
2026-08-26 12:59:19 +02:00
Zhuoying Cai d3f59e1f8f Add secure-boot to s390-ccw-virtio machine type option
Add secure-boot as a parameter of s390-ccw-virtio machine type option.

The `secure-boot=on|off` parameter is implemented to enable secure IPL.

By default, secure-boot is set to false if not specified in
the command line.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-28-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai a8e4f5cb61 pc-bios/s390-ccw: Add additional security checks for secure boot
Add additional checks to ensure that components do not overlap with
signed components when loaded into memory.

Add additional checks to ensure the load addresses of unsigned components
are greater than or equal to 0x2000.

When the secure IPL code loading attributes facility (SCLAF) is installed,
all signed components must contain a secure code loading attributes block
(SCLAB).

The SCLAB provides further validation of information on where to load the
signed binary code from the load device, and where to start the execution
of the loaded OS code.

When SCLAF is installed, its content must be evaluated during secure IPL.

Add IPL Information Error Indicators (IIEI) and Component Error
Indicators (CEI) for IPL Information Report Block (IIRB).

When SCLAF is installed, additional secure boot checks are performed
during zipl and store results of verification into IIRB.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-27-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai d6de77dab6 s390x: Guest support for Secure-IPL Facility
Introduce Secure-IPL (SIPL) facility.

Use fac_ipl to represent bytes 136 and 137 for IPL device facilities
of the SCLP Read SCP Info.

Availability of SIPL facility is determined by byte 136 bit 1 of the
SCLP Read SCP Info. Byte 136's facilities cannot be represented
without the availability of the extended-length-SCCB, so add it as a
check for consistency.

Secure IPL is not available for guests under protected virtualization.

This feature is available starting with the gen16 CPU model.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-20-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 3289d6db95 hw/s390x/ipl: Rework s390_ipl_map_iplb_chain for certificate storage
Rework s390_ipl_map_iplb_chain to always allocate maximum memory for
the IPLB chain, regardless of the number of boot devices. This space
is also used to store certificates during secure boot, providing a
safe location for certificates until the kernel reads them during boot.

Rename next_iplb to ipl_data to better reflect its multiple purposes:
storing both IPLB chains and certificate data.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-19-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 854de451f2 hw/s390x/ipl: Add IPIB flags to IPL Parameter Block
Add IPIB flags to IPL Parameter Block to determine if IPL needs to
perform securely and if IPL Information Report Block (IIRB) exists.

Move DIAG308 flags to a separated header file and add flags for secure IPL.
Move IPLB length related definitions to include/hw/s390x/ipl/qipl.h and
add a maximum length constant to support secure IPL.

Secure boot in audit mode will perform if certificate(s) exist in the
key store. IIRB will exist and results of verification will be stored in
IIRB.

To ensure proper alignment of the IIRB and prevent overlap, set
iplb->len to the maximum length of the IPLB, allowing alignment
constraints to be determined based on its size.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jared Rossi <jrossi@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-18-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 3c057b9386 pc-bios/s390-ccw: Define memory for IPLB and convert IPLB to pointers
Define a memory space for both IPL Parameter Block (IPLB) and
IPL Information Report Block (IIRB) since IIRB is stored immediately
following IPLB.

Convert IPLB to pointer and it points to the start of the defined memory space.
IIRB points to the end of IPLB.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Jared Rossi <jrossi@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-17-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai e4a2805118 s390x/ipl: Introduce IPL Information Report Block (IIRB)
The IPL information report block (IIRB) contains information used
to locate IPL records and to report the results of signature verification
of one or more secure components of the load device.

IIRB is stored immediately following the IPL Parameter Block. Results on
component verification in any case (failure or success) are stored.

The IIRB data is reserved and protected by the guest kernel during early
boot to prevent it from being overwritten before the certificate data is
permanently saved.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-16-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Collin Walling f5faede1ea s390x/diag: Implement DIAG 508 subcode 1 for signature verification
DIAG 508 subcode 1 performs signature-verification on signed components.
A signed component may be a Linux kernel image, or any other signed
binary. **Verification of initrd is not supported.**

The instruction call expects two item-pairs: an address of a device
component, an address of the analogous signature file (in PKCS#7 DER format),
and their respective lengths. All of this data should be encapsulated
within a Diag508SigVerifBlock.

The DIAG handler will read from the provided addresses
to retrieve the necessary data, parse the signature file, then
perform the signature-verification. Because there is no way to
correlate a specific certificate to a component, each certificate
in the store is tried until either verification succeeds, or all
certs have been exhausted.

A return code of 1 indicates success, and the index and length of the
corresponding certificate will be set in the Diag508SigVerifBlock.
The following values indicate failure:

	0x0102: no certificates are available in the store
	0x0202: component data is invalid
	0x0302: PKCS#7 format signature is invalid
	0x0402: signature-verification failed
	0x0502: length of Diag508SigVerifBlock is invalid

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-15-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai ea691e20cc crypto/x509-utils: Add helper functions for DIAG 508 subcode 1
Introduce helper functions to support signature verification required by
DIAG 508 subcode 1:

qcrypto_pkcs7_convert_sig_pem() – converts a signature from DER to PEM format
qcrypto_x509_verify_sig() – verifies the provided data against the given signature

These functions enable basic signature verification support.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-13-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Collin Walling 06b8b50b05 s390x/diag: Introduce DIAG 508 for secure IPL operations
In order to support secure IPL (aka secure boot) for the s390-ccw BIOS,
a new s390 DIAGNOSE instruction is introduced to leverage QEMU for
handling operations such as signature verification and certificate
retrieval.

Currently, only subcode 0 is supported with this patch, which is used to
query a bitmap of which subcodes are supported.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-12-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 327a56d0dc hw/s390x: Define finite size for single entry VCEntry
Define MAX_VCENTRY_SIZE(8KB) and CERT_BUF_MAX_LEN to establish a finite
size for a single entry VCEntry. Add validation in update_cert_store()
to ensure certificate data does not exceed this limit.

This finite size definition is needed for proper memory allocation and
will be used in a later commit to handle VCEntry structures with known
size constraints.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-11-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 70f062675a s390x/diag: Implement DIAG 320 subcode 2
DIAG 320 subcode 2 provides verification-certificates (VCs) that are in the
certificate store. Only X509 certificates in DER format and SHA-256 hash
type are recognized.

The subcode value is denoted by setting the second-left-most bit
of an 8-byte field.

The Verification Certificate Block (VCB) contains the output data
when the operation completes successfully. It includes a common
header followed by zero or more Verification Certificate Entries (VCEs),
depending on the VCB input length and the VC range (from the first VC
index to the last VC index) in the certificate store.

Each VCE contains information about a certificate retrieved from
the S390IPLCertificateStore, such as the certificate name, key type,
key ID length, hash length, and the raw certificate data.
The key ID and hash are extracted from the raw certificate by the crypto API.

Note: SHA2-256 VC hash type is required for retrieving the hash
(fingerprint) of the certificate.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Jared Rossi <jrossi@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-10-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai e8317c4c9f crypto/x509-utils: Add helper functions for DIAG 320 subcode 2
Introduce new helper functions to extract certificate metadata:

qcrypto_x509_check_cert_times() - validates the certificate's validity period against the current time
qcrypto_x509_get_cert_key_id() - extracts the key ID from the certificate
qcrypto_x509_check_ecc_curve_p521() - determines the ECC public key algorithm uses P-521 curve

These functions provide support for metadata extraction and validity checking
for X.509 certificates.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-9-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 65b61969a7 s390x/diag: Implement DIAG 320 subcode 1
DIAG 320 subcode 1 provides information needed to determine
the amount of storage to store one or more certificates from the
certificate store.

Upon successful completion, this subcode returns information of the current
cert store, such as the number of certificates stored and allowed in the cert
store, amount of space may need to be allocate to store a certificate,
etc for verification-certificate blocks (VCBs).

The subcode value is denoted by setting the left-most bit
of an 8-byte field.

The verification-certificate-storage-size block (VCSSB) contains
the output data when the operation completes successfully. A VCSSB
length of 4 indicates that no certificate are available in the cert
store.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-8-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 66deb27152 s390x/diag: Introduce DIAG 320 for Certificate Store Facility
DIAGNOSE 320 is introduced to support Certificate Store (CS)
Facility, which includes operations such as query certificate
storage information and provide certificates in the certificate
store.

Currently, only subcode 0 is supported with this patch, which is
used to query the Installed Subcodes Mask (ISM).

This subcode is only supported when the CS facility is enabled.

Availability of CS facility is determined by byte 134 bit 5 of the
SCLP Read Info block. Byte 134's facilities cannot be represented
without the availability of the extended-length-SCCB, so add it as
a check for consistency.

Note: secure IPL is not available for Secure Execution (SE) guests,
as their images are already integrity protected, and an additional
protection of the kernel by secure IPL is not necessary.

This feature is available starting with the gen16 CPU model.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-6-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 9520eba83d hw/s390x/ipl: Create certificate store
Create a certificate store for boot certificates used for secure IPL.

Load certificates from the `boot-certs` parameter of s390-ccw-virtio
machine type option into the cert store.

Currently, only X.509 certificates in PEM format are supported, as the
QEMU command line accepts certificates in PEM format only.

The raw Base64 data is stored, as well as the certificate's size.  The
binary (DER) size is stored as well, which may later be utilized for
secure boot (signature verification).

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-5-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 0246d8fd2b crypto/x509-utils: Add helper functions for certificate store
Introduce new helper functions for x509 certificate, which will be used
by the certificate store:

qcrypto_x509_convert_cert_der() - converts a certificate from PEM to DER format

These functions provide support for certificate format conversion.

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-4-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Zhuoying Cai 21efab616e Add boot-certs to s390-ccw-virtio machine type option
Introduce a new `boot-certs` machine type option for the s390-ccw-virtio
machine. This allows users to specify one or more certificate file paths
or directories to be used during secure boot.

Each entry is specified using the syntax:
	boot-certs.<index>.path=/path/to/cert.pem

Multiple paths can be specify using array properties:
	boot-certs.0.path=/path/to/cert.pem,
	boot-certs.1.path=/path/to/cert-dir,
	boot-certs.2.path=/path/to/another-dir...

Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-2-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
2026-08-26 06:52:20 -04:00
Akihiko Odaki cd71534b22 hw/display/virtio-gpu: Propagate udmabuf errors
Propagate udmabuf errors so that the requested operation will be
canceled instead of producing an incomplete result and the user can
notice the failure.

Fixes: e0933d91b1 ("virtio-gpu: Add virtio_gpu_resource_create_blob")
Fixes: f66767f75c ("virtio-gpu: add virtio-gpu/blob vmstate subsection")
Fixes: 4ae1c5c7d6 ("hw/display/virtio-gpu: Initialize blob mapping for ATTACH_BACKING")
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260825-dmabuf-v2-3-b3d64d3b9a0e@rsg.ci.i.u-tokyo.ac.jp>
2026-08-25 15:20:43 +04:00
Marc-André Lureau 86fc385ca0 ui/egl: fix qemu_egl_display type
EGLDisplay is already a pointer type (void *), so declaring
qemu_egl_display as EGLDisplay * makes it void **, which
doesn't match any of its usages.

Fixes: 7ced9e9f6d ("ui: add egl-helpers")
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260820131933.2729240-1-marcandre.lureau@redhat.com>
2026-08-25 15:20:43 +04:00
Tao Ding 096ead3195 hw/riscv: k230: add decomp gzip in K230 board
This commit replaces the unimplemented part of Decomp_gzip in K230.
Connect to the handshake interface of GSDMA.

Signed-off-by: Tao Ding <dingtao0430@163.com>
Reviewed-by: Junze Cao <caojunze424@gmail.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Message-ID: <20260808062227.66961-6-dingtao0430@163.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-08-24 11:15:16 +10:00
Tao Ding 8041d17308 tests/qtest: add test for K230 gsdma
This commit adds test cases for GSDMA.
Imitate the behavior of the driver, set LLT and sdma registers.
After the data transmission is completed, check the destination address data.

Update MAINTAINERS for this test.

Run this qtest:
    $ mkdir build && cd build && ../configure --target-list="riscv64-softmmu"
    $ QTEST_QEMU_BINARY=./qemu-system-riscv64   tests/qtest/k230-gsdma-test

Signed-off-by: Tao Ding <dingtao0430@163.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Reviewed-by: Junze Cao <caojunze424@gmail.com>
Message-ID: <20260808062227.66961-4-dingtao0430@163.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-08-24 11:12:52 +10:00
Tao Ding dde8fbba19 hw/riscv: k230: add gsdma in K230 board
This commit replaces the unimplemented part of GSDMA in K230. And connect the interrupt to plic.

Update K230.rst.

Signed-off-by: Tao Ding <dingtao0430@163.com>
Reviewed-by: Junze Cao <caojunze424@gmail.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Message-ID: <20260808062227.66961-3-dingtao0430@163.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-08-24 11:10:49 +10:00
Tao Ding 54bc6c4f15 hw/dma: add K230 gsdma
K230 GSDMA includes SDMA (System Direct Memory Access) and GDMA (Graphic Direct Memory Access).
In this patch, add SDMA for k230 board. The following features have not been implemented:
1. axi protocol related
2. channel arbitration
3. lower power mode

SDMA supports transfer data between memory, in which case SDMA is the controller.
It also supports transfer data to decomp_gzip and caching it through SRAM.
In this case, decomp_gzip is the controller, which controls SDMA through handshake signals.

According to "K230 Technical Reference Manual v0.3.1" section 2.5.2.
https://download.kendryte.com/developer/k230/HDK/K230%E7%A1%AC%E4%BB%B6%E6%96%87%E6%A1%A3/K230_Technical_Reference_Manual_V0.3.1_20241118.pdf

This commit includes:
- K230 SDMA (System Direct Memory Access) model (k230_gsdma.c, k230_gsdma.h)
- GSDMA trace log (trace-events)
- Kconfig and meson.build
- update MAINTAINERS

Signed-off-by: Tao Ding <dingtao0430@163.com>
Reviewed-by: Chao Liu <chao.liu@processmission.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Reviewed-by: Junze Cao <caojunze424@gmail.com>
Message-ID: <20260808062227.66961-2-dingtao0430@163.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-08-24 11:08:25 +10:00
Yanfeng Liu 2a99140258 riscv/virt: Add optional UART1
This adds optional UART1 to RiscV virt board if required at
runtime to simplify multicore development.

Note that UART0 remains default serial_hd(0) and it is:

- the lowest address UART
- first serial in DTB
- behind /aliases/serial0 in DTB
- the /chosen/stdout-path in DTB

Note that UART1 is placed at different page from UART0 to
support page level isolation.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <tencent_4EEBFC805F3E59863BEDC38094EF5A109206@qq.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-08-24 11:06:23 +10:00
Junze Cao 4309ee8e91 hw/riscv: Connect K230 DDR controller and PHY models
Replace the unimplemented K230 DDR configuration region with the DDRC
model and map the PHY model at 0x9a000000.

Connect the controller to the PHY so DFI status reflects PHY training and
initialization state.

Suggested-by: Chao Liu <chao.liu@processmission.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Signed-off-by: Junze Cao <caojunze424@gmail.com>
Message-ID: <20260807-k230-ddr-v2-v2-2-c531308ae819@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-08-24 10:47:13 +10:00
Junze Cao 798eddba10 hw/misc: Add K230 DDR controller and PHY models
The K230 SDK U-Boot SPL programs K230 DDRC CFG and K230 DDR PHY
registers before DRAM can be used.

Add separate SysBus devices for both register ranges. Model controller
reset values, DFI and software-update handshakes. For the PHY, model
register ownership, the training mailbox, and DFI completion.

Include migration state for both devices.

Signed-off-by: Junze Cao <caojunze424@gmail.com>
Suggested-by: Chao Liu <chao.liu@processmission.com>
Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Message-ID: <20260807-k230-ddr-v2-v2-1-c531308ae819@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2026-08-24 10:47:13 +10:00
Richard Henderson eea8fe61b8 Merge tag 'igvm-20260821-pull-request' of https://gitlab.com/kraxel/qemu into staging
igvm + vmlaunchupdate: allow guests supply their own igvm firmware images.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmqIeGcACgkQTLbY7tPo
# cTi6eA/+LTgcwLrRIRlZBJ1ExwYBAVeeI2AwfoVvL7LrNrVTeW5O3HBkkd5iW3u1
# O5GGabV/8dQsrt3cTbQ6Tj1FuTaAFluNgykok4uCb9kavji/WQofkBgoek6PmDBi
# 4CPwseO12eh9i/OV1yyCRdKqBuUjwnk1LbJIaBRDhz+AOhvTrPZYtxZMC1XZUY/4
# QPTHzo4lDyRphdq/puXe+Z4WPRMpt0tEUzSq1ev57W2Pwu3Rrf6BNM5X+uH8vTXQ
# 3OwzmpNDsJusMKpo0/+gc1pGuLrNSSVWfbrEzsKot6jUg3hfkqmonTEFT+ArZNSn
# cqBCulWVlopJttRcnbUUSdjTaoBHIfS2yX2w10K2eVX7s2DbXy49GERhlfC23BHi
# zMrBQ0JGU4njdZXobFnR8HtCqwAlaTgFHiTHIjk4+IZHRPHUCAOVAIb0rkCeFSX3
# qgE1vHJhEBHLIsCv5F6Kb3aUbTiqWSzfFR67FRZctTzJp0nvJ06EiTlKURDk9CyG
# krInt79qeTHgNu8zNTDwoy8WbHlbDepv0aL/S+liHcE8Drvr5X0pWA0vMWE6mgvj
# Ibd8BEpw6VbLrGe/cz0eLRdu2/6tIDEKYmlAReuRX9ifP3kT41fT9aF/h9BOuJae
# zKWRSDgNfPB6MNf2r/6jvOHNCVaaG69jd0HJH/9cbzxHqinMe54=
# =9hRx
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 21 Aug 2026 09:10:15 AM PDT
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [unknown]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [unknown]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [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: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* tag 'igvm-20260821-pull-request' of https://gitlab.com/kraxel/qemu:
  Update MAINTAINERS
  Add functional and unit tests for the vm-launch-update device
  tests/qtest: Add small igvm files for testing purpose
  docs/spec: Add a specification document for vm-launch-update device
  hw/misc/vmlaunchupdate: Introduce hypervisor fw-cfg interface support
  hw/misc/vmlaunchupdate: add api header
  backends/igvm: add a tracepoint for qigvm_cleanup_memory
  system/memory: add a tracepoint for memory_region_finalize
  igvm: cleanup memory regions
  igvm: track memory regions
  igvm: store IgvmCfg pointer in QIgvm
  MAINTAINERS: elevating myself to be a maintainer for igvm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-08-21 10:39:31 -07:00
Bin Meng 37c0a0059d hw/arm: xilinx_zynq: Store boot info in the machine state
arm_load_kernel() keeps a pointer to the boot info struct for the
lifetime of the VM, so the struct logically belongs to the machine
rather than to a file scoped static object.

Move the boot info into the existing ZynqMachineState.

As in the xlnx-zcu102 and raspi machines, the boot info belongs to
the machine rather than to a static object:

4d1ac883a7 ("hw/arm: xlnx-zcu102: Move arm_boot_info into XlnxZCU102")
0f15c6e338 ("hw/arm/raspi: Move arm_boot_info structure to RaspiMachineState")

Signed-off-by: Bin Meng <bin.meng@processmission.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20260816131300.51799-21-bin.meng@processmission.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-08-21 10:28:10 +01:00
Bin Meng 244b542695 hw/arm: npcm8xx: Store boot info in the machine state
arm_load_kernel() keeps a pointer to the boot info struct for the
lifetime of the VM, so the struct logically belongs to the machine
rather than to a file scoped static object inside
npcm8xx_load_kernel().

Let the caller own the boot info: the board stores it in its
NPCM8xxMachine and passes it to npcm8xx_load_kernel(), which only
fills in the SoC specific values.

As in the xlnx-zcu102 and raspi machines, the boot info belongs to
the machine rather than to a static object:

4d1ac883a7 ("hw/arm: xlnx-zcu102: Move arm_boot_info into XlnxZCU102")
0f15c6e338 ("hw/arm/raspi: Move arm_boot_info structure to RaspiMachineState")

Signed-off-by: Bin Meng <bin.meng@processmission.com>
Message-id: 20260816131300.51799-15-bin.meng@processmission.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-08-21 10:26:59 +01:00
Bin Meng 92fbe79cb0 hw/arm: npcm7xx: Store boot info in the machine state
arm_load_kernel() keeps a pointer to the boot info struct for the
lifetime of the VM, so the struct logically belongs to the machine
rather than to a file scoped static object inside
npcm7xx_load_kernel().

Let the caller own the boot info: the boards store it in their
NPCM7xxMachine and pass it to npcm7xx_load_kernel(), which only fills
in the SoC specific values.

As in the xlnx-zcu102 and raspi machines, the boot info belongs to
the machine rather than to a static object:

4d1ac883a7 ("hw/arm: xlnx-zcu102: Move arm_boot_info into XlnxZCU102")
0f15c6e338 ("hw/arm/raspi: Move arm_boot_info structure to RaspiMachineState")

Signed-off-by: Bin Meng <bin.meng@processmission.com>
Message-id: 20260816131300.51799-14-bin.meng@processmission.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-08-21 10:26:19 +01:00
Bin Meng 7a0c61ad4e hw/arm: aspeed: Store boot info in the machine state
arm_load_kernel() keeps a pointer to the boot info struct for the
lifetime of the VM, so the struct logically belongs to the machine
rather than to a file scoped static object.

Move the boot info into the existing AspeedMachineState.

As in the xlnx-zcu102 and raspi machines, the boot info belongs to
the machine rather than to a static object:

4d1ac883a7 ("hw/arm: xlnx-zcu102: Move arm_boot_info into XlnxZCU102")
0f15c6e338 ("hw/arm/raspi: Move arm_boot_info structure to RaspiMachineState")

Signed-off-by: Bin Meng <bin.meng@processmission.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-id: 20260816131300.51799-2-bin.meng@processmission.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-08-21 10:19:55 +01:00
Richard Henderson b4f6f672a3 tcg: Export tcg_gen_ussub_i{32,64,tl}
Move from tcg-op-gvec.c to tcg-op.c.
Use a temporary, to cover the possibility of operand overlap.

(Cc for stable as this is a prerequisite for the bug fix
in the next commit.)

Cc: qemu-stable@nongnu.org
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-id: 20260811191540.79882-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2026-08-21 09:14:35 +01:00
Richard Henderson f57fc2f7ce Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* dockerfiles: cleanup, update CentOS 9 container to Python 3.11
* rust: fix issues in bits crate
* rust: replace bilge dependency with bitfield-struct
* rust: update build system for Meson 1.12.0
* serial: fix hot-unplug issue
* target/i386: emulate: simplify flags conversion and storage
* target/i386: tcg: small fixes
* target/i386: mshv: complete migration support
* target/i386: sev: add support for SEV features
* target/i386: whpx: bugfixes

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmqGq8wUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroPWBwf6A4w91Tr+mxm3fjcbr/KjVqFnX45k
# qG8l8+60WlA+YY4lUUCJHc4CtPPH9hinOKgm8yGjPdbFrpdcJgQPor4IUgIHnTGu
# Bjceu5k6wlqR7DRetF0TD+NWC2BCkTtbmFcivLd5Ua/vqZVP5j+CITP3t7v5AiuG
# +jEHPTqdk/RMhPdsXcFBl+WditIGNz1/R+pxMKGYfOxF9rQ86sSLd/y2cWrAYNnc
# bO5s8vBxxoNNSxt8qt48aU4gGKvBajpvVQy4/6bPoSs1Z9fwCyCWkQleYSBcBAyn
# 3VTRAoift8j/xEgyOtXVdsviIeaUCE4S0aUGso+TMlA+SwEwSi20P917pg==
# =OXwa
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 20 Aug 2026 12:25: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: (53 commits)
  rust: remove bilge crate
  rust: pl011: switch from bilge to bitfield-struct
  rust: update Cargo dependencies
  scripts: remove now dead parts of rustc_args.py
  docs: rust: update for new-style build rules
  rust: use meson automatic parsing of Cargo.toml
  meson: use compiler_target() to get rustc target
  rust: switch to autogenerated meson rules
  rust: switch to cargo subprojects
  rust: update Cargo.lock
  rust/bits: Use checked_ilog2() in Binary::format to avoid panic
  rust/bits: Align SubAssign behavior with Sub
  python, meson: update meson required for Rust to 1.12.0
  dockerfiles: update CentOS Stream 9 to Python 3.11, Meson to 1.12
  dockerfiles: remove packages required by Avocado
  meson: make linker warnings non-fatal on Linux
  serial: clear transmit retry callback on unrealize
  whpx: i386: inject back db
  whpx: i386: work around Hyper-V FP state oddities
  whpx: i386: synchronise PAT too
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-08-20 16:01:59 -07:00
Ani Sinha 30688c02a7 hw/misc/vmlaunchupdate: Introduce hypervisor fw-cfg interface support
VM launch update is a mechanism where the virtual machines can use IGVM
file bundle to boot into a trusted execution environment without
having to depend on a untrusted party to provide the IGVM bundle or firmware
image. This is particularly useful for confidential virtual machines that
are deployed in the cloud where the tenant and the cloud provider are two
different entities. In this scenario, virtual machines can bring their own
trusted IGVM file containing a trusted firmware image
bundled as a part of their filesystem and then use this hypervisor interface
to update to a trusted and deterministic boot state.
This also allows the guests to have a consistent measurements on the firmware
image.

Currently, this mechanism only works if the VM was started with IGVM in the
first place.

This change introduces support for the fw-cfg based hypervisor interface
and the corresponding device. The interface is made generic
enough so that guests are free to use their own ABI to pass required
information between initial and trusted execution contexts (where they are
running their own trusted boot state) without the hypervisor getting
involved in between.

Currently, this device is only supported for x86_64 machines. Presence of
IGVM host libraries is also required for parsing IGVM files. Hence, the device
cannot be initialized for other machine types or hosts where IGVM support
is not present. Trying to initialize it for arm for example will lead to failure:

$ ./qemu-system-arm -device vm-launch-update -machine virt
qemu-system-arm: -device vm-launch-update: This machine does not support vm-launch-update device

A document detailing the specification is added in a subsequent patch. Please
see docs/specs/vmlaunchupdate.rst.
Functional and qtests are added in a subsequent patch.

CC: Alex Graf <graf@amazon.com>
CC: Gerd Hoffman <kraxel@redhat.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Alexander Graf <graf@amazon.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Message-ID: <20260817142010.80693-8-anisinha@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2026-08-20 16:40:33 +02:00
Ani Sinha b23f6d5294 hw/misc/vmlaunchupdate: add api header
Add a separate header file for guest usable api definitions.

CC: Alex Graf <graf@amazon.com>
CC: Gerd Hoffman <kraxel@redhat.com>
Reviewed-by: Alexander Graf <graf@amazon.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Message-ID: <20260819041105.110625-1-anisinha@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2026-08-20 16:40:33 +02:00