[PATCH v5 10/16] acpi/ghes: better name GHES memory error function

2024-12-03 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 Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c

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

2024-12-03 Thread Mauro Carvalho Chehab
As described at: ACPI 6.5 spec at: 18.3.2. ACPI Error Source In particular at GHES/GHESv2 table: Table 18.10 Generic Hardware Error Source Structure HEST source ID is actually a 16-bit value. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor M

Re: [PATCH v4 13/15] acpi/ghes: move offset calculus to a separate function

2024-12-03 Thread Igor Mammedov
On Tue, 3 Dec 2024 14:47:30 +0100 Mauro Carvalho Chehab wrote: > Em Tue, 3 Dec 2024 12:51:43 +0100 > Igor Mammedov escreveu: > > > On Fri, 22 Nov 2024 10:11:30 +0100 > > Mauro Carvalho Chehab wrote: > > > > > Currently, CPER address location is calculated as an offset of > > > the hardware_

RE: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member to set the different Capability Registers.

2024-12-03 Thread Jamin Lin
Hi Philippe, > Subject: Re: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member > to set the different Capability Registers. > > On 4/12/24 04:14, Jamin Lin wrote: > > Hi Bernhard, > > > >> Subject: Re: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class > >> member to set the di

RE: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member to set the different Capability Registers.

2024-12-03 Thread Jamin Lin
Hi Philippe, > Subject: Re: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member > to set the different Capability Registers. > > On 3/12/24 03:14, Jamin Lin via wrote: > > Currently, it set the hardcode value of capability registers to all > > ASPEED SOCs However, the value of capabil

Re: [PATCH v4 08/15] acpi/ghes: make the GHES record generation more generic

2024-12-03 Thread Mauro Carvalho Chehab
Em Mon, 25 Nov 2024 11:56:43 + Jonathan Cameron escreveu: > On Fri, 22 Nov 2024 10:11:25 +0100 > Mauro Carvalho Chehab wrote: > > > 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_

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

2024-12-03 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 v5 04/16] acpi/ghes: better handle source_id and notification

2024-12-03 Thread Mauro Carvalho Chehab
GHES has two fields that are stored on HEST error source blocks associated with notifications: - 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

[PATCH v5 11/16] acpi/ghes: don't crash QEMU if ghes GED is not found

2024-12-03 Thread Mauro Carvalho Chehab
Make error handling within ghes_record_cper_errors() consistent, i.e. instead abort just print a error in case ghes GED is not found. Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov --- hw/acpi/ghes.c | 5 - 1 file changed, 4 insertions(+), 1 d

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

2024-12-03 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 Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 56 ++ 1 file changed, 29 insertions

[PATCH v5 12/16] acpi/ghes: rename etc/hardware_error file macros

2024-12-03 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. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Igor Mammedov Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 38 ++

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

2024-12-03 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 Reviewed-by: Jonathan Cameron --- hw/acpi/ghes.c | 7 ++- include/hw/acpi/ghes.h | 3 ++- 2 files changed, 4 ins

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

2024-12-03 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 the Generic Error Data part of the record, as

[PATCH v5 14/16] acpi/ghes: move offset calculus to a separate function

2024-12-03 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 v5 13/16] acpi/ghes: better name the offset of the hardware error firmware

2024-12-03 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 Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --

[PATCH v5 08/16] acpi/ghes: don't check if physical_address is not zero

2024-12-03 Thread Mauro Carvalho Chehab
The 'physical_address' value is a faulty page. As such, 0 is as valid as any other value. Suggested-by: Igor Mammedov Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index edc74c38bf8a..a3dffd78b012 1

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

2024-12-03 Thread Mauro Carvalho Chehab
Align the header file with the actual implementation of this function, as the first argument is source ID and not notification type. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Reviewed-by: Igor Mammedov --- Changes from v8: - Non-rename/cleanup changes merged altogethe

[PATCH v5 15/16] acpi/ghes: Change ghes fill logic to work with only one source

2024-12-03 Thread Mauro Carvalho Chehab
Extending to multiple sources require a BIOS pointer to the beginning of the HEST table, which in turn requires a backward-compatible code. So, the current code supports only one source. Ensure that and simplify the code. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron Review

[PATCH 2/5] tests/functional: Extract the find_free_ports() function into a helper file

2024-12-03 Thread Thomas Huth
We'll need this functionality in other functional tests, too, so let's extract it into the qemu_test module. Also add an __enter__ and __exit__ function that can be used for using this functionality in a locked context, so that tests that are running in parallel don't try to compete for the same p

[PATCH 4/5] tests/functional/test_vnc: Remove the test_no_vnc test

2024-12-03 Thread Thomas Huth
This test matches exactly the first three lines of the following test_no_vnc_change_password test, so there is exactly zero additional test coverage in here. Signed-off-by: Thomas Huth --- tests/functional/test_vnc.py | 5 - 1 file changed, 5 deletions(-) diff --git a/tests/functional/test_

[PATCH 1/5] tests/functional: Convert the vnc test

2024-12-03 Thread Thomas Huth
Nothing thrilling in here, it's just a straight forward conversion. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/functional/meson.build | 1 + tests/{avocado/vnc.py => functional/test_vnc.py} | 12 +++-

[PATCH for-10.0 0/5] tests/functional: Convert tests with find_free_ports()

2024-12-03 Thread Thomas Huth
Convert the vnc and migration test that use a find_free_ports() function to look for a free port. Since the functional tests can be run in parallel, we extract the find_free_ports() function into a helper and provide a locking mechanism so that the tests don't race for the free ports (see second pa

[PATCH] MAINTAINERS: Cover the tests/functional/test_sh4eb_r2d.py file

2024-12-03 Thread Thomas Huth
This file should belong to the R2D machine in the MAINTAINERS file. Signed-off-by: Thomas Huth --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index aaf0505a21..727f18fae5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1643,7 +1643,7

[PATCH] tests/functional: Bump the timeout of the sh4_tuxrun test

2024-12-03 Thread Thomas Huth
When running "make -j$(nproc) check SPEED=thorough", the sh4_tuxrun test is timing out for me, and using TIMEOUT_MULTIPLIER I can see that it clearly takes more than 100 seconds to finish. Thus increase the timeout setting of this test to avoid the problem. Signed-off-by: Thomas Huth --- tests/f

Re: [PATCH 03/11] softfloat: Use goto for default nan case in pick_nan_muladd

2024-12-03 Thread Philippe Mathieu-Daudé
On 3/12/24 21:39, Richard Henderson wrote: Remove "3" as a special case for which and simply branch to return the desired value. Signed-off-by: Richard Henderson --- fpu/softfloat-parts.c.inc | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) Reviewed-by: Philippe

Re: [PATCH-for-10.0 v2 01/13] hw/pci: Do not declare PCIBus::flags mask as enum

2024-12-03 Thread Thomas Huth
On 27/11/2024 10.37, Philippe Mathieu-Daudé wrote: On 26/11/24 12:22, Philippe Mathieu-Daudé wrote: We use PCIBus::flags to mask various flags. It is not an enum, and doing so confuses static analyzers. Rename the enum as singular. Use a generic unsigned type for the mask. Signed-off-by: Philip

Re: [PATCH for-10.0 2/2] hw: add compat machines for 10.0

2024-12-03 Thread Thomas Huth
On 26/11/2024 11.30, Cornelia Huck wrote: Add 10.0 machine types for arm/i440fx/m68k/q35/s390x/spapr. Signed-off-by: Cornelia Huck --- hw/arm/virt.c | 9 - hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 13 ++

Re: [PATCH 05/11] softfloat: Pad array size in pick_nan_muladd

2024-12-03 Thread Philippe Mathieu-Daudé
On 3/12/24 21:39, Richard Henderson wrote: While all indices into val[] should be in [0-2], the mask applied is two bits. To help static analysis see there is no possibility of read beyond the end of the array, pad the array to 4 entries, with the final being (implicitly) NULL. Squash in previ

Re: [PATCH 04/11] softfloat: Remove which from parts_pick_nan_muladd

2024-12-03 Thread Philippe Mathieu-Daudé
On 3/12/24 21:39, Richard Henderson wrote: Assign the pointer return value to 'a' directly, rather than going through an intermediary index. Signed-off-by: Richard Henderson --- fpu/softfloat-parts.c.inc | 32 ++-- 1 file changed, 10 insertions(+), 22 deletions(-)

Re: [PATCH v5 18/20] intel_iommu: Introduce a property x-flts for scalable modern mode

2024-12-03 Thread CLEMENT MATHIEU--DRIF
On 04/12/2024 04:34, Jason Wang wrote: > Caution: External email. Do not open attachments or click links, unless this > email comes from a known sender and you know the content is safe. > > > On Mon, Nov 11, 2024 at 4:39 PM Zhenzhong Duan > wrote: >> >> Intel VT-d 3.0 introduces scalable mod

Re: [PATCH 01/11] target/arm: Copy entire float_status in is_ebf

2024-12-03 Thread Philippe Mathieu-Daudé
On 3/12/24 21:39, Richard Henderson wrote: Now that float_status has a bunch of fp parameters, it is easier to copy an existing structure than create one from scratch. Begin by copying the structure that corresponds to the FPSR and make only the adjustments required for BFloat16 semantics. Sign

Re: [PATCH 11/11] softfloat: Replace WHICH with RET in parts_pick_nan

2024-12-03 Thread Philippe Mathieu-Daudé
On 3/12/24 21:39, Richard Henderson wrote: Replace the "index" selecting between A and B with a result variable of the proper type. This improves clarity within the function. Signed-off-by: Richard Henderson --- fpu/softfloat-parts.c.inc | 28 +--- 1 file changed, 13

Re: [PATCH 08/11] softfloat: Inline pickNaN

2024-12-03 Thread Philippe Mathieu-Daudé
On 3/12/24 21:39, Richard Henderson wrote: Inline pickNaN into its only caller. This makes one assert redundant with the immediately preceding IF. Signed-off-by: Richard Henderson --- fpu/softfloat-parts.c.inc | 82 + fpu/softfloat-specialize.c.inc | 96

Re: [PATCH 02/11] softfloat: Inline pickNaNMulAdd

2024-12-03 Thread Philippe Mathieu-Daudé
On 3/12/24 21:39, Richard Henderson wrote: Inline pickNaNMulAdd into its only caller. This makes one assert redundant with the immediately preceding IF. Signed-off-by: Richard Henderson --- fpu/softfloat-parts.c.inc | 35 +- fpu/softfloat-specialize.c.inc | 54 -

Re: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member to set the different Capability Registers.

2024-12-03 Thread Philippe Mathieu-Daudé
On 4/12/24 04:14, Jamin Lin wrote: Hi Bernhard, Subject: Re: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member to set the different Capability Registers. Am 3. Dezember 2024 02:14:57 UTC schrieb Jamin Lin via : Currently, it set the hardcode value of capability registers to al

Re: [PATCH for-10.0 0/9] target/riscv: add 'sha' support

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:19 AM Daniel Henrique Barboza wrote: > > Hi, > > 'sha' is defined in RVA22 as "augmented hypervisor extension" and > consists of a set of named features that must be enabled. > > RVA23 makes 'sha' mandatory, so let's add official support for it in > preparation to support

Re: [PATCH for-10.0 9/9] target/riscv/tcg: add sha

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:19 AM Daniel Henrique Barboza wrote: > > 'sha' is the augmented hypervisor extension, defined in RVA22 as a set of > the following extensions: > > - RVH > - Ssstateen > - Shcounterenw (always present) > - Shvstvala (always present) > - Shtvala (always present) > - Shvstve

Re: [PATCH for-10.0 8/9] target/riscv: add shgatpa

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:20 AM Daniel Henrique Barboza wrote: > > shgatpa is defined in RVA22 as: > > "For each supported virtual memory scheme SvNN supported in satp, the > corresponding hgatp SvNNx4 mode must be supported. The hgatp mode Bare > must also be supported." > > Claim support for shg

Re: [PATCH for-10.0 7/9] target/riscv: add shvsatpa

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:20 AM Daniel Henrique Barboza wrote: > > shvsatpa is defined in RVA22 as: > > "All translation modes supported in satp must be supported in vsatp." > > This is always true in TCG so let's claim support for it. > > Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alis

Re: [PATCH for-10.0 6/9] target/riscv: add shvstvecd

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:20 AM Daniel Henrique Barboza wrote: > > shvstvecd is defined in RVA22 as: > > "vstvec.MODE must be capable of holding the value 0 (Direct). > When vstvec.MODE=Direct, vstvec.BASE must be capable of holding any > valid four-byte-aligned address." > > This is always true f

Re: [PATCH for-10.0 5/9] target/riscv: add shtvala

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:20 AM Daniel Henrique Barboza wrote: > > shtvala is described in RVA22 as: > > "htval must be written with the faulting guest physical address > in all circumstances permitted by the ISA." > > This is the case since commit 3067553993, so claim support for shtvala. > > Sig

Re: [PATCH for-10.0 4/9] target/riscv: add shvstvala

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:20 AM Daniel Henrique Barboza wrote: > > shvstvala is defined in RVA22 as: > > "vstval must be written in all cases described above for stval." > > By "cases describe above" the doc refer to the description of sstvala: > > "stval must be written with the faulting virtual

Re: [PATCH for-10.0 3/9] target/riscv: add shcounterenw

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:20 AM Daniel Henrique Barboza wrote: > > shcounterenw is defined in RVA22 as: > > "For any hpmcounter that is not read-only zero, the corresponding bit in > hcounteren must be writable." > > This is always true in TCG so let's claim support for it. > > Signed-off-by: Dani

Re: [PATCH for-10.0 2/9] target/riscv: add ssstateen

2024-12-03 Thread Alistair Francis
On Thu, Nov 14, 2024 at 2:20 AM Daniel Henrique Barboza wrote: > > ssstateen is defined in RVA22 as: > > "Supervisor-mode view of the state-enable extension. The supervisor-mode > (sstateen0-3) and hypervisor-mode (hstateen0-3) state-enable registers > must be provided." > > Add ssstateen as a nam

Re: [PATCH v5 18/20] intel_iommu: Introduce a property x-flts for scalable modern mode

2024-12-03 Thread Jason Wang
On Mon, Nov 11, 2024 at 4:39 PM Zhenzhong Duan wrote: > > Intel VT-d 3.0 introduces scalable mode, and it has a bunch of capabilities > related to scalable mode translation, thus there are multiple combinations. > > This vIOMMU implementation wants to simplify it with a new property "x-flts". > Wh

Re: [PATCH v5 16/20] intel_iommu: Set default aw_bits to 48 starting from QEMU 9.2

2024-12-03 Thread Jason Wang
On Mon, Nov 11, 2024 at 4:39 PM Zhenzhong Duan wrote: > > According to VTD spec, stage-1 page table could support 4-level and > 5-level paging. > > However, 5-level paging translation emulation is unsupported yet. > That means the only supported value for aw_bits is 48. So default > aw_bits to 48

Re: [PATCH v5 13/20] intel_iommu: Add support for PASID-based device IOTLB invalidation

2024-12-03 Thread Jason Wang
On Mon, Nov 11, 2024 at 4:39 PM Zhenzhong Duan wrote: > > From: Clément Mathieu--Drif > > Signed-off-by: Clément Mathieu--Drif > Signed-off-by: Zhenzhong Duan > --- Acked-by: Jason Wang Thanks

Re: [PATCH v5 15/20] tests/acpi: q35: allow DMAR acpi table changes

2024-12-03 Thread Jason Wang
On Mon, Nov 11, 2024 at 4:39 PM Zhenzhong Duan wrote: > > Signed-off-by: Zhenzhong Duan > --- > tests/qtest/bios-tables-test-allowed-diff.h | 1 + > 1 file changed, 1 insertion(+) Acked-by: Jason Wang Thanks

[PATCH RESEND v1] target/riscv: add support for RV64 Xiangshan Nanhu CPU

2024-12-03 Thread MollyChen
Add a CPU entry for the RV64 XiangShan NANHU CPU which supports single-core and dual-core configurations. More details can be found at https://docs.xiangshan.cc/zh-cn/latest/integration/overview Signed-off-by: MollyChen --- target/riscv/cpu-qom.h | 1 + target/riscv/cpu.c | 29

RE: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member to set the different Capability Registers.

2024-12-03 Thread Jamin Lin
Hi Bernhard, > Subject: Re: [PATCH v2 3/6] hw:sdhci: Introduce a new "capareg" class member > to set the different Capability Registers. > Am 3. Dezember 2024 02:14:57 UTC schrieb Jamin Lin via > : > >Currently, it set the hardcode value of capability registers to all > >ASPEED SOCs However, the

[PATCH v1] Add a CPU entry for the RV64 XiangShan NANHU CPU which supports single-core and dual-core configurations. More details can be found at https://docs.xiangshan.cc/zh-cn/latest/integration/ove

2024-12-03 Thread MollyChen
Signed-off-by: MollyChen --- target/riscv/cpu-qom.h | 1 + target/riscv/cpu.c | 29 + 2 files changed, 30 insertions(+) diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h index 62115375cd..8f6fac463c 100644 --- a/target/riscv/cpu-qom.h +++ b/target/risc

Re: Host riscv disas is broken

2024-12-03 Thread Alistair Francis
On Thu, Oct 17, 2024 at 2:39 PM LIU Zhiwei wrote: > > > On 2024/10/17 11:52, Richard Henderson wrote: > > On 10/16/24 19:57, LIU Zhiwei wrote: > >> Hi Richard, > >> > >> On 2024/10/17 02:38, Richard Henderson wrote: > >>> 2595: if (dec->cfg->ext_zcmop) { > >>> 2690:if (dec->cfg->ex

Re: [PATCH 0/2] target/riscv: Include missing headers in '*internals.h'

2024-12-03 Thread Alistair Francis
On Wed, Dec 4, 2024 at 5:09 AM Philippe Mathieu-Daudé wrote: > > 2 trivial RISC-V oriented patches extracted from a bigger > series which refactor include/exec/ headers. > > Philippe Mathieu-Daudé (2): > target/riscv: Include missing headers in 'vector_internals.h' > target/riscv: Include miss

Re: [PATCH v5 0/6] Introduce svukte ISA extension

2024-12-03 Thread Alistair Francis
On Tue, Dec 3, 2024 at 12:39 PM Fea.Wang wrote: > > The Svukte ISA extension has been approved for fast-track development. > https://lf-riscv.atlassian.net/browse/RVS-2977 > And there are Linux patches for the Svukte that are under review. > https://lore.kernel.org/kvm/20240920-dev-maxh-svukte-reb

Re: [PATCH 2/2] target/riscv: Include missing headers in 'internals.h'

2024-12-03 Thread Alistair Francis
On Wed, Dec 4, 2024 at 5:09 AM Philippe Mathieu-Daudé wrote: > > Rather than relying on implicit includes, explicit them, > in order to avoid when refactoring unrelated headers: > > target/riscv/internals.h:49:15: error: use of undeclared identifier 'PRV_S' > 49 | ret = PRV_S; >

Re: [PATCH 1/2] target/riscv: Include missing headers in 'vector_internals.h'

2024-12-03 Thread Alistair Francis
On Wed, Dec 4, 2024 at 5:09 AM Philippe Mathieu-Daudé wrote: > > Rather than relying on implicit includes, explicit them, > in order to avoid when refactoring unrelated headers: > > target/riscv/vector_internals.h:36:12: error: call to undeclared function > 'FIELD_EX32'; ISO C99 and later do no

[PATCH v2] hw/mem: support zero memory size CXL device

2024-12-03 Thread Hongjian Fan
This patch allows a CXL type3 device to be initialized with zero memory size, when there is no memory device property provided. Signed-off-by: Hongjian Fan --- hw/mem/cxl_type3.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_t

[PATCH v8 09/12] migration/multifd: Enable DSA offloading in multifd sender path.

2024-12-03 Thread Yichen Wang
From: Hao Xiang Multifd sender path gets an array of pages queued by the migration thread. It performs zero page checking on every page in the array. The pages are classfied as either a zero page or a normal page. This change uses Intel DSA to offload the zero page checking from CPU to the DSA ac

[PATCH v8 05/12] util/dsa: Implement DSA task asynchronous completion thread model.

2024-12-03 Thread Yichen Wang
From: Hao Xiang * Create a dedicated thread for DSA task completion. * DSA completion thread runs a loop and poll for completed tasks. * Start and stop DSA completion thread during DSA device start stop. User space application can directly submit task to Intel DSA accelerator by writing to DSA's

[PATCH v8 10/12] util/dsa: Add unit test coverage for Intel DSA task submission and completion.

2024-12-03 Thread Yichen Wang
From: Hao Xiang * Test DSA start and stop path. * Test DSA configure and cleanup path. * Test DSA task submission and completion path. Signed-off-by: Bryan Zhang Signed-off-by: Hao Xiang Signed-off-by: Yichen Wang --- tests/unit/meson.build | 6 + tests/unit/test-dsa.c | 503 +

[PATCH v8 08/12] migration/multifd: Add new migration option for multifd DSA offloading.

2024-12-03 Thread Yichen Wang
From: Hao Xiang Intel DSA offloading is an optional feature that turns on if proper hardware and software stack is available. To turn on DSA offloading in multifd live migration by setting: zero-page-detection=dsa-accel accel-path="dsa: dsa:[dsa_dev_path2] ..." This feature is turned off by def

[PATCH v8 01/12] meson: Introduce new instruction set enqcmd to the build system.

2024-12-03 Thread Yichen Wang
From: Hao Xiang Enable instruction set enqcmd in build. Signed-off-by: Hao Xiang Signed-off-by: Yichen Wang Reviewed-by: Fabiano Rosas --- meson.build | 14 ++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 19 ins

[PATCH v8 02/12] util/dsa: Add idxd into linux header copy list.

2024-12-03 Thread Yichen Wang
Signed-off-by: Yichen Wang Reviewed-by: Fabiano Rosas --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 99a8d9fa4c..9128c7499b 100755 --- a/scripts/update-linux-headers.s

[PATCH v8 07/12] util/dsa: Implement DSA task asynchronous submission and wait for completion.

2024-12-03 Thread Yichen Wang
From: Hao Xiang * Add a DSA task completion callback. * DSA completion thread will call the tasks's completion callback on every task/batch task completion. * DSA submission path to wait for completion. * Implement CPU fallback if DSA is not able to complete the task. Signed-off-by: Hao Xiang S

[PATCH v8 12/12] migration/doc: Add DSA zero page detection doc

2024-12-03 Thread Yichen Wang
From: Yuan Liu Signed-off-by: Yuan Liu Signed-off-by: Yichen Wang Reviewed-by: Fabiano Rosas --- .../migration/dsa-zero-page-detection.rst | 290 ++ docs/devel/migration/features.rst | 1 + 2 files changed, 291 insertions(+) create mode 100644 docs/devel/mig

[PATCH v8 00/12] Use Intel DSA accelerator to offload zero page checking in multifd live migration.

2024-12-03 Thread Yichen Wang
v8 * Rebase on top of 1cf9bc6eba7506ab6d9de635f224259225f63466; * Fixed the hmp parsing crash in migrate_set_parameter; * Addressed initialization/cleanup comments from v7; v7 * Rebase on top of f0a5a31c33a8109061c2493e475c8a2f4d022432; * Fix a bug that will crash QEMU when DSA initialization fail

[PATCH v8 11/12] migration/multifd: Add integration tests for multifd with Intel DSA offloading.

2024-12-03 Thread Yichen Wang
From: Hao Xiang * Add test case to start and complete multifd live migration with DSA offloading enabled. * Add test case to start and cancel multifd live migration with DSA offloading enabled. Signed-off-by: Bryan Zhang Signed-off-by: Hao Xiang Signed-off-by: Yichen Wang Reviewed-by: Fabiano

[PATCH v8 04/12] util/dsa: Implement DSA task enqueue and dequeue.

2024-12-03 Thread Yichen Wang
From: Hao Xiang * Use a safe thread queue for DSA task enqueue/dequeue. * Implement DSA task submission. * Implement DSA batch task submission. Signed-off-by: Hao Xiang Signed-off-by: Yichen Wang Reviewed-by: Fabiano Rosas --- include/qemu/dsa.h | 29 +++ util/dsa.c | 186 ++

[PATCH v8 03/12] util/dsa: Implement DSA device start and stop logic.

2024-12-03 Thread Yichen Wang
From: Hao Xiang * DSA device open and close. * DSA group contains multiple DSA devices. * DSA group configure/start/stop/clean. Signed-off-by: Hao Xiang Signed-off-by: Bryan Zhang Signed-off-by: Yichen Wang --- include/qemu/dsa.h | 99 util/dsa.c | 280 +

[PATCH v8 06/12] util/dsa: Implement zero page checking in DSA task.

2024-12-03 Thread Yichen Wang
From: Hao Xiang Create DSA task with operation code DSA_OPCODE_COMPVAL. Here we create two types of DSA tasks, a single DSA task and a batch DSA task. Batch DSA task reduces task submission overhead and hence should be the default option. However, due to the way DSA hardware works, a DSA batch ta

Re: [PATCH v5 08/20] intel_iommu: Check stage-1 translation result with interrupt range

2024-12-03 Thread Jason Wang
On Mon, Nov 11, 2024 at 4:38 PM Zhenzhong Duan wrote: > > Per VT-d spec 4.1 section 3.15, "Untranslated requests and translation > requests that result in an address in the interrupt range will be > blocked with condition code LGN.4 or SGN.8." > > This applies to both stage-1 and stage-2 IOMMU pag

[RFC PATCH 0/1] ACPI: Fix missing CPU hotplug/hotunplug events with > 255 vCPUs

2024-12-03 Thread Eric Mackay
ACPI hotplug with 255 or less vCPUs can use the legacy CPU hotplug interface, which does not support hotunplug. If it's available, hotunplug will use the modern CPU hotplug interface. This creates a situation where hotplug and hotunplug are using different interfaces, but the end result is still

[RFC PATCH 1/1] ACPI: Enforce mutual exclusion betwen CPU insertion and removal events

2024-12-03 Thread Eric Mackay
Setting a new pending event will clear a previously pending event of the opposite type, for a given vCPU. Intuitively, a physical CPU cannot be in the process of both hotplugging and hot-unplugging at the same time. Signed-off-by: Eric Mackay --- hw/acpi/cpu.c | 36 +

Re: [PATCH 4/5] migration: Activate block devices if VM is paused when migrating

2024-12-03 Thread Peter Xu
On Wed, Nov 27, 2024 at 07:40:39PM +0200, Andrey Drobyshev wrote: > On 11/25/24 7:07 PM, Peter Xu wrote: > > On Mon, Nov 25, 2024 at 11:46:11AM -0300, Fabiano Rosas wrote: > >> Currently a VM that has been target of a migration using > >> late-block-activate will crash at the end of a new migration

[PATCH RFC 11/11] tests/qtest/migration: Test successive migrations

2024-12-03 Thread Peter Xu
From: Fabiano Rosas Add a framework for running migrations back and forth between two guests (aka ping-pong migration). We have seen a couple of bugs that only reproduce when a guest is migrated and the destination machine is used as the source of a new migration. Add a simple test that does 2 m

[PATCH RFC 05/11] migration/block: Merge block reactivations for fail/cancel

2024-12-03 Thread Peter Xu
When migration is either cancelled or failed during switchover, especially when after the disks are inactivated, QEMU needs to remember re-activate the disks again before vm starts. It used to be done separately in two paths: one in qmp_migrate_cancel(), the other one in the failure path of migrat

[PATCH RFC 07/11] migration/block: Apply the migration_block_* API to postcopy

2024-12-03 Thread Peter Xu
Postcopy also has similar error handling for re-activation of block devices. Use the same API as precopy to do the re-activation, for both src & dst sides. Signed-off-by: Peter Xu --- migration/migration.c | 22 +++--- migration/savevm.c| 10 -- 2 files changed, 7 in

[PATCH RFC 06/11] migration/block: Extend the migration_block_* API to dest side

2024-12-03 Thread Peter Xu
Extend the usage of such API to the receiver side, because such status maintenance is also necessary there. It's needed to avoid bdrv_inactivate_all() not being invoked when the drives are already inactive. When invoked, it can crash QEMU. See the issue link for more information. So it means we

[PATCH RFC 10/11] tests/qtest/migration: Support cleaning up only one side of migration

2024-12-03 Thread Peter Xu
From: Fabiano Rosas We don't always want to cleanup both VMs at the same time. One example is the multifd cancel test, where there's a second migration reusing the source VM. The next patches will add another instance, keeping the destination VM instead. Extract the cleanup routine from test_mig

[PATCH RFC 09/11] tests/qtest/migration: Don't use hardcoded strings for -serial

2024-12-03 Thread Peter Xu
From: Fabiano Rosas Stop using hardcoded strings for -serial so we can in the next patches perform more than one migration in a row. Having the serial path hardcoded means we cannot reuse the code when dst becomes the new src. Signed-off-by: Fabiano Rosas Link: https://lore.kernel.org/r/2024112

[PATCH RFC 01/11] migration: Add helper to get target runstate

2024-12-03 Thread Peter Xu
In 99% cases, after QEMU migrates to dest host, it tries to detect the target VM runstate using global_state_get_runstate(). There's one outlier so far which is Xen that won't send global state. That's the major reason why global_state_received() check was always there together with global_state_g

[PATCH RFC 00/11] migration/block: disk activation rewrite

2024-12-03 Thread Peter Xu
I started looking at this problem as a whole when reviewing Fabiano's series, especially the patch (for a QEMU crash [1]): https://lore.kernel.org/r/20241125144612.16194-5-faro...@suse.de The proposed patch could work, but it's unwanted to add such side effect to migration. So I start to think a

[PATCH RFC 02/11] migration/block: Make late-block-active the default

2024-12-03 Thread Peter Xu
Migration capability 'late-block-active' controls when the block drives will be activated. If enabled, block drives will only be activated until VM starts, either src runstate was "live" (RUNNING, or SUSPENDED), or it'll be postponed until qmp_cont(). Let's do this unconditionally. There's no ha

[PATCH RFC 08/11] tests/qtest/migration: Move more code under only_target

2024-12-03 Thread Peter Xu
From: Fabiano Rosas The only_target option's purpose is to make sure only the destination QTestState machine is initialized. This allows the test code to retain an already initialized source machine (e.g. for doing ping pong migration). We have drifted from that a bit when adding new code, so mo

[PATCH RFC 03/11] migration/block: Apply late-block-active behavior to postcopy

2024-12-03 Thread Peter Xu
Postcopy never cared about late-block-active. However there's no mention in the capability that it doesn't apply to postcopy. Considering that we _assumed_ late activation is always good, do that too for postcopy unconditionally, just like precopy. After this patch, we should have unified the be

[PATCH RFC 04/11] migration/block: Fix possible race with block_inactive

2024-12-03 Thread Peter Xu
Src QEMU sets block_inactive=true very early before the invalidation takes place. It means if something wrong happened during setting the flag but before reaching qemu_savevm_state_complete_precopy_non_iterable() where it did the invalidation work, it'll make block_inactive flag inconsistent. For

RE: [RFC PATCH v1 36/43] target/hexagon: Add temporary vector storage

2024-12-03 Thread ltaylorsimpson
> -Original Message- > From: Brian Cain > Sent: Tuesday, December 3, 2024 1:28 PM > To: Anton Johansson ; Richard Henderson > > Cc: qemu-devel@nongnu.org; a...@rev.ng; ltaylorsimp...@gmail.com; > bc...@quicinc.com; phi...@linaro.org; alex.ben...@linaro.org > Subject: Re: [RFC PATCH v1

[PATCH v4 06/11] target/riscv: Add counter delegation definitions

2024-12-03 Thread Atish Patra
From: Kaiwen Xue This adds definitions for counter delegation, including the new scountinhibit register and the mstateen.CD bit. Signed-off-by: Kaiwen Xue Reviewed-by: Alistair Francis Signed-off-by: Atish Patra --- target/riscv/cpu.h | 1 + target/riscv/cpu_bits.h | 8 +++- target/

[PATCH v4 03/11] target/riscv: Enable S*stateen bits for AIA

2024-12-03 Thread Atish Patra
As per the ratified AIA spec v1.0, three stateen bits control AIA CSR access. Bit 60 controls the indirect CSRs Bit 59 controls the most AIA CSR state Bit 58 controls the IMSIC state such as stopei and vstopei Enable the corresponding bits in [m|h]stateen and enable corresponding checks in the CS

[PATCH v4 04/11] target/riscv: Support generic CSR indirect access

2024-12-03 Thread Atish Patra
From: Kaiwen Xue This adds the indirect access registers required by sscsrind/smcsrind and the operations on them. Note that xiselect and xireg are used for both AIA and sxcsrind, and the behavior of accessing them depends on whether each extension is enabled and the value stored in xiselect. Co

[PATCH v4 00/11] Add RISC-V Counter delegation ISA extension support

2024-12-03 Thread Atish Patra
This series adds the counter delegation extension support. The counter delegation ISA extension(Smcdeleg/Ssccfg) actually depends on multiple ISA extensions. 1. S[m|s]csrind : The indirect CSR extension[1] which defines additional 5 ([M|S|VS]IREG2-[M|S|VS]IREG6) register to address size limitat

[PATCH v4 11/11] target/riscv: Add configuration for S[m|s]csrind, Smcdeleg/Ssccfg

2024-12-03 Thread Atish Patra
Add configuration options so that they can be enabled/disabld from qemu commandline. Acked-by: Alistair Francis Reviewed-by: Daniel Henrique Barboza Signed-off-by: Atish Patra --- target/riscv/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c

[PATCH v4 10/11] target/riscv: Add implied rule for counter delegation extensions

2024-12-03 Thread Atish Patra
The counter delegation/configuration extensions depend on the following extensions. 1. Smcdeleg - To enable counter delegation from M to S 2. S[m|s]csrind - To enable indirect access CSRs Add an implied rule so that these extensions are enabled by default if the sscfg extension is enabled. Revie

[PATCH v4 02/11] target/riscv: Decouple AIA processing from xiselect and xireg

2024-12-03 Thread Atish Patra
From: Kaiwen Xue Since xiselect and xireg also will be of use in sxcsrind, AIA should have its own separated interface when those CSRs are accessed. Signed-off-by: Kaiwen Xue Reviewed-by: Alistair Francis Signed-off-by: Atish Patra --- target/riscv/csr.c | 165 +++

[PATCH v4 01/11] target/riscv: Add properties for Indirect CSR Access extension

2024-12-03 Thread Atish Patra
From: Kaiwen Xue This adds the properties for sxcsrind. Definitions of new registers and implementations will come with future patches. Signed-off-by: Kaiwen Xue Reviewed-by: Daniel Henrique Barboza Signed-off-by: Atish Patra --- target/riscv/cpu.c | 2 ++ target/riscv/cpu_cfg.h | 2 ++

[PATCH v4 09/11] target/riscv: Invoke pmu init after feature enable

2024-12-03 Thread Atish Patra
The dependant ISA features are enabled at the end of cpu_realize in finalize_features. Thus, PMU init should be invoked after that only. Move the init invocation to riscv_tcg_cpu_finalize_features. Reviewed-by: Alistair Francis Signed-off-by: Atish Patra --- target/riscv/tcg/tcg-cpu.c | 28

[PATCH v4 07/11] target/riscv: Add select value range check for counter delegation

2024-12-03 Thread Atish Patra
From: Kaiwen Xue This adds checks in ops performed on xireg and xireg2-xireg6 so that the counter delegation function will receive a valid xiselect value with the proper extensions enabled. Co-developed-by: Atish Patra Signed-off-by: Kaiwen Xue Reviewed-by: Alistair Francis Signed-off-by: Ati

[PATCH v4 05/11] target/riscv: Add properties for counter delegation ISA extensions

2024-12-03 Thread Atish Patra
This adds the properties for counter delegation ISA extensions (Smcdeleg/Ssccfg). Definitions of new registers and and implementation will come in the next set of patches. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Atish Patra --- target/riscv/cpu.c | 2 ++ target/riscv/cpu_cfg.h |

[PATCH v4 08/11] target/riscv: Add counter delegation/configuration support

2024-12-03 Thread Atish Patra
From: Kaiwen Xue The Smcdeleg/Ssccfg adds the support for counter delegation via S*indcsr and Ssccfg. It also adds a new shadow CSR scountinhibit and menvcfg enable bit (CDE) to enable this extension and scountovf virtualization. Signed-off-by: Kaiwen Xue Co-developed-by: Atish Patra Signed-o

[ANNOUNCE] QEMU 9.2.0-rc3 is now available

2024-12-03 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the fourth release candidate for the QEMU 9.2 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu.org/qemu-9.2.0-rc3.tar.xz http://download.qemu

  1   2   3   4   >