Re: [PATCH 6/6] ppc/pnv: Fix system symbols in HOMER structure definitions

2025-03-16 Thread Thomas Huth
On 17/03/2025 06.23, Nicholas Piggin wrote: These definitions were taken from skiboot firmware. I naively thought it would be nicer to keep the code similar by using the preprocessor, but it was pointed out that system headers might still use those symbols and cause something unexpected. Also jus

Re: [PATCH v3 8/8] tests/functional: Add test for fadump in PSeries

2025-03-16 Thread Aditya Gupta
Hi Thomas, On 17/03/25 11:55, Thomas Huth wrote:  Hi! On 15/03/2025 07.46, Aditya Gupta wrote: Add testcases for testing fadump with PSeries and PSeries+KVM combinations ... diff --git a/tests/functional/test_ppc64_fadump.py b/tests/functional/test_ppc64_fadump.py new file mode 100755 index

Re: [PATCH v3 2/3] hw/loongarch/virt: Remove unnecessary NULL pointer

2025-03-16 Thread bibo mao
On 2025/3/17 下午2:08, Markus Armbruster wrote: Bibo Mao writes: There is NULL pointer checking function error_propagate() already, it is not necessary to add checking for function parameter. Here remove NULL pointer checking with function parameter. Since function will return directly when

Re: [PATCH] tests/functional/test_arm_orangepi: rename test class to 'OrangePiMachine'

2025-03-16 Thread Thomas Huth
On 16/03/2025 22.02, Niek Linnenbank wrote: The test class in this file contains all functional test cases for testing the Orange Pi PC board. It should be given a name matching the Qemu machine it covers. This commit sets the test class name to 'OrangePiMachine'. Signed-off-by: Niek Linnenbank

Re: [PATCH v3 6/7] memory: Attach MemoryAttributeManager to guest_memfd-backed RAMBlocks

2025-03-16 Thread Tony Lindgren
Hi, On Mon, Mar 10, 2025 at 04:18:34PM +0800, Chenyi Qiang wrote: > --- a/system/physmem.c > +++ b/system/physmem.c > @@ -1885,6 +1886,16 @@ static void ram_block_add(RAMBlock *new_block, Error > **errp) > qemu_mutex_unlock_ramlist(); > goto out_free; > } > + >

Re: [PATCH v3 8/8] tests/functional: Add test for fadump in PSeries

2025-03-16 Thread Thomas Huth
Hi! On 15/03/2025 07.46, Aditya Gupta wrote: Add testcases for testing fadump with PSeries and PSeries+KVM combinations ... diff --git a/tests/functional/test_ppc64_fadump.py b/tests/functional/test_ppc64_fadump.py new file mode 100755 index ..3d6d3734e243 --- /dev/null +++ b/tes

Re: [PATCH v3 2/3] hw/loongarch/virt: Remove unnecessary NULL pointer

2025-03-16 Thread Markus Armbruster
Bibo Mao writes: > There is NULL pointer checking function error_propagate() already, > it is not necessary to add checking for function parameter. Here remove > NULL pointer checking with function parameter. > > Since function will return directly when there is error report, this > patch removes

[PATCH 6/6] ppc/pnv: Fix system symbols in HOMER structure definitions

2025-03-16 Thread Nicholas Piggin
These definitions were taken from skiboot firmware. I naively thought it would be nicer to keep the code similar by using the preprocessor, but it was pointed out that system headers might still use those symbols and cause something unexpected. Also just nicer to keep the QEMU tree clean. Cc: Thom

Re: [PATCH] target/ppc: Add PIR to ppc_cpu_dump_state() for debug print out

2025-03-16 Thread Nicholas Piggin
On Mon Mar 17, 2025 at 12:43 AM AEST, BALATON Zoltan wrote: > Some CPU variants have a Processor Identification Register which was > not printed in register dump. Add it to ppc_cpu_dump_state() which is > used by debug options to print CPU register values. > > Signed-off-by: BALATON Zoltan Looks

[PATCH 3/6] ppc/xive2: Fix logical / bitwise comparison typo

2025-03-16 Thread Nicholas Piggin
The comparison as written is always false (perhaps confusingly, because the functions/macros are not really booleans but return 0 or the tested bit value). Change to use logical-and. Resolves: Coverity CID 1593721 Cc: Cédric Le Goater Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 2 +- 1

[PATCH 1/6] ppc/xive: Fix typo in crowd block level calculation

2025-03-16 Thread Nicholas Piggin
I introduced this bug when "tidying" the original patch, not Frederic. Paper bag for me. Fixes: 9cb7f6ebed60 ("ppc/xive2: Support group-matching when looking for target") Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/int

[PATCH 5/6] ppc/pnv: Move the PNOR LPC address into struct PnvPnor

2025-03-16 Thread Nicholas Piggin
Rather than use the hardcoded define throughout the tree for the PNOR LPC address, keep it within the PnvPnor object. This should solve a dead code issue in the BMC HIOMAP checks where Coverity (correctly) reported that the sanity checks are dead code. We would like to keep the sanity checks witho

[PATCH 4/6] ppc/spapr: Fix possible pa_features memory overflow

2025-03-16 Thread Nicholas Piggin
Coverity reports a possible memory overflow in spapr_dt_pa_features(). This should not be a true bug since DAWR1 cap is only be true for CPU_POWERPC_LOGICAL_3_10. Add an assertion to ensure any bug there is caught. Resolves: Coverity CID 1593722 Fixes: 5f361ea187ba ("ppc: spapr: Enable 2nd DAWR on

[PATCH v2 2/2] memory: suppress INVALID_MEM logs caused by debug access

2025-03-16 Thread Nicholas Piggin
Debugger-driven invalid memory accesses are not guest errors, so should not cause these error logs. Debuggers can access memory wildly, including access to addresses not specified by the user (e.g., gdb it might try to walk the stack or load target addresses to display disassembly). Failure is rep

[PATCH 2/6] pnv/xive: Fix possible undefined shift error in group size calculation

2025-03-16 Thread Nicholas Piggin
Coverity discovered a potential shift overflow in group size calculation in the case of a guest error. Add checks and logs to ensure a issues are caught. Make the group and crowd error checking code more similar to one another while here. Resolves: Coverity CID 1593724 Fixes: 9cb7f6ebed60 ("ppc/x

[PATCH v2 0/2] gdb invalid memory access handling improvements

2025-03-16 Thread Nicholas Piggin
This adds .debug=1 attribute for GDB's phys mem access mode, adds memory transaction error handling for it so it reports cannot access memory instead of silent success, and silences warning logs for invalid memory access coming from the debugger. Changes since v1: - Move phys_memory_rw_debug() int

[PATCH v2 1/2] gdbstub: Improve physical memory access handling

2025-03-16 Thread Nicholas Piggin
Bring gdb's physical memory access handling up to speed with the CPU memory access, by setting MemTxAttribute.debug=1, and by checking for memory transaction errors. GDB with PhyMemMode will now report failure for memory access outside valid system memory addresses, and it is also able to write to

Re: [PATCH v3 3/7] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard()

2025-03-16 Thread Kishen Maloor
On 3/10/25 1:18 AM, Chenyi Qiang wrote: ... diff --git a/migration/ram.c b/migration/ram.c index ce28328141..053730367b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -816,8 +816,8 @@ static inline bool migration_bitmap_clear_dirty(RAMState *rs, return ret; } -static void dirty

Re: [PATCH] ppc/amigaone: Check blk_pwrite return value

2025-03-16 Thread Nicholas Piggin
On Sat Mar 15, 2025 at 6:01 AM AEST, BALATON Zoltan wrote: > Coverity reported that return value of blk_pwrite() maybe should not > be ignored. We can't do much if this happens other than report an > error but let's do that to silence this report. > > Resolves: Coverity CID 1593725 > Signed-off-by:

Re: [PATCH] ppc/amigaone: Constify default_env

2025-03-16 Thread Nicholas Piggin
On Sat Mar 15, 2025 at 6:01 AM AEST, BALATON Zoltan wrote: > The variable holding default env is not supposed to be written. > > Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin > --- > hw/ppc/amigaone.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/ppc/

Re: [PATCH v3 3/7] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard()

2025-03-16 Thread Chenyi Qiang
On 3/17/2025 11:00 AM, Kishen Maloor wrote: > On 3/10/25 1:18 AM, Chenyi Qiang wrote: >> ... >> diff --git a/migration/ram.c b/migration/ram.c >> index ce28328141..053730367b 100644 >> --- a/migration/ram.c >> +++ b/migration/ram.c >> @@ -816,8 +816,8 @@ static inline bool >> migration_bitmap_cl

Re: [PATCH v3 4/7] memory-attribute-manager: Introduce MemoryAttributeManager to manage RAMBLock with guest_memfd

2025-03-16 Thread Chenyi Qiang
On 3/14/2025 8:11 PM, Gupta, Pankaj wrote: > On 3/10/2025 9:18 AM, Chenyi Qiang wrote: >> As the commit 852f0048f3 ("RAMBlock: make guest_memfd require >> uncoordinated discard") highlighted, some subsystems like VFIO may >> disable ram block discard. However, guest_memfd relies on the discard >

[PATCH v3 3/3] target/loongarch: Remove unnecessary temporary variable assignment

2025-03-16 Thread Bibo Mao
Temporary variable ret is assigned at last line and return, it can be removed and return directly. Signed-off-by: Bibo Mao Reviewed-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé --- target/loongarch/tcg/tlb_helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff -

[PATCH v3 0/3] target/loongarch: Solve some issues reported from coccinelle

2025-03-16 Thread Bibo Mao
This patch set solves errors reported by coccinelle tool with commands: spatch --sp-file scripts/coccinelle/*.cocci --dir target/loongarch/ spatch --sp-file scripts/coccinelle/*.cocci --dir hw/loongarch/ The main problem is that qemu should fail to run when feature is forced to enabled however

[PATCH v3 2/3] hw/loongarch/virt: Remove unnecessary NULL pointer

2025-03-16 Thread Bibo Mao
There is NULL pointer checking function error_propagate() already, it is not necessary to add checking for function parameter. Here remove NULL pointer checking with function parameter. Since function will return directly when there is error report, this patch removes combination about error_setg(

[PATCH v3] QIOChannelSocket: Flush zerocopy socket error queue on sendmsg failure due to ENOBUF

2025-03-16 Thread Manish Mishra
We allocate extra metadata SKBs in case of a zerocopy send. This metadata memory is accounted for in the OPTMEM limit. If there is any error while sending zerocopy packets or if zerocopy is skipped, these metadata SKBs are queued in the socket error queue. This error queue is freed when userspace r

Re: [CAUTION - External Sender] Re: [PATCH 00/12] target/riscv: Fix some RISC-V instruction corner cases

2025-03-16 Thread Anton Blanchard
Hi Max, On Fri, Feb 28, 2025 at 1:47 AM Max Chou wrote: > While reviewing this patchset, I noticed a few missing parts related to > the mismatched input EEWs encoding constraint. > I also found a few other rvv encoding issues and planned to submit an > upstream patchset to address them. > However

Re: [PATCH] host/include/loongarch64: Fix inline assembly compatibility with Clang

2025-03-16 Thread bibo mao
Reviewed-by: Mao Bibo On 2025/3/14 上午11:31, Yao Zi wrote: Clang on LoongArch only accepts fp register names in the dollar-prefixed form, while GCC allows omitting the dollar. Change registers in ASM clobbers to the dollar-prefixed form to make user emulators buildable with Clang on loongarch64.

Re: [PATCH] util/loongarch64: Add clang compiler support

2025-03-16 Thread bibo mao
On 2025/3/15 上午1:19, Yao Zi wrote: On Fri, Mar 07, 2025 at 09:13:39AM +0800, Bibo Mao wrote: Float register name f0 - f31 is not recognized with clang compiler with LoongArch64 target, its name should be $f0 - $f31. It is ok for both gcc and clang compiler. Sorry I didn't search the list ca

Re: [PATCH v2] vdpa: Allow vDPA to work on big-endian machine

2025-03-16 Thread Michael S. Tsirkin
On Mon, Mar 17, 2025 at 08:26:37AM +0800, Jason Wang wrote: > On Thu, Mar 13, 2025 at 11:14 PM Konstantin Shkolnyy > wrote: > > > > On 2/23/2025 19:57, Jason Wang wrote: > > > On Sat, Feb 22, 2025 at 3:08 AM Konstantin Shkolnyy > > > wrote: > > >> > > >> Add .set_vnet_le() function that always

Re: [PATCH v2] vdpa: Allow vDPA to work on big-endian machine

2025-03-16 Thread Jason Wang
On Thu, Mar 13, 2025 at 11:14 PM Konstantin Shkolnyy wrote: > > On 2/23/2025 19:57, Jason Wang wrote: > > On Sat, Feb 22, 2025 at 3:08 AM Konstantin Shkolnyy > > wrote: > >> > >> Add .set_vnet_le() function that always returns success, assuming that > >> vDPA h/w always implements LE data format

[PATCH] tests/functional/test_arm_orangepi: rename test class to 'OrangePiMachine'

2025-03-16 Thread Niek Linnenbank
The test class in this file contains all functional test cases for testing the Orange Pi PC board. It should be given a name matching the Qemu machine it covers. This commit sets the test class name to 'OrangePiMachine'. Signed-off-by: Niek Linnenbank --- tests/functional/test_arm_orangepi.py |

Re: [PATCH] docs/system: Fix the information on how to run certain functional tests

2025-03-16 Thread Niek Linnenbank
Hi Thomas, On Tue, Mar 11, 2025 at 5:08 PM Thomas Huth wrote: > The tests have been converted to the functional framework, so > we should not talk about Avocado here anymore. > > Fixes: f7d6b772200 ("tests/functional: Convert BananaPi tests to the > functional framework") > Fixes: 380f7268b7b ("

[PATCH] target/ppc: Add PIR to ppc_cpu_dump_state() for debug print out

2025-03-16 Thread BALATON Zoltan
Some CPU variants have a Processor Identification Register which was not printed in register dump. Add it to ppc_cpu_dump_state() which is used by debug options to print CPU register values. Signed-off-by: BALATON Zoltan --- target/ppc/cpu_init.c | 11 --- 1 file changed, 8 insertions(+)

Re: [PATCH 3/6] amd_iommu: Update bitmasks representing DTE reserved fields

2025-03-16 Thread Arun Kodilkar, Sairaj
On 3/13/2025 7:53 PM, Alejandro Jimenez wrote: On 3/12/25 12:12 AM, Arun Kodilkar, Sairaj wrote: Hi Alejandro, On 3/11/2025 8:54 PM, Alejandro Jimenez wrote: [...] --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -25,6 +25,8 @@   #include "hw/i386/x86-iommu.h"   #include "qom/obj