Skip to contentSkip to conversation

QEMU patches for 2025-08-27

GIT PULL Applied Paolo Bonzini 2 participants 16 messages Aug 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 88f72048d2f5835a1b9eaba690c7861393aef283:

Update version for the v10.1.0-rc4 release (2025-08-19 14:05:56 -0400)

are available in the Git repository at:

https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 92dedaf169ddcf8c81fa6d21c86c60f3b82458e5:

rust: move dependencies to rust/Cargo.toml (2025-08-27 10:57:04 +0200)

----------------------------------------------------------------
* rust: declare self as qemu_api for proc-macros
* rust/qemu-api-macros: make derive(Object) friendly when missing parent
* x86/loader: Don't update kernel header for CoCo VMs
* target/i386: Add support for save/load of exception error code
* i386/tcg/svm: fix incorrect canonicalization
* scripts/minikconf.py: small fixes

----------------------------------------------------------------
Ani Sinha (1):
kvm/kvm-all: make kvm_park/unpark_vcpu local to kvm-all.c

Manos Pitsidianakis (3):
scripts/minikconf.py: fix invalid attribute access scripts/minikconf.py: s/Error/KconfigParserError
rust: declare self as qemu_api for proc-macros

Marc-André Lureau (1):
rust/qemu-api-macros: make derive(Object) friendly when missing parent

Paolo Bonzini (6):
python: mkvenv: fix messages printed by mkvenv
MAINTAINERS: add a few more files to "Top Level Makefile and configure"
rust: disable borrow_as_ptr warning
rust: qemu-api-macros: support matching more than one error
subprojects: update proc-macro2 and syn
rust: move dependencies to rust/Cargo.toml

Xiaoyao Li (1):
x86/loader: Don't update kernel header for CoCo VMs

Xin Wang (1):
target/i386: Add support for save/load of exception error code

Zero Tang (1):
i386/tcg/svm: fix incorrect canonicalization

 MAINTAINERS                                        |  4 +++-
 include/system/kvm.h                               | 17 ---------------
 accel/kvm/kvm-all.c                                |  4 ++--
 hw/i386/x86-common.c                               |  2 +-
 target/i386/machine.c                              | 19 +++++++++++++++++
 target/i386/tcg/system/svm_helper.c                |  2 +-
 python/scripts/mkvenv.py                           |  4 ++++
 rust/Cargo.lock                                    |  8 ++++----
 rust/Cargo.toml                                    |  6 +++++-
 rust/qemu-api-macros/src/lib.rs                    | 24 ++++++++++++++--------
 rust/qemu-api-macros/src/tests.rs                  |  6 +++---
 rust/qemu-api/Cargo.toml                           |  6 +++---
 rust/qemu-api/src/lib.rs                           |  4 ++++
 scripts/minikconf.py                               |  6 ++++--
 .../packagefiles/proc-macro2-1-rs/meson.build      |  2 +-
 subprojects/packagefiles/syn-2-rs/meson.build      |  2 +-
 subprojects/proc-macro2-1-rs.wrap                  |  8 ++++----
 subprojects/syn-2-rs.wrap                          |  8 ++++----
 18 files changed, 78 insertions(+), 54 deletions(-)
Signature · 1 line
2.51.0
#1 lore raw

[PULL 04/14] python: mkvenv: fix messages printed by mkvenv

The new Matcher class does not have a __str__ implementation, and therefore it prints the debugging representation of the internal object:

  $ ../configure --enable-rust && make qemu-system-arm --enable-download
  python determined to be '/usr/bin/python3'
  python version: Python 3.13.6
  mkvenv: Creating non-isolated virtual environment at 'pyvenv'
  mkvenv: checking for LegacyMatcher('meson>=1.5.0')
  mkvenv: checking for LegacyMatcher('pycotap>=1.1.0')

Add the method to print the nicer

mkvenv: checking for meson>=1.5.0
mkvenv: checking for pycotap>=1.1.0

---
 python/scripts/mkvenv.py | 4 ++++
 1 file changed, 4 insertions(+)
python/scripts/mkvenv.py +4 -0
index f102527c4de..9aed266df1b 100644
@@ -184,6 +184,10 @@ def match(self, version_str: str) -> bool:
             )
         )
 
+    def __str__(self) -> str:
+        """String representation delegated to the backend."""
+        return str(self._m)
+
     def __repr__(self) -> str:
         """Stable debug representation delegated to the backend."""
         return repr(self._m)
Signature · 1 line
2.51.0
#2 lore raw

[PULL 03/14] scripts/minikconf.py: s/Error/KconfigParserError

In reply to Paolo Bonzini

From: Manos Pitsidianakis <[email protected]>

Error is not defined in this script, raise KconfigParserError instead.

Fixes 82f5181777ebe04b550fd94a1d04c49dd3f012dc ("kconfig: introduce kconfig files")
---
 scripts/minikconf.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/minikconf.py +3 -1
index 2a4694fb6a3..4de5aeed11a 100644
@@ -363,7 +363,9 @@ def parse_file(self, fp):
 
     def do_assignment(self, var, val):
         if not var.startswith("CONFIG_"):
-            raise Error('assigned variable should start with CONFIG_')
+            raise KconfigParserError(
+                self, "assigned variable should start with CONFIG_"
+            )
         var = self.data.do_var(var[7:])
         self.data.do_assignment(var, val)
 
Signature · 1 line
2.51.0
#3 lore raw

[PULL 09/14] rust: disable borrow_as_ptr warning

In reply to Paolo Bonzini

This is pretty noisy, but it was not visible until now because it only shows up if the rust-version has "&raw const".

---
 rust/Cargo.toml | 1 -
 1 file changed, 1 deletion(-)
rust/Cargo.toml +0 -1
index 0868e1b4268..0a83db15356 100644
@@ -53,7 +53,6 @@ as_ptr_cast_mut = "deny"
 as_underscore = "deny"
 assertions_on_result_states = "deny"
 bool_to_int_with_if = "deny"
-borrow_as_ptr = "deny"
 cast_lossless = "deny"
 dbg_macro = "deny"
 debug_assert_with_mut_call = "deny"
Signature · 1 line
2.51.0
#4 lore raw

[PULL 05/14] MAINTAINERS: add a few more files to "Top Level Makefile and configure"

In reply to Paolo Bonzini

A few files in scripts, and the list of packages in pythondeps.toml, are strictly related to the toplevel build scripts. Add them to the MAINTAINERS file stanza.

---
 MAINTAINERS | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
MAINTAINERS +3 -1
index a07086ed762..0f3e55b51e8 100644
@@ -4392,7 +4392,6 @@ R: Philippe Mathieu-Daudé <[email protected]>
 S: Maintained
 F: meson.build
 F: meson_options.txt
-F: scripts/meson-buildoptions.*
 F: scripts/check_sparse.py
 F: scripts/symlink-install-tree.py
 
@@ -4403,6 +4402,9 @@ R: Thomas Huth <[email protected]>
 S: Maintained
 F: Makefile
 F: configure
+F: pythondeps.toml
+F: scripts/git-submodule.sh
+F: scripts/meson-buildoptions.*
 F: scripts/mtest2make.py
 F: tests/Makefile.include
 
Signature · 1 line
2.51.0
#5 lore raw

[PULL 02/14] scripts/minikconf.py: fix invalid attribute access

In reply to Paolo Bonzini

From: Manos Pitsidianakis <[email protected]>

Fix parse method to use defconfig global variable instead of the non-existent KconfigParser class attribute

Fixes f349474920d80838ecea3d421531fdb0660b8740 ("minikconfig: implement allnoconfig and defconfig modes")
---
 scripts/minikconf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/minikconf.py +1 -1
index 6f7f43b2918..2a4694fb6a3 100644
@@ -340,7 +340,7 @@ class KconfigParser:
 
     @classmethod
     def parse(self, fp, mode=None):
-        data = KconfigData(mode or KconfigParser.defconfig)
+        data = KconfigData(mode or defconfig)
         parser = KconfigParser(data)
         parser.parse_file(fp)
         return data
Signature · 1 line
2.51.0
#6 lore raw

[PULL 08/14] kvm/kvm-all: make kvm_park/unpark_vcpu local to kvm-all.c

In reply to Paolo Bonzini

From: Ani Sinha <[email protected]>

kvm_park_vcpu() and kvm_unpark_vcpu() is only used in kvm-all.c. Declare it static, remove it from common header file and make it local to kvm-all.c

---
 include/system/kvm.h | 17 -----------------
 accel/kvm/kvm-all.c  |  4 ++--
 2 files changed, 2 insertions(+), 19 deletions(-)
include/system/kvm.h +0 -17
index 3c7d3147366..4fc09e38910 100644
@@ -317,23 +317,6 @@ int kvm_create_device(KVMState *s, uint64_t type, bool test);
  */
 bool kvm_device_supported(int vmfd, uint64_t type);
 
-/**
- * kvm_park_vcpu - Park QEMU KVM vCPU context
- * @cpu: QOM CPUState object for which QEMU KVM vCPU context has to be parked.
- *
- * @returns: none
- */
-void kvm_park_vcpu(CPUState *cpu);
-
-/**
- * kvm_unpark_vcpu - unpark QEMU KVM vCPU context
- * @s: KVM State
- * @vcpu_id: Architecture vCPU ID of the parked vCPU
- *
- * @returns: KVM fd
- */
-int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id);
-
 /**
  * kvm_create_and_park_vcpu - Create and park a KVM vCPU
  * @cpu: QOM CPUState object for which KVM vCPU has to be created and parked.
accel/kvm/kvm-all.c +2 -2
index 890d5ea9f86..f36dfe33492 100644
@@ -414,7 +414,7 @@ err:
     return ret;
 }
 
-void kvm_park_vcpu(CPUState *cpu)
+static void kvm_park_vcpu(CPUState *cpu)
 {
     struct KVMParkedVcpu *vcpu;
 
@@ -426,7 +426,7 @@ void kvm_park_vcpu(CPUState *cpu)
     QLIST_INSERT_HEAD(&kvm_state->kvm_parked_vcpus, vcpu, node);
 }
 
-int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
+static int kvm_unpark_vcpu(KVMState *s, unsigned long vcpu_id)
 {
     struct KVMParkedVcpu *cpu;
     int kvm_fd = -ENOENT;
Signature · 1 line
2.51.0
#7 lore raw

[PULL 13/14] rust: declare self as qemu_api for proc-macros

In reply to Paolo Bonzini

From: Manos Pitsidianakis <[email protected]>

Fix an outstanding TODO.

Declaring extern crate self as qemu_api allows use of qemu_api within the qemu_api crate; this allows the Wrapper derive macro and future proc macros to be used interchangeably in the qemu_api crate and other crates. This is not required currently and is only for future-proofing.

---
 rust/qemu-api-macros/src/lib.rs | 14 ++++++--------
 rust/qemu-api/src/lib.rs        |  4 ++++
 2 files changed, 10 insertions(+), 8 deletions(-)
rust/qemu-api-macros/src/lib.rs +6 -8
index a6147418891..959726efe6d 100644
@@ -123,23 +123,21 @@ fn derive_opaque_or_error(input: DeriveInput) -> Result<proc_macro2::TokenStream
     let field = &get_unnamed_field(&input, "#[derive(Wrapper)]")?;
     let typ = &field.ty;
 
-    // TODO: how to add "::qemu_api"?  For now, this is only used in the
-    // qemu_api crate so it's not a problem.
     Ok(quote! {
-        unsafe impl crate::cell::Wrapper for #name {
-            type Wrapped = <#typ as crate::cell::Wrapper>::Wrapped;
+        unsafe impl ::qemu_api::cell::Wrapper for #name {
+            type Wrapped = <#typ as ::qemu_api::cell::Wrapper>::Wrapped;
         }
         impl #name {
-            pub unsafe fn from_raw<'a>(ptr: *mut <Self as crate::cell::Wrapper>::Wrapped) -> &'a Self {
+            pub unsafe fn from_raw<'a>(ptr: *mut <Self as ::qemu_api::cell::Wrapper>::Wrapped) -> &'a Self {
                 let ptr = ::std::ptr::NonNull::new(ptr).unwrap().cast::<Self>();
                 unsafe { ptr.as_ref() }
             }
 
-            pub const fn as_mut_ptr(&self) -> *mut <Self as crate::cell::Wrapper>::Wrapped {
+            pub const fn as_mut_ptr(&self) -> *mut <Self as ::qemu_api::cell::Wrapper>::Wrapped {
                 self.0.as_mut_ptr()
             }
 
-            pub const fn as_ptr(&self) -> *const <Self as crate::cell::Wrapper>::Wrapped {
+            pub const fn as_ptr(&self) -> *const <Self as ::qemu_api::cell::Wrapper>::Wrapped {
                 self.0.as_ptr()
             }
 
@@ -147,7 +145,7 @@ pub const fn as_void_ptr(&self) -> *mut ::core::ffi::c_void {
                 self.0.as_void_ptr()
             }
 
-            pub const fn raw_get(slot: *mut Self) -> *mut <Self as crate::cell::Wrapper>::Wrapped {
+            pub const fn raw_get(slot: *mut Self) -> *mut <Self as ::qemu_api::cell::Wrapper>::Wrapped {
                 slot.cast()
             }
         }
rust/qemu-api/src/lib.rs +4 -0
index 86dcd8ef17a..bcb51c7986a 100644
@@ -32,6 +32,10 @@
 pub mod vmstate;
 pub mod zeroable;
 
+// Allow proc-macros to refer to `::qemu_api` inside the `qemu_api` crate (this
+// crate).
+extern crate self as qemu_api;
+
 use std::{
     alloc::{GlobalAlloc, Layout},
     ffi::c_void,
Signature · 1 line
2.51.0
#8 lore raw

[PULL 14/14] rust: move dependencies to rust/Cargo.toml

In reply to Paolo Bonzini

As more crates start using the same dependencies, it's better to not repeat the versions and move the dependency declarations to the workspace.

---
 rust/Cargo.toml          | 5 +++++
 rust/qemu-api/Cargo.toml | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)
rust/Cargo.toml +5 -0
index 0a83db15356..6f8884eb30b 100644
@@ -15,6 +15,11 @@ license = "GPL-2.0-or-later"
 repository = "https://gitlab.com/qemu-project/qemu/"
 rust-version = "1.77.0"
 
+[workspace.dependencies]
+anyhow = "~1.0"
+foreign = "~0.3.1"
+libc = "0.2.162"
+
 [workspace.lints.rust]
 unexpected_cfgs = { level = "deny", check-cfg = [
     'cfg(MESON)', 'cfg(HAVE_GLIB_WITH_ALIGNED_ALLOC)',
rust/qemu-api/Cargo.toml +3 -3
index db7000dee44..c07a17a28b0 100644
@@ -15,9 +15,9 @@ rust-version.workspace = true
 
 [dependencies]
 qemu_api_macros = { path = "../qemu-api-macros" }
-anyhow = "~1.0"
-libc = "0.2.162"
-foreign = "~0.3.1"
+anyhow = { workspace = true }
+foreign = { workspace = true }
+libc = { workspace = true }
 
 [features]
 default = ["debug_cell"]
Signature · 1 line
2.51.0
#9 lore raw

[PULL 06/14] x86/loader: Don't update kernel header for CoCo VMs

In reply to Paolo Bonzini

From: Xiaoyao Li <[email protected]>

Update the header makes it different from the original kernel that user provides via "-kernel", which leads to a different hash and breaks the attestation, e.g., for TDX.

We already skip it for SEV VMs. Instead of adding another check of is_tdx_vm() to cover the TDX case, check machine->cgs to cover all the confidential computing case for x86.

---
 hw/i386/x86-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/x86-common.c +1 -1
index b1b5f11e739..7512be64d67 100644
@@ -952,7 +952,7 @@ void x86_load_linux(X86MachineState *x86ms,
      * kernel on the other side of the fw_cfg interface matches the hash of the
      * file the user passed in.
      */
-    if (!sev_enabled() && protocol > 0) {
+    if (!MACHINE(x86ms)->cgs && protocol > 0) {
         memcpy(setup, header, MIN(sizeof(header), setup_size));
     }
 
Signature · 1 line
2.51.0
#10 lore raw

[PULL 12/14] rust/qemu-api-macros: make derive(Object) friendly when missing parent

In reply to Paolo Bonzini

From: Marc-André Lureau <[email protected]>

---
 rust/qemu-api-macros/src/lib.rs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
rust/qemu-api-macros/src/lib.rs +9 -1
index b525d89c09e..a6147418891 100644
@@ -85,7 +85,15 @@ fn derive_object_or_error(input: DeriveInput) -> Result<proc_macro2::TokenStream
     is_c_repr(&input, "#[derive(Object)]")?;
 
     let name = &input.ident;
-    let parent = &get_fields(&input, "#[derive(Object)]")?[0].ident;
+    let parent = &get_fields(&input, "#[derive(Object)]")?
+        .get(0)
+        .ok_or_else(|| {
+            Error::new(
+                input.ident.span(),
+                "#[derive(Object)] requires a parent field",
+            )
+        })?
+        .ident;
 
     Ok(quote! {
         ::qemu_api::assert_field_type!(#name, #parent,
Signature · 1 line
2.51.0
#11 lore raw

[PULL 10/14] rust: qemu-api-macros: support matching more than one error

In reply to Paolo Bonzini
---
 rust/qemu-api-macros/src/tests.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
rust/qemu-api-macros/src/tests.rs +3 -3
index d6dcd62fcf6..6028cdbc4c3 100644
@@ -7,9 +7,9 @@
 use super::*;
 
 macro_rules! derive_compile_fail {
-    ($derive_fn:ident, $input:expr, $error_msg:expr) => {{
+    ($derive_fn:ident, $input:expr, $($error_msg:expr),+ $(,)?) => {{
         let input: proc_macro2::TokenStream = $input;
-        let error_msg: &str = $error_msg;
+        let error_msg = &[$( quote! { ::core::compile_error! { $error_msg } } ),*];
         let derive_fn: fn(input: syn::DeriveInput) -> Result<proc_macro2::TokenStream, syn::Error> =
             $derive_fn;
 
@@ -18,7 +18,7 @@ macro_rules! derive_compile_fail {
         let err = result.unwrap_err().into_compile_error();
         assert_eq!(
             err.to_string(),
-            quote! { ::core::compile_error! { #error_msg } }.to_string()
+            quote! { #(#error_msg)* }.to_string()
         );
     }};
 }
Signature · 1 line
2.51.0
#12 lore raw

[PULL 01/14] target/i386: Add support for save/load of exception error code

In reply to Paolo Bonzini

From: Xin Wang <[email protected]>

For now, qemu save/load CPU exception info(such as exception_nr and has_error_code), while the exception error_code is ignored. This will cause the dest hypervisor reinject a vCPU exception with error_code(0), potentially causing a guest kernel panic.

For instance, if src VM stopped with an user-mode write #PF (error_code 6), the dest hypervisor will reinject an #PF with error_code(0) when vCPU resume, then guest kernel panic as:

  BUG: unable to handle page fault for address: 00007f80319cb010
  #PF: supervisor read access in user mode
  #PF: error_code(0x0000) - not-present page
  RIP: 0033:0x40115d

To fix it, support save/load exception error_code.

---
 target/i386/machine.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
target/i386/machine.c +19 -0
index dd2dac1d443..45b7cea80aa 100644
@@ -462,6 +462,24 @@ static const VMStateDescription vmstate_exception_info = {
     }
 };
 
+static bool cpu_errcode_needed(void *opaque)
+{
+    X86CPU *cpu = opaque;
+
+    return cpu->env.has_error_code != 0;
+}
+
+static const VMStateDescription vmstate_error_code = {
+    .name = "cpu/error_code",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .needed = cpu_errcode_needed,
+    .fields = (const VMStateField[]) {
+        VMSTATE_INT32(env.error_code, X86CPU),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 /* Poll control MSR enabled by default */
 static bool poll_control_msr_needed(void *opaque)
 {
@@ -1746,6 +1764,7 @@ const VMStateDescription vmstate_x86_cpu = {
     },
     .subsections = (const VMStateDescription * const []) {
         &vmstate_exception_info,
+        &vmstate_error_code,
         &vmstate_async_pf_msr,
         &vmstate_async_pf_int_msr,
         &vmstate_pv_eoi_msr,
Signature · 1 line
2.51.0
#13 lore raw

[PULL 11/14] subprojects: update proc-macro2 and syn

In reply to Paolo Bonzini

syn 2.0.69 adds Punctuated::get(). The serde and attrs crate also need a newer version.

---
 rust/Cargo.lock                                       | 8 ++++----
 subprojects/packagefiles/proc-macro2-1-rs/meson.build | 2 +-
 subprojects/packagefiles/syn-2-rs/meson.build         | 2 +-
 subprojects/proc-macro2-1-rs.wrap                     | 8 ++++----
 subprojects/syn-2-rs.wrap                             | 8 ++++----
 5 files changed, 14 insertions(+), 14 deletions(-)
rust/Cargo.lock +4 -4
index b785c718f31..4baf6ba663c 100644
@@ -118,9 +118,9 @@ dependencies = [
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.84"
+version = "1.0.95"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6"
+checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
 dependencies = [
  "unicode-ident",
 ]
@@ -155,9 +155,9 @@ dependencies = [
 
 [[package]]
 name = "syn"
-version = "2.0.66"
+version = "2.0.104"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
+checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
 dependencies = [
  "proc-macro2",
  "quote",
subprojects/packagefiles/proc-macro2-1-rs/meson.build +1 -1
index 5759df3ecc9..ba7de070292 100644
@@ -1,6 +1,6 @@
 project('proc-macro2-1-rs', 'rust',
   meson_version: '>=1.5.0',
-  version: '1.0.84',
+  version: '1.0.95',
   license: 'MIT OR Apache-2.0',
   default_options: [])
 
subprojects/packagefiles/syn-2-rs/meson.build +1 -1
index a0094174084..3e6dc318a9c 100644
@@ -1,6 +1,6 @@
 project('syn-2-rs', 'rust',
   meson_version: '>=1.5.0',
-  version: '2.0.66',
+  version: '2.0.104',
   license: 'MIT OR Apache-2.0',
   default_options: [])
 
subprojects/proc-macro2-1-rs.wrap +4 -4
index 6c9369f0df3..0f06cd8e111 100644
@@ -1,8 +1,8 @@
 [wrap-file]
-directory = proc-macro2-1.0.84
-source_url = https://crates.io/api/v1/crates/proc-macro2/1.0.84/download
-source_filename = proc-macro2-1.0.84.0.tar.gz
-source_hash = ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6
+directory = proc-macro2-1.0.95
+source_url = https://crates.io/api/v1/crates/proc-macro2/1.0.95/download
+source_filename = proc-macro2-1.0.95.0.tar.gz
+source_hash = 02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778
 #method = cargo
 patch_directory = proc-macro2-1-rs
 
subprojects/syn-2-rs.wrap +4 -4
index d79cf750fb4..1e5e9d9fb6e 100644
@@ -1,8 +1,8 @@
 [wrap-file]
-directory = syn-2.0.66
-source_url = https://crates.io/api/v1/crates/syn/2.0.66/download
-source_filename = syn-2.0.66.0.tar.gz
-source_hash = c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5
+directory = syn-2.0.104
+source_url = https://crates.io/api/v1/crates/syn/2.0.104/download
+source_filename = syn-2.0.104.0.tar.gz
+source_hash = 17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40
 #method = cargo
 patch_directory = syn-2-rs
 
Signature · 1 line
2.51.0
#14 lore raw

[PULL 07/14] i386/tcg/svm: fix incorrect canonicalization

In reply to Paolo Bonzini

From: Zero Tang <[email protected]>

For all 32-bit systems and 64-bit Windows systems, "long" is 4 bytes long. Due to using "long" for a linear address, svm_canonicalization would set all high bits to 1 when (assuming 48-bit linear address) the segment base is bigger than 0x7FFF.

This fixes booting guests under TCG when the guest IDT and GDT bases are above 0x7FFF, thereby resulting in incorrect bases. When an interrupt arrives, it would trigger a #PF exception; the #PF would trigger again, resulting in a #DF exception; the #PF would trigger for the third time, resulting in triple-fault, and eventually causes a shutdown VM-Exit to the hypervisor right after guest boot.

---
 target/i386/tcg/system/svm_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/tcg/system/svm_helper.c +1 -1
index b27049b9ed1..dea039b87a6 100644
@@ -49,7 +49,7 @@ static void svm_save_seg(CPUX86State *env, int mmu_idx, hwaddr addr,
 static inline void svm_canonicalization(CPUX86State *env, target_ulong *seg_base)
 {
     uint16_t shift_amt = 64 - cpu_x86_virtual_addr_width(env);
-    *seg_base = ((((long) *seg_base) << shift_amt) >> shift_amt);
+    *seg_base = (((int64_t) *seg_base) << shift_amt) >> shift_amt;
 }
 
 static void svm_load_seg(CPUX86State *env, int mmu_idx, hwaddr addr,
Signature · 1 line
2.51.0
#15 lore raw
In reply to Paolo Bonzini
Quoted 12 lines · Paolo Bonzini

The following changes since commit 88f72048d2f5835a1b9eaba690c7861393aef283:

   Update version for the v10.1.0-rc4 release (2025-08-19 14:05:56 -0400)

are available in the Git repository at:

https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 92dedaf169ddcf8c81fa6d21c86c60f3b82458e5:

   rust: move dependencies to rust/Cargo.toml (2025-08-27 10:57:04 +0200)
Quoted 7 lines

----------------------------------------------------------------
* rust: declare self as qemu_api for proc-macros
* rust/qemu-api-macros: make derive(Object) friendly when missing parent
* x86/loader: Don't update kernel header for CoCo VMs
* target/i386: Add support for save/load of exception error code
* i386/tcg/svm: fix incorrect canonicalization
* scripts/minikconf.py: small fixes

Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/10.2 as appropriate.

r~