Re: [PATCH v2 06/11] iotests/290: add test case to check 'discard-no-unref' option behavior

2024-05-23 Thread Alberto Garcia
On Mon 13 May 2024 09:31:58 AM +03, Andrey Drobyshev wrote: > We basically fill 2 images with identical data and perform discard > operations with and without 'discard-no-unref' enabled. Then we check > that images still read identically, that their disk usage is the same > (i.e. fallocate(FALLOC_

Re: [PATCH v2 05/11] iotests/common.rc: add disk_usage function

2024-05-23 Thread Alberto Garcia
On Mon 13 May 2024 09:31:57 AM +03, Andrey Drobyshev wrote: > Move the definition from iotests/250 to common.rc. This is used to > detect real disk usage of sparse files. In particular, we want to use > it for checking subclusters-based discards. > > Signed-off-by: Andrey Drobyshev Reviewed-by:

Re: [PATCH v2 04/11] block/file-posix: add trace event for fallocate() calls

2024-05-23 Thread Alberto Garcia
On Mon 13 May 2024 09:31:56 AM +03, Andrey Drobyshev wrote: > This would ease debugging of write zeroes and discard operations. > > Signed-off-by: Andrey Drobyshev Reviewed-by: Alberto Garcia Berto

[PATCH 0/2] migrate inflight emulated SCSI request for the scsi disk device

2024-05-23 Thread Hyman Huang
This patchset refine the comment of ther previous series: https://patchew.org/QEMU/cover.1712577715.git.yong.hu...@smartx.com/ Aiming to make the review easier, please review, thanks. Yong When designing the USB mass storage device model, QEMU places SCSI disk device as the backend of USB mass s

[PATCH 1/2] scsi-disk: Introduce the migrate_emulate_scsi_request field

2024-05-23 Thread Hyman Huang
To indicate to the destination whether or not emulational SCSI requests are sent, introduce the migrate_emulate_scsi_request in struct SCSIDiskState. It seeks to achieve migration backend compatibility. This commit sets the stage for the next one, which addresses the crash of a VM configured with

[PATCH 2/2] scsi-disk: Fix crash for VM configured with USB CDROM after live migration

2024-05-23 Thread Hyman Huang
For VMs configured with the USB CDROM device: -drive file=/path/to/local/file,id=drive-usb-disk0,media=cdrom,readonly=on... -device usb-storage,drive=drive-usb-disk0,id=usb-disk0... QEMU process may crash after live migration, to reproduce the issue, configure VM (Guest OS ubuntu 20.04 or 21.10)

[PATCH v2 03/12] tests/data/uefi-boot-images: Add RISC-V ISO image

2024-05-23 Thread Sunil V L
To test ACPI tables, edk2 needs to be booted with a disk image having EFI partition. This image is created using UefiTestToolsPkg. The image is generated using tests/uefi-test-tools source. Signed-off-by: Sunil V L --- .../bios-tables-test.riscv64.iso.qcow2 | Bin 0 -> 16896 bytes test

[PATCH v2 07/12] meson.build: Add RISC-V to the edk2-target list

2024-05-23 Thread Sunil V L
so that ACPI table test can be supported. Signed-off-by: Sunil V L Reviewed-by: Alistair Francis --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a9de71d450..576c803a8a 100644 --- a/meson.build +++ b/meson.build @@ -93,7 +93,7 @

[PATCH v2 10/12] tests/qtest/bios-tables-test: Add empty ACPI data files for RISC-V

2024-05-23 Thread Sunil V L
As per process documented (steps 1-3) in bios-tables-test.c, add empty AML data files for RISC-V ACPI tables and add the entries in bios-tables-test-allowed-diff.h. Signed-off-by: Sunil V L --- tests/data/acpi/virt/riscv64/APIC | 0 tests/data/acpi/virt/riscv64/DSDT | 0 test

[PATCH v2 12/12] tests/qtest/bios-tables-test: Add expected ACPI data files for RISC-V

2024-05-23 Thread Sunil V L
As per the step 5 in the process documented in bios-tables-test.c, generate the expected ACPI AML data files for RISC-V using the rebuild-expected-aml.sh script and update the bios-tables-test-allowed-diff.h. These are all new files being added for the first time. Hence, iASL diff output is not ad

[PATCH v2 04/12] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them

2024-05-23 Thread Sunil V L
Existing AARCH64 virt test functions do not have AARCH64 in their name. To add RISC-V virt related test cases, better to rename existing functions to indicate they are ARM only. Signed-off-by: Sunil V L Reviewed-by: Alistair Francis --- tests/qtest/bios-tables-test.c | 35 ++

[PATCH v2 09/12] tests/data/acpi/rebuild-expected-aml.sh: Add RISC-V

2024-05-23 Thread Sunil V L
Update the list of supported architectures to include RISC-V. Signed-off-by: Sunil V L Reviewed-by: Alistair Francis --- tests/data/acpi/rebuild-expected-aml.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/data/acpi/rebuild-expected-aml.sh b/tests/data/acpi/re

[PATCH v2 08/12] pc-bios/meson.build: Add support for RISC-V in unpack_edk2_blobs

2024-05-23 Thread Sunil V L
Update list of images supported in unpack_edk2_blobs to enable RISC-V ACPI table testing. Signed-off-by: Sunil V L Reviewed-by: Alistair Francis --- pc-bios/meson.build | 2 ++ tests/qtest/meson.build | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pc-bios/meson.build b/pc-bios/meso

[PATCH v2 11/12] tests/qtest/bios-tables-test.c: Enable basic testing for RISC-V

2024-05-23 Thread Sunil V L
Add basic ACPI table test case for RISC-V. Signed-off-by: Sunil V L --- tests/qtest/bios-tables-test.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index c73174ad00..880435a5fa 100644 --- a/tests/

[PATCH v2 06/12] tests/data/acpi/virt: Move ACPI tables under aarch64

2024-05-23 Thread Sunil V L
Since virt is a common machine name across architectures like ARM64 and RISC-V, move existing ARM64 ACPI tables under aarch64 folder so that RISC-V tables can be added under riscv64 folder in future. Signed-off-by: Sunil V L Reviewed-by: Alistair Francis --- tests/data/acpi/virt/{ => aarch64}/A

[PATCH v2 01/12] uefi-test-tools/UefiTestToolsPkg: Add RISC-V support

2024-05-23 Thread Sunil V L
Enable building the test application for RISC-V with appropriate dependencies updated. Signed-off-by: Sunil V L Acked-by: Gerd Hoffmann --- tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/uefi-test-tools/

[PATCH v2 02/12] uefi-test-tools: Add support for python based build script

2024-05-23 Thread Sunil V L
edk2-funcs.sh which is used in this Makefile, was removed in the commit c28a2891f3 ("edk2: update build script"). It is replaced with a python based script. So, update the Makefile and add the configuration file as required to support the python based build script. Signed-off-by: Sunil V L --- t

[PATCH v2 05/12] tests/qtest/bios-tables-test.c: Add support for arch in path

2024-05-23 Thread Sunil V L
Since virt machine is common for multiple architectures, add "arch" in the path to search expected AML files. Since the AML files are still under old path, support both by searching with and without arch in the path. Signed-off-by: Sunil V L Reviewed-by: Alistair Francis --- tests/qtest/bios-ta

[PATCH v2 00/12] Add support for RISC-V ACPI tests

2024-05-23 Thread Sunil V L
Currently, bios-table-test doesn't support RISC-V. This series enables the framework changes required and basic testing. Things like NUMA related test cases will be added later. This needs refactoring/renaming of ARM64 bios table tests. Importantly, the test cases now look for the expected AML fil

[PATCH v4 3/4] qapi: Do not cast function pointers

2024-05-23 Thread Akihiko Odaki
-fsanitize=undefined complains if function pointers are casted. It also prevents enabling teh strict mode of CFI which is currently disabled with -fsanitize-cfi-icall-generalize-pointers. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2346 Signed-off-by: Akihiko Odaki --- include/qapi/c

[PATCH v4 0/4] Fix sanitizer errors with clang 18.1.1

2024-05-23 Thread Akihiko Odaki
I upgraded my Fedora Asahi Remix from 39 to 40 and found new sanitizer errors with clang it ships so here are fixes. The patch "meson: Drop the .fa library prefix" may have a broad impact to the build system so please tell me if you have a concern with it. To: Michael Tokarev To: Laurent Vivier

[PATCH v4 4/4] meson: Drop the .fa library suffix

2024-05-23 Thread Akihiko Odaki
The non-standard .fa library suffix breaks the link source de-duplication done by Meson so drop it. The lack of link source de-duplication causes AddressSanitizer to complain ODR violations, and makes GNU ld abort when combined with clang's LTO. Previously, the non-standard suffix was necessary f

[PATCH v4 2/4] lockable: Do not cast function pointers

2024-05-23 Thread Akihiko Odaki
-fsanitize=undefined complains if function pointers are casted. It also prevents enabling teh strict mode of CFI which is currently disabled with -fsanitize-cfi-icall-generalize-pointers. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2345 Signed-off-by: Akihiko Odaki --- include/qemu/l

[PATCH v4 1/4] qemu-keymap: Make references to allocations static

2024-05-23 Thread Akihiko Odaki
LeakSanitizer complains about allocations whose references are held only by automatic variables. It is possible to free them to suppress the complaints, but it is a chore to make sure they are freed in all exit paths so make them static instead. Signed-off-by: Akihiko Odaki --- qemu-keymap.c | 8

Re: [PULL 0/5] tcg patch queue

2024-05-23 Thread Richard Henderson
https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20240523 for you to fetch changes up to bfd43cccab9fb77b8405ca556fc2f2ed3b2920a3: accel/tcg: Init tb size and icount before plugin_gen_tb_end (2024-05-22 19:05:26 -0700) --

Re: [PATCH] tests/qtest/migration-test: Run some basic tests on s390x and ppc64 with TCG, too

2024-05-23 Thread Thomas Huth
On 24/05/2024 02.05, Nicholas Piggin wrote: On Wed May 22, 2024 at 7:12 PM AEST, Thomas Huth wrote: On s390x, we recently had a regression that broke migration / savevm (see commit bebe9603fc ("hw/intc/s390_flic: Fix crash that occurs when saving the machine state"). The problem was merged witho

Re: [PATCH v3 00/11] Support persistent reservation operations

2024-05-23 Thread 卢长奇
Hi, could anyone please review this series? On 2024/5/17 17:52, Changqi Lu wrote: > Hi, > > Please ignore the v2 series. Please review the v3 series instead. > Thanks! > > v2->v3: > In v2 Persist Through Power Loss(PTPL) is enable default. > In v3 PTPL is supported, which is passed as a parameter

Re: [PATCH v3 0/3] Add extioi virt extension support

2024-05-23 Thread maobibo
Song will online next week. Please correct me if there is something wrong, song. On 2024/5/24 上午7:50, Jiaxun Yang wrote: 在2024年5月21日五月 下午1:32,Song Gao写道: On LoongArch, IRQs can be routed to four vcpus with hardware extioi. This patch adds the extioi virt extension support so that the IRQ ca

Re: [PATCH] tests/qtest/migration-test: Run some basic tests on s390x and ppc64 with TCG, too

2024-05-23 Thread Nicholas Piggin
On Wed May 22, 2024 at 7:12 PM AEST, Thomas Huth wrote: > On s390x, we recently had a regression that broke migration / savevm > (see commit bebe9603fc ("hw/intc/s390_flic: Fix crash that occurs when > saving the machine state"). The problem was merged without being noticed > since we currently do

[PULL 00/72] ppc-for-9.1-1 queue

2024-05-23 Thread Nicholas Piggin
es to lists. Thanks, Nick The following changes since commit 70581940cabcc51b329652becddfbc6a261b1b83: Merge tag 'pull-tcg-20240523' of https://gitlab.com/rth7680/qemu into staging (2024-05-23 09:47:40 -0700) are available in the Git repository at: https://gitlab.com/npiggin/qemu.gi

Re: [PATCH v3 0/3] Add extioi virt extension support

2024-05-23 Thread Jiaxun Yang
在2024年5月21日五月 下午1:32,Song Gao写道: > On LoongArch, IRQs can be routed to four vcpus with hardware extioi. > This patch adds the extioi virt extension support so that the IRQ can > route to 256 vcpus. Hi Song, Sorry for chime in here, I'm a little bit confused by this series, can you give me a li

Re: [PATCH v12 13/13] virtio-gpu: Support Venus context

2024-05-23 Thread Dmitry Osipenko
On 5/23/24 10:18, Manos Pitsidianakis wrote: >> #define virtio_gpu_hostmem_enabled(_cfg) \ >>     (_cfg.hostmem > 0) >> +#define virtio_gpu_venus_enabled(_cfg) \ >> +    (_cfg.flags & (1 << VIRTIO_GPU_FLAG_VENUS_ENABLED)) >> > > Can we have both venus and rutabaga enabled on the same virtio-gpu >

Re: [PULL 00/72] ppc-for-9.1-1 queue

2024-05-23 Thread Nicholas Piggin
On Fri May 24, 2024 at 9:06 AM AEST, Nicholas Piggin wrote: > The following changes since commit 70581940cabcc51b329652becddfbc6a261b1b83: > > Merge tag 'pull-tcg-20240523' of https://gitlab.com/rth7680/qemu into > staging (2024-05-23 09:47:40 -0700) > > are availa

Re: [PATCH 0/2] target/ppc: Fix PMU instruction counting

2024-05-23 Thread Nicholas Piggin
On Thu May 23, 2024 at 8:46 AM AEST, Richard Henderson wrote: > On 5/21/24 21:04, Nicholas Piggin wrote: > > The crux of the problem being that dynamic exits from a TB would > > not count instructions previously executed in the TB. I don't > > know how important it is for PMU to count instructions

[PULL 62/72] target/ppc/mmu_common.c: Split off real mode handling from get_physical_address_wtlb()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Add ppc_real_mode_xlate() to handle real mode translation and allow removing this case from ppc_jumbo_xlate(). Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 46 -

[PULL 17/72] target/ppc: Move cmp{rb, eqb}, tw[i], td[i], isel instructions to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the following instructions to decodetree specification : cmp{rb, eqb}, t{w, d} : X-form t{w, d}i: D-form isel: A-form The changes were verified by validating that the tcg ops generated by those instructions

[PULL 27/72] target/ppc: Remove redundant MEMOP_GET_SIZE macro

2024-05-23 Thread Nicholas Piggin
There is a memop_size() function for this. Reviewed-by: BALATON Zoltan Reviewed-by: Richard Henderson Signed-off-by: Nicholas Piggin --- target/ppc/translate.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 6c10

[PULL 26/72] target/ppc: larx/stcx generation need only apply DEF_MEMOP() once

2024-05-23 Thread Nicholas Piggin
Use DEF_MEMOP() consistently in larx and stcx. generation, and apply it once when it's used rather than where the macros are expanded, to reduce typing. Reviewed-by: Richard Henderson Signed-off-by: Nicholas Piggin --- target/ppc/translate.c | 18 +- 1 file changed, 9 insertions

[PULL 38/72] target/ppc: add SMT support to msgsnd broadcast

2024-05-23 Thread Nicholas Piggin
msgsnd has a broadcast mode that sends hypervisor doorbells to all threads belonging to the same core as the target. A "subcore" mode sends to all or one thread depending on 1LPAR mode. Reviewed-by: Glenn Miles Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h |

[PULL 33/72] target/ppc: add helper to write per-LPAR SPRs

2024-05-23 Thread Nicholas Piggin
An SPR can be either per-thread, per-core, or per-LPAR. Per-LPAR means per-thread or per-core, depending on 1LPAR mode. Reviewed-by: Glenn Miles Signed-off-by: Nicholas Piggin --- target/ppc/spr_common.h | 2 ++ target/ppc/translate.c | 28 2 files changed, 30 ins

[PULL 69/72] target/ppc/mmu-radix64.c: Drop a local variable

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan The value is only used once so no need to introduce a local variable for it. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu-radix64.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ta

[PULL 32/72] target/ppc: Add PPR32 SPR

2024-05-23 Thread Nicholas Piggin
PPR32 provides access to the upper half of PPR. Reviewed-by: Richard Henderson Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h| 1 + target/ppc/cpu_init.c | 12 target/ppc/spr_common.h | 2 ++ target/ppc/translate.c | 24 4 files changed, 3

[PULL 40/72] target/ppc: Remove unused helper

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan The helper_rac function is defined but not used, remove it. Fixes: 005b69fdcc (target/ppc: Remove PowerPC 601 CPUs) Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/helper.h | 2 -- target/ppc/mmu_helper.c | 24

[PULL 71/72] target/ppc: Move out BookE and related MMU functions from mmu_common.c

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Add a new mmu-booke.c file for BookE and related MMU bits from mmu_common.c. Acked-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h| 4 - target/ppc/meson.build | 1 + target/ppc/mmu-booke.c | 531 +++

[PULL 72/72] target/ppc: Remove pp_check() and reuse ppc_hash32_pp_prot()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan The ppc_hash32_pp_prot() function in mmu-hash32.c is the same as pp_check() in mmu_common.c, merge these to remove duplicated code. Define the common function as static lnline otherwise exporting the function from mmu-hash32.c would stop the compiler inlining it which results

[PULL 35/72] target/ppc: Add SMT support to PTCR SPR

2024-05-23 Thread Nicholas Piggin
PTCR is a per-core register. Reviewed-by: Glenn Miles Signed-off-by: Nicholas Piggin --- target/ppc/misc_helper.c | 16 ++-- target/ppc/translate.c | 4 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c index

[PULL 58/72] target/ppc/mmu_common.c: Remove BookE from direct store handling

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan As BookE never returns -4 we can drop BookE from the direct store case in ppc_jumbo_xlate(). Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-)

[PULL 50/72] target/ppc/mmu_common.c: Split off real mode cases in get_physical_address_wtlb()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan The real mode handling is identical in the remaining switch cases. Split off these common real mode cases into a separate conditional to leave only the else branches in the switch that are different. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by:

[PULL 57/72] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke206_get_physical_address()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan mmubooke206_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 32 ++

[PULL 59/72] target/ppc/mmu_common.c: Split off BookE handling from ppc_jumbo_xlate()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Introduce ppc_booke_xlate() to handle BookE and BookE 2.06 cases to reduce ppc_jumbo_xlate() further. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 146 ++-- 1 f

[PULL 64/72] target/ppc/mmu_common.c: Transform ppc_jumbo_xlate() into ppc_6xx_xlate()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Now that only 6xx cases left in ppc_jumbo_xlate() we can change it to ppc_6xx_xlate() also removing get_physical_address_wtlb(). Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/internal.h | 5 + target/ppc/m

[PULL 63/72] target/ppc/mmu_common.c: Split off 40x cases from ppc_jumbo_xlate()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Introduce ppc_40x_xlate() to split off 40x handlning leaving only 6xx in ppc_jumbo_xlate() now. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 150 +--- 1 file ch

[PULL 19/72] target/ppc: Move VMX storage access instructions to decodetree

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the following instructions to decodetree specification : {l,st}ve{b,h,w}x, {l,st}v{x,xl}, lvs{l,r}: X-form The changes were verified by validating that the tcg ops generated by those instructions remain the same, which were captu

[PULL 44/72] target/ppc/mmu_common.c: Drop cases for unimplemented MPC8xx MMU

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Drop MPC8xx cases from get_physical_address_wtlb() and ppc_jumbo_xlate(). The default case would still catch this and abort the same way and there is still a warning about it in ppc_tlb_invalidate_all() which is called in ppc_cpu_reset_hold() so likely we never get here but t

[PULL 41/72] target/ppc/mmu_common.c: Move calculation of a value closer to its usage

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan In mmubooke_check_tlb() and mmubooke206_check_tlb() prot2 is calculated first but only used after an unrelated check that can return before tha value is used. Move the calculation after the check, closer to where it is used, to keep them together and avoid computing it when n

[PULL 43/72] target/ppc/mmu_common.c: Simplify checking for real mode

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan In get_physical_address_wtlb() the real_mode flag depends on either the MSR[IR] or MSR[DR] bit depending on access_type. Extract just the needed bit in a more straight forward way instead of doing unnecessary computation. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON

[PULL 61/72] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 2

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Merge the code fetch and data access cases in a common switch. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 52 - 1 file changed, 20 insertions(+), 32 delet

[PULL 36/72] target/ppc: Implement LDBAR, TTR SPRs

2024-05-23 Thread Nicholas Piggin
LDBAR, TTR are a Power-specific SPRs. These simple implementations are enough for IBM proprietary firmware for now. Reviewed-by: Glenn Miles Signed-off-by: Nicholas Piggin --- target/ppc/cpu.h | 2 ++ target/ppc/cpu_init.c | 10 ++ 2 files changed, 12 insertions(+) diff --git a/t

[PULL 47/72] target/ppc/mmu_common.c: Move some debug logging

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Move the debug logging within ppc6xx_tlb_check() from after its only call to simplify the caller. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 54 ++--- 1 file

[PULL 54/72] target/ppc/mmu_common.c: Replace hard coded constants in ppc_jumbo_xlate()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan The "2" in booke206_update_mas_tlb_miss() call corresponds to MMU_INST_FETCH which is the value of access_type in this branch; mmubooke206_esr() only checks for MMU_DATA_STORE and it's called from code access so using MMU_DATA_LOAD here seems wrong so replace it with access_t

[PULL 06/72] target/ppc: Move sync instructions to decodetree

2024-05-23 Thread Nicholas Piggin
This tries to faithfully reproduce the odd BookE logic. Note the e206 check in gen_msync_4xx() is always false, so not carried over. It does change the handling of non-zero reserved bits outside the defined fields from being illegal to being ignored, which the architecture specifies ot help with b

[PULL 53/72] target/ppc/mmu_common.c: Deindent ppc_jumbo_xlate()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Instead of putting a large block of code in an if, invert the condition and return early to be able to deindent the code block. Acked-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 319 --

[PULL 15/72] target/ppc: Move multiply fixed-point insns (64-bit operands) to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the following instructions to decodetree : mul{ld, ldo, hd, hdu}[.]: XO-form madd{hd, hdu, ld} : VA-form The changes were verified by validating that the tcg ops generated by those instructions remain the same, which were captured

[PULL 16/72] target/ppc: Move div/mod fixed-point insns (64 bits operands) to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the below instructions to decodetree specification : divd[u, e, eu][o][.]: XO-form mod{sd, ud} : X-form With this patch, all the fixed-point arithmetic instructions have been moved to decodetree. The changes were verified by validating t

[PULL 23/72] This commit continues adding support for the Branch History Rolling Buffer (BHRB) as is provided starting with the P8 processor and continuing with its successors. This commit is limited

2024-05-23 Thread Nicholas Piggin
From: Glenn Miles The following changes were made: - Enabled functionality on P10 processors only due to performance impact seen with P8 and P9 where it is not disabled for non problem state branches. - Added a BHRB buffer for storing branch instruction and target addresses for t

[PULL 51/72] target/ppc/mmu_common.c: Inline and remove check_physical()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan This function just does two assignments and and unnecessary check that is always true so inline it in the only caller left and remove it. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 26 +++---

[PULL 55/72] target/ppc/mmu_common.c: Don't use mmu_ctx_t for mmu40x_get_physical_address()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan mmu40x_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 37 +++

[PULL 68/72] target/ppc/mmu-hash32.c: Drop a local variable

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan In ppc_hash32_xlate() the value of need_prop is checked in two places but precalculating it does not help because when we reach the first check we always return and not reach the second place so the value will only be used once. We can drop the local variable and calculate it

[PULL 70/72] target/ppc: Add a function to check for page protection bit

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Checking if a page protection bit is set for a given access type is a common operation. Add a function to avoid repeating the same check at multiple places. As this relies on access type and page protection bit values having certain relation also add an assert to ensure that

[PULL 39/72] target/ppc: Remove unused struct 'mmu_ctx_hash32'

2024-05-23 Thread Nicholas Piggin
From: "Dr. David Alan Gilbert" I think it's use was removed by Commit 5883d8b296 ("mmu-hash*: Don't use full ppc_hash{32, 64}_translate() path for get_phys_page_debug()") Reviewed-by: BALATON Zoltan Signed-off-by: Dr. David Alan Gilbert Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Pi

[PULL 60/72] target/ppc/mmu_common.c: Simplify ppc_booke_xlate() part 1

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Move setting error_code that appears in every case out in front and hoist the common fall through case for BOOKE206 as well which allows removing the nested switches. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc

[PULL 66/72] target/ppc: Remove id_tlbs flag from CPU env

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan This flag for split instruction/data TLBs is only set for 6xx soft TLB MMU model and not used otherwise so no need to have a separate flag for that. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- hw/ppc/pegasos2.c|

[PULL 67/72] target/ppc: Split off common embedded TLB init

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Several 4xx CPUs and e200 share the same TLB settings enclosed in an ifdef. Split it off in a common function to reduce code duplication and the number of ifdefs. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/cpu

[PULL 65/72] target/ppc/mmu_common.c: Move mmu_ctx_t type to mmu_common.c

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Remove mmu_ctx_t definition from internal.h as this type is only used within mmu_common.c. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/internal.h | 12 target/ppc/mmu_common.c | 11 +++ 2

[PULL 52/72] target/ppc/mmu_common.c: Fix misindented qemu_log_mask() calls

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Fix several qemu_log_mask() calls that are misindented. Acked-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 42 - 1 file changed, 20 insertions(+), 22 deletions(-) d

[PULL 05/72] tcg/cputlb: remove other-cpu capability from TLB flushing

2024-05-23 Thread Nicholas Piggin
Some TLB flush operations can flush other CPUs. The problem with this is they used non-synced variants of flushes (i.e., that return before the destination has completed the flush). Since all TLB flush users need the _synced variants, and that last user (ppc) of the non-synced flush was buggy, this

[PULL 48/72] target/ppc/mmu_common.c: Eliminate ret from mmu6xx_get_physical_address()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Return directly, which is simpler than dragging a return value through multpile if and else blocks. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 84 +++-- 1 fil

[PULL 56/72] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke_get_physical_address()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan mmubooke_get_physical_address() only uses the raddr and prot fields from mmu_ctx_t. Pass these directly instead of using a ctx struct. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 30 ++---

[PULL 30/72] target/ppc: Implement attn instruction on BookS 64-bit processors

2024-05-23 Thread Nicholas Piggin
attn is an implementation-specific instruction that on POWER (and G5/ 970) can be enabled with a HID bit (disabled = illegal), and executing it causes the host processor to stop and the service processor to be notified. Generally used for debugging. Implement attn and make it checkstop the system,

[PULL 46/72] target/ppc/mmu_common.c: Move else branch to avoid large if block

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan In mmu6xx_get_physical_address() we have a large if block with a two line else branch that effectively returns. Invert the condition and move the else there to allow deindenting the large if block to make the flow easier to follow. Reviewed-by: Nicholas Piggin Signed-off-by

[PULL 34/72] target/ppc: Add SMT support to simple SPRs

2024-05-23 Thread Nicholas Piggin
AMOR, MMCRC, HRMOR, TSCR, HMEER, RPR SPRs are per-core or per-LPAR registers with simple (generic) implementations. Reviewed-by: Glenn Miles Signed-off-by: Nicholas Piggin --- target/ppc/cpu_init.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/ppc/cpu_i

[PULL 31/72] target/ppc: BookE DECAR SPR is 32-bit

2024-05-23 Thread Nicholas Piggin
The DECAR SPR is 32-bits width. Reviewed-by: Glenn Miles Signed-off-by: Nicholas Piggin --- target/ppc/cpu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index ee01415c32..927721d49a 100644 --- a/target/ppc/cpu_init.c +++

[PULL 42/72] target/ppc/mmu_common.c: Remove unneeded local variable

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan In mmubooke_check_tlb() and mmubooke206_check_tlb() we can assign the value of prot2 directly to the destination, no need to have a separate local variable for it. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mm

[PULL 29/72] target/ppc: improve checkstop logging

2024-05-23 Thread Nicholas Piggin
Change the logging not to print to stderr as well, because a checkstop is a guest error (or perhaps a simulated machine error) rather than a QEMU error, so send it to the log. Update the checkstop message, and log CPU registers too. Reviewed-by: Richard Henderson Reviewed-by: Glenn Miles Signed

[PULL 08/72] target/ppc: Add ISA v3.1 variants of sync instruction

2024-05-23 Thread Nicholas Piggin
POWER10 adds a new field to sync for store-store syncs, and some new variants of the existing syncs that include persistent memory. Implement the store-store syncs and plwsync/phwsync. Reviewed-by: Chinmay Rath Signed-off-by: Nicholas Piggin --- target/ppc/insn32.decode | 6 ++--

[PULL 04/72] tcg/cputlb: Remove non-synced variants of global TLB flushes

2024-05-23 Thread Nicholas Piggin
These are no longer used. tlb_flush_all_cpus: removed by previous commit. tlb_flush_page_all_cpus: removed by previous commit. tlb_flush_page_bits_by_mmuidx_all_cpus: never used. tlb_flush_page_by_mmuidx_all_cpus: never used. tlb_flush_page_bits_by_mmuidx_all_cpus: never used, thus:

[PULL 11/72] target/ppc: Move mul{li, lw, lwo, hw, hwu} instructions to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the following instructions to decodetree specification : mulli : D-form mul{lw, lwo, hw, hwu}[.]: XO-form The changes were verified by validating that the tcg ops generated by those instructions remain the same, which we

[PULL 49/72] target/ppc/mmu_common.c: Split out BookE cases before checking real mode

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan BookE does not have real mode so split off and handle it first in get_physical_address_wtlb() before checking for real mode for other MMU models. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 14 ++

[PULL 37/72] target/ppc: Implement SPRC/SPRD SPRs

2024-05-23 Thread Nicholas Piggin
This implements the POWER SPRC/SPRD SPRs, and SCRATCH0-7 registers that can be accessed via these indirect SPRs. SCRATCH registers only provide storage, but they are used by firmware for low level crash and progress data, so this implementation logs writes to the registers to help with analysis.

[PULL 14/72] target/ppc: Move neg, darn, mod{sw, uw} to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the below instructions to decodetree specification : neg[o][.] : XO-form mod{sw, uw}, darn : X-form The changes were verified by validating that the tcg ops generated by those instructions remain the same, which were captured with th

[PULL 45/72] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address()

2024-05-23 Thread Nicholas Piggin
From: BALATON Zoltan Repurpose get_segment_6xx_tlb() to do the whole address translation for POWERPC_MMU_SOFT_6xx MMU model by moving the BAT check there and renaming it to match other similar functions. These are only called once together so no need to keep these separate functions and combining

[PULL 10/72] target/ppc: Move floating-point arithmetic instructions to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath This patch moves the below instructions to decodetree specification : f{add, sub, mul, div, re, rsqrte, madd, msub, nmadd, nmsub}[s][.] : A-form ft{div, sqrt} : X-form With this patch, all the floating-point arithmet

[PULL 28/72] target/ppc: Make checkstop actually stop the system

2024-05-23 Thread Nicholas Piggin
checkstop state does not halt the system, interrupts continue to be serviced, and other CPUs run. Make it stop the machine with qemu_system_guest_panicked. Reviewed-by: Glenn Miles Signed-off-by: Nicholas Piggin --- target/ppc/excp_helper.c | 16 +--- 1 file changed, 13 insertions(+

[PULL 25/72] Adds migration support for Branch History Rolling Buffer (BHRB) internal state.

2024-05-23 Thread Nicholas Piggin
From: Glenn Miles Reviewed-by: Nicholas Piggin Signed-off-by: Glenn Miles Signed-off-by: Nicholas Piggin --- target/ppc/machine.c | 21 + 1 file changed, 21 insertions(+) diff --git a/target/ppc/machine.c b/target/ppc/machine.c index 6b6c31d903..731dd8df35 100644 --- a/ta

[PULL 24/72] Add support for the clrbhrb and mfbhrbe instructions.

2024-05-23 Thread Nicholas Piggin
From: Glenn Miles Since neither instruction is believed to be critical to performance, both instructions were implemented using helper functions. Access to both instructions is controlled by bits in the HFSCR (for privileged state) and MMCR0 (for problem state). A new function, helper_mmcr0_faci

[PULL 20/72] target/ppc: Move VMX integer logical instructions to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the following instructions to decodetree specification: v{and, andc, nand, or, orc, nor, xor, eqv} : VX-form The changes were verified by validating that the tcp ops generated by those instructions remain the same, which were captured with the '-d in_asm,o

[PULL 18/72] target/ppc: Move logical fixed-point instructions to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the below instructions to decodetree specification : andi[s]., {ori, xori}[s]: D-form {and, andc, nand, or, orc, nor, xor, eqv}[.], exts{b, h, w}[.], cnt{l, t}z{w, d}[.], popcnt{b, w, d}, prty{w, d}, cmp, bpermd

[PULL 21/72] target/ppc: Move VMX integer max/min instructions to decodetree.

2024-05-23 Thread Nicholas Piggin
From: Chinmay Rath Moving the following instructions to decodetree specification : v{max, min}{u, s}{b, h, w, d} : VX-form The changes were verified by validating that the tcg ops generated by those instructions remain the same, which were captured with the '-d in_asm,op' flag. Revie

[PULL 00/72] ppc-for-9.1-1 queue

2024-05-23 Thread Nicholas Piggin
The following changes since commit 70581940cabcc51b329652becddfbc6a261b1b83: Merge tag 'pull-tcg-20240523' of https://gitlab.com/rth7680/qemu into staging (2024-05-23 09:47:40 -0700) are available in the Git repository at: https://gitlab.com/npiggin/qemu.git tags/pull-ppc

[PULL 22/72] This commit is preparatory to the addition of Branch History Rolling Buffer (BHRB) functionality, which is being provided today starting with the P8 processor.

2024-05-23 Thread Nicholas Piggin
From: Glenn Miles BHRB uses several SPR register fields to control whether or not a branch instruction's address (and sometimes target address) should be recorded. Checking each of these fields with each branch instruction using jitted code would lead to a significant decrease in performance. T

  1   2   3   4   >