[RFC PATCH QEMU 2/3] plugins: Add cache miss reporting over a socket.

2025-01-24 Thread Jonathan Cameron via
This allows an external program to act as a hotness tracker. Signed-off-by: Jonathan Cameron --- contrib/plugins/cache.c | 75 + 1 file changed, 68 insertions(+), 7 deletions(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 7baff868

[PATCH 47/76] target/arm: Implement FPCR.AH semantics for FMAXV and FMINV

2025-01-24 Thread Peter Maydell
Implement the FPCR.AH semantics for FMAXV and FMINV. These are the "recursively reduce all lanes of a vector to a scalar result" insns; we just need to use the _ah_ helper for the reduction step when FPCR.AH == 1. Signed-off-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 28

Re: [PATCH 20/28] target/riscv: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h | 9 + target/riscv/internals.h | 3 --- target/riscv/cpu.c | 8 +++- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/target/riscv/cpu.h b/tar

Re: [PATCH 12/28] target/hppa: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/hppa/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 21/28] target/rx: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 0/2] target/i386: Fix 0 * Inf + QNaN regression

2025-01-24 Thread Paolo Bonzini
Queued, thanks. Paolo

[PATCH 0/2] hw/char/sh_serial: QOM housekeeping

2025-01-24 Thread Philippe Mathieu-Daudé
- Parity in realize / unrealize - Define TypeInfo structure Philippe Mathieu-Daudé (2): hw/char/sh_serial: Delete fifo_timeout_timer in DeviceUnrealize hw/char/sh_serial: Convert to TypeInfo hw/char/sh_serial.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-)

Re: [PATCH] docs/system/arm/aspeed: Remove tacoma-bmc from the documentation

2025-01-24 Thread Cédric Le Goater
On 1/24/25 18:45, Thomas Huth wrote: The tacoma-bmc machine has recently been removed, so let's remove it from the documentation now, too. Fixes: 2b1b66e01f ("arm: Remove tacoma-bmc machine") Signed-off-by: Thomas Huth Reviewed-by: Cédric Le Goater Thanks, C. --- docs/system/arm/aspe

Re: [PATCH 06/28] cpus: Un-inline cpu_has_work()

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: In order to expand cpu_has_work(), un-inline it. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 6 +- hw/core/cpu-system.c | 6 ++ 2 files changed, 7 insertions(+), 5 deletions(-) Reviewed-by: Richard Henderson r

Re: [PATCH 3/5] tests/functional/test_mipsel_malta: Convert the mipsel replay tests

2025-01-24 Thread Daniel P . Berrangé
On Fri, Jan 24, 2025 at 03:15:27PM +0100, Thomas Huth wrote: > Move the mipsel replay tests from tests/avocado/replay_kernel.py to > the functional framework. Since the functional tests should be run per > target, we cannot stick all replay tests in one file. Thus let's add > these tests to the fil

Re: [PATCH 17/28] target/mips: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Move has_work() from CPUClass to SysemuCPUOps and cpu_mips_hw_interrupts_enabled() to system. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 4 ++-- target/mips/cpu.c | 4 +++- 2 files changed, 5 insertions(+), 3 delet

Re: [PATCH 11/28] target/hexagon: Remove CPUClass:has_work() handler

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Remove as unreachable code. Signed-off-by: Philippe Mathieu-Daudé --- target/hexagon/cpu.c | 6 -- 1 file changed, 6 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 05/28] cpus: Restrict cpu_has_work() to system emulation

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: This method is not used on user emulation, because there is always work to do there. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) Reviewed

Re: [PATCH 15/28] target/m68k: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/m68k/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~ diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 41dfdf58045..eb7fb4f7e4c 100644

Re: [PATCH 16/28] target/microblaze: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 23/28] target/s390x: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Move has_work() from CPUClass to SysemuCPUOps, move s390_cpu_has_work() to cpu-system.c so it is only build for system emulation binaries, restrict functions not used anymore on user emulation in interrupt.c. Signed-off-by: Philippe Mathieu-Daudé -

Re: [PATCH 26/28] target/tricore: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/tricore/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-24 Thread Eric Auger
Hi, On 1/24/25 4:41 AM, Jason Wang wrote: > On Fri, Jan 24, 2025 at 11:30 AM Jason Wang wrote: >> On Fri, Jan 24, 2025 at 10:44 AM Duan, Zhenzhong >> wrote: >>> >>> -Original Message- From: Eric Auger Subject: Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOM

[PULL 2/2] hw/hppa: Fix booting Linux kernel with initrd

2025-01-24 Thread deller
From: Helge Deller Commit 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()") broke booting the Linux kernel with initrd which may have been provided on the command line. The problem is, that the mentioned commit zeroes out initial registers which were preset with addresses for the L

[PULL 1/2] hw/hppa: Support up to 256 GiB RAM on 64-bit machines

2025-01-24 Thread deller
From: Helge Deller Allow up to 256 GB RAM, which is the maximum a rp8440 machine (the very last 64-bit PA-RISC machine) physically supports. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- hw/hppa/hppa_hardware.h | 2 ++ hw/hppa/machine.c | 26 +++---

[PULL 0/2] Hppa system for v10 patches

2025-01-24 Thread deller
From: Helge Deller The following changes since commit 32a97c5d05c5deb54a42315d48cecf86cbeadaf4: Merge tag 'pull-tcg-20250117' of https://gitlab.com/rth7680/qemu into staging (2025-01-21 08:28:33 -0500) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git tags/h

Re: [PATCH v1 1/4] x86-disas: add x86-mini instruction set metadata

2025-01-24 Thread Michael Clark
On 1/24/25 13:10, Michael Clark wrote: this metadata is based on x86-csv with numerous inaccuracies fixed plus conversion of legacy instructions to a new LEX format. this metadata has been fuzz-tested against the LLVM disassembler for x86-64 with 64-bit ISA coverage in the order of ~99.9%. addi

Re: [PATCH v2 5/5] vfio/igd: handle x-igd-opregion in vfio_probe_igd_config_quirk()

2025-01-24 Thread Alex Williamson
On Sat, 25 Jan 2025 03:12:45 +0800 Tomita Moeko wrote: > Both enable opregion option (x-igd-opregion) and legacy mode require > setting up OpRegion copy for IGD devices. Move x-igd-opregion handler > in vfio_realize() to vfio_probe_igd_config_quirk() to elimate duplicate > code. Finally we moved

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-24 Thread Peter Xu
On Fri, Jan 24, 2025 at 05:47:45PM +0800, Xu Yilun wrote: > On Thu, Jan 23, 2025 at 11:47:17AM -0500, Peter Xu wrote: > > On Thu, Jan 23, 2025 at 05:33:53PM +0800, Xu Yilun wrote: > > > On Wed, Jan 22, 2025 at 11:43:01AM -0500, Peter Xu wrote: > > > > On Wed, Jan 22, 2025 at 05:41:31PM +0800, Xu Yi

[PATCH 59/76] target/arm: Handle FPCR.AH in negation steps in SVE FCADD

2025-01-24 Thread Peter Maydell
The negation steps in FCADD must honour FPCR.AH's "don't change the sign of a NaN" semantics. Implement this in the same way we did for the base ASIMD FCADD, by encoding FPCR.AH into the SIMD data field passed to the helper and using that to decide whether to negate the values. Signed-off-by: Pet

Re: [PATCH 02/28] target/rx: Ensure not being build on user emulation

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Currently only system emulation is supported. Assert no target code is built for user emulation. Remove #ifdef'ry since more work is required before being able to emulate a user process. Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.h

Re: [PATCH 11/28] target/hexagon: Remove CPUClass:has_work() handler

2025-01-24 Thread Brian Cain
On 1/21/2025 8:23 AM, Philippe Mathieu-Daudé wrote: Remove as unreachable code. Signed-off-by: Philippe Mathieu-Daudé --- Reviewed-by: Brian Cain target/hexagon/cpu.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 0b7fc98f6c

Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-24 Thread Eric Auger
Hi Zhenzhong, On 1/24/25 3:44 AM, Duan, Zhenzhong wrote: > >> -Original Message- >> From: Eric Auger >> Subject: Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets >> disabled >> >> Hi Jason, >> >> >> On 1/23/25 2:34 AM, Jason Wang wrote: >>> On Wed, Jan 22, 2025 at 3:5

Re: [PATCH 2/2] hw/hppa: Fix booting Linux kernel with initrd

2025-01-24 Thread Richard Henderson
On 1/22/25 10:09, del...@kernel.org wrote: From: Helge Deller Commit 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()") broke booting the Linux kernel with initrd which may have been provided on the command line. The problem is, that the mentioned commit zeroes out initial register

Re: [PATCH 28/28] cpus: Remove CPUClass::has_work() handler

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 7b16bda2250..7f287984aa6 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -25,12 +25,8 @@ bool cpu_has_work(CPUState *cpu) { -if (cpu->cc->sysemu_ops->has_work

Re: [PATCH 1/2] hw/hppa: Support up to 256 GiB RAM on 64-bit machines

2025-01-24 Thread Richard Henderson
On 1/22/25 10:09, del...@kernel.org wrote: From: Helge Deller Allow up to 256 GB RAM, which is the maximum a rp8440 machine (the very last 64-bit PA-RISC machine) physically supports. Signed-off-by: Helge Deller --- hw/hppa/hppa_hardware.h | 2 ++ hw/hppa/machine.c | 26

[PATCH 2/2] hw/char/sh_serial: Convert to TypeInfo

2025-01-24 Thread Philippe Mathieu-Daudé
QOM types are now registered using as TypeInfo via DEFINE_TYPES() or type_init(). Update TYPE_SH_SERIAL, removing the empty QOM instance_init/finalize handlers. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sh_serial.c | 23 +++ 1 file changed, 11 insertions(+), 12 deleti

[PATCH 1/2] hw/char/sh_serial: Delete fifo_timeout_timer in DeviceUnrealize

2025-01-24 Thread Philippe Mathieu-Daudé
fifo_timeout_timer is created in the DeviceRealize handler, not in the instance_init one. For parity, delete it in DeviceUnrealize, rather than instance_finalize. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sh_serial.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --

Re: [PATCH 1/2] hw/hppa: Support up to 256 GiB RAM on 64-bit machines

2025-01-24 Thread Philippe Mathieu-Daudé
On 22/1/25 19:09, del...@kernel.org wrote: From: Helge Deller Allow up to 256 GB RAM, which is the maximum a rp8440 machine (the very last 64-bit PA-RISC machine) physically supports. Signed-off-by: Helge Deller --- hw/hppa/hppa_hardware.h | 2 ++ hw/hppa/machine.c | 26

Re: [PATCH 2/2] hw/cxl: Allow tracing component I/O accesses

2025-01-24 Thread Jonathan Cameron via
On Thu, 23 Jan 2025 09:51:51 + Jonathan Cameron via wrote: > On Wed, 22 Jan 2025 07:56:24 +0100 > Philippe Mathieu-Daudé wrote: > > > Map the component I/O region as UnimplementedDevice > > to be able to trace guest I/O accesses with '-d unimp'. > > > > Signed-off-by: Philippe Mathieu-Daud

Re: [PATCH 13/28] target/i386: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Move has_work() from CPUClass to SysemuCPUOps, restrict x86_cpu_pending_interrupt() to system. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.h | 4 ++-- target/i386/cpu.c | 8 +++- 2 files changed, 5 insertions(+), 7 deletions(-

Re: [PATCH 14/28] target/loongarch: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/cpu.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 02/76] tests/tcg/x86_64/fma: Test some x86 fused-multiply-add cases

2025-01-24 Thread Alex Bennée
Peter Maydell writes: > Add a test case which tests some corner case behaviour of > fused-multiply-add on x86: > * 0 * Inf + SNaN should raise Invalid > * 0 * Inf + QNaN shouldh not raise Invalid > * tininess should be detected after rounding > > There is also one currently-disabled test case:

Re: [PATCH v3] hw/usb/hcd-ehci: Fix debug printf format string

2025-01-24 Thread Philippe Mathieu-Daudé
On 24/1/25 13:47, BALATON Zoltan wrote: The variable is uint64_t so needs %PRIu64 instead of %d. Fixes: 3ae7eb88c47 ("ehci: fix overflow in frame timer code") Signed-off-by: BALATON Zoltan Reviewed-by: Peter Maydell --- v3: Fixed commit message to match what the patch actually does hw/usb/h

Re: [PATCH 08/28] target/alpha: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 10/28] target/avr: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/avr/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 19/28] target/ppc: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 18/28] target/openrisc: Move has_work() from CPUClass to SysemuCPUOps

2025-01-24 Thread Richard Henderson
On 1/21/25 06:23, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/openrisc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v1 1/3] hw/s390x: add SCLP event type CPI

2025-01-24 Thread Nina Schoetterl-Glausch
Please swap patch 1 and 2 and incorporate the changes of write_event_data into this patch. Reviewed-by: Nina Schoetterl-Glausch See some minor nits below. On Wed, 2025-01-15 at 14:31 +0100, Shalini Chellathurai Saroja wrote: > This commit implements the SCLP event type Control-Program > Identif

[PATCH 67/76] target/arm: Handle FPCR.AH in SVE FTMAD

2025-01-24 Thread Peter Maydell
The negation step in the SVE FTMAD insn mustn't negate a NaN when FPCR.AH is set. Pass FPCR.AH to the helper via the SIMD data field and use that to determine whether to do the negation. Signed-off-by: Peter Maydell --- target/arm/tcg/sve_helper.c| 21 +++-- target/arm/tcg/t

[RFC PATCH QEMU 1/3] hw/cxl: Initial CXL Hotness Monitoring Unit Emulation

2025-01-24 Thread Jonathan Cameron via
Intended to support enabling in kernel. For now this is dumb and the data made up. That will change in the near future. Instantiates 3 instances within one CHMU with separate interrupts. Signed-off-by: Jonathan Cameron --- include/hw/cxl/cxl.h| 1 + include/hw/cxl/cxl_chmu.h | 154

Re: [PULL 00/48] i386, rust changes for 2024-01-24

2025-01-24 Thread Stefan Hajnoczi
On Fri, 24 Jan 2025 at 04:52, Paolo Bonzini wrote: > > The following changes since commit d6430c17d7113d3c38480dc34e59d00b0504e2f7: > > Merge tag 'pull-riscv-to-apply-20250119-1' of > https://github.com/alistair23/qemu into staging (2025-01-19 08:55:46 -0500) > > are available in the Git reposi

[PATCH v2 1/5] vfio/igd: remove GTT write quirk in IO BAR 4

2025-01-24 Thread Tomita Moeko
The IO BAR4 of IGD devices contains a pair of 32-bit address/data registers, MMIO_Index (0x0) and MMIO_Data (0x4), which provide access to the MMIO BAR0 (GTTMMADR) from IO space. These registers are probably only used by the VBIOS, and are not documented by intel. The observed layout of MMIO_Index

[PATCH v2 3/5] vfio/igd: refactor vfio_probe_igd_bar4_quirk() into pci config quirk

2025-01-24 Thread Tomita Moeko
The actual IO BAR4 write quirk in vfio_probe_igd_bar4_quirk() was removed in previous change, leaving the function not matching its name, so move it into the newly introduced vfio_config_quirk_setup(). There is no functional change in this commit. If any failure occurs, the function simply returns

[PATCH v2 4/5] vfio/igd: do not include GTT stolen size in etc/igd-bdsm-size

2025-01-24 Thread Tomita Moeko
Though GTT Stolen Memory (GSM) is right below Data Stolen Memory (DSM) in host address space, direct access to GSM is prohibited, and it is not mapped to guest address space. Both host and guest accesses GSM indirectly through the second half of MMIO BAR0 (GTTMMADR). Guest firmware only need to re

[PATCH v2 0/5] vfio/igd: remove incorrect IO BAR4 quirk

2025-01-24 Thread Tomita Moeko
Based on experiments and reverse engineering about the mysterious IO BAR4, it appears that the current quirk implementation is incorrect. As discussed in a previous mail thread [1], current implementation believes VBIOS is writing HPA of Data Stolen Memory (DSM) in GTT entries, so it intercepts and

[PATCH v2 2/5] vfio/pci: add placeholder for device-specific config space quirks

2025-01-24 Thread Tomita Moeko
Some devices, such as IGD, require device-specific quirks to be applied to their pci config spaces. Currently, these quirks are either part of BAR quirk, or being a part of vfio_realize(). Add a placeholder for pci config quirks for moving the quirks to one place later. Signed-off-by: Tomita Moeko

[PATCH v2 5/5] vfio/igd: handle x-igd-opregion in vfio_probe_igd_config_quirk()

2025-01-24 Thread Tomita Moeko
Both enable opregion option (x-igd-opregion) and legacy mode require setting up OpRegion copy for IGD devices. Move x-igd-opregion handler in vfio_realize() to vfio_probe_igd_config_quirk() to elimate duplicate code. Finally we moved all the IGD-related code into igd.c. Signed-off-by: Tomita Moeko

Re: [PATCH v2 01/10] hw/core/generic-loader: Do not open-code cpu_set_pc()

2025-01-24 Thread Richard Henderson
On 1/22/25 01:30, Philippe Mathieu-Daudé wrote: Directly call cpu_set_pc() instead of open-coding it. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/generic-loader.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c

[PATCH v3 1/2] s390x/pci: add support for guests that request direct mapping

2025-01-24 Thread Matthew Rosato
When receiving a guest mpcifc(4) or mpcifc(6) instruction without the T bit set, treat this as a request to perform direct mapping instead of address translation. In order to facilitate this, pin the entirety of guest memory into the host iommu. Pinning for the direct mapping case is handled via

Re: [PATCH v7 1/6] coreaudio: Remove unnecessary explicit casts

2025-01-24 Thread Christian Schoenebeck
On Friday, January 24, 2025 6:12:04 AM CET Akihiko Odaki wrote: > coreaudio had unnecessary explicit casts and they had extra whitespaces > around them so remove them. > > Signed-off-by: Akihiko Odaki > --- > audio/coreaudio.m | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > di

[PULL 26/48] rust: vmstate: implement VMState for non-leaf types

2025-01-24 Thread Paolo Bonzini
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 --- rust/qemu-api/src/vmstate.rs | 79 +++- 1 file changed

[PULL 40/48] rust: pl011: pull interrupt updates out of read/write ops

2025-01-24 Thread Paolo Bonzini
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

[PULL 12/48] target/i386: execute multiple REP/REPZ iterations without leaving TB

2025-01-24 Thread Paolo Bonzini
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 mai

[PULL 32/48] rust: pl011: switch vmstate to new-style macros

2025-01-24 Thread Paolo Bonzini
Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 3 ++- rust/hw/char/pl011/src/device_class.rs | 36 +- rust/hw/char/pl011/src/lib.rs | 6 + 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/rust

[PULL 29/48] rust: vmstate: implement VMState for scalar types

2025-01-24 Thread Paolo Bonzini
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

[PULL 37/48] rust: pl011: hide unnecessarily "pub" items from outside pl011::device

2025-01-24 Thread Paolo Bonzini
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 Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 2 +- rust/hw/char/pl011/src/device_class.rs |

[PULL 27/48] rust: vmstate: add varray support to vmstate_of!

2025-01-24 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/vmstate.rs | 42 ++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/vmstate.rs index 211c3d096b7..2b14d4839df 100644 --- a/rust/qemu-api/src/vmstate

Re: [PATCH v7 2/6] coreaudio: Remove extra whitespaces

2025-01-24 Thread Christian Schoenebeck
On Friday, January 24, 2025 6:12:05 AM CET Akihiko Odaki wrote: > Remove extra whitespaces around parentheses. > > Signed-off-by: Akihiko Odaki > --- > audio/coreaudio.m | 108 > +++--- > 1 file changed, 54 insertions(+), 54 deletions(-) > > diff

Re: [PATCH] target/riscv: rvv: Fix incorrect vlen comparison in prop_vlen_set

2025-01-24 Thread Daniel Henrique Barboza
On 1/24/25 6:05 AM, Max Chou wrote: In prop_vlen_set function, there is an incorrect comparison between vlen(bit) and vlenb(byte). This will cause unexpected error when user applies the `vlen=1024` cpu option with a vendor predefined cpu type that the default vlen is 1024(vlenb=128). Fixes:

[PULL 00/48] i386, rust changes for 2024-01-24

2025-01-24 Thread Paolo Bonzini
The following changes since commit d6430c17d7113d3c38480dc34e59d00b0504e2f7: Merge tag 'pull-riscv-to-apply-20250119-1' of https://github.com/alistair23/qemu into staging (2025-01-19 08:55:46 -0500) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstrea

Re: [PATCH] target/riscv: rvv: Fix unexpected behavior of vector reduction instructions when vl is 0

2025-01-24 Thread Daniel Henrique Barboza
On 1/24/25 7:14 AM, Max Chou wrote: According to the Vector Reduction Operations section in the RISC-V "V" Vector Extension spec, "If vl=0, no operation is performed and the destination register is not updated." The vd should be updated when vl is larger than 0. Fixes: fe5c9ab1fc ("target/

[PULL 41/48] rust: pl011: extract PL011Registers

2025-01-24 Thread Paolo Bonzini
Pull all the mutable fields of PL011State into a separate struct. Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 251 ++--- rust/hw/char/pl011/src/device_class.rs | 46 +++-- 2 files changed, 168 insertions(+), 129 deletions(

Re: [PATCH 05/11] acpi/generic_event_device: add logic to detect if HEST addr is available

2025-01-24 Thread Igor Mammedov
On Wed, 22 Jan 2025 16:46:22 +0100 Mauro Carvalho Chehab wrote: > Create a new property (x-has-hest-addr) and use it to detect if > the GHES table offsets can be calculated from the HEST address > (qemu 9.2 and upper) or via the legacy way via an offset obtained 10.0 by now > from the hardware_

Re: [PATCH 08/11] acpi/generic_event_device: add an APEI error device

2025-01-24 Thread Igor Mammedov
On Wed, 22 Jan 2025 16:46:25 +0100 Mauro Carvalho Chehab wrote: > Adds a generic error device to handle generic hardware error > events as specified at ACPI 6.5 specification at 18.3.2.7.2: > https://uefi.org/specs/ACPI/6.5/18_Platform_Error_Interfaces.html#event-notification-for-generic-error-so

Re: [PATCH v6 3/5] coreaudio: Commit the result of init in the end

2025-01-24 Thread BALATON Zoltan
On Fri, 24 Jan 2025, Akihiko Odaki wrote: init_out_device may only commit some part of the result and leave the state inconsistent when it encounters a fatal error or the device gets unplugged during the operation, which is expressed by kAudioHardwareBadObjectError or kAudioHardwareBadDeviceError

Re: [PATCH] target/mips: fix possible int overflow

2025-01-24 Thread Peter Maydell
On Fri, 24 Jan 2025 at 12:27, wrote: > > From: Denis Rastyogin > > Fix possible overflow in 1 << (DF_BITS(df) - 2) when DF_BITS(df) > is 64 by using a 64-bit integer for the shift operation. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Reported-by: Dmitriy Fedin > Si

Re: [PATCH v2] hw/usb/hcd-ehci: Fix debug printf format string

2025-01-24 Thread Peter Maydell
On Fri, 24 Jan 2025 at 02:53, BALATON Zoltan wrote: > > The variable is uint64_t so needs %ld instead of %d. > > Fixes: 3ae7eb88c47 ("ehci: fix overflow in frame timer code") > Signed-off-by: BALATON Zoltan > --- > hw/usb/hcd-ehci.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Revi

Re: [PATCH v6 3/5] coreaudio: Commit the result of init in the end

2025-01-24 Thread BALATON Zoltan
On Fri, 24 Jan 2025, BALATON Zoltan wrote: On Fri, 24 Jan 2025, Akihiko Odaki wrote: init_out_device may only commit some part of the result and leave the state inconsistent when it encounters a fatal error or the device gets unplugged during the operation, which is expressed by kAudioHardwareBa

Re: [PATCH 10/11] qapi/acpi-hest: add an interface to do generic CPER error injection

2025-01-24 Thread Igor Mammedov
On Wed, 22 Jan 2025 16:46:27 +0100 Mauro Carvalho Chehab wrote: > Creates a QMP command to be used for generic ACPI APEI hardware error > injection (HEST) via GHESv2, and add support for it for ARM guests. > > Error injection uses ACPI_HEST_SRC_ID_QMP source ID to be platform > independent. This

Re: [PATCH 10/11] qapi/acpi-hest: add an interface to do generic CPER error injection

2025-01-24 Thread Igor Mammedov
On Thu, 23 Jan 2025 11:00:32 + Jonathan Cameron wrote: > On Wed, 22 Jan 2025 16:46:27 +0100 > Mauro Carvalho Chehab wrote: > > > Creates a QMP command to be used for generic ACPI APEI hardware error > > injection (HEST) via GHESv2, and add support for it for ARM guests. > > > > Error injec

[PATCH v7 13/52] i386/tdx: Set APIC bus rate to match with what TDX module enforces

2025-01-24 Thread Xiaoyao Li
TDX advertises core crystal clock with cpuid[0x15] as 25MHz for TD guests and it's unchangeable from VMM. As a result, TDX guest reads the APIC timer as the same frequency, 25MHz. While KVM's default emulated frequency for APIC bus is 1GHz, set the APIC bus rate to match with TDX explicitly to ens

[PATCH v7 15/52] i386/tdx: load TDVF for TD guest

2025-01-24 Thread Xiaoyao Li
From: Chao Peng TDVF(OVMF) needs to run at private memory for TD guest. TDX cannot support pflash device since it doesn't support read-only private memory. Thus load TDVF(OVMF) with -bios option for TDs. Use memory_region_init_ram_guest_memfd() to allocate the MemoryRegion for TDVF because it ne

[PATCH v7 05/52] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2025-01-24 Thread Xiaoyao Li
KVM provides TDX capabilities via sub command KVM_TDX_CAPABILITIES of IOCTL(KVM_MEMORY_ENCRYPT_OP). Get the capabilities when initializing TDX context. It will be used to validate user's setting later. Since there is no interface reporting how many cpuid configs contains in KVM_TDX_CAPABILITIES, Q

[PATCH v7 11/52] i386/tdx: Wire CPU features up with attributes of TD guest

2025-01-24 Thread Xiaoyao Li
For QEMU VMs, - PKS is configured via CPUID_7_0_ECX_PKS, e.g., -cpu xxx,+pks and - PMU is configured by x86cpu->enable_pmu, e.g., -cpu xxx,pmu=on While the bit 30 (PKS) and bit 63 (PERFMON) of TD's attributes are also used to configure the PKS and PERFMON/PMU of TD, reuse the existing configu

[PATCH v7 10/52] i386/tdx: Make sept_ve_disable set by default

2025-01-24 Thread Xiaoyao Li
From: Isaku Yamahata For TDX KVM use case, Linux guest is the most major one. It requires sept_ve_disable set. Make it default for the main use case. For other use case, it can be enabled/disabled via qemu command line. Signed-off-by: Isaku Yamahata Signed-off-by: Xiaoyao Li --- target/i38

[PATCH v7 17/52] i386/tdx: Parse TDVF metadata for TDX VM

2025-01-24 Thread Xiaoyao Li
After TDVF is loaded to bios MemoryRegion, it needs parse TDVF metadata. Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann --- hw/i386/pc_sysfw.c | 7 +++ target/i386/kvm/tdx-stub.c | 5 + target/i386/kvm/tdx.c | 5 + target/i386/kvm/tdx.h | 3 +++ 4 files changed,

[PATCH v7 12/52] i386/tdx: Validate TD attributes

2025-01-24 Thread Xiaoyao Li
Validate TD attributes with tdx_caps that only supported bits arer allowed by KVM. Besides, sanity check the attribute bits that have not been supported by QEMU yet. e.g., debug bit, it will be allowed in the future when debug TD support lands in QEMU. Signed-off-by: Xiaoyao Li Acked-by: Gerd Ho

[PATCH v7 16/52] i386/tdvf: Introduce function to parse TDVF metadata

2025-01-24 Thread Xiaoyao Li
From: Isaku Yamahata TDX VM needs to boot with its specialized firmware, Trusted Domain Virtual Firmware (TDVF). QEMU needs to parse TDVF and map it in TD guest memory prior to running the TDX VM. A TDVF Metadata in TDVF image describes the structure of firmware. QEMU refers to it to setup memor

[PATCH v7 37/52] i386/tdx: Only configure MSR_IA32_UCODE_REV in kvm_init_msrs() for TDs

2025-01-24 Thread Xiaoyao Li
For TDs, only MSR_IA32_UCODE_REV in kvm_init_msrs() can be configured by VMM, while the features enumerated/controlled by other MSRs except MSR_IA32_UCODE_REV in kvm_init_msrs() are not under control of VMM. Only configure MSR_IA32_UCODE_REV for TDs. Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoff

[PATCH v7 03/52] i386/tdx: Implement tdx_kvm_type() for TDX

2025-01-24 Thread Xiaoyao Li
TDX VM requires VM type to be KVM_X86_TDX_VM. Implement tdx_kvm_type() as X86ConfidentialGuestClass->kvm_type. Signed-off-by: Xiaoyao Li --- Changes in v6: - new added patch; --- target/i386/kvm/kvm.c | 1 + target/i386/kvm/tdx.c | 12 2 files changed, 13 insertions(+) diff --git

[PATCH v7 40/52] i386/cgs: Rename *mask_cpuid_features() to *adjust_cpuid_features()

2025-01-24 Thread Xiaoyao Li
Because for TDX case, there are also fixed-1 bits that enfored by TDX module. Signed-off-by: Xiaoyao Li --- target/i386/confidential-guest.h | 20 ++-- target/i386/kvm/kvm.c| 2 +- target/i386/sev.c| 4 ++-- 3 files changed, 13 insertions(+), 13 dele

[PATCH v7 18/52] i386/tdx: Don't initialize pc.rom for TDX VMs

2025-01-24 Thread Xiaoyao Li
For TDX, the address below 1MB are entirely general RAM. No need to initialize pc.rom memory region for TDs. Signed-off-by: Xiaoyao Li --- This is more as a workaround of the issue that for q35 machine type, the real memslot update (which requires memslot deletion )for pc.rom happens after tdx_in

[PATCH v7 23/52] i386/tdx: Add TDVF memory via KVM_TDX_INIT_MEM_REGION

2025-01-24 Thread Xiaoyao Li
From: Isaku Yamahata TDVF firmware (CODE and VARS) needs to be copied to TD's private memory via KVM_TDX_INIT_MEM_REGION, as well as TD HOB and TEMP memory. If the TDVF section has TDVF_SECTION_ATTRIBUTES_MR_EXTEND set in the flag, calling KVM_TDX_EXTEND_MEMORY to extend the measurement. After

[PATCH v7 22/52] i386/tdx: Setup the TD HOB list

2025-01-24 Thread Xiaoyao Li
The TD HOB list is used to pass the information from VMM to TDVF. The TD HOB must include PHIT HOB and Resource Descriptor HOB. More details can be found in TDVF specification and PI specification. Build the TD HOB in TDX's machine_init_done callback. Co-developed-by: Isaku Yamahata Signed-off-b

[PATCH v7 42/52] i386/tdx: Apply TDX fixed0 and fixed1 information to supported CPUIDs

2025-01-24 Thread Xiaoyao Li
TDX architecture forcibly sets some CPUID bits for TD guest that VMM cannot disable it. It also disallows some CPUID bits though they might be supported for VMX VMs. The fixed0 and fixed1 bits may vary on different TDX module and on different host. It's a huge burden to maintain all combination. T

[PATCH v7 47/52] i386/cgs: Introduce x86_confidential_guest_check_features()

2025-01-24 Thread Xiaoyao Li
To do cgs specific feature checking. Note the feature checking in x86_cpu_filter_features() is valid for non-cgs VMs. For cgs VMs like TDX, what features can be supported has more restrictions. Signed-off-by: Xiaoyao Li --- target/i386/confidential-guest.h | 13 + target/i386/kvm/kvm

[PATCH v7 35/52] i386/tdx: Disable PIC for TDX VMs

2025-01-24 Thread Xiaoyao Li
Legacy PIC (8259) cannot be supported for TDX VMs since TDX module doesn't allow directly interrupt injection. Using posted interrupts for the PIC is not a viable option as the guest BIOS/kernel will not do EOI for PIC IRQs, i.e. will leave the vIRR bit set. Hence disable PIC for TDX VMs and erro

[PATCH v7 50/52] i386/tdx: Make invtsc default on

2025-01-24 Thread Xiaoyao Li
Because it's fixed1 bit that enforced by TDX module. Signed-off-by: Xiaoyao Li --- target/i386/kvm/tdx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c index 58ea6a4d3156..bb75eb06dad9 100644 --- a/target/i386/kvm/tdx.c +++ b/target/i386/kvm/

[PATCH v7 52/52] docs: Add TDX documentation

2025-01-24 Thread Xiaoyao Li
Add docs/system/i386/tdx.rst for TDX support, and add tdx in confidential-guest-support.rst Signed-off-by: Xiaoyao Li --- Changes in v6: - Add more information of "Feature configuration" - Mark TD Attestation as future work because KVM now drops the support of it. Changes in v5: - Add TD a

[PATCH v7 38/52] i386/apic: Skip kvm_apic_put() for TDX

2025-01-24 Thread Xiaoyao Li
KVM neithers allow writing to MSR_IA32_APICBASE for TDs, nor allow for KVM_SET_LAPIC[*]. Note, KVM_GET_LAPIC is also disallowed for TDX. It is called in the path do_kvm_cpu_synchronize_state() -> kvm_arch_get_registers() -> kvm_get_apic() and it's already disllowed for confidential gues

[PATCH v7 28/52] i386/tdx: Wire TDX_REPORT_FATAL_ERROR with GuestPanic facility

2025-01-24 Thread Xiaoyao Li
Integrate TDX's TDX_REPORT_FATAL_ERROR into QEMU GuestPanic facility Originated-from: Isaku Yamahata Signed-off-by: Xiaoyao Li --- Changes in v6: - change error_code of GuestPanicInformationTdx from uint64_t to uint32_t, to only contains the bit 31:0 returned in r12. Changes in v5: - mention

[PATCH v7 34/52] i386/tdx: Disable SMM for TDX VMs

2025-01-24 Thread Xiaoyao Li
TDX doesn't support SMM and VMM cannot emulate SMM for TDX VMs because VMM cannot manipulate TDX VM's memory. Disable SMM for TDX VMs and error out if user requests to enable SMM. Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann --- target/i386/kvm/tdx.c | 9 + 1 file changed, 9 inser

[PATCH v7 21/52] headers: Add definitions from UEFI spec for volumes, resources, etc...

2025-01-24 Thread Xiaoyao Li
Add UEFI definitions for literals, enums, structs, GUIDs, etc... that will be used by TDX to build the UEFI Hand-Off Block (HOB) that is passed to the Trusted Domain Virtual Firmware (TDVF). All values come from the UEFI specification [1], PI spec [2] and TDVF design guide[3]. [1] UEFI Specificat

[PATCH v7 00/52] QEMU TDX support

2025-01-24 Thread Xiaoyao Li
This is the v7 series of TDX QEMU enabling. The series is also available in github: https://github.com/intel-staging/qemu-tdx/tree/tdx-qemu-upstream-v7 To boot TD guest, please always use the latest TDX module (1.5) and OVMF available. Note, this series has a dependency on https://lore.kernel.org

  1   2   3   4   >