Re: [PATCH 2/2] hw/ipack: Remove legacy qemu_allocate_irqs() use

2025-01-20 Thread Philippe Mathieu-Daudé
On 21/1/25 08:44, Philippe Mathieu-Daudé wrote: No need to dynamically allocate IRQ when we know before hands how many we'll use. Declare the 2 of them in IPackDevice state and initialize them in the DeviceRealize handler. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ipack/ipack.h | 7

[PATCH 1/2] hw/ipack: Clarify KConfig symbols

2025-01-20 Thread Philippe Mathieu-Daudé
Split IPACK Kconfig key as {IPACK, TPCI200, IP_OCTAL_232} - IPack is a bus - TPCI200 is a PCI device providing an IPack bus - IP-Octal232 is an IPack device plugged on an IPack bus Signed-off-by: Philippe Mathieu-Daudé --- hw/char/Kconfig| 5 + hw/char/meson.build

[PATCH 0/2] hw/ipack: Minor dust removal

2025-01-20 Thread Philippe Mathieu-Daudé
Clarify what is what in Kconfig, replace qemu_allocate_irqs() by qemu_init_irq(). Philippe Mathieu-Daudé (2): hw/ipack: Clarify KConfig symbols hw/ipack: Remove legacy qemu_allocate_irqs() use include/hw/ipack/ipack.h | 7 ++- hw/ipack/ipack.c | 7 +++ hw/char/Kco

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

2025-01-20 Thread Eric Auger
Hi Jason, On 1/21/25 4:27 AM, Jason Wang wrote: > On Tue, Jan 21, 2025 at 1:33 AM Eric Auger wrote: >> When a guest exposed with a vhost device and protected by an >> intel IOMMU gets rebooted, we sometimes observe a spurious warning: >> >> Fail to lookup the translated address e000 >> >> W

[PATCH v1 05/18] hw/intc/aspeed: Introduce helper functions for enable and status registers

2025-01-20 Thread Jamin Lin via
The behavior of the enable and status registers is almost identical between INTC0 and INTC1. To reduce duplicated code, adds "aspeed_2700_intc_enable_handler" functions to handle enable register write behavior and "aspeed_2700_intc_status_handler" functions to handle status register write behavior.

[PATCH v1 16/18] hw/misc/aspeed_hace: Add AST2700 support

2025-01-20 Thread Jamin Lin via
Introduce a new ast2700 class to support AST2700. Signed-off-by: Jamin Lin --- hw/misc/aspeed_hace.c | 20 include/hw/misc/aspeed_hace.h | 1 + 2 files changed, 21 insertions(+) diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c index 18b85081c7..86422cb3be

[PATCH v1 15/18] hw/misc/aspeed_hace: Fix coding style

2025-01-20 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin --- hw/misc/aspeed_hace.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/misc/aspeed_hace.c b/hw/misc/aspeed_hace.c index e3f7df2e86..18b85081c7 100644 --- a/hw/misc/aspeed_hace.c +++ b/hw/m

[PATCH v1 11/18] hw/misc/aspeed_scu: Add Support for AST2700/AST2750 A1 Silicon Revisions

2025-01-20 Thread Jamin Lin via
Added new definitions for AST2700_A1_SILICON_REV and AST2750_A1_SILICON_REV to identify the A1 silicon revisions. Update "aspeed_ast2700_scu_reset" to set the silicon_rev field in the SCU registers. Signed-off-by: Jamin Lin --- hw/misc/aspeed_scu.c | 3 +++ include/hw/misc/aspeed_scu.h

[PATCH v1 10/18] hw/intc/aspeed: Add Support for AST2700 INTC1 Controller

2025-01-20 Thread Jamin Lin via
Introduce a new ast2700 INTC1 class to support AST2700 INTC1. Added new register definitions for INTC1, including enable and status registers for IRQs GICINT192 through GICINT197. Created a dedicated IRQ array for INTC1, supporting six input pins and six output pins, aligning with the newly defined

[PATCH v1 18/18] hw/misc/aspeed_hace: (DROP) Fix boot issue in the Crypto Manager Self Test(WORKAROUND)

2025-01-20 Thread Jamin Lin via
Currently, it does not support the CRYPT command. Instead, it only sends an interrupt to notify the firmware that the crypt command has completed. It is a temporary workaround to resolve the boot issue in the Crypto Manager Self Test. Full support for the CRYPT command will be implemented in the fu

[PATCH v1 12/18] hw/arm/aspeed_ast27x0: Support two levels of INTC controllers for AST2700 A1

2025-01-20 Thread Jamin Lin via
The design of INTC controllers has significantly changed in AST2700 A1. There are a total of 480 interrupt sources in AST2700 A1. For interrupt numbers from 0 to 127, they can route directly to PSP, SSP, and TSP. Due to the limitation of interrupt numbers of processors, the interrupts are merged e

[PATCH v1 04/18] hw/intc/aspeed: Support setting different memory and register size

2025-01-20 Thread Jamin Lin via
According to the AST2700 datasheet, the INTC0 (CPU DIE) controller has 16KB (0x4000) of register space, and the INTC1 (I/O DIE) controller has 1KB (0x400) of register space. Introduced a new class attribute "mem_size" to set different memory sizes for the INTC models in AST2700. Introduced a new

[PATCH v1 06/18] hw/intc/aspeed: Introduce AspeedINTCIRQ structure to save the irq index and register address

2025-01-20 Thread Jamin Lin via
The INTC0 controller supports GICINT128 to GICINT136, mapping 1:1 to input and output IRQs 0 to 8. Previously, the formula "address & 0x0f00" was used to derive the IRQ index numbers. However, the INTC0 controller also supports GICINT192_201, mapping 1 input IRQ pin to 10 output IRQ pins. The pin

[PATCH v1 01/18] hw/intc/aspeed: Rename INTC to INTC0

2025-01-20 Thread Jamin Lin via
The design of the INTC has significant changes in the AST2700 A1. In the AST2700 A0, there was one INTC controller, whereas in the AST2700 A1, there were two INTC controllers: INTC0 (CPU DIE) and INTC1 (I/O DIE). The previous INTC model only supported the AST2700 A0 and was implemented for the INT

[PATCH v1 17/18] hw/arm/aspeed_ast27x0: Add HACE support for AST2700

2025-01-20 Thread Jamin Lin via
The HACE controller between AST2600 and AST2700 are almost identical. The HACE controller registers base address starts at 0x1207_ and its alarm interrupt is connected to GICINT4. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 15 +++ 1 file changed, 15 insertions(+) dif

[PATCH v1 08/18] hw/intc/aspeed: Add Support for Multi-Output IRQ Handling

2025-01-20 Thread Jamin Lin via
This update introduces support for handling multi-output IRQs in the AST2700 interrupt controller (INTC), specifically for GICINT192_201. GICINT192_201 maps 1:10 to input IRQ 0 and output IRQs 0 to 9. Each status bit corresponds to a specific IRQ. Implemented "aspeed_intc_set_irq_handler_multi_out

[PATCH v1 14/18] hw/arm/aspeed: Add SoC and Machine Support for AST2700 A1

2025-01-20 Thread Jamin Lin via
The memory map for AST2700 A1 remains compatible with AST2700 A0. However, the IRQ mapping has been updated for AST2700 A1, with GIC interrupts now ranging from 192 to 201. Add a new IRQ map table for AST2700 A1. Introduce "aspeed_machine_ast2700_evb_class_init" to initialize the AST2700 EVB machi

[PATCH v1 13/18] hw/arm/aspeed: Rename IRQ table and machine name for AST2700 A0

2025-01-20 Thread Jamin Lin via
Currently, AST2700 SoC only supports A0. To support AST2700 A1, rename its IRQ table and machine name. Signed-off-by: Jamin Lin --- hw/arm/aspeed.c | 8 hw/arm/aspeed_ast27x0.c | 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/

[PATCH v1 07/18] hw/intc/aspeed: Introduce IRQ handler function to reduce code duplication

2025-01-20 Thread Jamin Lin via
The behavior of the INTC set IRQ is almost identical between INTC0 and INTC1. To reduce duplicated code, introduce the `aspeed_intc_set_irq_handler` function to handle both INTC0 and INTC1 IRQ behavior. Signed-off-by: Jamin Lin --- hw/intc/aspeed_intc.c | 56 +++--

[PATCH v1 03/18] hw/intc/aspeed: Introduce a new aspeed_2700_intc0_ops for INTC0

2025-01-20 Thread Jamin Lin via
Rename "aspeed_intc_read" to "aspeed_2700_intc0_read" and "aspeed_intc_write" to "aspeed_2700_intc0_write". Introduce a new memory region operation, "aspeed_2700_intc0_ops", for the AST2700 INTC0 model. Signed-off-by: Jamin Lin --- hw/intc/aspeed_intc.c | 20 +++- 1 file changed

[PATCH v1 09/18] hw/intc/aspeed: Add ID to trace events for better debugging

2025-01-20 Thread Jamin Lin via
Currently, it is difficult to recognize whether these trace events are from INTC0 or INTC1. To make these trace events more readable, add an ID to the INTC trace events. Updated trace events to include the "id" field for better identification. Updated the "AspeedINTCClass" structure to include an "

[PATCH v1 02/18] hw/intc/aspeed: Support different memory region ops

2025-01-20 Thread Jamin Lin via
The previous implementation set the "aspeed_intc_ops" struct, containing read and write callbacks, to be used when I/O is performed on the INTC region. Both "aspeed_intc_read" and "aspeed_intc_write" callback functions were used for INTC0 (CPU DIE). To support the INTC1 (I/O DIE) model, introduces

[PATCH v1 00/18] Support AST2700 A1

2025-01-20 Thread Jamin Lin via
v1: 1. Refactor INTC model to support both INTC0 and INTC1. 2. Support AST2700 A1. 3. Create ast2700a0-evb machine. With the patch applied, QEMU now supports two machines for running AST2700 SoCs: ast2700a0-evb: Designed for AST2700 A0 ast2700-evb: Designed for AST2700 A1 Test information 1.

[PATCH] tests/functional: Fix broken decorators with lamda functions

2025-01-20 Thread Thomas Huth
The decorators that use a lambda function are currently broken and do not properly skip the test if the condition is not met. Using "return skipUnless(lambda: ...)" does not work as expected. To fix it, rewrite the decorators without lambda, it's simpler that way anyway. skipIfMissingImports also

Re: [PATCH v3 2/4] qtest/libqos/pci: Enforce balanced iomap/unmap

2025-01-20 Thread Philippe Mathieu-Daudé
On 21/1/25 05:39, Nicholas Piggin wrote: On Mon Jan 20, 2025 at 3:29 PM AEST, Philippe Mathieu-Daudé wrote: Hi Nick, Only nitpicking comments... Hey, no they're good comments actually. On 17/1/25 18:22, Nicholas Piggin wrote: Add assertions to ensure a BAR is not mapped twice, and only pr

Re: [PATCH 6/7] RAMBlock: make guest_memfd require coordinate discard

2025-01-20 Thread Chenyi Qiang
On 1/20/2025 9:11 PM, David Hildenbrand wrote: > On 14.01.25 02:38, Chenyi Qiang wrote: >> >> >> On 1/13/2025 6:56 PM, David Hildenbrand wrote: >>> On 13.12.24 08:08, Chenyi Qiang wrote: As guest_memfd is now managed by guest_memfd_manager with RamDiscardManager, only block uncoordinat

Re: [PATCH 2/7] tests/qtest: don't attempt to clock_step while waiting for virtio ISR

2025-01-20 Thread Thomas Huth
On 20/01/2025 22.02, Alex Bennée wrote: This replicates the changes from 92cb8f8bf6 (tests/qtest: remove clock_steps from virtio tests) as there are no timers in the virtio code. We still busy wait and timeout though. Signed-off-by: Alex Bennée --- tests/qtest/libqos/virtio-pci-modern.c | 6 +

Re: [PATCH 3/9] qtest/e1000e|igb: assert irqs are clear before triggering an irq

2025-01-20 Thread Nicholas Piggin
On Sun Jan 19, 2025 at 7:22 PM AEST, Yan Vugenfirer wrote: > On Fri, Jan 17, 2025 at 7:05 PM Nicholas Piggin wrote: > >> Assert there is no existing irq raised that would lead to a false >> positive interrupt test. >> >> e1000e has to disable interrupt throttling for this test, because >> it can c

Re: [PATCH 2/2] hw/pci: Assert a bar is not registered multiple times

2025-01-20 Thread Nicholas Piggin
On Sun Jan 19, 2025 at 8:38 PM AEST, Phil Dennis-Jordan wrote: > Looks good to me. There is a risk here that the assertion will fail on > existing code. (Unless you've rigorously audited all callers, which would > be quite the task.) However, I agree that this would constitute a bug in > the callin

Re: [PATCH v3 2/4] qtest/libqos/pci: Enforce balanced iomap/unmap

2025-01-20 Thread Nicholas Piggin
On Mon Jan 20, 2025 at 3:29 PM AEST, Philippe Mathieu-Daudé wrote: > Hi Nick, > > Only nitpicking comments... Hey, no they're good comments actually. > > On 17/1/25 18:22, Nicholas Piggin wrote: >> Add assertions to ensure a BAR is not mapped twice, and only >> previously mapped BARs are unmapped

Re: [PATCH 0/8] accel/tcg: Constify various helpers

2025-01-20 Thread Richard Henderson
On 1/19/25 23:27, Philippe Mathieu-Daudé wrote: Constify argument in preparation of constifying CPUClass helpers. Philippe Mathieu-Daudé (8): accel/tcg: Constify curr_cflags() accel/tcg: Constify tcg_cflags_has() accel/tcg: Constify cpu_in_serial_context() accel/tcg: Consfity tlb_ind

Re: [PATCH v5 8/8] docs/system: Expand the virtio-gpu documentation

2025-01-20 Thread Akihiko Odaki
On 2025/01/20 21:23, Alex Bennée wrote: Akihiko Odaki writes: On 2025/01/20 7:00, Dmitry Osipenko wrote: From: Alex Bennée This attempts to tidy up the VirtIO GPU documentation to make the list of requirements clearer. There are still a lot of moving parts and the distros have some catching

Re: [PATCH v3] hw/i386/cpu: remove default_cpu_version and simplify

2025-01-20 Thread Ani Sinha
On Thu, Jan 16, 2025 at 9:04 AM Ani Sinha wrote: > > commit 0788a56bd1ae3 ("i386: Make unversioned CPU models be aliases") > introduced 'default_cpu_version' for PCMachineClass. This created three > categories of CPU models: > - Most unversioned CPU models would use version 1 by default. > - For

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

2025-01-20 Thread Jason Wang
On Tue, Jan 21, 2025 at 1:33 AM Eric Auger wrote: > > When a guest exposed with a vhost device and protected by an > intel IOMMU gets rebooted, we sometimes observe a spurious warning: > > Fail to lookup the translated address e000 > > We observe that the IOMMU gets disabled through a write to

Re: [PATCH 4/4] docs: Add GNR, SRF and CWF CPU models

2025-01-20 Thread Tao Su
On Tue, Jan 21, 2025 at 04:12:48AM +0100, BALATON Zoltan wrote: > On Tue, 21 Jan 2025, Tao Su wrote: > > 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. > > > >

Re: [PATCH 4/4] docs: Add GNR, SRF and CWF CPU models

2025-01-20 Thread BALATON Zoltan
On Tue, 21 Jan 2025, Tao Su wrote: 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 Signed-off-by: Tao Su --- docs/system/cpu-models-x86.rst.inc |

Re: [PATCH 20/21] hw/i2c: Import TCA6416 emulation from Xilinx

2025-01-20 Thread BALATON Zoltan
On Mon, 20 Jan 2025, Bernhard Beschow wrote: Xilinx QEMU implements a TCA6416 device model which may be useful for the broader QEMU community, so upstream it. In the Xilinx fork, the device model gets compiled whenever CONFIG_CADENCE is true, so have it maintained by the "hw/*/cadence_*" maintain

Re: [PATCH 17/21] hw/arm/fsl-imx8mp: Add boot ROM

2025-01-20 Thread BALATON Zoltan
On Mon, 20 Jan 2025, Bernhard Beschow wrote: On a real device, the boot ROM contains the very first instructions the CPU executes. Also, U-Boot calls into the ROM to determine the boot device. While we're not actually implementing this here, let's create the infrastructure and add a dummy ROM wit

Re: [PATCH 08/21] hw/arm/fsl-imx8mp: Add USDHC storage controllers

2025-01-20 Thread BALATON Zoltan
On Mon, 20 Jan 2025, Bernhard Beschow wrote: The USDHC emulation allows for running real-world images such as those generated by Buildroot. Convert the board documentation accordingly instead of running a Linux kernel with ephemeral storage. Signed-off-by: Bernhard Beschow --- docs/system/arm/i

[PATCH 1/4] target/i386: Introduce SierraForest-v2 model

2025-01-20 Thread Tao Su
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 mitig

[PATCH 1/3] hw/intc/loongarch_ipi: Add basic hotplug framework

2025-01-20 Thread Bibo Mao
LoongArch ipi can send interrupt to multiple CPUs, interrupt routing to CPU comes from destination physical cpu id. Here hotplug interface is added for IPI object, so that parent irq line can be connected, and routing table can be added for new created cpu. Here only basic hotplug framework is add

[PATCH 2/3] hw/intc/loongarch_ipi: Implment cpu hotplug interface

2025-01-20 Thread Bibo Mao
Add logic cpu allocation and cpu mapping with cpu hotplug interface. When cpu is added, connect ipi gpio irq to CPU IRQ_IPI irq pin. Signed-off-by: Bibo Mao --- hw/intc/loongarch_ipi.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/hw/intc/loongarch_

[PATCH 0/3] hw/intc/loongarch_ipi: CPU irq routing enhancement

2025-01-20 Thread Bibo Mao
LoongArch ipi can send intterrupt to multiple CPUs, physical cpu id is used to route interrupt for CPUs. With cpu hotplug feature in future, notification for ipi interrupt controller is required. Here cpu hotplug interface is added on ipi class, so that gpio irq line is connected to cpu irq line,

[PATCH 3/3] hw/intc/loongarch_ipi: Notify ipi object when cpu is plugged

2025-01-20 Thread Bibo Mao
Use hotplug_handler_plug() to nofity ipi object when cold-plug cpu is created, so that ipi can set and configure irq routing to new cpu. Signed-off-by: Bibo Mao --- hw/loongarch/virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt

[PATCH 3/4] target/i386: Add new CPU model ClearwaterForest

2025-01-20 Thread Tao Su
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

[PATCH 4/4] docs: Add GNR, SRF and CWF CPU models

2025-01-20 Thread Tao Su
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 Signed-off-by: Tao Su --- docs/system/cpu-models-x86.rst.inc | 42 ++ 1

[PATCH 2/4] target/i386: Export BHI_NO bit to guests

2025-01-20 Thread Tao Su
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

[PATCH 0/4] Introduce SierraForest-v2 and ClearwaterForest CPU model

2025-01-20 Thread Tao Su
Sorry for resending this series, because it didn't seem to be received by the mailing list before. Update SierraForest CPU model to stepping 3 as adding LAM and missing features. Clearwater Forest is a new Intel Xeon processor, which will debut in the market in 2025, add the new CPU model Clearwa

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

2025-01-20 Thread Chenyi Qiang
On 1/21/2025 2:33 AM, Peter Xu wrote: > On Mon, Jan 20, 2025 at 06:54:14PM +0100, David Hildenbrand wrote: >> On 20.01.25 18:21, Peter Xu wrote: >>> On Mon, Jan 20, 2025 at 11:48:39AM +0100, David Hildenbrand wrote: Sorry, I was traveling end of last week. I wrote a mail on the train and >>

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

2025-01-20 Thread Xu Yilun
On Mon, Jan 20, 2025 at 03:46:15PM -0500, Peter Xu wrote: > On Mon, Jan 20, 2025 at 09:22:50PM +1100, Alexey Kardashevskiy wrote: > > > It is still uncertain how to implement the private MMIO. Our assumption > > > is the private MMIO would also create a memory region with > > > guest_memfd-like bac

Re: [RFC PATCH] tests/qtest: don't step clock at start of npcm7xx periodic IRQ test

2025-01-20 Thread Hao Wu
Have you tried that the test can pass with this? If I remember correctly, interrupt won't trigger properly if not advancing the timer If the test passes it's probably fine to remove that. On Mon, Jan 20, 2025 at 11:00 PM Alex Bennée wrote: > Until there are timers enabled the semantics of clock

[PATCH v2] gdbstub/user-target: fix gdbserver int format (%d -> %x)

2025-01-20 Thread Dominik 'Disconnect3d' Czarnota
This commit fixes an incorrect format string for formatting integers provided to GDB when debugging a target run in QEMU user mode. The correct format is hexadecimal for both success and errno values, some of which can be seen here [0]. [0] https://github.com/bminor/binutils-gdb/blob/e65a355022d

Re: [PATCH] Skip resizing image to the same size

2025-01-20 Thread Fahrzin Hemmati
Happy to wait until your patchset is in. Yes, this is a no-op, but it reads the entire disk image to perform that no-op, so this is merely a time-saving improvement, not a behavior change. On Mon Jan 20, 2025, 09:49 PM GMT, Michael Tokarev wrote: 20.01.2025 23:17, Fahrzin Hemmati wrote: My apo

Re: [PATCH 5/7] tests/qtest: rename qtest_send_prefix and roll-up into qtest_send

2025-01-20 Thread Daniel Henrique Barboza
On 1/20/25 6:02 PM, Alex Bennée wrote: qtest_send_prefix never actually sent something over the chardev, all it does is print the timestamp to the QTEST_LOG when enabled. So rename the function, make it static, remove the unused CharDev and simplify all the call sites by handling that directly

[RFC PATCH v2 1/3] linux-headers: Update for 6.12 and SNP certificate support

2025-01-20 Thread Melody Wang
From: Michael Roth Add defines for SNP certificate support. Signed-off-by: Michael Roth Signed-off-by: Melody Wang --- linux-headers/linux/kvm.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 3bcd4eabe3..10f6c908d9 1

[RFC PATCH v2 3/3] i386/sev: Add KVM_EXIT_SNP_REQ_CERTS support for certificate-fetching

2025-01-20 Thread Melody Wang
From: Michael Roth The GHCB specification[1] defines a VMGEXIT-based Guest Request hypercall to allow an SNP guest to issue encrypted requests directly to SNP firmware to do things like query the attestation report for the guest. These are generally handled purely in the kernel. In some some cas

[RFC PATCH v2 2/3] accel/kvm: Add kvm_immediate_exit callback infrastructure

2025-01-20 Thread Melody Wang
From: Michael Roth Provide a generic mechanism so that users of struct kvm_run's 'immediate_exit' flag can register a callback that can be issued after returning from KVM. Signed-off-by: Michael Roth Signed-off-by: Melody Wang --- accel/kvm/kvm-all.c | 43

[RFC PATCH v2 0/3] SEV-SNP: Add support for SNP certificate fetching

2025-01-20 Thread Melody Wang
This patchset is also available at: https://github.com/amdese/qemu/commits/snp-certs-rfc2 and is based on top of qemu master (7433709a1477) Overview The GHCB 2.0 specification defines 2 GHCB request types to allow SNP guests to send encrypted messages/requests to firmware: SNP Guest

Re: [PATCH] Skip resizing image to the same size

2025-01-20 Thread Michael Tokarev
20.01.2025 23:17, Fahrzin Hemmati wrote: My apologies, I saw the Signed-off-by requirement at first, but as I followed the docs I got to "git publish" and didn't realize "git publish" was actually able to send emails on my system (I don't remember setting up any SMTP settings). By that time, I fo

[PATCH v4 3/7] linux-user: netlink: Add IP_PKTINFO cmsg parsing

2025-01-20 Thread deller
From: Helge Deller Fixes those warnings: Unsupported host ancillary data: 0/8 Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 10 ++ linux-user/syscall_defs.h | 6 ++ 2 files changed, 16 insertions(+) diff --git a/linux-user/syscall.c b/l

[PATCH v4 5/7] linux-user: netlink: add netlink neighbour emulation

2025-01-20 Thread deller
From: Helge Deller 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

[PATCH v4 4/7] linux-user: netlink: Add emulation of IP_MULTICAST_IF

2025-01-20 Thread deller
From: Helge Deller 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 a

[PATCH v4 2/7] linux-user: Use unique error messages for cmsg parsing

2025-01-20 Thread deller
From: Helge Deller 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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 4 ++-- 1 file changed, 2

[PATCH v4 7/7] linux-user: netlink: Use QEMU_IFA_XXX values instead of IFA_XXX

2025-01-20 Thread deller
From: Helge Deller Convert existing places to use QEMU_IFA_XXX values. Signed-off-by: Helge Deller --- linux-user/fd-trans.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-user/fd-trans.c b/linux-user/fd-trans.c index 105b1f0713..f83d1f79d5 100644 --

[PATCH v4 0/7] linux-user: Add support for various missing netlink sockopt entries

2025-01-20 Thread deller
From: Helge Deller This patchset adds various missing sockopt calls, so that qemu linux-user is able to successfully build the debian gupnp package in a chroot. Tested with a 32-bit big-endian hppa linux-user chroot running on a phyiscal x86-64 little-endian host. This fixes debian's bug report

[PATCH v4 6/7] linux-user: netlink: Add missing QEMU_IFLA entries

2025-01-20 Thread deller
From: Helge Deller 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 N

[PATCH v4 1/7] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr()

2025-01-20 Thread deller
From: Helge Deller Fixes this warning: Unknown host IFA type: 11 IFA_PROTO has been introduced in kernel v5.18, and as such using it unconditionally breaks build on Ubuntu 22.04. Instead convert the IFA_XXX values to QEMU_IDA_XXX values and use those instead. Already existing IFA_XXX usages ar

Re: [PATCH] Skip resizing image to the same size

2025-01-20 Thread Fahrzin Hemmati
My apologies, I saw the Signed-off-by requirement at first, but as I followed the docs I got to "git publish" and didn't realize "git publish" was actually able to send emails on my system (I don't remember setting up any SMTP settings). By that time, I forgot and thought this patch was short enoug

[PATCH v2 1/2] target/riscv/debug.c: use wp size = 4 for 32-bit CPUs

2025-01-20 Thread Daniel Henrique Barboza
The mcontrol select bit (19) is always zero, meaning our triggers will always match virtual addresses. In this condition, if the user does not specify a size for the trigger, the access size defaults to XLEN. At this moment we're using def_size = 8 regardless of CPU XLEN. Use def_size = 4 in case

[PATCH 5/7] tests/qtest: rename qtest_send_prefix and roll-up into qtest_send

2025-01-20 Thread Alex Bennée
qtest_send_prefix never actually sent something over the chardev, all it does is print the timestamp to the QTEST_LOG when enabled. So rename the function, make it static, remove the unused CharDev and simplify all the call sites by handling that directly with qtest_send (and qtest_log_send). Sign

[PATCH 3/7] tests/qtest: don't step clock at start of npcm7xx periodic IRQ test

2025-01-20 Thread Alex Bennée
Until there are timers enabled the semantics of clock_step_next() will fail. Since d524441a36 (system/qtest: properly feedback results of clock_[step|set]) we will signal a FAIL if time doesn't advance. Signed-off-by: Alex Bennée --- tests/qtest/npcm7xx_timer-test.c | 1 - 1 file changed, 1 dele

[PATCH 7/7] Revert "util/timer: avoid deadlock when shutting down"

2025-01-20 Thread Alex Bennée
This reverts commit bc02be4508d8753d1f6071b77d10f4661587df6f. Now we catch attempts to clock_step to the next timer when none are enabled we can revert the previous attempt to prevent deadlock. As long as a new target time is given we will move time forward even if no timers will fire. This is des

[PATCH 6/7] tests/qtest: tighten up the checks on clock_step

2025-01-20 Thread Alex Bennée
It is invalid to call clock_step with an implied time to step forward as if no timers are running we won't be able to advance. Signed-off-by: Alex Bennée --- system/qtest.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/qtest.c b/system/qtest.c index 28b6fac37c.

[PATCH 2/7] tests/qtest: don't attempt to clock_step while waiting for virtio ISR

2025-01-20 Thread Alex Bennée
This replicates the changes from 92cb8f8bf6 (tests/qtest: remove clock_steps from virtio tests) as there are no timers in the virtio code. We still busy wait and timeout though. Signed-off-by: Alex Bennée --- tests/qtest/libqos/virtio-pci-modern.c | 6 ++ tests/qtest/libqos/virtio-pci.c

[PATCH 1/7] tests/docker: replicate the check-rust-tools-nightly CI job

2025-01-20 Thread Alex Bennée
This allows people to run the test locally: make docker-test-rust@fedora-rust-nightly Signed-off-by: Alex Bennée --- tests/docker/Makefile.include | 3 +++ tests/docker/test-rust| 21 + 2 files changed, 24 insertions(+) create mode 100755 tests/docker/test-rust

[PATCH 4/7] tests/qtest: simplify qtest_process_inbuf

2025-01-20 Thread Alex Bennée
Don't both creating a GString to temporarily hold our qtest command. Instead do a simpler g_strndup and use autofree to clean up afterwards. Signed-off-by: Alex Bennée --- system/qtest.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/system/qtest.c b/sy

[PATCH 0/7] testing/next (qtest timer stuff)

2025-01-20 Thread Alex Bennée
Hi, Thomas found that a number of tests fail under CFI and other exotic setups. The eventual realisation was that --enable-slirp masks a lot of timer misuse because it ensures there is always a timer and therefor things tend to move on (until the system is shutting down). It turns out that bc02be

hw/ipack: Is IndustryPack still useful to maintain?

2025-01-20 Thread Philippe Mathieu-Daudé
Hi Alberto, You are listed as odd-fix maintainer for IPack. After your contribution in 2012, I only see maintenance changes on this code (besides test addition by Andreas in 2014). Is it still worthwhile maintaining this code? If so, can we have real world tests? I'm updating legacy APIs and th

[PATCH v2 2/2] target/riscv: throw debug exception before page fault

2025-01-20 Thread Daniel Henrique Barboza
In the RISC-V privileged ISA section 3.1.15 table 15, it is determined that a debug exception that is triggered from a load/store has a higher priority than a possible fault that this access might trigger. This is not the case ATM as shown in [1]. Adding a breakpoint in an address that deliberatel

Re: [PATCH v3 4/6] linux-user: netlink: Add emulation of IP_MULTICAST_IF

2025-01-20 Thread Helge Deller
On 1/20/25 21:42, Helge Deller wrote: On 1/20/25 19:17, Laurent Vivier wrote: Le 19/01/2025 à 05:41, del...@kernel.org a écrit : From: Helge Deller 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) 

[PATCH v2 0/2] target/riscv: throw debug exception before page fault

2025-01-20 Thread Daniel Henrique Barboza
Hi, This second version implements the change Richard suggested in v1, i.e. do not search for wps twice. To do that we need to make an assumption that a watchpoint for a 64 bit address will have size 8, in particular when the user does not set a watchpoint size. To be consistent we also need to c

Re: [PATCH v3 4/6] linux-user: netlink: Add emulation of IP_MULTICAST_IF

2025-01-20 Thread Helge Deller
On 1/20/25 19:17, Laurent Vivier wrote: Le 19/01/2025 à 05:41, del...@kernel.org a écrit : From: Helge Deller 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

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

2025-01-20 Thread Peter Xu
On Mon, Jan 20, 2025 at 09:22:50PM +1100, Alexey Kardashevskiy wrote: > > It is still uncertain how to implement the private MMIO. Our assumption > > is the private MMIO would also create a memory region with > > guest_memfd-like backend. Its mr->ram is true and should be managed by > > RamdDiscard

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

2025-01-20 Thread Peter Xu
On Mon, Jan 20, 2025 at 09:25:51PM +0100, David Hildenbrand wrote: > Yes, calling it "attributes" popped up during RFC discussion: in theory, > disacard vs. populated and shared vs. private could co-exist (maybe in the > future with virtio-mem or something similar). Yes makes sense. The attribute

[PATCH 10/21] hw/arm/fsl-imx8mp: Add GPIO controllers

2025-01-20 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- docs/system/arm/imx8mp-evk.rst | 1 + include/hw/arm/fsl-imx8mp.h| 14 + hw/arm/fsl-imx8mp.c| 55 ++ 3 files changed, 70 insertions(+) diff --git a/docs/system/arm/imx8mp-evk.rst b/docs/system/arm/imx8mp

[PATCH 14/21] hw/arm/fsl-imx8mp: Implement gneral purpose timers

2025-01-20 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- docs/system/arm/imx8mp-evk.rst | 1 + include/hw/arm/fsl-imx8mp.h| 11 +++ include/hw/timer/imx_gpt.h | 1 + hw/arm/fsl-imx8mp.c| 53 ++ hw/timer/imx_gpt.c | 25 hw/arm/Kconf

[PATCH 20/21] hw/i2c: Import TCA6416 emulation from Xilinx

2025-01-20 Thread Bernhard Beschow
Xilinx QEMU implements a TCA6416 device model which may be useful for the broader QEMU community, so upstream it. In the Xilinx fork, the device model gets compiled whenever CONFIG_CADENCE is true, so have it maintained by the "hw/*/cadence_*" maintainers. The code is based on Xilinx QEMU version

[PATCH 09/21] hw/arm/fsl-imx8mp: Add PCIe support

2025-01-20 Thread Bernhard Beschow
Linux checks for the PLLs in the PHY to be locked, so implement a model emulating that. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 2 + docs/system/arm/imx8mp-evk.rst | 13 + include/hw/arm/fsl-imx8mp.h | 10 include/hw/pci-host/fsl_imx8m_phy

[PATCH 08/21] hw/arm/fsl-imx8mp: Add USDHC storage controllers

2025-01-20 Thread Bernhard Beschow
The USDHC emulation allows for running real-world images such as those generated by Buildroot. Convert the board documentation accordingly instead of running a Linux kernel with ephemeral storage. Signed-off-by: Bernhard Beschow --- docs/system/arm/imx8mp-evk.rst | 39 +++

[PATCH 15/21] hw/arm/fsl-imx8mp: Add Ethernet controller

2025-01-20 Thread Bernhard Beschow
The i.MX 8M Plus SoC actually has two ethernet controllers, the usual ENET one and a Designware one. There is no device model for the latter, so only add the ENET one. Signed-off-by: Bernhard Beschow --- docs/system/arm/imx8mp-evk.rst | 1 + include/hw/arm/fsl-imx8mp.h| 8 hw/arm/

[PATCH 17/21] hw/arm/fsl-imx8mp: Add boot ROM

2025-01-20 Thread Bernhard Beschow
On a real device, the boot ROM contains the very first instructions the CPU executes. Also, U-Boot calls into the ROM to determine the boot device. While we're not actually implementing this here, let's create the infrastructure and add a dummy ROM with all zeros. This allows for implementing a ROM

[PATCH 00/21] Add i.MX 8M Plus EVK machine

2025-01-20 Thread Bernhard Beschow
This series adds a new aarch64 machine to QEMU: i.MX 8M Plus EVK [1]. It allows for running Linux distributions such as Buildroot (freescale_imx8mpevk_defconfig) and Arch Linux [2] via direct kernel boot. U-Boot does not work yet. I plan to use this machine myself and I also want to make it availab

[PATCH 18/21] hw/arm/fsl-imx8mp: Add on-chip RAM

2025-01-20 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- include/hw/arm/fsl-imx8mp.h | 1 + hw/arm/fsl-imx8mp.c | 11 +++ 2 files changed, 12 insertions(+) diff --git a/include/hw/arm/fsl-imx8mp.h b/include/hw/arm/fsl-imx8mp.h index 326c4ddf69..e0442665fc 100644 --- a/include/hw/arm/fsl-imx8mp.h +++

[PATCH 04/21] hw/usb/hcd-dwc3: Align global registers size with Linux

2025-01-20 Thread Bernhard Beschow
While at it add missing GUSB2RHBCTL register as found in i.MX 8M Plus reference manual. Signed-off-by: Bernhard Beschow --- include/hw/usb/hcd-dwc3.h | 2 +- hw/usb/hcd-dwc3.c | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/hw/usb/hcd-dwc3.h b/include/hw/

[PATCH 16/21] hw/arm/fsl-imx8mp: Add USB support

2025-01-20 Thread Bernhard Beschow
Split the USB MMIO regions to better keep track of the implemented vs. unimplemented regions. Signed-off-by: Bernhard Beschow --- docs/system/arm/imx8mp-evk.rst | 1 + include/hw/arm/fsl-imx8mp.h| 12 +++ hw/arm/fsl-imx8mp.c| 37 -- hw/arm

[PATCH 11/21] hw/arm/fsl-imx8mp: Add I2C controllers

2025-01-20 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- docs/system/arm/imx8mp-evk.rst | 1 + include/hw/arm/fsl-imx8mp.h| 11 +++ hw/arm/fsl-imx8mp.c| 29 + hw/arm/Kconfig | 2 ++ 4 files changed, 43 insertions(+) diff --git a/docs/system/arm/im

[PATCH 13/21] hw/arm/fsl-imx8mp: Add watchdog support

2025-01-20 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- docs/system/arm/imx8mp-evk.rst | 1 + include/hw/arm/fsl-imx8mp.h| 7 +++ hw/arm/fsl-imx8mp.c| 28 hw/arm/Kconfig | 1 + 4 files changed, 37 insertions(+) diff --git a/docs/system/arm/imx8mp-e

[PATCH 02/21] hw/char/imx_serial: Update all state before restarting ageing timer

2025-01-20 Thread Bernhard Beschow
Fixes characters to be "echoed" after each keystroke rather than after every other since imx_serial_rx_fifo_ageing_timer_restart() would see ~UTS1_RXEMPTY only after every other keystroke. Signed-off-by: Bernhard Beschow --- hw/char/imx_serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 del

[PATCH 21/21] hw/gpio/imx_gpio: Don't clear input GPIO values upon reset

2025-01-20 Thread Bernhard Beschow
Input GPIO values such as a present SD card may get notified before the GPIO controller itself gets reset. Claring the input values thus loses data. Assuming that input GPIO events are only fired when the state changes, the input values shouldn't be reset. Signed-off-by: Bernhard Beschow --- hw/

[PATCH 07/21] hw/arm/fsl-imx8mp: Add SNVS

2025-01-20 Thread Bernhard Beschow
SNVS contains an RTC which allows Linux to deal correctly with time. This is particularly useful when handling persistent storage which will be done in the next patch. Signed-off-by: Bernhard Beschow --- docs/system/arm/imx8mp-evk.rst | 1 + include/hw/arm/fsl-imx8mp.h| 2 ++ hw/arm/fsl-im

  1   2   >