Branch: refs/heads/staging
Home: https://github.com/qemu/qemu
Commit: 5faaac0a4c5593865a33a3080b4fd211feb51d31
https://github.com/qemu/qemu/commit/5faaac0a4c5593865a33a3080b4fd211feb51d31
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-22 (Wed, 22 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust: pl011: fix repr(C) for PL011Class
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 6ace2d5163bbc0b38d9982e04f3a4199c5fef315
https://github.com/qemu/qemu/commit/6ace2d5163bbc0b38d9982e04f3a4199c5fef315
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/emit.c.inc
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: inline gen_jcc into sole caller
The code of gen_Jcc is very similar to gen_LOOP* and gen_JCXZ, but this
is hidden by gen_jcc.
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: e604be4fb4ed1abe5286f8f4145701bf3fc15b97
https://github.com/qemu/qemu/commit/e604be4fb4ed1abe5286f8f4145701bf3fc15b97
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/emit.c.inc
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: remove trailing 1 from gen_{j, cmov, set}cc1
This is not needed anymore now that gen_jcc has been eliminated
(merged into the similarly-named gen_Jcc, where the uppercase letter
gives away that it is an emission function).
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: b519556f58dcb548f295c5cbbf91617377c5c564
https://github.com/qemu/qemu/commit/b519556f58dcb548f295c5cbbf91617377c5c564
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: unify REP and REPZ/REPNZ generation
It only differs in a single call to gen_jcc, so use a "bool" argument
to distinguish the two cases; do not duplicate code.
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: d8d552d4591257368633831953a190b868e5f566
https://github.com/qemu/qemu/commit/d8d552d4591257368633831953a190b868e5f566
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/emit.c.inc
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: unify choice between single and repeated string instructions
The same "if" is present in all generator functions for string instructions.
Push it inside gen_repz() and gen_repz_nz() instead.
Signed-off-by: Paolo Bonzini <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 0eb7046e1bbe83468169a74b1886fa9c2605ffa7
https://github.com/qemu/qemu/commit/0eb7046e1bbe83468169a74b1886fa9c2605ffa7
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: reorganize ops emitted by do_gen_rep, drop repz_opt
The condition for optimizing repeat instruction is more or less the
opposite of what you imagine: almost always the string instruction
was _not_ optimized and optimizing the loop relied on goto_tb.
This is obviously not great for performance, due to the cost of the
exit-to-main-loop check, but also wrong. In fact, after expanding
dc->jmp_opt and simplifying "!!x" to "x", the condition for looping used
to be:
((cflags & CF_NO_GOTO_TB) ||
(flags & (HF_RF_MASK | HF_TF_MASK | HF_INHIBIT_IRQ_MASK))) && !(cflags &
CF_USE_ICOUNT)
In other words, setting aside RF (it requires special handling for REP
instructions and it was completely missing), repeat instruction were
being optimized if TF or inhibit IRQ flags were set. This is certainly
wrong for TF, because string instructions trap after every execution,
and probably for interrupt shadow too.
Get rid of repz_opt completely. The next patches will reintroduce the
optimization, applying it in the common case instead of the unlikely
and wrong one.
While at it, place the CX/ECX/RCX=0 case is at the end of the function,
which saves a label and is clearer when reading the generated ops.
For clarity, mark the cc_op explicitly as DYNAMIC even if at the end
of the translation block; the cc_op can come from either the previous
instruction or the string instruction, and currently we rely on
a gen_update_cc_op() that is hidden in the bowels of gen_jcc() to
spill cc_op and mark it clean.
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 4d7704ebc59a1f52d6ab65e5fff8e3160c1f4d79
https://github.com/qemu/qemu/commit/4d7704ebc59a1f52d6ab65e5fff8e3160c1f4d79
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: tcg: move gen_set/reset_* earlier in the file
Allow using them in the code that translates REP/REPZ, without
forward declarations.
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 0d82d9e84644ecee3e626bdf204e9847ffe10bce
https://github.com/qemu/qemu/commit/0d82d9e84644ecee3e626bdf204e9847ffe10bce
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: fix RF handling for string instructions
RF must be set on traps and interrupts from a string instruction,
except if they occur after the last iteration. Ensure it is set
before giving the main loop a chance to execute.
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 6986cf003226ddf7e5af36a9f4f033cb16c8636c
https://github.com/qemu/qemu/commit/6986cf003226ddf7e5af36a9f4f033cb16c8636c
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: make cc_op handling more explicit for repeated string
instructions.
Since the cost of gen_update_cc_op() must be paid anyway, it's easier
to place them manually and not rely on spilling that is buried under
multiple levels of function calls. While at it, clarify the circumstances
in which the gen_update_cc_op() is needed, and why it is not for REPxx
SCAS and REPxx CMPS.
And since cc_op will have been spilled at the point of a fault, just
make the whole insn CC_OP_DYNAMIC. Once repz_opt is reintroduced,
a fault could happen either before or after the first execution of
CMPS/SCAS, and CC_OP_DYNAMIC sidesteps the complicated matter of what
x86_restore_state_to_opc would do.
Signed-off-by: Paolo Bonzini <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 365811602572054b1c1173b19e8fd28689d827d9
https://github.com/qemu/qemu/commit/365811602572054b1c1173b19e8fd28689d827d9
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: do not use gen_op_jz_ecx for repeated string operations
Explicitly generate a TSTEQ branch (which is optimized to NE x,0 if possible).
This does not make much sense yet, but later we will add more checks and some
will use a temporary to check on the decremented value of CX/ECX/RCX; it will
be clearer for all checks to share the same logic using TSTEQ(reg, cx_mask).
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 0360b781870a628379de20e03305c4e62dbdcca4
https://github.com/qemu/qemu/commit/0360b781870a628379de20e03305c4e62dbdcca4
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: optimize CX handling in repeated string operations
In a repeated string operation, CX/ECX will be decremented until it
is 0 but never underflow. Use this observation to avoid a deposit or
zero-extend operation if the address size of the operation is smaller
than MO_TL.
As in the previous patch, the patch is structured to include some
preparatory work for subsequent changes. In particular, introducing
cx_next prepares for when ECX will be decremented *before* calling
fn(s, ot), and therefore cannot yet be written back to cpu_regs.
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 456709db50f424d112bc5f07260fdc51555f3a24
https://github.com/qemu/qemu/commit/456709db50f424d112bc5f07260fdc51555f3a24
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: execute multiple REP/REPZ iterations without leaving TB
Use a TCG loop so that it is not necessary to go through the setup steps
of REP and through the I/O check on every iteration. Interestingly, this
is not a particularly effective optimization on its own, though it avoids
the cost of correct RF emulation that was added in the previous patch.
The main benefit lies in allowing the hoisting of loop invariants outside
the loop, which will happen separately.
The loop exits when the low 16 bits of CX/ECX/RCX are zero (so generally
speaking the string operation runs in 65536 iteration batches) to give
the main loop an opportunity to pick up interrupts.
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 4f094e27f3ad2a35e305cb26a2926864815b6ac6
https://github.com/qemu/qemu/commit/4f094e27f3ad2a35e305cb26a2926864815b6ac6
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: pull computation of string update value out of loop
This is a common operation that is executed many times in rep
movs or rep stos loops. It can improve performance by several
percentage points.
Signed-off-by: Paolo Bonzini <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 82290c76476021c647824f816d8ccfbbfb773b2e
https://github.com/qemu/qemu/commit/82290c76476021c647824f816d8ccfbbfb773b2e
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: extract common bits of gen_repz/gen_repz_nz
Now that everything has been cleaned up, look at DF and prefixes
in a single function, and call that one from gen_repz and gen_repz_nz.
Suggested-by: Richard Henderson <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 22063f03a7626c77d7a4546b90fd27badd504269
https://github.com/qemu/qemu/commit/22063f03a7626c77d7a4546b90fd27badd504269
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/tcg/translate.c
Log Message:
-----------
target/i386: avoid using s->tmp0 for add to implicit registers
For updates to implicit registers (RCX in LOOP instructions, RSI or RDI
in string instructions, or the stack pointer) do the add directly using
the registers (with no temporary) if 32-bit or 64-bit, or use a temporary
created for the occasion if 16-bit. This is more efficient and removes
move instructions for the MO_TL case.
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: c597ff5339a9918b00d9f4160126db0ac2a423cc
https://github.com/qemu/qemu/commit/c597ff5339a9918b00d9f4160126db0ac2a423cc
Author: Tao Su <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/cpu.c
Log Message:
-----------
target/i386: Introduce SierraForest-v2 model
Update SierraForest CPU model to add LAM, 4 bits indicating certain bits
of IA32_SPEC_CTR are supported(intel-psfd, ipred-ctrl, rrsba-ctrl,
bhi-ctrl) and the missing features(ss, tsc-adjust, cldemote, movdiri,
movdir64b)
Also add GDS-NO and RFDS-NO to indicate the related vulnerabilities are
mitigated in stepping 3.
Tested-by: Xuelian Guo <[email protected]>
Signed-off-by: Tao Su <[email protected]>
Reviewed-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: b611931d4f70b9a3e49e39c405c63b3b5e9c0df1
https://github.com/qemu/qemu/commit/b611931d4f70b9a3e49e39c405c63b3b5e9c0df1
Author: Tao Su <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/cpu.c
Log Message:
-----------
target/i386: Export BHI_NO bit to guests
Branch History Injection (BHI) is a CPU side-channel vulnerability, where
an attacker may manipulate branch history before transitioning from user
to supervisor mode or from VMX non-root/guest to root mode. CPUs that set
BHI_NO bit in MSR IA32_ARCH_CAPABILITIES to indicate no additional
mitigation is required to prevent BHI.
Make BHI_NO bit available to guests.
Tested-by: Xuelian Guo <[email protected]>
Signed-off-by: Tao Su <[email protected]>
Reviewed-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 56e84d898f17606b5d88778726466540af96b234
https://github.com/qemu/qemu/commit/56e84d898f17606b5d88778726466540af96b234
Author: Tao Su <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M target/i386/cpu.c
M target/i386/cpu.h
Log Message:
-----------
target/i386: Add new CPU model ClearwaterForest
According to table 1-2 in Intel Architecture Instruction Set Extensions
and Future Features (rev 056) [1], ClearwaterForest has the following new
features which have already been virtualized:
- AVX-VNNI-INT16 CPUID.(EAX=7,ECX=1):EDX[bit 10]
- SHA512 CPUID.(EAX=7,ECX=1):EAX[bit 0]
- SM3 CPUID.(EAX=7,ECX=1):EAX[bit 1]
- SM4 CPUID.(EAX=7,ECX=1):EAX[bit 2]
Add above features to new CPU model ClearwaterForest. Comparing with
SierraForest, ClearwaterForest bare-metal contains all features of
SierraForest-v2 CPU model and adds:
- PREFETCHI CPUID.(EAX=7,ECX=1):EDX[bit 14]
- DDPD_U CPUID.(EAX=7,ECX=2):EDX[bit 3]
- BHI_NO IA32_ARCH_CAPABILITIES[bit 20]
Add above and all features of SierraForest-v2 CPU model to new CPU model
ClearwaterForest.
[1] https://cdrdv2.intel.com/v1/dl/getContent/671368
Tested-by: Xuelian Guo <[email protected]>
Signed-off-by: Tao Su <[email protected]>
Reviewed-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 0a6dec6d11e5e392dcd6299548bf1514f1201707
https://github.com/qemu/qemu/commit/0a6dec6d11e5e392dcd6299548bf1514f1201707
Author: Tao Su <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M docs/system/cpu-models-x86.rst.inc
Log Message:
-----------
docs: Add GNR, SRF and CWF CPU models
Update GraniteRapids, SierraForest and ClearwaterForest CPU models in
section "Preferred CPU models for Intel x86 hosts".
Also introduce bhi-no, gds-no and rfds-no in doc.
Suggested-by: Zhao Liu <[email protected]>
Signed-off-by: Tao Su <[email protected]>
Reviewed-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 8113dbbcdaee05f319a7e48272416d918cb2b04a
https://github.com/qemu/qemu/commit/8113dbbcdaee05f319a7e48272416d918cb2b04a
Author: Zhao Liu <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M stubs/meson.build
Log Message:
-----------
stub: Fix build failure with --enable-user --disable-system --enable-tools
Configuring "--enable-user --disable-system --enable-tools" causes the
build failure with the following information:
/usr/bin/ld: libhwcore.a.p/hw_core_qdev.c.o: in function `device_finalize':
/qemu/build/../hw/core/qdev.c:688: undefined reference to
`qapi_event_send_device_deleted'
collect2: error: ld returned 1 exit status
To fix the above issue, add qdev.c stub when build with `have_tools`.
With this fix, QEMU could be successfully built in the following cases:
--enable-user --disable-system --enable-tools
--enable-user --disable-system --disable-tools
--enable-user --disable-system
Cc: [email protected]
Fixes: 388b849fb6c3 ("stubs: avoid duplicate symbols in libqemuutil.a")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2766
Signed-off-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 0f9eb0ff2b25787be62fceb036dba7c3f54fde2d
https://github.com/qemu/qemu/commit/0f9eb0ff2b25787be62fceb036dba7c3f54fde2d
Author: Zhao Liu <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/qemu-api/src/qdev.rs
Log Message:
-----------
rust/qdev: Make REALIZE safe
A safe REALIZE accepts immutable reference.
Since current PL011's realize() only calls a char binding function (
qemu_chr_fe_set_handlers), it is possible to convert mutable reference
(&mut self) to immutable reference (&self), which only needs to convert
the pointers passed to C to mutable pointers.
Thus, make REALIZE accept immutable reference.
Signed-off-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 06a1cfb5550a090b63c81cf5f44d2558010a8ed7
https://github.com/qemu/qemu/commit/06a1cfb5550a090b63c81cf5f44d2558010a8ed7
Author: Zhao Liu <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust/pl011: Avoid bindings::*
List all the necessary bindings to better identify gaps in rust/qapi.
And include the bindings wrapped by rust/qapi instead mapping the raw
bindings directly.
Inspired-by: Paolo Bonzini <[email protected]>
Signed-off-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 5014e33b1e00d330f13df33c09a3932ac88f8d94
https://github.com/qemu/qemu/commit/5014e33b1e00d330f13df33c09a3932ac88f8d94
Author: Zhao Liu <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M include/exec/memattrs.h
Log Message:
-----------
memattrs: Convert unspecified member to bool
Convert `unspecified` member of MemTxAttrs from bit field to bool, so
that bindgen could generate more ergonomic Rust binding with bool type.
As a result, MemTxAttrs needs to be expanded from 4 bytes to 8 bytes.
Therefore, move `unspecified` to after the bit fields and add reserved
members to ensure that the whole structure is packed into 8 bytes.
Suggested-by: Richard Henderson <[email protected]>
Suggested-by: Paolo Bonzini <[email protected]>
Signed-off-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 57f9d9c84a9112d534fa90f2a6dad74bd71150b6
https://github.com/qemu/qemu/commit/57f9d9c84a9112d534fa90f2a6dad74bd71150b6
Author: Zhao Liu <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M include/exec/memattrs.h
Log Message:
-----------
memattrs: Check the size of MemTxAttrs
Make sure MemTxAttrs is packed into 8 bytes and does not exceed 8 bytes.
Suggested-by: Philippe Mathieu-Daudà <[email protected]>
Signed-off-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 0d43ddae35a29d1822ec3f35a31bfe7c91618ef4
https://github.com/qemu/qemu/commit/0d43ddae35a29d1822ec3f35a31bfe7c91618ef4
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/qemu-api/src/prelude.rs
M rust/qemu-api/src/vmstate.rs
Log Message:
-----------
rust: vmstate: add new type safe implementation
The existing translation of the C macros for vmstate does not make
any attempt to type-check vmstate declarations against the struct, so
introduce a new system that computes VMStateField based on the actual
struct declaration.
Macros do not have full access to the type system, therefore a full
implementation of this scheme requires a helper trait to analyze the
type and produce a VMStateField from it; a macro "vmstate_of!" accepts
arguments similar to "offset_of!" and tricks the compiler into looking
up the trait for the right type.
The patch introduces not just vmstate_of!, but also the slightly too
clever enabling macro call_func_with_field!. The particular trick used
here was proposed on the users.rust-lang.org forum, so I take no merit
and all the blame.
Introduce the trait and some functions to access it; the actual
implementation comes later.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 80aa3045bd42bec287d1f9bcc94be32a4c1b582e
https://github.com/qemu/qemu/commit/80aa3045bd42bec287d1f9bcc94be32a4c1b582e
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/qemu-api/src/vmstate.rs
Log Message:
-----------
rust: vmstate: implement VMState for non-leaf types
Arrays, pointers and cells use a VMStateField that is based on that
for the inner type. The implementation therefore delegates to the
VMState implementation of the inner type.
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 5b024b4e73f180402fde8485e8d4a51383592940
https://github.com/qemu/qemu/commit/5b024b4e73f180402fde8485e8d4a51383592940
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/qemu-api/src/vmstate.rs
Log Message:
-----------
rust: vmstate: add varray support to vmstate_of!
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 2537f8309885013c4b04ae7b2888591ba0cb6ca7
https://github.com/qemu/qemu/commit/2537f8309885013c4b04ae7b2888591ba0cb6ca7
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/qemu-api/src/vmstate.rs
M rust/qemu-api/src/zeroable.rs
Log Message:
-----------
rust: vmstate: implement Zeroable for VMStateField
This shortens a bit the constants. Do not bother using it
in the vmstate macros since most of them will go away soon.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: f2cb78bdbe5f9ff61366beb216971a8502456c3a
https://github.com/qemu/qemu/commit/f2cb78bdbe5f9ff61366beb216971a8502456c3a
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/qemu-api/src/vmstate.rs
Log Message:
-----------
rust: vmstate: implement VMState for scalar types
Scalar types are those that have their own VMStateInfo. This poses
a problem in that references to VMStateInfo can only be included in
associated consts starting with Rust 1.83.0, when the const_refs_static
was stabilized. Removing the requirement is done by placing a limited
list of VMStateInfos in an enum, and going from enum to &VMStateInfo
only when building the VMStateField.
The same thing cannot be done with VMS_STRUCT because the set of
VMStateDescriptions extends to structs defined by the devices.
Therefore, structs and cells cannot yet use vmstate_of!.
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 00f89716a8858f6b9274dd4067740fb40212e88b
https://github.com/qemu/qemu/commit/00f89716a8858f6b9274dd4067740fb40212e88b
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/qemu-api/src/vmstate.rs
Log Message:
-----------
rust: vmstate: add public utility macros to implement VMState
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 9a2ba4882d320a650b4f98f92b49bb45956d227e
https://github.com/qemu/qemu/commit/9a2ba4882d320a650b4f98f92b49bb45956d227e
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/qemu-api/src/vmstate.rs
Log Message:
-----------
rust: qemu_api: add vmstate_struct
It is not type safe, but it's the best that can be done without
const_refs_static. It can also be used with BqlCell and BqlRefCell.
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: b800a3132194014928cfbf9d79062da77ea70fee
https://github.com/qemu/qemu/commit/b800a3132194014928cfbf9d79062da77ea70fee
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/lib.rs
Log Message:
-----------
rust: pl011: switch vmstate to new-style macros
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 9d4899496b555751c8ea4155d6da4fc3dbd7edae
https://github.com/qemu/qemu/commit/9d4899496b555751c8ea4155d6da4fc3dbd7edae
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/qemu-api/src/vmstate.rs
Log Message:
-----------
rust: vmstate: remove translation of C vmstate macros
Keep vmstate_clock!; because it uses a field of type VMStateDescription,
it cannot be converted to the VMState trait without access to the
const_refs_static feature.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 24f0e8d818b931758b6dc47f973a6b1b80ecee1f
https://github.com/qemu/qemu/commit/24f0e8d818b931758b6dc47f973a6b1b80ecee1f
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device_class.rs
M rust/qemu-api/src/vmstate.rs
Log Message:
-----------
rust: vmstate: make order of parameters consistent in vmstate_clock
Place struct_name before field_name, similar to offset_of.
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 7d0520398f7f58214cf5242b34c1b46efa2fcf4f
https://github.com/qemu/qemu/commit/7d0520398f7f58214cf5242b34c1b46efa2fcf4f
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/memory_ops.rs
M rust/qemu-api/src/qdev.rs
M rust/qemu-api/src/qom.rs
Log Message:
-----------
rust: prefer NonNull::new to assertions
Do not use new_unchecked; the effect is the same, but the
code is easier to read and unsafe regions become smaller.
Likewise, NonNull::new can be used instead of assertion and
followed by as_ref() or as_mut() instead of dereferencing the
pointer.
Suggested-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: efe5719c64c7fd7e85f65dc378de1ec3776ef3ee
https://github.com/qemu/qemu/commit/efe5719c64c7fd7e85f65dc378de1ec3776ef3ee
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/lib.rs
Log Message:
-----------
rust: pl011: remove unnecessary "extern crate"
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: d1f27ae9ca1c87268b97741c0a2560baa7be4c8b
https://github.com/qemu/qemu/commit/d1f27ae9ca1c87268b97741c0a2560baa7be4c8b
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-23 (Thu, 23 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/lib.rs
Log Message:
-----------
rust: pl011: hide unnecessarily "pub" items from outside pl011::device
The only public interfaces for pl011 are TYPE_PL011 and pl011_create.
Remove pub from everything else.
Note: the "allow(dead_code)" is removed later.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 6d314cc04544969bd83521a315312702b8c166d1
https://github.com/qemu/qemu/commit/6d314cc04544969bd83521a315312702b8c166d1
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/lib.rs
Log Message:
-----------
rust: pl011: extract conversion to RegisterOffset
As an added bonus, this also makes the new function return u32 instead
of u64, thus factoring some casts into a single place.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 137612772e300a386f0f0c31486eae7d1008a68c
https://github.com/qemu/qemu/commit/137612772e300a386f0f0c31486eae7d1008a68c
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust: pl011: extract CharBackend receive logic into a separate function
Prepare for moving all references to the registers and the FIFO into a
separate struct.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: ab6b6a8a55b5434b77dc229f86179c8d3ca55873
https://github.com/qemu/qemu/commit/ab6b6a8a55b5434b77dc229f86179c8d3ca55873
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust: pl011: pull interrupt updates out of read/write ops
qemu_irqs are not part of the vmstate, therefore they will remain in
PL011State. Update them if needed after regs_read()/regs_write().
Apply #[must_use] to functions that return whether the interrupt state
could have changed, so that it's harder to forget the call to update().
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 49bfe63f297f71c5d7e1578a8b69953430b7b532
https://github.com/qemu/qemu/commit/49bfe63f297f71c5d7e1578a8b69953430b7b532
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
Log Message:
-----------
rust: pl011: extract PL011Registers
Pull all the mutable fields of PL011State into a separate struct.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: abc113877b5531f3f639d7532faa6eb54b565166
https://github.com/qemu/qemu/commit/abc113877b5531f3f639d7532faa6eb54b565166
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
Log Message:
-----------
rust: pl011: wrap registers with BqlRefCell
This is a step towards making memory ops use a shared reference to the
device type; it's not yet possible due to the calls to character device
functions.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: e4b43dbcedef7a0992331a3bd51a51017ec3a55c
https://github.com/qemu/qemu/commit/e4b43dbcedef7a0992331a3bd51a51017ec3a55c
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/lib.rs
Log Message:
-----------
rust: pl011: remove duplicate definitions
Unify the "Interrupt" enum and the "INT_*" constants with a struct
that contains the bits. The "int_level" and "int_enabled" fields
could use a crate such as "bitflags".
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: e77a60f95a9295d45e6aa27d6a7fcb59bea2f642
https://github.com/qemu/qemu/commit/e77a60f95a9295d45e6aa27d6a7fcb59bea2f642
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/memory_ops.rs
Log Message:
-----------
rust: pl011: pull device-specific code out of MemoryRegionOps callbacks
read() can now return a simple u64.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 530c47420d7bedc57bf48ae9d312cfe9cddefe81
https://github.com/qemu/qemu/commit/530c47420d7bedc57bf48ae9d312cfe9cddefe81
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
Log Message:
-----------
rust: pl011: drop use of ControlFlow
It is a poor match for what the code is doing, anyway.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: b7e925574b8825a1ac31217ce093677c6716247a
https://github.com/qemu/qemu/commit/b7e925574b8825a1ac31217ce093677c6716247a
Author: Paolo Bonzini <[email protected]>
Date: 2025-01-27 (Mon, 27 Jan 2025)
Changed paths:
M rust/hw/char/pl011/src/device.rs
M rust/qemu-api/src/qdev.rs
Log Message:
-----------
rust: qdev: make reset take a shared reference
Because register reset is within a borrow_mut() call, reset
does not need anymore a mut reference to the PL011State.
Reviewed-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: d83b5c620c0e0e71804334ec3b9e8f7b4802ef96
https://github.com/qemu/qemu/commit/d83b5c620c0e0e71804334ec3b9e8f7b4802ef96
Author: Zhao Liu <[email protected]>
Date: 2025-01-28 (Tue, 28 Jan 2025)
Changed paths:
M rust/qemu-api/src/zeroable.rs
Log Message:
-----------
rust/zeroable: Implement Zeroable with const_zero macro
The `const_zero` crate provides a nice macro to zero type-specific
constants, which doesn't need to enumerates the fields one by one.
Introduce the `const_zero` macro to QEMU (along with its documentation), and
use it to simplify the implementation of `Zeroable` trait.
Suggested-by: Paolo Bonzini <[email protected]>
Signed-off-by: Zhao Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 021d8e747907d4a2226557bf9885d4c0fa6abd8b
https://github.com/qemu/qemu/commit/021d8e747907d4a2226557bf9885d4c0fa6abd8b
Author: Zhao Liu <[email protected]>
Date: 2025-01-28 (Tue, 28 Jan 2025)
Changed paths:
M rust/qemu-api/tests/tests.rs
Log Message:
-----------
rust: qemu-api: add sub-subclass to the integration tests
Signed-off-by: Zhao Liu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Commit: 683a3778f31fce57b4a21554a9052960c15e2713
https://github.com/qemu/qemu/commit/683a3778f31fce57b4a21554a9052960c15e2713
Author: Stefan Hajnoczi <[email protected]>
Date: 2025-01-28 (Tue, 28 Jan 2025)
Changed paths:
M docs/system/cpu-models-x86.rst.inc
M include/exec/memattrs.h
M rust/hw/char/pl011/src/device.rs
M rust/hw/char/pl011/src/device_class.rs
M rust/hw/char/pl011/src/lib.rs
M rust/hw/char/pl011/src/memory_ops.rs
M rust/qemu-api/src/prelude.rs
M rust/qemu-api/src/qdev.rs
M rust/qemu-api/src/qom.rs
M rust/qemu-api/src/vmstate.rs
M rust/qemu-api/src/zeroable.rs
M rust/qemu-api/tests/tests.rs
M stubs/meson.build
M target/i386/cpu.c
M target/i386/cpu.h
M target/i386/tcg/emit.c.inc
M target/i386/tcg/translate.c
Log Message:
-----------
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* target/i386: optimize string instructions
* target/i386: new Sierra Forest and Clearwater Forest models
* rust: type-safe vmstate implementation
* rust: use interior mutability for PL011
* rust: clean ups
* memtxattrs: remove usage of bitfields from MEMTXATTRS_UNSPECIFIED
# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmeYvhoUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroPUigf6Akd/9TCqFauuy09eBtyNnG/FqyEx
# JSCN356OIbDJR0szGeuDdZpiYykSrQzSRoOnbPaywJMw2R20j3Sdc+AhSyVcH6mn
# zVW+UcvvMU+KHpZNbCdNAE/ooLlPHVaSMCtkwJeoA5DuTr6Hy2gAFSsgCDDTvpvr
# AhNrgxS7bxfnG2DH5xVSPQJnXw3HQikJFbi46BBrBZe3VfhZoR/Bt5H2FWVoEVVv
# CUbnBKzWdR2Nhf0bthx+7UK3Sf4WTCYyKL0rjC1BjCXBJZ1k+Eid7uFxQoGSYSJs
# esu5pQmIDJKITAcGxkAvBKYtyH3RU6intodrfQrfL1FCg2oiaXV+CY4ryA==
# =VvKS
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 28 Jan 2025 06:23:06 EST
# gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg: issuer "[email protected]"
# gpg: Good signature from "Paolo Bonzini <[email protected]>" [full]
# gpg: aka "Paolo Bonzini <[email protected]>" [full]
# 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: (48 commits)
rust: qemu-api: add sub-subclass to the integration tests
rust/zeroable: Implement Zeroable with const_zero macro
rust: qdev: make reset take a shared reference
rust: pl011: drop use of ControlFlow
rust: pl011: pull device-specific code out of MemoryRegionOps callbacks
rust: pl011: remove duplicate definitions
rust: pl011: wrap registers with BqlRefCell
rust: pl011: extract PL011Registers
rust: pl011: pull interrupt updates out of read/write ops
rust: pl011: extract CharBackend receive logic into a separate function
rust: pl011: extract conversion to RegisterOffset
rust: pl011: hide unnecessarily "pub" items from outside pl011::device
rust: pl011: remove unnecessary "extern crate"
rust: prefer NonNull::new to assertions
rust: vmstate: make order of parameters consistent in vmstate_clock
rust: vmstate: remove translation of C vmstate macros
rust: pl011: switch vmstate to new-style macros
rust: qemu_api: add vmstate_struct
rust: vmstate: add public utility macros to implement VMState
rust: vmstate: implement VMState for scalar types
...
Signed-off-by: Stefan Hajnoczi <[email protected]>
Compare: https://github.com/qemu/qemu/compare/7faf9d2f12ac...683a3778f31f
To unsubscribe from these emails, change your notification settings at
https://github.com/qemu/qemu/settings/notifications