[PULL v2 25/47] docs/specs: add riscv-iommu

2024-09-24 Thread Alistair Francis
From: Daniel Henrique Barboza Add a simple guideline to use the existing RISC-V IOMMU support we just added. This doc will be updated once we add the riscv-iommu-sys device. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Message-ID: <20240903201633.93182-13-dbarb...@vent

[PULL v2 18/47] hw/riscv: add riscv-iommu-pci reference device

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach The RISC-V IOMMU can be modelled as a PCIe device following the guidelines of the RISC-V IOMMU spec, chapter 7.1, "Integrating an IOMMU as a PCIe device". Signed-off-by: Tomasz Jeznach Signed-off-by: Daniel Henrique Barboza Reviewed-by: Frank Chang Reviewed-by: Alistair F

[PULL v2 00/47] riscv-to-apply queue

2024-09-24 Thread Alistair Francis
The following changes since commit 01dc65a3bc262ab1bec8fe89775e9bbfa627becb: Merge tag 'pull-target-arm-20240919' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-09-19 14:15:15 +0100) are available in the Git repository at: https://github.com/alistair23/qemu.git tags/

[PULL v2 20/47] test/qtest: add riscv-iommu-pci tests

2024-09-24 Thread Alistair Francis
From: Daniel Henrique Barboza To test the RISC-V IOMMU emulation we'll use its PCI representation. Create a new 'riscv-iommu-pci' libqos device that will be present with CONFIG_RISCV_IOMMU. This config is only available for RISC-V, so this device will only be consumed by the RISC-V libqos machin

[PULL v2 13/47] target/riscv: Add textra matching condition for the triggers

2024-09-24 Thread Alistair Francis
From: Alvin Chang According to RISC-V Debug specification, the optional textra32 and textra64 trigger CSRs can be used to configure additional matching conditions for the triggers. For example, if the textra.MHSELECT field is set to 4 (mcontext), this trigger will only match or fire if the low bi

[PULL v2 16/47] hw/riscv: add RISC-V IOMMU base emulation

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach The RISC-V IOMMU specification is now ratified as-per the RISC-V international process. The latest frozen specifcation can be found at: https://github.com/riscv-non-isa/riscv-iommu/releases/download/v1.0/riscv-iommu.pdf Add the foundation of the device emulation for RISC-V

[PULL v2 02/47] tests/acpi: Add empty ACPI SRAT data file for RISC-V

2024-09-24 Thread Alistair Francis
From: Haibo Xu As per process documented (steps 1-3) in bios-tables-test.c, add empty AML data file for RISC-V ACPI SRAT table and add the entry in bios-tables-test-allowed-diff.h. Signed-off-by: Haibo Xu Reviewed-by: Sunil V L Acked-by: Alistair Francis Message-ID: <0e30216273f2f59916bc6513

[PULL v2 08/47] target/riscv/kvm: Fix the group bit setting of AIA

2024-09-24 Thread Alistair Francis
From: Andrew Jones Just as the hart bit setting of the AIA should be calculated as ceil(log2(max_hart_id + 1)) the group bit setting should be calculated as ceil(log2(max_group_id + 1)). The hart bits are implemented by passing max_hart_id to find_last_bit() and adding one to the result. Do the s

[PULL v2 01/47] target/riscv: Add a property to set vl to ceil(AVL/2)

2024-09-24 Thread Alistair Francis
From: Jason Chien RVV spec allows implementations to set vl with values within [ceil(AVL/2),VLMAX] when VLMAX < AVL < 2*VLMAX. This commit adds a property "rvv_vl_half_avl" to enable setting vl = ceil(AVL/2). This behavior helps identify compiler issues and bugs. Signed-off-by: Jason Chien Revi

[PULL v2 22/47] hw/riscv/riscv-iommu: add ATS support

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach Add PCIe Address Translation Services (ATS) capabilities to the IOMMU. This will add support for ATS translation requests in Fault/Event queues, Page-request queue and IOATC invalidations. Signed-off-by: Tomasz Jeznach Signed-off-by: Daniel Henrique Barboza Reviewed-by: Fr

[PULL v2 26/47] hw/riscv: Respect firmware ELF entry point

2024-09-24 Thread Alistair Francis
From: Samuel Holland When riscv_load_firmware() loads an ELF, the ELF segment addresses are used, not the passed-in firmware_load_addr. The machine models assume the firmware entry point is what they provided for firmware_load_addr, and use that address to generate the boot ROM, so if the ELF is

[PULL v2 15/47] hw/riscv: add riscv-iommu-bits.h

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach This header will be used by the RISC-V IOMMU emulation to be added in the next patch. Due to its size it's being sent in separate for an easier review. One thing to notice is that this header can be replaced by the future Linux RISC-V IOMMU driver header, which would become

[PULL v2 19/47] hw/riscv/virt.c: support for RISC-V IOMMU PCIDevice hotplug

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach Generate device tree entry for riscv-iommu PCI device, along with mapping all PCI device identifiers to the single IOMMU device instance. Signed-off-by: Tomasz Jeznach Signed-off-by: Daniel Henrique Barboza Reviewed-by: Frank Chang Reviewed-by: Alistair Francis Message-I

[PULL v2 07/47] target: riscv: Enable Bit Manip for OpenTitan Ibex CPU

2024-09-24 Thread Alistair Francis
From: Alistair Francis The OpenTitan Ibex CPU now supports the the Zba, Zbb, Zbc and Zbs bit-manipulation sub-extensions ratified in v.1.0.0 of the RISC-V Bit- Manipulation ISA Extension, so let's enable them in QEMU as well. 1: https://github.com/lowRISC/opentitan/pull/9748 Signed-off-by: Alis

[PULL v2 14/47] exec/memtxattr: add process identifier to the transaction attributes

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach Extend memory transaction attributes with process identifier to allow per-request address translation logic to use requester_id / process_id to identify memory mapping (e.g. enabling IOMMU w/ PASID translations). Signed-off-by: Tomasz Jeznach Reviewed-by: Frank Chang Revie

[PULL v2 30/47] hw/intc: riscv-imsic: Fix interrupt state updates.

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach The IMSIC state variable eistate[] is modified by CSR instructions within a range dedicated to the local CPU and by MMIO writes from any CPU. Access to eistate from MMIO accessors is protected by the BQL, but read-modify-write (RMW) sequences from CSRRW do not acquire the BQL

[PULL v2 32/47] bsd-user: Add RISC-V CPU execution loop and syscall handling

2024-09-24 Thread Alistair Francis
From: Mark Corbin Implemented the RISC-V CPU execution loop, including handling various exceptions and system calls. The loop continuously executes CPU instructions,processes exceptions, and handles system calls by invoking FreeBSD syscall handlers. Signed-off-by: Mark Corbin Signed-off-by: Aje

[PULL v2 03/47] tests/qtest/bios-tables-test.c: Enable numamem testing for RISC-V

2024-09-24 Thread Alistair Francis
From: Haibo Xu Add ACPI SRAT table test case for RISC-V when NUMA was enabled. Signed-off-by: Haibo Xu Reviewed-by: Sunil V L Acked-by: Alistair Francis Message-ID: Signed-off-by: Alistair Francis --- tests/qtest/bios-tables-test.c | 28 1 file changed, 28 ins

[PULL v2 17/47] pci-ids.rst: add Red Hat pci-id for RISC-V IOMMU device

2024-09-24 Thread Alistair Francis
From: Daniel Henrique Barboza The RISC-V IOMMU PCI device we're going to add next is a reference implementation of the riscv-iommu spec [1], which predicts that the IOMMU can be implemented as a PCIe device. However, RISC-V International (RVI), the entity that ratified the riscv-iommu spec, didn

[PULL v2 04/47] tests/acpi: Add expected ACPI SRAT AML file for RISC-V

2024-09-24 Thread Alistair Francis
From: Haibo Xu As per the step 5 in the process documented in bios-tables-test.c, generate the expected ACPI SRAT AML data file for RISC-V using the rebuild-expected-aml.sh script and update the bios-tables-test-allowed-diff.h. This is a new file being added for the first time. Hence, iASL diff

[PULL v2 35/47] bsd-user: Add RISC-V ELF definitions and hardware capability detection

2024-09-24 Thread Alistair Francis
From: Mark Corbin Introduced RISC-V specific ELF definitions and hardware capability detection. Additionally, a function to retrieve hardware capabilities ('get_elf_hwcap') is implemented, which returns the common bits set in each CPU's ISA strings. Signed-off-by: Mark Corbin Signed-off-by: Aje

[PULL v2 29/47] target/riscv/cpu_helper: Fix linking problem with semihosting disabled

2024-09-24 Thread Alistair Francis
From: Thomas Huth If QEMU has been configured with "--without-default-devices", the build is currently failing with: /usr/bin/ld: libqemu-riscv32-softmmu.a.p/target_riscv_cpu_helper.c.o: in function `riscv_cpu_do_interrupt': .../qemu/target/riscv/cpu_helper.c:1678:(.text+0x2214): undefined

[PULL v2 09/47] target/riscv: Stop timer with infinite timecmp

2024-09-24 Thread Alistair Francis
From: Andrew Jones While the spec doesn't state it, setting timecmp to UINT64_MAX is another way to stop a timer, as it's considered setting the next timer event to occur at infinity. And, even if the time CSR does eventually reach UINT64_MAX, the very next tick will bring it back to zero, once a

[PULL v2 47/47] bsd-user: Add RISC-V 64-bit Target Configuration and Debug XML Files

2024-09-24 Thread Alistair Francis
From: Warner Losh Added configuration for RISC-V 64-bit target to the build system. Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh Reviewed-by: Richard Henderson Message-ID: <20240916155119.14610-18-itac...@freebsd.org> Signed-off-by: Alistair Francis --- configs/targets/riscv64-bsd-

Re: [PATCH v1 2/2] xilink-zynq-devcfg: Fix up for memory address range size not set correctly

2024-09-24 Thread Edgar E. Iglesias
On Sun, Sep 22, 2024 at 09:24:33PM +0800, Chao Liu wrote: > Signed-off-by: Chao Liu Reviewed-by: Edgar E. Iglesias > --- > hw/dma/xlnx-zynq-devcfg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/dma/xlnx-zynq-devcfg.c b/hw/dma/xlnx-zynq-devcfg.c > index b8544d0

Re: [PATCH v2 1/4] hw/xen: Expose handle_bufioreq in xen_register_ioreq

2024-09-24 Thread Stefano Stabellini
On Mon, 23 Sep 2024, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Expose handle_bufioreq in xen_register_ioreq(). > This is to allow machines to enable or disable buffered ioreqs. > > No functional change since all callers still set it to > HVM_IOREQSRV_BUFIOREQ_ATOMIC. > > Signed-o

Re: [PATCH v2 2/4] hw/xen: xenpvh: Disable buffered IOREQs for ARM

2024-09-24 Thread Stefano Stabellini
On Mon, 23 Sep 2024, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Add a way to enable/disable buffered IOREQs for PVH machines > and disable them for ARM. ARM does not support buffered > IOREQ's nor the legacy way to map IOREQ info pages. > > See the following for more details: > htt

Re: [PATCH 0/3] Fix WinXP ISO boot using the dc390/am53C974 SCSI device

2024-09-24 Thread Michael S. Tsirkin
On Sun, Sep 22, 2024 at 02:31:08PM +, Ricardo Ribalda wrote: > Mark Cave-Ayland reported that after landing the pre-computed _PRT, the > above mentioned testcase failed to pass. > > It seems that it is due to WinXP not handling properly a variable > package. Let's replace it. Thanks, will me

Re: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support

2024-09-24 Thread Andrew Jeffery
On Tue, 2024-09-24 at 03:03 +, Jamin Lin wrote: > Hi Andrew, > > > Subject: Re: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support > > > > Hi Jamin, > > > > On Mon, 2024-09-23 at 17:42 +0800, Jamin Lin wrote: > > > > > + > > > +/* interrupt status */ > > > +group_value = set->int_statu

Re: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support

2024-09-24 Thread Andrew Jeffery
On Tue, 2024-09-24 at 06:48 +, Jamin Lin wrote: > Hi Andrew, > > > Subject: RE: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support > > > > Hi Andrew, > > > > > Subject: Re: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support > > > > > > Hi Jamin, > > > > > > > > > > +} > > > > +set->int_

Re: [PATCH] docs: Mark "gluster" support in QEMU as deprecated

2024-09-24 Thread Niels de Vos
On Tue, 2024-09-24 at 15:24 +0200, Thomas Huth wrote: > According to https://marc.info/?l=fedora-devel-list&m=171934833215726 > the GlusterFS development effectively ended. Thus mark it as > deprecated > in QEMU, so we can remove it in a future release if the project does > not gain momentum again.

Re: [PATCH v2] Add -build-info and -build-info-json CLI arguments

2024-09-24 Thread Manos Pitsidianakis
Hello Daniel, On Tue, 24 Sept 2024 at 11:45, Daniel P. Berrangé wrote: > > On Mon, Sep 23, 2024 at 10:09:32PM +0300, Manos Pitsidianakis wrote: > > Hello Daniel, > > > > On Mon, 23 Sep 2024 19:45, "Daniel P. Berrangé" wrote: > > > On Mon, Sep 23, 2024 at 09:05:24AM +0300, Manos Pitsidianakis wro

RE: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support

2024-09-24 Thread Jamin Lin
Hi Andrew, > Subject: Re: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support > > On Tue, 2024-09-24 at 06:48 +, Jamin Lin wrote: > > Hi Andrew, > > > > > Subject: RE: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support > > > > > > Hi Andrew, > > > > > > > Subject: Re: [PATCH 4/5] hw/gpio/aspeed: Add

RE: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support

2024-09-24 Thread Jamin Lin
Hi Andrew, > Subject: Re: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support > > On Tue, 2024-09-24 at 03:03 +, Jamin Lin wrote: > > Hi Andrew, > > > > > Subject: Re: [PATCH 4/5] hw/gpio/aspeed: Add AST2700 support > > > > > > Hi Jamin, > > > > > > On Mon, 2024-09-23 at 17:42 +0800, Jamin Lin w

[PATCH v2 0/6] Support GPIO for AST2700

2024-09-24 Thread Jamin Lin via
v1: Support GPIO for AST2700 v2: Fix clear incorrect interrupt status and adds reviewer suggestion Jamin Lin (6): hw/gpio/aspeed: Fix coding style hw/gpio/aspeed: Support to set the different memory size hw/gpio/aspeed: Support different memory region ops hw/gpio/aspeed: Fix clear incorrec

[PATCH v2 5/6] hw/gpio/aspeed: Add AST2700 support

2024-09-24 Thread Jamin Lin via
AST2700 integrates two set of Parallel GPIO Controller with maximum 212 control pins, which are 27 groups. (H, exclude pin: H7 H6 H5 H4) In the previous design of ASPEED SOCs, one register is used for setting one function for one set which are 32 pins and 4 groups. ex: GPIO000 is used for setting

[PATCH v2 3/6] hw/gpio/aspeed: Support different memory region ops

2024-09-24 Thread Jamin Lin via
It set "aspeed_gpio_ops" struct which containing read and write callbacks to be used when I/O is performed on the GPIO region. Besides, in the previous design of ASPEED SOCs, one register is used for setting one function for 32 GPIO pins. ex: GPIO000 is used for setting data value for GPIO A, B, C

[PATCH v2 4/6] hw/gpio/aspeed: Fix clear incorrect interrupt status for GPIO index mode

2024-09-24 Thread Jamin Lin via
The interrupt status field is W1C, where a set bit on read indicates an interrupt is pending. If the bit extracted from data is set it should clear the corresponding bit in group_value. However, if the extracted bit is clear then the value of the corresponding bit in group_value should be unchanged

[PATCH v2 6/6] aspeed/soc: Support GPIO for AST2700

2024-09-24 Thread Jamin Lin via
Add GPIO model for AST2700 GPIO support. The GPIO controller registers base address is start at 0x14C0_B000 and its address space is 0x1000. The AST2700 GPIO controller interrupt is connected to GICINT130_INTC at bit 18. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 18 +++-

[PATCH v2 1/6] hw/gpio/aspeed: Fix coding style

2024-09-24 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Signed-off-by: Jamin Lin --- hw/gpio/aspeed_gpio.c | 5 +++-- include/hw/gpio/aspeed_gpio.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 71756664dd..a5886ffa43 100644

[PATCH v2 2/6] hw/gpio/aspeed: Support to set the different memory size

2024-09-24 Thread Jamin Lin via
According to the datasheet of ASPEED SOCs, a GPIO controller owns 4KB of register space for AST2700, AST2500, AST2400 and AST1030; owns 2KB of register space for AST2600 1.8v and owns 2KB of register space for AST2600 3.3v. It set the memory region size 2KB by default and it does not compatible re

[PULL 0/1] qemu-openbios queue 20240924

2024-09-24 Thread Mark Cave-Ayland
u.git tags/qemu-openbios-20240924 for you to fetch changes up to 972208be775a37dccb3047702ea1582e9936102c: roms/openbios: update OpenBIOS images to c3a19c1e built from submodule (2024-09-24 20:58:54 +0100) qemu-openbios queu

Re: [PATCH 09/23] hw/ppc/mpc8544_guts: Populate POR PLL ratio status register

2024-09-24 Thread BALATON Zoltan
On Tue, 24 Sep 2024, Bernhard Beschow wrote: Am 24. September 2024 09:59:21 UTC schrieb BALATON Zoltan : On Mon, 23 Sep 2024, Bernhard Beschow wrote: Am 23. September 2024 10:43:19 UTC schrieb BALATON Zoltan : On Mon, 23 Sep 2024, Bernhard Beschow wrote: Populate this read-only register with

[PULL v2 37/47] bsd-user: Add RISC-V signal trampoline setup function

2024-09-24 Thread Alistair Francis
From: Mark Corbin Implemented the 'setup_sigtramp' function for setting up the signal trampoline code in the RISC-V architecture. Signed-off-by: Mark Corbin Signed-off-by: Ajeet Singh Reviewed-by: Richard Henderson Message-ID: <20240916155119.14610-8-itac...@freebsd.org> Signed-off-by: Alista

[PULL v2 43/47] bsd-user: Define RISC-V signal handling structures and constants

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added definitions for RISC-V signal handling, including structures and constants for managing signal frames and context Signed-off-by: Mark Corbin Signed-off-by: Ajeet Singh Co-authored-by: Warner Losh Reviewed-by: Richard Henderson Message-ID: <20240916155119.14610-14-itac

[PULL v2 21/47] hw/riscv/riscv-iommu: add Address Translation Cache (IOATC)

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach The RISC-V IOMMU spec predicts that the IOMMU can use translation caches to hold entries from the DDT. This includes implementation for all cache commands that are marked as 'not implemented'. There are some artifacts included in the cache that predicts s-stage and g-stage e

[PULL v2 40/47] bsd-user: Define RISC-V VM parameters and helper functions

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added definitions for RISC-V VM parameters, including maximum and default sizes for text, data, and stack, as well as address space limits. Implemented helper functions for retrieving and setting specific values in the CPU state, such as stack pointer and return values. Signed-

[PULL v2 36/47] bsd-user: Define RISC-V register structures and register copying

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added definitions for RISC-V register structures, including general-purpose registers and floating-point registers, in 'target_arch_reg.h'. Implemented the 'target_copy_regs' function to copy register values from the CPU state to the target register structure, ensuring proper en

[PULL v2 27/47] target: riscv: Add Svvptc extension support

2024-09-24 Thread Alistair Francis
From: Alexandre Ghiti The Svvptc extension describes a uarch that does not cache invalid TLB entries: that's the case for qemu so there is nothing particular to implement other than the introduction of this extension. Since qemu already exposes Svvptc behaviour, let's enable it by default since

[PULL v2 23/47] hw/riscv/riscv-iommu: add DBG support

2024-09-24 Thread Alistair Francis
From: Tomasz Jeznach DBG support adds three additional registers: tr_req_iova, tr_req_ctl and tr_response. The DBG cap is always enabled. No on/off toggle is provided for it. Signed-off-by: Tomasz Jeznach Signed-off-by: Daniel Henrique Barboza Reviewed-by: Frank Chang Reviewed-by: Alistair F

[PULL v2 33/47] bsd-user: Implement RISC-V CPU register cloning and reset functions

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added functions for cloning CPU registers and resetting the CPU state for RISC-V architecture. Signed-off-by: Mark Corbin Signed-off-by: Ajeet Singh Reviewed-by: Richard Henderson Message-ID: <20240916155119.14610-4-itac...@freebsd.org> Signed-off-by: Alistair Francis ---

[PULL v2 24/47] qtest/riscv-iommu-test: add init queues test

2024-09-24 Thread Alistair Francis
From: Daniel Henrique Barboza Add an additional test to further exercise the IOMMU where we attempt to initialize the command, fault and page-request queues. These steps are taken from chapter 6.2 of the RISC-V IOMMU spec, "Guidelines for initialization". It emulates what we expect from the soft

[PULL v2 41/47] bsd-user: Define RISC-V system call structures and constants

2024-09-24 Thread Alistair Francis
From: Mark Corbin Introduced definitions for the RISC-V system call interface, including the 'target_pt_regs' structure that outlines the register storage layout during a system call. Added constants for hardware machine identifiers. Signed-off-by: Mark Corbin Signed-off-by: Ajeet Singh Co-aut

[PULL v2 38/47] bsd-user: Implement RISC-V sysarch system call emulation

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added the 'do_freebsd_arch_sysarch' function to emulate the 'sysarch' system call for the RISC-V architecture. Currently, this function returns '-TARGET_EOPNOTSUPP' to indicate that the operation is not supported. Signed-off-by: Mark Corbin Signed-off-by: Ajeet Singh Reviewed

[PULL v2 46/47] bsd-user: Implement set_mcontext and get_ucontext_sigreturn for RISCV

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added implementations for 'set_mcontext' and 'get_ucontext_sigreturn' functions for RISC-V architecture, Both functions ensure that the CPU state and user context are properly managed. Signed-off-by: Mark Corbin Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh Co-author

[PULL v2 34/47] bsd-user: Implement RISC-V TLS register setup

2024-09-24 Thread Alistair Francis
From: Mark Corbin Included the prototype for the 'target_cpu_set_tls' function in the 'target_arch.h' header file. This function is responsible for setting the Thread Local Storage (TLS) register for RISC-V architecture. Signed-off-by: Mark Corbin Signed-off-by: Ajeet Singh Reviewed-by: Richar

[PULL v2 39/47] bsd-user: Add RISC-V thread setup and initialization support

2024-09-24 Thread Alistair Francis
From: Mark Corbin Implemented functions for setting up and initializing threads in the RISC-V architecture. The 'target_thread_set_upcall' function sets up the stack pointer, program counter, and function argument for new threads. The 'target_thread_init' function initializes thread registers bas

[PULL v2 28/47] target/riscv32: Fix masking of physical address

2024-09-24 Thread Alistair Francis
From: Andrew Jones C doesn't extend the sign bit for unsigned types since there isn't a sign bit to extend. This means a promotion of a u32 to a u64 results in the upper 32 bits of the u64 being zero. If that result is then used as a mask on another u64 the upper 32 bits will be cleared. rv32 phy

[PULL v2 45/47] bsd-user: Implement 'get_mcontext' for RISC-V

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added the 'get_mcontext' function to extract and populate the RISC-V machine context from the CPU state. This function is used to gather the current state of the general-purpose registers and store it in a 'target_mcontext_' structure. Signed-off-by: Mark Corbin Signed-off-by:

[PULL v2 12/47] target/riscv: Preliminary textra trigger CSR writting support

2024-09-24 Thread Alistair Francis
From: Alvin Chang This commit allows program to write textra trigger CSR for type 2, 3, 6 triggers. In this preliminary patch, the textra.MHVALUE and the textra.MHSELECT fields are allowed to be configured. Other fields, such as textra.SBYTEMASK, textra.SVALUE, and textra.SSELECT, are hardwired t

[PULL v2 31/47] bsd-user: Implement RISC-V CPU initialization and main loop

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added the initial implementation for RISC-V CPU initialization and main loop. This includes setting up the general-purpose registers and program counter based on the provided target architecture definitions. Signed-off-by: Mark Corbin Signed-off-by: Ajeet Singh Co-authored-by

[PULL v2 42/47] bsd-user: Add generic RISC-V64 target definitions

2024-09-24 Thread Alistair Francis
From: Warner Losh Added a generic definition for RISC-V64 target-specific details. Implemented the 'regpairs_aligned' function,which returns 'false' to indicate that register pairs are not aligned in the RISC-V64 ABI. Signed-off-by: Warner Losh Signed-off-by: Ajeet Singh Reviewed-by: Richard H

[PULL v2 05/47] target/riscv/tcg/tcg-cpu.c: consider MISA bit choice in implied rule

2024-09-24 Thread Alistair Francis
From: Daniel Henrique Barboza Gitlab issue [1] reports a misleading error when trying to run a 'rv64' cpu with 'zfinx' and without 'f': $ ./build/qemu-system-riscv64 -nographic -M virt -cpu rv64,zfinx=true,f=false qemu-system-riscv64: Zfinx cannot be supported together with F extension The user

[PULL v2 11/47] util/util/cpuinfo-riscv.c: fix riscv64 build on musl libc

2024-09-24 Thread Alistair Francis
From: Milan P. Stanić build fails on musl libc (alpine linux) with this error: ../util/cpuinfo-riscv.c: In function 'cpuinfo_init': ../util/cpuinfo-riscv.c:63:21: error: '__NR_riscv_hwprobe' undeclared (first use in this function); did you mean 'riscv_hwprobe'? 63 | if (syscall(__NR_

[PULL v2 44/47] bsd-user: Implement RISC-V signal trampoline setup functions

2024-09-24 Thread Alistair Francis
From: Mark Corbin Added functions for setting up the RISC-V signal trampoline and signal frame: 'set_sigtramp_args()': Configures the RISC-V CPU state with arguments for the signal handler. It sets up the registers with the signal number,pointers to the signal info and user context, the signal h

[PATCH 01/15] acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED

2024-09-24 Thread Mauro Carvalho Chehab
This is just duplicating ACPI_GHES_ERROR_SOURCE_COUNT, which has a better name. So, drop the duplication. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 7 ++- include/hw/acpi/ghes.h | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) dif

[PATCH 00/15] Prepare GHES driver to support error injection

2024-09-24 Thread Mauro Carvalho Chehab
During the development of a patch series meant to allow GHESv2 error injections, it was requested a change on how CPER offsets are calculated, by adding a new BIOS pointer and reworking the GHES logic. See: https://lore.kernel.org/qemu-devel/cover.1726293808.git.mchehab+hua...@kernel.org/ Such ch

[PATCH 12/15] acpi/ghes: don't crash QEMU if ghes GED is not found

2024-09-24 Thread Mauro Carvalho Chehab
Instead, produce an error and continue working Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index 3af1cd16d4d7..209095f67e9a 100644 --- a/hw/acpi/ghes.c +++ b/hw/acpi/ghes.c @@ -418

[PATCH 07/15] acpi/ghes: Change the type for source_id

2024-09-24 Thread Mauro Carvalho Chehab
HEST source ID is actually a 16-bit value Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c | 2 +- include/hw/acpi/ghes.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/acpi/ghes-stub.c b/hw/acpi/ghes-stub.c index c315de180

[PATCH 09/15] acpi/ghes: make the GHES record generation more generic

2024-09-24 Thread Mauro Carvalho Chehab
Split the code into separate functions to allow using the common CPER filling code by different error sources. The generic code was moved to ghes_record_cper_errors(), and ghes_gen_err_data_uncorrectable_recoverable() now contains only a logic to fill GEGB part of the record. The remaining code t

[PATCH 08/15] acpi/ghes: Prepare to support multiple sources on ghes

2024-09-24 Thread Mauro Carvalho Chehab
The current code is actually dependent on having just one error structure with a single source. As the number of sources should be arch-dependent, as it will depend on what kind of synchronous/assynchronous notifications will exist, change the logic to dynamically build the table. Yet, for a prop

[PATCH 06/15] acpi/ghes: Remove a duplicated out of bounds check

2024-09-24 Thread Mauro Carvalho Chehab
acpi_ghes_record_errors() has an assert() at the beginning to ensure that source_id will be lower than ACPI_GHES_ERROR_SOURCE_COUNT. Remove a duplicated check. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletion

[PATCH 03/15] acpi/ghes: simplify the per-arch caller to build HEST table

2024-09-24 Thread Mauro Carvalho Chehab
The GHES driver requires not only a HEST table, but also a separate firmware file to store Error Structure records. It can't do one without the other. Simplify the caller logic for it to require one function. This prepares for further changes where the HEST table generation will become more gener

[PATCH 05/15] acpi/ghes: Fix acpi_ghes_record_errors() argument

2024-09-24 Thread Mauro Carvalho Chehab
The first argument is source ID and not notification type. Signed-off-by: Mauro Carvalho Chehab --- Changes from v8: - Non-rename/cleanup changes merged altogether; - source ID is now more generic, defined per guest target. That should make easier to add support for 86. Signed-off-by: Mauro

[PATCH 13/15] acpi/ghes: rename etc/hardware_error file macros

2024-09-24 Thread Mauro Carvalho Chehab
Now that we have also have a file to store HEST data location, which is part of GHES, better name the file where CPER records are stored. No functional changes. Reviewed-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 32 +++- 1 file chan

[PATCH 11/15] acpi/ghes: better name GHES memory error function

2024-09-24 Thread Mauro Carvalho Chehab
The current function used to generate GHES data is specific for memory errors. Give a better name for it, as we now have a generic function as well. Reviewed-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c | 2 +- include/hw/acpi/

[PATCH 10/15] acpi/ghes: move offset calculus to a separate function

2024-09-24 Thread Mauro Carvalho Chehab
Currently, CPER address location is calculated as an offset of the hardware_errors table. It is also badly named, as the offset actually used is the address where the CPER data starts, and not the beginning of the error source. Move the logic which calculates such offset to a separate function, in

[PATCH 15/15] docs: acpi_hest_ghes: fix documentation for CPER size

2024-09-24 Thread Mauro Carvalho Chehab
While the spec defines a CPER size of 4KiB for each record, currently it is set to 1KiB. Fix the documentation and add a pointer to the macro name there, as this may help to keep it updated. Signed-off-by: Mauro Carvalho Chehab Acked-by: Igor Mammedov --- docs/specs/acpi_hest_ghes.rst | 6 -

[PATCH 04/15] acpi/ghes: better handle source_id and notification

2024-09-24 Thread Mauro Carvalho Chehab
GHES has two fields that are stored on HEST error source blocks: - notification type, which is a number defined at the ACPI spec containing several arch-specific synchronous and assynchronous types; - source id, which is a HW/FW defined number, used to distinguish between different implement

[PATCH 02/15] acpi/ghes: simplify acpi_ghes_record_errors() code

2024-09-24 Thread Mauro Carvalho Chehab
Reduce the ident of the function and prepares it for the next changes. No functional changes. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 56 ++ 1 file changed, 29 insertions(+), 27 deletions(-) diff --gi

[PATCH 14/15] better name the offset of the hardware error firmware

2024-09-24 Thread Mauro Carvalho Chehab
The hardware error firmware is where HEST error structures are stored. Those can be GHESv2, but they can also be other types. Better name the location of the hardware error. No functional changes. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 4 ++-- hw/acpi/ghes.c

Re: [PATCH 00/18] Stop all qemu-cpu threads on a breakpoint

2024-09-24 Thread Richard Henderson
On 9/23/24 18:12, Ilya Leoshkevich wrote: Hi, On reporting a breakpoint in a non-non-stop mode, GDB remotes must stop all threads. Currently qemu-user doesn't do that, breaking the debugging session for at least two reasons: concurrent access to the GDB socket, and an assertion within GDB [1].

Re: [PATCH] tests/docker: Fix microblaze atomics

2024-09-24 Thread Alex Bennée
Ilya Leoshkevich writes: (add Mahesh to CC) > GCC produces invalid code for microblaze atomics. > > The fix is unfortunately not upstream, so fetch it from an external > location and apply it locally. Queued to testing/next, thanks. However I didn't see any tests failing so I'm curious where y

Re: [PATCH v2] Add -build-info and -build-info-json CLI arguments

2024-09-24 Thread Alex Bennée
Manos Pitsidianakis writes: > Hello Daniel, > > On Tue, 24 Sept 2024 at 11:45, Daniel P. Berrangé wrote: >> >> On Mon, Sep 23, 2024 at 10:09:32PM +0300, Manos Pitsidianakis wrote: >> > Hello Daniel, >> > >> > On Mon, 23 Sep 2024 19:45, "Daniel P. Berrangé" >> > wrote: >> > > On Mon, Sep 23, 20

Re: [PATCH v2] Add -build-info and -build-info-json CLI arguments

2024-09-24 Thread Daniel P . Berrangé
On Tue, Sep 24, 2024 at 01:02:26PM +0100, Alex Bennée wrote: > Manos Pitsidianakis writes: > > > Hello Daniel, > > > > On Tue, 24 Sept 2024 at 11:45, Daniel P. Berrangé > > wrote: > >> > >> On Mon, Sep 23, 2024 at 10:09:32PM +0300, Manos Pitsidianakis wrote: > >> > Hello Daniel, > >> > > >> > O

Re: [PATCH v3 30/34] migration: remove return after g_assert_not_reached()

2024-09-24 Thread Thomas Huth
On 19/09/2024 06.46, Pierrick Bouvier wrote: This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. Signed-off-by: Pierrick Bouvier --- migration/dirtyrate.c| 1 - migration/postcopy-ram.c

[PATCH v2 09/22] hw/vhost-scsi: fix -Werror=maybe-uninitialized

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../hw/scsi/vhost-scsi.c:173:12: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialized] It can be reached when num_queues=0. It probably doesn't make much sense to instantiate a vhost-scsi with 0 IO queues though. For now, make vhost_scsi_set_workers() retur

[PATCH v2 00/22] -Werror=maybe-uninitialized fixes

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau Hi, Depending on -Doptimization=, GCC (14.2.1 here) produces different maybe-uninitialized warnings: - g: produces -Werror=maybe-uninitialized errors - 0: clean build - 1: produces -Werror=maybe-uninitialized errors - 2: clean build - 3: produces few -Werror=maybe-uniniti

[PATCH v2 03/22] hw/qxl: fix -Werror=maybe-uninitialized false-positives

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../hw/display/qxl.c:1352:5: error: ‘pci_region’ may be used uninitialized [-Werror=maybe-uninitialized] ../hw/display/qxl.c:1365:22: error: ‘pci_start’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Marc-André Lureau --- hw/display/qxl.c | 4 ++

[PATCH v2 12/22] migration: fix -Werror=maybe-uninitialized false-positives

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../migration/dirtyrate.c:186:5: error: ‘records’ may be used uninitialized [-Werror=maybe-uninitialized] ../migration/dirtyrate.c:168:12: error: ‘gen_id’ may be used uninitialized [-Werror=maybe-uninitialized] ../migration/migration.c:2273:5: error: ‘file’ may be used un

[PATCH v2 00/22] -Werror=maybe-uninitialized fixes

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau Hi, Depending on -Doptimization=, GCC (14.2.1 here) produces different maybe-uninitialized warnings: - g: produces -Werror=maybe-uninitialized errors - 0: clean build - 1: produces -Werror=maybe-uninitialized errors - 2: clean build - 3: produces few -Werror=maybe-uniniti

[PATCH v2 07/22] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../block/stream.c:193:19: error: ‘unfiltered_bs’ may be used uninitialized [-Werror=maybe-uninitialized] ../block/stream.c:176:5: error: ‘len’ may be used uninitialized [-Werror=maybe-uninitialized] trace/trace-block.h:906:9: error: ‘ret’ may be used uninitialized [-Wer

Re: [PATCH v10 00/21] Add ACPI CPER firmware first error injection on ARM emulation

2024-09-24 Thread Mauro Carvalho Chehab
Em Tue, 17 Sep 2024 14:15:19 +0200 Igor Mammedov escreveu: > I'm done with this round of review. > > Given that the series accumulated a bunch of cleanups, > I'd suggest to move all cleanups/renamings not related > to new HEST lookup and new src id mapping to the beginning > of the series, so on

[PATCH v2 06/22] block/mirror: fix -Werror=maybe-uninitialized false-positive

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../block/mirror.c:404:5: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialized] ../block/mirror.c:895:12: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialized] ../block/mirror.c:578:12: error: ‘ret’ may be used uninitialized [-Werror=maybe-u

[PATCH v2 04/22] nbd: fix -Werror=maybe-uninitialized false-positive

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../nbd/client-connection.c:419:8: error: ‘wait_co’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- nbd/client-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbd/clie

[PATCH v2 11/22] block/block-copy: fix -Werror=maybe-uninitialized false-positive

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../block/block-copy.c:591:12: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Marc-André Lureau --- block/block-copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-copy.c b/block/block-copy.c index

[PATCH v2 01/22] util/coroutine: fix -Werror=maybe-uninitialized false-positive

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../util/qemu-coroutine.c:150:8: error: ‘batch’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Hajnoczi --- util/qemu-coroutine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu

[PATCH v2 10/22] hw/sdhci: fix -Werror=maybe-uninitialized false-positive

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../hw/sd/sdhci.c:846:16: error: ‘res’ may be used uninitialized [-Werror=maybe-uninitialized] False-positive, because "length" is non-null. Signed-off-by: Marc-André Lureau --- hw/sd/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/sdh

[PATCH v2 08/22] hw/ahci: fix -Werror=maybe-uninitialized false-positive

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../hw/ide/ahci.c:989:58: error: ‘tbl_entry_size’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Marc-André Lureau --- hw/ide/ahci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 7fc2a08

[PATCH v2 02/22] util/timer: fix -Werror=maybe-uninitialized false-positive

2024-09-24 Thread marcandre . lureau
From: Marc-André Lureau ../util/qemu-timer.c:198:24: error: ‘expire_time’ may be used uninitialized [-Werror=maybe-uninitialized] ../util/qemu-timer.c:476:8: error: ‘rearm’ may be used uninitialized [-Werror=maybe-uninitialized] Signed-off-by: Marc-André Lureau --- util/qemu-timer.c | 6 +++-

  1   2   >