* [PULL 00/14] QEMU patches for 2025-08-27
@ 2025-08-27 18:25 Paolo Bonzini
2025-08-27 18:25 ` [PULL 01/14] target/i386: Add support for save/load of exception error code Paolo Bonzini
` (14 more replies)
0 siblings, 15 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel
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(-)
--
2.51.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PULL 01/14] target/i386: Add support for save/load of exception error code
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 02/14] scripts/minikconf.py: fix invalid attribute access Paolo Bonzini
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Xin Wang
From: Xin Wang <wangxinxin.wang@huawei.com>
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.
Signed-off-by: Xin Wang <wangxinxin.wang@huawei.com>
Link: https://lore.kernel.org/r/20250819145834.3998-1-wangxinxin.wang@huawei.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/machine.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/target/i386/machine.c b/target/i386/machine.c
index dd2dac1d443..45b7cea80aa 100644
--- a/target/i386/machine.c
+++ b/target/i386/machine.c
@@ -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,
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 02/14] scripts/minikconf.py: fix invalid attribute access
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
2025-08-27 18:25 ` [PULL 01/14] target/i386: Add support for save/load of exception error code Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 03/14] scripts/minikconf.py: s/Error/KconfigParserError Paolo Bonzini
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Manos Pitsidianakis
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Fix parse method to use `defconfig` global variable instead of the
non-existent KconfigParser class attribute
Fixes: f349474920d80838ecea3d421531fdb0660b8740 ("minikconfig: implement allnoconfig and defconfig modes")
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/r/20250820-scripts-minikconf-fixes-v1-1-252041a9125e@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/minikconf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/minikconf.py b/scripts/minikconf.py
index 6f7f43b2918..2a4694fb6a3 100644
--- a/scripts/minikconf.py
+++ b/scripts/minikconf.py
@@ -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
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 03/14] scripts/minikconf.py: s/Error/KconfigParserError
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
2025-08-27 18:25 ` [PULL 01/14] target/i386: Add support for save/load of exception error code Paolo Bonzini
2025-08-27 18:25 ` [PULL 02/14] scripts/minikconf.py: fix invalid attribute access Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 04/14] python: mkvenv: fix messages printed by mkvenv Paolo Bonzini
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Manos Pitsidianakis
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Error is not defined in this script, raise KconfigParserError instead.
Fixes: 82f5181777ebe04b550fd94a1d04c49dd3f012dc ("kconfig: introduce kconfig files")
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/r/20250820-scripts-minikconf-fixes-v1-2-252041a9125e@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/minikconf.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/minikconf.py b/scripts/minikconf.py
index 2a4694fb6a3..4de5aeed11a 100644
--- a/scripts/minikconf.py
+++ b/scripts/minikconf.py
@@ -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)
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 04/14] python: mkvenv: fix messages printed by mkvenv
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (2 preceding siblings ...)
2025-08-27 18:25 ` [PULL 03/14] scripts/minikconf.py: s/Error/KconfigParserError Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 05/14] MAINTAINERS: add a few more files to "Top Level Makefile and configure" Paolo Bonzini
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-stable, John Snow, Manos Pitsidianakis,
Philippe Mathieu-Daudé
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
Cc: qemu-stable@nongnu.org
Cc: John Snow <jsnow@redhat.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
python/scripts/mkvenv.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py
index f102527c4de..9aed266df1b 100644
--- a/python/scripts/mkvenv.py
+++ b/python/scripts/mkvenv.py
@@ -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)
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 05/14] MAINTAINERS: add a few more files to "Top Level Makefile and configure"
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (3 preceding siblings ...)
2025-08-27 18:25 ` [PULL 04/14] python: mkvenv: fix messages printed by mkvenv Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 06/14] x86/loader: Don't update kernel header for CoCo VMs Paolo Bonzini
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel
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.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
MAINTAINERS | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index a07086ed762..0f3e55b51e8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4392,7 +4392,6 @@ R: Philippe Mathieu-Daudé <philmd@linaro.org>
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 <thuth@redhat.com>
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
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 06/14] x86/loader: Don't update kernel header for CoCo VMs
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (4 preceding siblings ...)
2025-08-27 18:25 ` [PULL 05/14] MAINTAINERS: add a few more files to "Top Level Makefile and configure" Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 07/14] i386/tcg/svm: fix incorrect canonicalization Paolo Bonzini
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Xiaoyao Li, Vikrant Garg
From: Xiaoyao Li <xiaoyao.li@intel.com>
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.
Reported-by: Vikrant Garg <vikrant1garg@gmail.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20250814092111.2353598-1-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/i386/x86-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index b1b5f11e739..7512be64d67 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -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));
}
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 07/14] i386/tcg/svm: fix incorrect canonicalization
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (5 preceding siblings ...)
2025-08-27 18:25 ` [PULL 06/14] x86/loader: Don't update kernel header for CoCo VMs Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 08/14] kvm/kvm-all: make kvm_park/unpark_vcpu local to kvm-all.c Paolo Bonzini
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Zero Tang, qemu-stable
From: Zero Tang <zero.tangptr@gmail.com>
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.
Cc: qemu-stable@nongnu.org
Signed-off-by: Zero Tang <zero.tangptr@gmail.com>
---
target/i386/tcg/system/svm_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/tcg/system/svm_helper.c b/target/i386/tcg/system/svm_helper.c
index b27049b9ed1..dea039b87a6 100644
--- a/target/i386/tcg/system/svm_helper.c
+++ b/target/i386/tcg/system/svm_helper.c
@@ -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,
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 08/14] kvm/kvm-all: make kvm_park/unpark_vcpu local to kvm-all.c
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (6 preceding siblings ...)
2025-08-27 18:25 ` [PULL 07/14] i386/tcg/svm: fix incorrect canonicalization Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 09/14] rust: disable borrow_as_ptr warning Paolo Bonzini
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Ani Sinha, Igor Mammedov, Zhao Liu
From: Ani Sinha <anisinha@redhat.com>
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
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250815065445.8978-1-anisinha@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/system/kvm.h | 17 -----------------
accel/kvm/kvm-all.c | 4 ++--
2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/include/system/kvm.h b/include/system/kvm.h
index 3c7d3147366..4fc09e38910 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -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.
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 890d5ea9f86..f36dfe33492 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -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;
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 09/14] rust: disable borrow_as_ptr warning
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (7 preceding siblings ...)
2025-08-27 18:25 ` [PULL 08/14] kvm/kvm-all: make kvm_park/unpark_vcpu local to kvm-all.c Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 10/14] rust: qemu-api-macros: support matching more than one error Paolo Bonzini
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel
This is pretty noisy, but it was not visible until now because it only shows up
if the rust-version has "&raw const".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/Cargo.toml | 1 -
1 file changed, 1 deletion(-)
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 0868e1b4268..0a83db15356 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -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"
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 10/14] rust: qemu-api-macros: support matching more than one error
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (8 preceding siblings ...)
2025-08-27 18:25 ` [PULL 09/14] rust: disable borrow_as_ptr warning Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 11/14] subprojects: update proc-macro2 and syn Paolo Bonzini
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/qemu-api-macros/src/tests.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rust/qemu-api-macros/src/tests.rs b/rust/qemu-api-macros/src/tests.rs
index d6dcd62fcf6..6028cdbc4c3 100644
--- a/rust/qemu-api-macros/src/tests.rs
+++ b/rust/qemu-api-macros/src/tests.rs
@@ -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()
);
}};
}
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 11/14] subprojects: update proc-macro2 and syn
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (9 preceding siblings ...)
2025-08-27 18:25 ` [PULL 10/14] rust: qemu-api-macros: support matching more than one error Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 12/14] rust/qemu-api-macros: make derive(Object) friendly when missing parent Paolo Bonzini
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel
syn 2.0.69 adds Punctuated::get(). The serde and attrs crate also need
a newer version.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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(-)
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index b785c718f31..4baf6ba663c 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -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",
diff --git a/subprojects/packagefiles/proc-macro2-1-rs/meson.build b/subprojects/packagefiles/proc-macro2-1-rs/meson.build
index 5759df3ecc9..ba7de070292 100644
--- a/subprojects/packagefiles/proc-macro2-1-rs/meson.build
+++ b/subprojects/packagefiles/proc-macro2-1-rs/meson.build
@@ -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: [])
diff --git a/subprojects/packagefiles/syn-2-rs/meson.build b/subprojects/packagefiles/syn-2-rs/meson.build
index a0094174084..3e6dc318a9c 100644
--- a/subprojects/packagefiles/syn-2-rs/meson.build
+++ b/subprojects/packagefiles/syn-2-rs/meson.build
@@ -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: [])
diff --git a/subprojects/proc-macro2-1-rs.wrap b/subprojects/proc-macro2-1-rs.wrap
index 6c9369f0df3..0f06cd8e111 100644
--- a/subprojects/proc-macro2-1-rs.wrap
+++ b/subprojects/proc-macro2-1-rs.wrap
@@ -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
diff --git a/subprojects/syn-2-rs.wrap b/subprojects/syn-2-rs.wrap
index d79cf750fb4..1e5e9d9fb6e 100644
--- a/subprojects/syn-2-rs.wrap
+++ b/subprojects/syn-2-rs.wrap
@@ -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
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 12/14] rust/qemu-api-macros: make derive(Object) friendly when missing parent
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (10 preceding siblings ...)
2025-08-27 18:25 ` [PULL 11/14] subprojects: update proc-macro2 and syn Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 13/14] rust: declare self as qemu_api for proc-macros Paolo Bonzini
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Link: https://lore.kernel.org/r/20250826133132.4064478-5-marcandre.lureau@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/qemu-api-macros/src/lib.rs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/rust/qemu-api-macros/src/lib.rs b/rust/qemu-api-macros/src/lib.rs
index b525d89c09e..a6147418891 100644
--- a/rust/qemu-api-macros/src/lib.rs
+++ b/rust/qemu-api-macros/src/lib.rs
@@ -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,
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 13/14] rust: declare self as qemu_api for proc-macros
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (11 preceding siblings ...)
2025-08-27 18:25 ` [PULL 12/14] rust/qemu-api-macros: make derive(Object) friendly when missing parent Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 18:25 ` [PULL 14/14] rust: move dependencies to rust/Cargo.toml Paolo Bonzini
2025-08-27 22:50 ` [PULL 00/14] QEMU patches for 2025-08-27 Richard Henderson
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Manos Pitsidianakis
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
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.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/r/20250728-self-as-qemu_api-v1-1-001c339cccc8@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/qemu-api-macros/src/lib.rs | 14 ++++++--------
rust/qemu-api/src/lib.rs | 4 ++++
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/rust/qemu-api-macros/src/lib.rs b/rust/qemu-api-macros/src/lib.rs
index a6147418891..959726efe6d 100644
--- a/rust/qemu-api-macros/src/lib.rs
+++ b/rust/qemu-api-macros/src/lib.rs
@@ -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()
}
}
diff --git a/rust/qemu-api/src/lib.rs b/rust/qemu-api/src/lib.rs
index 86dcd8ef17a..bcb51c7986a 100644
--- a/rust/qemu-api/src/lib.rs
+++ b/rust/qemu-api/src/lib.rs
@@ -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,
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 14/14] rust: move dependencies to rust/Cargo.toml
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (12 preceding siblings ...)
2025-08-27 18:25 ` [PULL 13/14] rust: declare self as qemu_api for proc-macros Paolo Bonzini
@ 2025-08-27 18:25 ` Paolo Bonzini
2025-08-27 22:50 ` [PULL 00/14] QEMU patches for 2025-08-27 Richard Henderson
14 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-08-27 18:25 UTC (permalink / raw)
To: qemu-devel; +Cc: Manos Pitsidianakis, Zhao Liu
As more crates start using the same dependencies, it's better to not
repeat the versions and move the dependency declarations to the workspace.
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/Cargo.toml | 5 +++++
rust/qemu-api/Cargo.toml | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 0a83db15356..6f8884eb30b 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -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)',
diff --git a/rust/qemu-api/Cargo.toml b/rust/qemu-api/Cargo.toml
index db7000dee44..c07a17a28b0 100644
--- a/rust/qemu-api/Cargo.toml
+++ b/rust/qemu-api/Cargo.toml
@@ -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"]
--
2.51.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PULL 00/14] QEMU patches for 2025-08-27
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
` (13 preceding siblings ...)
2025-08-27 18:25 ` [PULL 14/14] rust: move dependencies to rust/Cargo.toml Paolo Bonzini
@ 2025-08-27 22:50 ` Richard Henderson
14 siblings, 0 replies; 16+ messages in thread
From: Richard Henderson @ 2025-08-27 22:50 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel
On 8/28/25 04:25, Paolo Bonzini wrote:
> 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
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/10.2 as appropriate.
r~
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-08-27 22:51 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27 18:25 [PULL 00/14] QEMU patches for 2025-08-27 Paolo Bonzini
2025-08-27 18:25 ` [PULL 01/14] target/i386: Add support for save/load of exception error code Paolo Bonzini
2025-08-27 18:25 ` [PULL 02/14] scripts/minikconf.py: fix invalid attribute access Paolo Bonzini
2025-08-27 18:25 ` [PULL 03/14] scripts/minikconf.py: s/Error/KconfigParserError Paolo Bonzini
2025-08-27 18:25 ` [PULL 04/14] python: mkvenv: fix messages printed by mkvenv Paolo Bonzini
2025-08-27 18:25 ` [PULL 05/14] MAINTAINERS: add a few more files to "Top Level Makefile and configure" Paolo Bonzini
2025-08-27 18:25 ` [PULL 06/14] x86/loader: Don't update kernel header for CoCo VMs Paolo Bonzini
2025-08-27 18:25 ` [PULL 07/14] i386/tcg/svm: fix incorrect canonicalization Paolo Bonzini
2025-08-27 18:25 ` [PULL 08/14] kvm/kvm-all: make kvm_park/unpark_vcpu local to kvm-all.c Paolo Bonzini
2025-08-27 18:25 ` [PULL 09/14] rust: disable borrow_as_ptr warning Paolo Bonzini
2025-08-27 18:25 ` [PULL 10/14] rust: qemu-api-macros: support matching more than one error Paolo Bonzini
2025-08-27 18:25 ` [PULL 11/14] subprojects: update proc-macro2 and syn Paolo Bonzini
2025-08-27 18:25 ` [PULL 12/14] rust/qemu-api-macros: make derive(Object) friendly when missing parent Paolo Bonzini
2025-08-27 18:25 ` [PULL 13/14] rust: declare self as qemu_api for proc-macros Paolo Bonzini
2025-08-27 18:25 ` [PULL 14/14] rust: move dependencies to rust/Cargo.toml Paolo Bonzini
2025-08-27 22:50 ` [PULL 00/14] QEMU patches for 2025-08-27 Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).