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: 461855e0d3721bfa27a6ba39328fcbabf5960d2f
      
https://github.com/qemu/qemu/commit/461855e0d3721bfa27a6ba39328fcbabf5960d2f
  Author: Paolo Bonzini <[email protected]>
  Date:   2025-01-23 (Thu, 23 Jan 2025)

  Changed paths:
    M rust/hw/char/pl011/src/device.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: 4c3eea1dea03453d3613a2adc0d48a6358624bcf
      
https://github.com/qemu/qemu/commit/4c3eea1dea03453d3613a2adc0d48a6358624bcf
  Author: Paolo Bonzini <[email protected]>
  Date:   2025-01-23 (Thu, 23 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: 75245a036759f3606e0cecb2d58e15d83e827aa9
      
https://github.com/qemu/qemu/commit/75245a036759f3606e0cecb2d58e15d83e827aa9
  Author: Paolo Bonzini <[email protected]>
  Date:   2025-01-23 (Thu, 23 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: 028404fd69019e52c826f03e14b5acd6fa9186ec
      
https://github.com/qemu/qemu/commit/028404fd69019e52c826f03e14b5acd6fa9186ec
  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

  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: a8f6b1705235d48e010beafc7c825785f0f4b5ae
      
https://github.com/qemu/qemu/commit/a8f6b1705235d48e010beafc7c825785f0f4b5ae
  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

  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: 699f7a5819c39c1c79d3a103506f48b2158d11e4
      
https://github.com/qemu/qemu/commit/699f7a5819c39c1c79d3a103506f48b2158d11e4
  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/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: c1aaf6cdaef3cec7d44e556fc5798a3a8c000f6b
      
https://github.com/qemu/qemu/commit/c1aaf6cdaef3cec7d44e556fc5798a3a8c000f6b
  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/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: ccd90d882629e241aec5dd3cdcdef56b9bb1ec28
      
https://github.com/qemu/qemu/commit/ccd90d882629e241aec5dd3cdcdef56b9bb1ec28
  Author: Paolo Bonzini <[email protected]>
  Date:   2025-01-23 (Thu, 23 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: 8580bd0a20ac3824ac9464f3bae03dcb6a6bf125
      
https://github.com/qemu/qemu/commit/8580bd0a20ac3824ac9464f3bae03dcb6a6bf125
  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/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: ed48da238efc4ace00a46fce9c22683553383802
      
https://github.com/qemu/qemu/commit/ed48da238efc4ace00a46fce9c22683553383802
  Author: Paolo Bonzini <[email protected]>
  Date:   2025-01-23 (Thu, 23 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: 9feb68638e504c91b59e745b94423e8536abfd03
      
https://github.com/qemu/qemu/commit/9feb68638e504c91b59e745b94423e8536abfd03
  Author: Paolo Bonzini <[email protected]>
  Date:   2025-01-23 (Thu, 23 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: 90f73c2d7fd006ef4cfb12d4146cae07afa861c1
      
https://github.com/qemu/qemu/commit/90f73c2d7fd006ef4cfb12d4146cae07afa861c1
  Author: Bibo Mao <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M target/loongarch/tcg/insn_trans/trans_privileged.c.inc
    A target/loongarch/tcg/tcg_loongarch.h
    M target/loongarch/tcg/translate.c

  Log Message:
  -----------
  target/loongarch: Add dynamic function access with CSR register

With CSR register, dynamic function access is used for CSR register
access in TCG mode, so that csr info can be used by other modules.

Signed-off-by: Bibo Mao <[email protected]>


  Commit: 3156b1c1e9eb0954c46346595e6b40af13114fd4
      
https://github.com/qemu/qemu/commit/3156b1c1e9eb0954c46346595e6b40af13114fd4
  Author: Bibo Mao <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M target/loongarch/tcg/insn_trans/trans_privileged.c.inc

  Log Message:
  -----------
  target/loongarch: Remove static CSR function setting

Since CSR function setting is done dynamically in TCG mode, remove
static CSR function setting here.

Signed-off-by: Bibo Mao <[email protected]>


  Commit: 75b2c5da94fc9f94370438d27c179abcc8f424be
      
https://github.com/qemu/qemu/commit/75b2c5da94fc9f94370438d27c179abcc8f424be
  Author: Bibo Mao <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M target/loongarch/tcg/insn_trans/trans_privileged.c.inc

  Log Message:
  -----------
  target/loongarch: Add generic csr function type

Parameter type TCGv and TCGv_ptr for function GenCSRRead and GenCSRWrite
is not used in non-TCG mode. Generic csr function type is added here
with parameter void type, so that it passes to compile with non-TCG mode.

Signed-off-by: Bibo Mao <[email protected]>


  Commit: d03114ea20e043278306f168bcf306a6605ed4a5
      
https://github.com/qemu/qemu/commit/d03114ea20e043278306f168bcf306a6605ed4a5
  Author: Bibo Mao <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    A target/loongarch/csr.h
    M target/loongarch/tcg/insn_trans/trans_privileged.c.inc

  Log Message:
  -----------
  target/loongarch: Add common header file for CSR registers

Common header file csr.h is added here, it can be used by both
TCG mode and kvm mode.

Signed-off-by: Bibo Mao <[email protected]>


  Commit: cb6fa4142f883684c7689944020aa95e422e0578
      
https://github.com/qemu/qemu/commit/cb6fa4142f883684c7689944020aa95e422e0578
  Author: Bibo Mao <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    A target/loongarch/csr.c
    M target/loongarch/csr.h
    M target/loongarch/meson.build
    M target/loongarch/tcg/insn_trans/trans_privileged.c.inc

  Log Message:
  -----------
  target/loongarch: Add common source file for CSR register

Common source file csr.c is added here, it can be used by both
TCG mode and kvm mode. The common code is removed from file
tcg/insn_trans/trans_privileged.c.inc to csrc.c

Signed-off-by: Bibo Mao <[email protected]>


  Commit: b5b13eb712e73545c4323d497ef1fabf7e63c360
      
https://github.com/qemu/qemu/commit/b5b13eb712e73545c4323d497ef1fabf7e63c360
  Author: Bibo Mao <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M target/loongarch/cpu.c
    M target/loongarch/csr.c
    M target/loongarch/csr.h

  Log Message:
  -----------
  target/loongarch: Set unused flag with CSR registers

On LA464, some CSR registers are not used such as CSR_SAVE8 -
CSR_SAVE15, also CSR registers relative with MCE is not used now.

Flag CSRFL_UNUSED is added for these registers, so that it will
not dumped. In order to keep compatiblity, these CSR registers are
not removed since it is used in vmstate already.

Signed-off-by: Bibo Mao <[email protected]>


  Commit: 3215fe8528de45a1794f0314623cc10bd8e8e19f
      
https://github.com/qemu/qemu/commit/3215fe8528de45a1794f0314623cc10bd8e8e19f
  Author: Bibo Mao <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M target/loongarch/cpu.c
    M target/loongarch/csr.c
    M target/loongarch/csr.h

  Log Message:
  -----------
  target/loongarch: Dump all generic CSR registers

CSR registers is import system control registers, it had better
dump all CSR registers when VM is running in system mode.

Here is dump output example of CSR registers:
 CSR000: CRMD   b4               PRMD   4                EUEN   0               
 MISC   0
 CSR004: ECFG   71c1c            ESTAT  0                ERA    
9000000002c31300 BADV   12022c0e0
 CSR008: BADI   2b0000
 CSR012: EENTRY 90000000046b0000
 CSR016: TLBIDX ffffffff8e000228 TLBEHI 120228000        TLBELO0 
400000016f19001f TLBELO1 400000016f1a401f
 CSR024: ASID   a0004            PGDL   90000001016f0000 PGDH   
9000000004680000 PGD    0
 CSR028: PWCL   5e56e            PWCH   2e4              STLBPS e               
 RVACFG 0
 CSR032: CPUID  0                PRCFG1 72f8             PRCFG2 3ffff000        
 PRCFG3 8073f2
 CSR048: SAVE0  0                SAVE1  af9c             SAVE2  12010d6a8       
 SAVE3  8300000
 CSR052: SAVE4  0                SAVE5  0                SAVE6  0               
 SAVE7  0
 CSR064: TID    0                TCFG   8f0ca15          TVAL   4cefd8b         
 CNTC   fffffffffe688aaa
 CSR068: TICLR  0
 CSR096: LLBCTL 1
 CSR136: TLBRENTRY 46ba000       TLBRBADV ffff8000130d81e2 TLBRERA 
9000000003585cb8 TLBRSAVE ffff8000130d81e0
 CSR140: TLBRELO0 1fe00043       TLBRELO1 40             TLBREHI 
ffff8000130d800e TLBRPRMD 0
 CSR384: DMW0   8000000000000001 DMW1   9000000000000011 DMW2   0               
 DMW3   0

Signed-off-by: Bibo Mao <[email protected]>


  Commit: 5f01c60879f0a1dd540c2c25757a57908847e055
      
https://github.com/qemu/qemu/commit/5f01c60879f0a1dd540c2c25757a57908847e055
  Author: Helge Deller <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M linux-user/fd-trans.c

  Log Message:
  -----------
  linux-user: netlink: Add missing IFA_PROTO to 
host_to_target_data_addr_rtattr()

Fix this warning:
 Unknown host IFA type: 11

While adding IFA_PROTO, convert all IFA_XXX values over to QEMU_IFA_XXX values
to avoid a build failure on Ubuntu 22.04 (kernel v5.18 which does not know
IFA_PROTO yet).

Signed-off-by: Helge Deller <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>


  Commit: b97f8d1fa5f783d1ff436b52b29612ecb8793f93
      
https://github.com/qemu/qemu/commit/b97f8d1fa5f783d1ff436b52b29612ecb8793f93
  Author: Helge Deller <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Use unique error messages for cmsg parsing

Avoid using the same error message for two different code paths
as it complicates determining the one which actually triggered.

Signed-off-by: Helge Deller <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>


  Commit: 017fc6620f2513c1d0217289c48be4c51e0167a7
      
https://github.com/qemu/qemu/commit/017fc6620f2513c1d0217289c48be4c51e0167a7
  Author: Helge Deller <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M linux-user/syscall.c
    M linux-user/syscall_defs.h

  Log Message:
  -----------
  linux-user: netlink: Add IP_PKTINFO cmsg parsing

Fixes those warnings:
 Unsupported host ancillary data: 0/8

Signed-off-by: Helge Deller <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>


  Commit: f65464ce6d00fdec726dbd9f8c8c543c3feb2924
      
https://github.com/qemu/qemu/commit/f65464ce6d00fdec726dbd9f8c8c543c3feb2924
  Author: Helge Deller <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: netlink: Add emulation of IP_MULTICAST_IF

Add IP_MULTICAST_IF and share the code with IP_ADD_MEMBERSHIP / 
IP_DROP_MEMBERSHIP.
Sharing the code makes sense, because the manpage of ip(7) says:

IP_MULTICAST_IF (since Linux 1.2)
      Set the local device for a multicast socket.  The argument
      for setsockopt(2) is an ip_mreqn or (since Linux 3.5)
      ip_mreq structure similar to IP_ADD_MEMBERSHIP, or an
      in_addr structure.  (The kernel determines which structure
      is being passed based on the size passed in optlen.)  For
      getsockopt(2), the argument is an in_addr structure.

Signed-off-by: Helge Deller <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>


  Commit: cc9a83155dde604020b4b4b4ad2926d5924b1375
      
https://github.com/qemu/qemu/commit/cc9a83155dde604020b4b4b4ad2926d5924b1375
  Author: Helge Deller <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M linux-user/fd-trans.c

  Log Message:
  -----------
  linux-user: netlink: add netlink neighbour emulation

Fixes various warnings in the testsuite while building gupnp:
 gssdp-net-DEBUG: Failed to send netlink message: Operation not supported
 gupnp-context-DEBUG: Mismatch between host header and host IP (example.com, 
expected: 127.0.0.1)
 gupnp-context-DEBUG: Mismatch between host header and host port (80, expected 
4711)
 gupnp-context-DEBUG: Mismatch between host header and host IP (192.168.1.2, 
expected: 127.0.0.1)
 gupnp-context-DEBUG: Mismatch between host header and host IP (fe80::01, 
expected: 127.0.0.1)
 gupnp-context-DEBUG: Mismatch between host header and host port (80, expected 
4711)
 gupnp-context-DEBUG: Failed to parse HOST header from request: Invalid IPv6 
address ?[fe80::01%1]? in URI
 gupnp-context-DEBUG: Failed to parse HOST header from request: Invalid IPv6 
address ?[fe80::01%eth0]? in URI
 gupnp-context-DEBUG: Failed to parse HOST header from request: Could not parse 
port ?:1? in URI
 gupnp-context-DEBUG: Mismatch between host header and host IP (example.com, 
expected: ::1)
 gupnp-context-DEBUG: Mismatch between host header and host port (80, expected 
4711)
 gupnp-context-DEBUG: Mismatch between host header and host IP (example.com, 
expected: ::1)
 gupnp-context-DEBUG: Mismatch between host header and host port (80, expected 
4711)
 gupnp-context-DEBUG: Mismatch between host header and host IP (example.com, 
expected: ::1)

Signed-off-by: Helge Deller <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>


  Commit: 3719acc273865744b885ad9bcb141b4496c31887
      
https://github.com/qemu/qemu/commit/3719acc273865744b885ad9bcb141b4496c31887
  Author: Helge Deller <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M linux-user/fd-trans.c

  Log Message:
  -----------
  linux-user: netlink: Add missing QEMU_IFLA entries

This fixes the following qemu warnings when building debian gupnp package:
 Unknown host QEMU_IFLA type: 61
 Unknown host QEMU_IFLA type: 58
 Unknown host QEMU_IFLA type: 59
 Unknown host QEMU_IFLA type: 60
 Unknown host QEMU_IFLA type: 32820

QEMU_IFLA type 32820 is actually NLA_NESTED | QEMU_IFLA_PROP_LIST (a nested
entry), which is why rta_type needs to be masked with NLA_TYPE_MASK.

Signed-off-by: Helge Deller <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>


  Commit: 8f9cb50fe6bb15be72e1af4c7676969556d600da
      
https://github.com/qemu/qemu/commit/8f9cb50fe6bb15be72e1af4c7676969556d600da
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M target/loongarch/cpu.c
    A target/loongarch/csr.c
    A target/loongarch/csr.h
    M target/loongarch/meson.build
    M target/loongarch/tcg/insn_trans/trans_privileged.c.inc
    A target/loongarch/tcg/tcg_loongarch.h
    M target/loongarch/tcg/translate.c

  Log Message:
  -----------
  Merge tag 'pull-loongarch-20250124' of https://gitlab.com/bibo-mao/qemu into 
staging

loongarch queue

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQQNhkKjomWfgLCz0aQfewwSUazn0QUCZ5M4AwAKCRAfewwSUazn
# 0aJAAP45/9qfbGSYiMCrBXpRFlyvtRN+GEXHEsERfk9Q1V+tQgEA/mMiUEcyc/xc
# Z1Z27cDoqUFRhPmxbd6/KyTGHzo2+As=
# =Zanw
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 24 Jan 2025 01:49:39 EST
# gpg:                using EDDSA key 0D8642A3A2659F80B0B3D1A41F7B0C1251ACE7D1
# gpg: Good signature from "bibo mao <[email protected]>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 7044 3A00 19C0 E97A 31C7  13C4 8E86 8FB7 A176 9D4C
#      Subkey fingerprint: 0D86 42A3 A265 9F80 B0B3  D1A4 1F7B 0C12 51AC E7D1

* tag 'pull-loongarch-20250124' of https://gitlab.com/bibo-mao/qemu:
  target/loongarch: Dump all generic CSR registers
  target/loongarch: Set unused flag with CSR registers
  target/loongarch: Add common source file for CSR register
  target/loongarch: Add common header file for CSR registers
  target/loongarch: Add generic csr function type
  target/loongarch: Remove static CSR function setting
  target/loongarch: Add dynamic function access with CSR register

Signed-off-by: Stefan Hajnoczi <[email protected]>


  Commit: 1e6705c6f4f6983fe03fea9eacf5a7a3986bcb3e
      
https://github.com/qemu/qemu/commit/1e6705c6f4f6983fe03fea9eacf5a7a3986bcb3e
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2025-01-24 (Fri, 24 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/vSX3jHroMFAmeShakUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroPjZAf8D5OY+b+QjpraVZPZjK/KNa3nzcui
# WdNPDFj5hmHNkw+mgqsKhdmbRST53cn5+9wnYGKuGvNQijmZN7+9b3yL23LwrruB
# +HME2iLNB4sitE6LmPGU4bOXnqjMmNWPRcijtNfS8Of6tZl5y5gWLalCmVq6A9Ro
# 3mcVJ1Hrlhb4NNuJW6jwlQ/J2nUYQc+45FxvapE/rjso73P2rwWgoAnNQtzIONje
# T2UEzs1E2HH1zH7A4Z8q/OtJuT34IJT5dGeobSH+GTurKVjHE17OMfCdPrHua+lv
# RifBJj58yVp9ogJCEEPXyFFwT+6bjub1jVecChiGLoQVtu9silUUR7ylaA==
# =B4/y
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 23 Jan 2025 13:08:41 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]>


  Commit: d1371c356cb5e39f9db0692098ece7ac3dd01775
      
https://github.com/qemu/qemu/commit/d1371c356cb5e39f9db0692098ece7ac3dd01775
  Author: Stefan Hajnoczi <[email protected]>
  Date:   2025-01-24 (Fri, 24 Jan 2025)

  Changed paths:
    M linux-user/fd-trans.c
    M linux-user/syscall.c
    M linux-user/syscall_defs.h

  Log Message:
  -----------
  Merge tag 'linux-user-fix-gupnp-pull-request' of 
https://github.com/hdeller/qemu-hppa into staging

linux-user: Add support for various missing netlink sockopt entries

Add missing sockopt calls and thus fix building the debian gupnp package in a 
chroot.

This fixes debian bug report:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1044651

Signed-off-by: Helge Deller <[email protected]>

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCZ5OPdwAKCRD3ErUQojoP
# X9EWAP0ZvoDehmNzgWMlUpWT+d4O06kMsrDsi+tRddUUSJgp4wEAuuycr4go4b9b
# 6xLDLr81C7MFEGsztGcRVhPwVdDJxAU=
# =Lw8U
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 24 Jan 2025 08:02:47 EST
# gpg:                using EDDSA key BCE9123E1AD29F07C049BBDEF712B510A23A0F5F
# gpg: Good signature from "Helge Deller <[email protected]>" [unknown]
# gpg:                 aka "Helge Deller <[email protected]>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 4544 8228 2CD9 10DB EF3D  25F8 3E5F 3D04 A7A2 4603
#      Subkey fingerprint: BCE9 123E 1AD2 9F07 C049  BBDE F712 B510 A23A 0F5F

* tag 'linux-user-fix-gupnp-pull-request' of 
https://github.com/hdeller/qemu-hppa:
  linux-user: netlink: Add missing QEMU_IFLA entries
  linux-user: netlink: add netlink neighbour emulation
  linux-user: netlink: Add emulation of IP_MULTICAST_IF
  linux-user: netlink: Add IP_PKTINFO cmsg parsing
  linux-user: Use unique error messages for cmsg parsing
  linux-user: netlink: Add missing IFA_PROTO to 
host_to_target_data_addr_rtattr()

Signed-off-by: Stefan Hajnoczi <[email protected]>


Compare: https://github.com/qemu/qemu/compare/cf86770c7aa3...d1371c356cb5

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications

Reply via email to