Re: [QEMU PATCH v5 06/13] virtio-gpu: Support context init feature with virglrenderer

2023-09-16 Thread Huang Rui
On Sat, Sep 16, 2023 at 06:42:04PM +0800, Akihiko Odaki wrote: > On 2023/09/16 19:32, Huang Rui wrote: > > On Fri, Sep 15, 2023 at 11:20:46PM +0800, Akihiko Odaki wrote: > >> On 2023/09/15 20:11, Huang Rui wrote: > >>> Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init > >>>

Re: [QEMU PATCH v5 06/13] virtio-gpu: Support context init feature with virglrenderer

2023-09-16 Thread Akihiko Odaki
On 2023/09/17 14:45, Huang Rui wrote: On Sat, Sep 16, 2023 at 06:42:04PM +0800, Akihiko Odaki wrote: On 2023/09/16 19:32, Huang Rui wrote: On Fri, Sep 15, 2023 at 11:20:46PM +0800, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: Patch "virtio-gpu: CONTEXT_INIT feature" has added

Re: qemu-riscv32 usermode still broken?

2023-09-16 Thread Andreas K. Huettel
Am Donnerstag, 14. September 2023, 03:22:49 CEST schrieb Andreas K. Huettel: > > > https://lists.gnu.org/archive/html/bug-bash/2023-09/msg00119.html > > > ^ Here I'm trying to find out more. > > > > > > Bash tests apparently indicate that argv[0] is overwritten, and that > > > reading through a

[PATCH 2/7] tcg/loongarch64: Use C_N2_I1 for INDEX_op_qemu_ld_a*_i128

2023-09-16 Thread Richard Henderson
Use new registers for the output, so that we never overlap the input address, which could happen for user-only. This avoids a "tmp = addr + 0" in that case. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target-con-set.h | 2 +- tcg/loongarch64/tcg-target.c.inc | 17

[PATCH 1/7] tcg: Add C_N2_I1

2023-09-16 Thread Richard Henderson
Constraint with two outputs, both in new registers. Signed-off-by: Richard Henderson --- tcg/tcg.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index 604fa9bf3e..fdbf79689a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -644,6 +644,7 @@ static void

[PATCH 3/7] util: Add cpuinfo for loongarch64

2023-09-16 Thread Richard Henderson
Signed-off-by: Richard Henderson --- host/include/loongarch64/host/cpuinfo.h | 21 +++ util/cpuinfo-loongarch.c| 35 + util/meson.build| 2 ++ 3 files changed, 58 insertions(+) create mode 100644

[PATCH 5/7] host/include/loongarch64: Add atomic16 load and store

2023-09-16 Thread Richard Henderson
While loongarch64 does not have a 128-bit cmpxchg, it does have 128-bit atomic load and store via the vector unit. Signed-off-by: Richard Henderson --- .../include/loongarch64/host/atomic128-ldst.h | 52 +++ .../loongarch64/host/load-extract-al16-al8.h | 39 ++

[PATCH 7/7] accel/tcg: Fix condition for store_atom_insert_al16

2023-09-16 Thread Richard Henderson
Store bytes under a mask is fundamentally a cmpxchg, not a straight store. Use HAVE_CMPXCHG128 instead of HAVE_ATOMIC128_RW. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 2 +- accel/tcg/ldst_atomicity.c.inc | 10 +- 2 files changed, 6 insertions(+), 6

[PATCH 6/7] accel/tcg: Remove redundant case in store_atom_16

2023-09-16 Thread Richard Henderson
We handled the HAVE_ATOMIC128_RW case with atomic16_set at the top of the function; the only thing left for a host without that support is to fall through to cpu_loop_exit_atomic. Signed-off-by: Richard Henderson --- accel/tcg/ldst_atomicity.c.inc | 4 1 file changed, 4 deletions(-) diff

[PATCH 4/7] tcg/loongarch64: Use cpuinfo.h

2023-09-16 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.h | 8 tcg/loongarch64/tcg-target.c.inc | 8 +--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 03017672f6..1bea15b02e 100644 ---

[PATCH 0/7] tcg/loongarch64: Improvements for 128-bit load/store

2023-09-16 Thread Richard Henderson
For tcg generated code, use new registers with load so that we never overlap the input address, so that we can simplify address build for 64-bit user-only. For tcg out-of-line code, implement the host/ headers to for atomic 128-bit load and store, reducing the cases for which we must raise

[PATCH v3 13/39] accel/tcg: Remove cpu_set_cpustate_pointers

2023-09-16 Thread Richard Henderson
This function is now empty, so remove it. In the case of m68k and tricore, this empties the class instance initfn, so remove those as well. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 10 -- target/alpha/cpu.c | 2 --

[PATCH v3 25/39] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h'

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé While these functions are not TCG specific, they are not target specific. Move them to "exec/cpu-common.h" so their callers don't have to be tainted as target specific. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id:

[PATCH v3 33/39] accel/tcg: Make icount.o a target agnostic unit

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé Remove the unused "exec/exec-all.h" header. There is no more target specific code in it: make it target agnostic (rename using the '-common' suffix). Since it is TCG specific, move it to accel/tcg, updating MAINTAINERS. Signed-off-by: Philippe Mathieu-Daudé

[PATCH v3 22/39] accel/tcg: Unify user and softmmu do_[st|ld]*_mmu()

2023-09-16 Thread Richard Henderson
From: Anton Johansson The prototype of do_[st|ld]*_mmu() is unified between system- and user-mode allowing a large chunk of helper_[st|ld]*() and cpu_[st|ld]*() functions to be expressed in same manner between both modes. These functions will be moved to ldst_common.c.inc in a following commit.

[PATCH v3 06/39] accel/tcg: Validate placement of CPUNegativeOffsetState

2023-09-16 Thread Richard Henderson
Verify that the distance between CPUNegativeOffsetState and CPUArchState is no greater than any alignment requirements. Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/exec/cpu-all.h

[PATCH v3 27/39] accel: Make accel-blocker.o target agnostic

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé accel-blocker.c is not target specific, move it to system_ss[]. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20230914185718.76241-5-phi...@linaro.org> Signed-off-by: Richard Henderson --- accel/meson.build | 4 ++-- 1 file

[PATCH v3 29/39] exec: Rename cpu.c -> cpu-target.c

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé We have exec/cpu code split in 2 files for target agnostic ("common") and specific. Rename 'cpu.c' which is target specific using the '-target' suffix. Update MAINTAINERS. Remove the 's from 'cpus-common.c' to match the API cpu_foo() functions. Signed-off-by:

[PATCH v3 23/39] accel/tcg: move ld/st helpers to ldst_common.c.inc

2023-09-16 Thread Richard Henderson
From: Anton Johansson A large chunk of ld/st functions are moved from cputlb.c and user-exec.c to ldst_common.c.inc as their implementation is the same between both modes. Eventually, ldst_common.c.inc could be compiled into a separate target-specific compilation unit, and be linked in with the

[PATCH v3 20/39] accel/tcg: Use CPUState in atomicity helpers

2023-09-16 Thread Richard Henderson
From: Anton Johansson Makes ldst_atomicity.c.inc almost target-independent, with the exception of TARGET_PAGE_MASK, which will be addressed in a future patch. Signed-off-by: Anton Johansson Message-Id: <20230912153428.17816-8-a...@rev.ng> Reviewed-by: Richard Henderson Reviewed-by: Philippe

[PATCH v3 31/39] accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h'

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé accel/tcg/internal.h contains target specific declarations. Unit files including it become "target tainted": they can not be compiled as target agnostic. Rename using the '-target' suffix to make this explicit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by:

[PATCH v3 32/39] accel/tcg: Make monitor.c a target-agnostic unit

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé Move target-agnostic declarations from "internal-target.h" to a new "internal-common.h" header. monitor.c now don't include target specific headers and can be compiled once in system_ss[]. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson

[PATCH v3 26/39] accel/tcg: Restrict dump_exec_info() declaration

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé In commit 00c9a5c2c3 ("accel/tcg: Restrict 'qapi-commands-machine.h' to system emulation") we moved the definition to accel/tcg/ which is where this function is called. No need to expose it outside. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson

[PATCH v3 04/39] target/arm: Remove size and alignment for cpu subclasses

2023-09-16 Thread Richard Henderson
Inherit the size and alignment from TYPE_ARM_CPU. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/cpu.c | 3 --- target/arm/cpu64.c | 4 2 files changed, 7 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index b9e09a702d..d48a70c039

[PATCH v3 18/39] accel/tcg: Modify memory access functions to use CPUState

2023-09-16 Thread Richard Henderson
From: Anton Johansson do_[ld|st]*() and mmu_lookup*() are changed to use CPUState over CPUArchState, moving the target-dependence to the target-facing facing cpu_[ld|st] functions. Signed-off-by: Anton Johansson Message-Id: <20230912153428.17816-6-a...@rev.ng> Reviewed-by: Richard Henderson

[PATCH v3 15/39] tcg: Remove TCGContext.tlb_fast_offset

2023-09-16 Thread Richard Henderson
Now that there is no padding between CPUNegativeOffsetState and CPUArchState, this value is constant across all targets. Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 - accel/tcg/translate-all.c | 2 -- tcg/tcg.c | 15

[PATCH v3 12/39] accel/tcg: Replace CPUState.env_ptr with cpu_env()

2023-09-16 Thread Richard Henderson
Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 1 - include/hw/core/cpu.h| 9 ++--- target/arm/common-semi-target.h | 2 +- accel/tcg/cpu-exec.c | 8 accel/tcg/cputlb.c

[PATCH v3 37/39] accel: Declare AccelClass::[un]realize_cpu() handlers

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé Currently accel_cpu_realize() only performs target-specific realization. Introduce the [un]realize_cpu fields in the base AccelClass to be able to perform target-agnostic [un]realization of vCPUs. Signed-off-by: Philippe Mathieu-Daudé Message-Id:

[PATCH v3 28/39] accel: Rename accel-common.c -> accel-target.c

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé We use the '-common.c' suffix for target agnostic units. This file is target specific, rename it using the '-target' suffix. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20230914185718.76241-6-phi...@linaro.org> Signed-off-by:

[PATCH v3 24/39] exec: Make EXCP_FOO definitions target agnostic

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé The EXCP_* definitions don't need to be target specific, move them to "exec/cpu-common.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20230914185718.76241-2-phi...@linaro.org> Signed-off-by: Richard Henderson ---

[PATCH v3 10/39] accel/tcg: Remove cpu_neg()

2023-09-16 Thread Richard Henderson
Now that CPUNegativeOffsetState is part of CPUState, we can reference it directly. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 11 --- include/exec/exec-all.h | 2 +- accel/tcg/cpu-exec.c | 14

[PATCH v3 36/39] accel: Introduce accel_cpu_unrealize() stub

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé Prepare the stub for parity with accel_cpu_realize(). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230915190009.68404-3-phi...@linaro.org> Signed-off-by: Richard Henderson --- include/qemu/accel.h | 6 ++ accel/accel-target.c | 4 cpu-target.c

[PATCH v3 19/39] accel/tcg: Modify atomic_mmu_lookup() to use CPUState

2023-09-16 Thread Richard Henderson
From: Anton Johansson The goal is to (in the future) allow for per-target compilation of functions in atomic_template.h whilst atomic_mmu_lookup() and cputlb.c are compiled once-per user- or system mode. Signed-off-by: Anton Johansson Message-Id: <20230912153428.17816-7-a...@rev.ng>

[PATCH v3 34/39] accel/tcg: Make cpu-exec-common.c a target agnostic unit

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé cpu_in_serial_context() is not target specific, move it declaration to "internal-common.h" (which we include in the 4 source files modified). Remove the unused "exec/exec-all.h" header from cpu-exec-common.c. There is no more target specific code in this file: make

[PATCH v3 08/39] accel/tcg: Remove CPUState.icount_decr_ptr

2023-09-16 Thread Richard Henderson
We can now access icount_decr directly. Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 1 - include/hw/core/cpu.h | 2 -- hw/core/cpu-common.c | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/exec/cpu-all.h

[PATCH v3 39/39] accel/tcg: Restrict tcg_exec_[un]realizefn() to TCG

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé We don't need to expose these TCG-specific methods to the whole code base. Register them as AccelClass handlers, they will be called by the generic accel_cpu_[un]realize() methods. Signed-off-by: Philippe Mathieu-Daudé Message-Id:

[PATCH v3 35/39] accel: Rename accel_cpu_realizefn() -> accel_cpu_realize()

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé We use the '*fn' suffix for handlers, this is a public method. Drop the suffix. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230915190009.68404-2-phi...@linaro.org> Signed-off-by: Richard Henderson --- include/qemu/accel.h | 4 ++--

[PATCH v3 02/39] accel/tcg: Move CPUTLB definitions from cpu-defs.h

2023-09-16 Thread Richard Henderson
Accept that we will consume space in CPUState for CONFIG_USER_ONLY, since we cannot test CONFIG_SOFTMMU within hw/core/cpu.h. Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h | 150 include/hw/core/cpu.h | 141

[PATCH v3 07/39] accel/tcg: Move CPUNegativeOffsetState into CPUState

2023-09-16 Thread Richard Henderson
Retain the separate structure to emphasize its importance. Enforce CPUArchState always follows CPUState without padding. Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h| 22 +- include/hw/core/cpu.h | 17 +++--

[PATCH v3 03/39] qom: Propagate alignment through type system

2023-09-16 Thread Richard Henderson
Propagate alignment just like size. This is required in order to get the correct alignment on most cpu subclasses where the size and alignment is only specified for the base cpu type. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- qom/object.c | 14 ++ 1

[PATCH v3 01/39] target/arm: Replace TARGET_PAGE_ENTRY_EXTRA

2023-09-16 Thread Richard Henderson
From: Anton Johansson TARGET_PAGE_ENTRY_EXTRA is a macro that allows guests to specify additional fields for caching with the full TLB entry. This macro is replaced with a union in CPUTLBEntryFull, thus making CPUTLB target-agnostic at the cost of slightly inflated CPUTLBEntryFull for non-arm

[PATCH v3 00/39] target agnostic cleanups

2023-09-16 Thread Richard Henderson
Omnibus cleanups for making more code target agnostic. r~ Based-on: 20230916171223.521545-1-richard.hender...@linaro.org ("[PULL v2 00/39] tcg patch queue") Supercedes: 20230914024435.1381329-1-richard.hender...@linaro.org ("[PATCH v2 00/24] Reduce usage of CPUArchState in cputlb.c")

[PATCH v3 14/39] accel/tcg: Remove env_neg()

2023-09-16 Thread Richard Henderson
Replace the single use within env_tlb() and remove. Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index

[PATCH v3 30/39] exec: Rename target specific page-vary.c -> page-vary-target.c

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé This matches the target agnostic 'page-vary-common.c' counterpart. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Message-Id: <20230914185718.76241-8-phi...@linaro.org> Signed-off-by: Richard Henderson --- MAINTAINERS |

[PATCH v3 38/39] accel/tcg: Have tcg_exec_realizefn() return a boolean

2023-09-16 Thread Richard Henderson
From: Philippe Mathieu-Daudé Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have tcg_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé Message-Id:

[PATCH v3 09/39] accel/tcg: Move can_do_io to CPUNegativeOffsetState

2023-09-16 Thread Richard Henderson
Minimize the displacement to can_do_io, since it may be touched at the start of each TranslationBlock. It fits into other padding within the substructure. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/hw/core/cpu.h| 2 +- accel/dummy-cpus.c

[PATCH v3 05/39] target/*: Add instance_align to all cpu base classes

2023-09-16 Thread Richard Henderson
The omission of alignment has technically been wrong since 269bd5d8f61, where QEMU_ALIGNED was added to CPUTLBDescFast. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/alpha/cpu.c | 1 + target/avr/cpu.c| 1 + target/cris/cpu.c | 1 +

[PATCH v3 21/39] accel/tcg: Remove env_tlb()

2023-09-16 Thread Richard Henderson
From: Anton Johansson The function is no longer used to access the TLB, and has been replaced by cpu->neg.tlb. Signed-off-by: Anton Johansson Message-Id: <20230912153428.17816-9-a...@rev.ng> Reviewed-by: Richard Henderson [rth: Merge comment update patch] Signed-off-by: Richard Henderson ---

[PATCH v3 17/39] accel/tcg: Modify probe_access_internal() to use CPUState

2023-09-16 Thread Richard Henderson
From: Anton Johansson probe_access_internal() is changed to instead take the generic CPUState over CPUArchState, in order to lessen the target-specific coupling of cputlb.c. Note: probe_access*() also don't need the full CPUArchState, but aren't touched in this patch as they are target-facing.

[PATCH v3 16/39] accel/tcg: Modify tlb_*() to use CPUState

2023-09-16 Thread Richard Henderson
From: Anton Johansson Changes tlb_*() functions to take CPUState instead of CPUArchState, as they don't require the full CPUArchState. This makes it easier to decouple target-(in)dependent code. Signed-off-by: Anton Johansson Message-Id: <20230912153428.17816-4-a...@rev.ng> Reviewed-by:

[PULL 7/8] linux-user/hppa: clear the PSW 'N' bit when delivering signals

2023-09-16 Thread deller
From: Mikulas Patocka qemu-hppa may crash when delivering a signal. It can be demonstrated with this program. Compile the program with "hppa-linux-gnu-gcc -O2 signal.c" and run it with "qemu-hppa -one-insn-per-tb a.out". It reports that the address of the flag is 0xb4 and it crashes when

[PULL 4/8] target/hppa: Add BTLB support to hppa TLB functions

2023-09-16 Thread deller
From: Helge Deller Change the TLB code to store the Block-TLBs at the beginning of the TLB table. New 4k TLB entries which are added later shall not overwrite any of the BTLB entries. Make sure that when the TLB is cleared by the OS via the ptlbe instruction, the Block-TLBs will not be dropped.

[PULL 2/8] target/hppa: Allow up to 16 BTLB entries

2023-09-16 Thread deller
From: Helge Deller Reserve 16 out of the 256 TLB entries for Block-TLBs. Signed-off-by: Helge Deller --- target/hppa/cpu.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index fa13694dab..23852d89b2 100644 ---

[PULL 8/8] linux-user/hppa: lock both words of function descriptor

2023-09-16 Thread deller
From: Mikulas Patocka The code in setup_rt_frame reads two words at haddr, but locks only one. This patch fixes it to lock both. Signed-off-by: Mikulas Patocka Acked-by: Helge Deller Cc: qemu-sta...@nongnu.org Signed-off-by: Helge Deller --- linux-user/hppa/signal.c | 5 +++-- 1 file

[PULL 6/8] target/hppa: Wire up diag instruction to support BTLB

2023-09-16 Thread deller
From: Helge Deller Wire up the hppa diag instruction to support Block-TLBs when called with the 0x100 value. The diag_btlb() helper function does all necessary steps to emulate the PDC BTLB firmware function, which includes providing BTLB info, adding a new BTLB, deleting a BTLB and removing

[PULL 5/8] target/hppa: Extract diagnose immediate value

2023-09-16 Thread deller
From: Helge Deller Extract the immediate value given by the diagnose CPU instruction. This is needed to distinguish the various diagnose calls. Signed-off-by: Helge Deller --- target/hppa/insns.decode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/insns.decode

[PULL 3/8] target/hppa: Report and clear BTLBs via fw_cfg at startup

2023-09-16 Thread deller
From: Helge Deller Report the new number of TLB entries (without BTLBs) to the guest and drop reporting of BTLB entries which weren't used at all. Clear all BTLB and TLB entries at machine reset. Signed-off-by: Helge Deller --- hw/hppa/machine.c | 10 +- 1 file changed, 5

[PULL 0/8] Hppa btlb patches

2023-09-16 Thread deller
From: Helge Deller The following changes since commit 9ef497755afc252fb8e060c9ea6b0987abfd20b6: Merge tag 'pull-vfio-20230911' of https://github.com/legoater/qemu into staging (2023-09-11 09:13:08 -0400) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git

Re: [PATCH] target/hppa: lock both words of function descriptor

2023-09-16 Thread Helge Deller
On 9/16/23 19:17, Richard Henderson wrote: On 9/16/23 09:18, Helge Deller wrote: On 9/16/23 15:52, Mikulas Patocka wrote: The code in setup_rt_frame reads two words at haddr, but locks only one. This patch fixes it to lock both. Signed-off-by: Mikulas Patocka ---   linux-user/hppa/signal.c

Re: [PATCH v3 09/16] memory-device, vhost: Support memory devices that dynamically consume memslots

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: We want to support memory devices that have a dynamically managed memory region container as device memory region. This device memory region maps multiple RAM memory subregions (e.g., aliases to the same RAM memory region), whereby these subregions

Re: [PATCH v2 5/8] qemu-img: rebase: avoid unnecessary COW operations

2023-09-16 Thread Andrey Drobyshev
On 9/16/23 00:52, Eric Blake wrote: > On Fri, Sep 15, 2023 at 07:20:13PM +0300, Andrey Drobyshev wrote: >> When rebasing an image from one backing file to another, we need to >> compare data from old and new backings. If the diff between that data >> happens to be unaligned to the target cluster

Re: [PATCH v3 13/16] memory: Clarify mapping requirements for RamDiscardManager

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: We really only care about the RAM memory region not being mapped into an address space yet as long as we're still setting up the RamDiscardManager. Once mapped into an address space, memory notifiers would get notified about such a region and any

Re: [PATCH] target/hppa: lock both words of function descriptor

2023-09-16 Thread Richard Henderson
On 9/16/23 09:18, Helge Deller wrote: On 9/16/23 15:52, Mikulas Patocka wrote: The code in setup_rt_frame reads two words at haddr, but locks only one. This patch fixes it to lock both. Signed-off-by: Mikulas Patocka ---   linux-user/hppa/signal.c |    5 ++---   1 file changed, 2

Re: [PATCH v3 11/16] vhost: Add vhost_get_max_memslots()

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: Let's add vhost_get_max_memslots(). Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH v3 10/16] kvm: Add stub for kvm_get_max_memslots()

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: We'll need the stub soon from memory device context. While at it, use "unsigned int" as return value and place the declaration next to kvm_get_free_memslots(). Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

[PULL v2 21/39] tcg/loongarch64: Implement 128-bit load & store

2023-09-16 Thread Richard Henderson
From: Jiajie Chen If LSX is available, use LSX instructions to implement 128-bit load & store when MO_128 is required, otherwise use two 64-bit loads & stores. Signed-off-by: Jiajie Chen Message-Id: <20230908022302.180442-1...@jia.je> Reviewed-by: Richard Henderson Signed-off-by: Richard

[PULL v2 00/39] tcg patch queue

2023-09-16 Thread Richard Henderson
v2: tcg/loongarch64 patch set without last minute tweaks. r~ The following changes since commit 005ad32358f12fe9313a4a01918a55e60d4f39e5: Merge tag 'pull-tpm-2023-09-12-3' of https://github.com/stefanberger/qemu-tpm into staging (2023-09-13 13:41:57 -0400) are available in the Git

Re: [PATCH] target/hppa: clear the PSW 'N' bit when delivering signals

2023-09-16 Thread Helge Deller
On 9/16/23 18:49, Helge Deller wrote: The reason for the crash is that the signal handling routine doesn't clear the 'N' flag in the PSW. If the signal interrupts a thread when the 'N' flag is set, the flag remains set at the beginning of the signal handler and the first instruction of the

Re: [PATCH] target/hppa: clear the PSW 'N' bit when delivering signals

2023-09-16 Thread Helge Deller
On 9/16/23 15:49, Mikulas Patocka wrote: qemu-hppa may crash when delivering a signal. It can be demonstrated with this program. Compile the program with "hppa-linux-gnu-gcc -O2 signal.c" and run it with "qemu-hppa -one-insn-per-tb a.out". It reports that the address of the flag is 0xb4 and it

Re: [PATCH v3 08/16] memory-device: Track required and actually used memslots in DeviceMemoryState

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: Let's track how many memslots are required by plugged memory devices and how many are currently actually getting used by plugged memory devices. "required - used" is the number of reserved memslots. For now, the number of used and required memslots

[PATCH v2] qemu-hppa: lock both words of function descriptor

2023-09-16 Thread Mikulas Patocka
On Sat, 16 Sep 2023, Helge Deller wrote: > On 9/16/23 15:52, Mikulas Patocka wrote: > > The code in setup_rt_frame reads two words at haddr, but locks only one. > > This patch fixes it to lock both. > > > > Signed-off-by: Mikulas Patocka > > > > --- > > linux-user/hppa/signal.c |5 ++---

Re: [PATCH v3 07/16] stubs: Rename qmp_memory_device.c to memory_device.c

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: We want to place non-qmp stubs in there, so let's rename it. While at it, put it into the MAINTAINERS file under "Memory devices". Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH v3 06/16] memory-device: Support memory devices with multiple memslots

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: We want to support memory devices that have a memory region container as device memory region that maps multiple RAM memory regions. Let's start by supporting memory devices that statically map multiple RAM memory regions and, thereby, consume

Re: [PATCH] target/hppa: lock both words of function descriptor

2023-09-16 Thread Helge Deller
On 9/16/23 15:52, Mikulas Patocka wrote: The code in setup_rt_frame reads two words at haddr, but locks only one. This patch fixes it to lock both. Signed-off-by: Mikulas Patocka --- linux-user/hppa/signal.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Index:

Re: [PATCH v3 05/16] vhost: Return number of free memslots

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: Let's return the number of free slots instead of only checking if there is a free slot. Required to support memory devices that consume multiple memslots. This is a preparation for memory devices that consume multiple memslots. Signed-off-by: David

Re: [PATCH v3 04/16] kvm: Return number of free memslots

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: Let's return the number of free slots instead of only checking if there is a free slot. While at it, check all address spaces, which will also consider SMM under x86 correctly. This is a preparation for memory devices that consume multiple memslots.

[PATCH] target/hppa: clear the PSW 'N' bit when delivering signals

2023-09-16 Thread Mikulas Patocka
qemu-hppa may crash when delivering a signal. It can be demonstrated with this program. Compile the program with "hppa-linux-gnu-gcc -O2 signal.c" and run it with "qemu-hppa -one-insn-per-tb a.out". It reports that the address of the flag is 0xb4 and it crashes when attempting to touch it.

[PATCH] target/hppa: lock both words of function descriptor

2023-09-16 Thread Mikulas Patocka
The code in setup_rt_frame reads two words at haddr, but locks only one. This patch fixes it to lock both. Signed-off-by: Mikulas Patocka --- linux-user/hppa/signal.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Index: qemu/linux-user/hppa/signal.c

Re: [PATCH v6 54/57] target/loongarch: Implement xvshuf xvperm{i} xvshuf4i

2023-09-16 Thread Richard Henderson
On 9/16/23 00:55, gaosong wrote: Hi, Richard Could you review this patch?  it's the lastet patch no review. Thanks. Song Gao 在 2023/9/14 上午10:26, Song Gao 写道: This patch includes: - XVSHUF.{B/H/W/D}; - XVPERM.W; - XVSHUF4i.{B/H/W/D}; - XVPERMI.{W/D/Q}; - XVEXTRINS.{B/H/W/D}. Signed-off-by:

Re: [QEMU PATCH v5 06/13] virtio-gpu: Support context init feature with virglrenderer

2023-09-16 Thread Akihiko Odaki
On 2023/09/16 19:32, Huang Rui wrote: On Fri, Sep 15, 2023 at 11:20:46PM +0800, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init feature flags. We would like to enable the feature with virglrenderer, so add to create

Re: [QEMU PATCH v5 06/13] virtio-gpu: Support context init feature with virglrenderer

2023-09-16 Thread Huang Rui
On Sat, Sep 16, 2023 at 12:58:31AM +0800, Akihiko Odaki wrote: > On 2023/09/15 20:11, Huang Rui wrote: > > Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init > > feature flags. > > We would like to enable the feature with virglrenderer, so add to create > > virgl renderer context

Re: [QEMU PATCH v5 06/13] virtio-gpu: Support context init feature with virglrenderer

2023-09-16 Thread Huang Rui
On Fri, Sep 15, 2023 at 11:20:46PM +0800, Akihiko Odaki wrote: > On 2023/09/15 20:11, Huang Rui wrote: > > Patch "virtio-gpu: CONTEXT_INIT feature" has added the context_init > > feature flags. > > We would like to enable the feature with virglrenderer, so add to create > > virgl renderer context

Re: [RFC Patch 5/5] hw/input: Add Allwinner-A10 PS2 emulation

2023-09-16 Thread Strahinja Jankovic
Hi Peter, Thank you for your comments. I used the PL050 component as a starting point, but I did not clean things up well after I saw it working. I will clean it up before sending the new patch version. On Fri, Sep 15, 2023 at 4:23 PM Peter Maydell wrote: > On Tue, 5 Sept 2023 at 21:14,

Re: [PATCH v2 08/20] asc: generate silence if FIFO empty but engine still running

2023-09-16 Thread Volker Rümelin
Am 14.09.23 um 09:56 schrieb Philippe Mathieu-Daudé: > > On 9/9/23 11:48, Mark Cave-Ayland wrote: >> MacOS (un)helpfully leaves the FIFO engine running even when all the >> samples have >> been written to the hardware, and expects the FIFO status flags and >> IRQ to be >> updated continuously. >>

[PATCH v8 08/19] gdbstub: Use GDBFeature for GDBRegisterState

2023-09-16 Thread Akihiko Odaki
Simplify GDBRegisterState by replacing num_regs and xml members with one member that points to GDBFeature. Signed-off-by: Akihiko Odaki --- gdbstub/gdbstub.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index

[PATCH v8 19/19] contrib/plugins: Add cc plugin

2023-09-16 Thread Akihiko Odaki
This demonstrates how to write a plugin in C++. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 8 configure | 15 --- contrib/plugins/Makefile | 5 + contrib/plugins/cc.cc | 17 + tests/tcg/Makefile.target | 3

[PATCH v8 10/19] gdbstub: Simplify XML lookup

2023-09-16 Thread Akihiko Odaki
Now we know all instances of GDBFeature that is used in CPU so we can traverse them to find XML. This removes the need for a CPU-specific lookup function for dynamic XMLs. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 2 + gdbstub/gdbstub.c | 85

[PATCH v8 17/19] contrib/plugins: Allow to log registers

2023-09-16 Thread Akihiko Odaki
This demonstrates how a register can be read from a plugin. Signed-off-by: Akihiko Odaki --- docs/devel/tcg-plugins.rst | 10 +++- contrib/plugins/execlog.c | 120 +++-- 2 files changed, 97 insertions(+), 33 deletions(-) diff --git a/docs/devel/tcg-plugins.rst

[PATCH v8 16/19] plugins: Allow to read registers

2023-09-16 Thread Akihiko Odaki
It is based on GDB protocol to ensure interface stability. The timing of the vcpu init hook is also changed so that the hook will get called after GDB features are initialized. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1706 Signed-off-by: Akihiko Odaki ---

[PATCH v8 14/19] gdbstub: Expose functions to read registers

2023-09-16 Thread Akihiko Odaki
gdb_find_feature() and gdb_find_feature_register() find registers. gdb_read_register() actually reads registers. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 5 + gdbstub/gdbstub.c | 31 ++- 2 files changed, 35 insertions(+), 1 deletion(-)

[PATCH v8 02/19] gdbstub: Introduce gdb_find_static_feature()

2023-09-16 Thread Akihiko Odaki
This function is useful to determine the number of registers exposed to GDB from the XML name. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 2 ++ gdbstub/gdbstub.c | 13

[PATCH v8 11/19] gdbstub: Infer number of core registers from XML

2023-09-16 Thread Akihiko Odaki
GDBFeature has the num_regs member so use it where applicable to remove magic numbers. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 3 ++- target/s390x/cpu.h | 2 -- gdbstub/gdbstub.c | 5 - target/arm/cpu.c| 1 - target/arm/cpu64.c | 1 -

[PATCH v8 13/19] gdbstub: Add members to identify registers to GDBFeature

2023-09-16 Thread Akihiko Odaki
These members will be used to help plugins to identify registers. The added members in instances of GDBFeature dynamically generated by CPUs will be filled in later changes. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 3 +++ gdbstub/gdbstub.c | 10 --

[PATCH v8 12/19] hw/core/cpu: Remove gdb_get_dynamic_xml member

2023-09-16 Thread Akihiko Odaki
This function is no longer used. Signed-off-by: Akihiko Odaki --- include/hw/core/cpu.h | 4 target/arm/cpu.h | 6 -- target/ppc/cpu.h | 1 - target/arm/cpu.c | 1 - target/arm/gdbstub.c | 18 -- target/ppc/cpu_init.c | 3 --- target/ppc/gdbstub.c

[PATCH v8 04/19] target/arm: Use GDBFeature for dynamic XML

2023-09-16 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Acked-by: Richard Henderson --- target/arm/cpu.h | 21 +++

[PATCH v8 15/19] cpu: Call plugin hooks only when ready

2023-09-16 Thread Akihiko Odaki
The initialization and exit hooks will not affect the state of vCPU outside TCG context, but they may depend on the state of vCPU. Therefore, it's better to call plugin hooks after the vCPU state is fully initialized and before it gets uninitialized. Signed-off-by: Akihiko Odaki --- cpu.c

[PATCH v8 05/19] target/ppc: Use GDBFeature for dynamic XML

2023-09-16 Thread Akihiko Odaki
In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- target/ppc/cpu-qom.h | 4 ++-- target/ppc/cpu.h

[PATCH v8 09/19] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb

2023-09-16 Thread Akihiko Odaki
Align the parameters of gdb_get_reg_cb and gdb_set_reg_cb with the gdb_read_register and gdb_write_register members of CPUClass to allow to unify the logic to access registers of the core and coprocessors in the future. Signed-off-by: Akihiko Odaki --- include/exec/gdbstub.h | 4 +-

[PATCH v8 03/19] gdbstub: Introduce GDBFeatureBuilder

2023-09-16 Thread Akihiko Odaki
GDBFeatureBuilder unifies the logic to generate dynamic GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson --- include/exec/gdbstub.h | 20 ++ gdbstub/gdbstub.c | 59 ++ 2 files changed, 79 insertions(+) diff --git

[PATCH v8 07/19] gdbstub: Use GDBFeature for gdb_register_coprocessor

2023-09-16 Thread Akihiko Odaki
This is a tree-wide change to introduce GDBFeature parameter to gdb_register_coprocessor(). The new parameter just replaces num_regs and xml parameters for now. GDBFeature will be utilized to simplify XML lookup in a following change. Signed-off-by: Akihiko Odaki Acked-by: Alex Bennée ---

  1   2   >