[PATCH] target/i386: Improve 16-bit/real mode debug support in GDB

2024-12-20 Thread Davidson Francis
Debugging 16-bit/real mode code in QEMU+GDB is challenging due to incorrect architecture detection and segmented memory addressing issues. This patch improves the debugging experience by reporting i8086 architecture to GDB when in real mode and converting segmented addresses (CS:EIP, SS:ESP) to th

Re: [PATCH 5/5] qtest/e1000e|igb: Fix msix to re-trigger interrupts

2024-12-20 Thread Akihiko Odaki
On 2024/12/21 13:14, Nicholas Piggin wrote: On Thu Dec 19, 2024 at 6:53 PM AEST, Akihiko Odaki wrote: On 2024/12/18 16:42, Nicholas Piggin wrote: The e1000e and igb tests don't clear the msix pending bit after waiting for it, as it is masked so the irq doesn't get sent. Failing to clear the pen

Re: [PATCH 4/5] qtest/e1000e|igb: Clear interrupt-cause bits after irq

2024-12-20 Thread Nicholas Piggin
On Thu Dec 19, 2024 at 7:00 PM AEST, Akihiko Odaki wrote: > On 2024/12/18 16:42, Nicholas Piggin wrote: > > The e1000e and igb tests do not clear the ICR/EICR cause bits (or > > set auto-clear) on seeing queue interrupts, which inhibits the > > triggering of a new interrupt. > > > > Fix this by cl

Re: [PATCH 5/5] qtest/e1000e|igb: Fix msix to re-trigger interrupts

2024-12-20 Thread Nicholas Piggin
On Thu Dec 19, 2024 at 6:53 PM AEST, Akihiko Odaki wrote: > On 2024/12/18 16:42, Nicholas Piggin wrote: > > The e1000e and igb tests don't clear the msix pending bit after waiting > > for it, as it is masked so the irq doesn't get sent. Failing to clear > > the pending interrupt means all subsequen

Re: [PATCH 2/5] spapr: Fix vpa dispatch count for record-replay

2024-12-20 Thread Nicholas Piggin
On Fri Dec 20, 2024 at 7:14 PM AEST, Harsh Prateek Bora wrote: > Hi Nick, > > On 12/19/24 09:10, Nicholas Piggin wrote: > > The dispatch count is a field in guest memory that the hypervisor > > increments when preempting and dispatching the guest. This was not > > being done deterministically with

Re: [PATCH 13/17] hw/scsi: Convert to new bh API

2024-12-20 Thread Nicholas Piggin
On Sat Dec 21, 2024 at 9:54 AM AEST, Paolo Bonzini wrote: > Il ven 20 dic 2024, 11:44 Nicholas Piggin ha scritto: > > > Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), > > which can specify the clock type, making it compatible with > > record-replay. > > > > Operations on SCS

Re: [PATCH 01/17] replay: Fix migration use of clock for statistics

2024-12-20 Thread Nicholas Piggin
On Sat Dec 21, 2024 at 2:31 AM AEST, Peter Xu wrote: > On Fri, Dec 20, 2024 at 08:42:03PM +1000, Nicholas Piggin wrote: > > Migration reads CLOCK_HOST when not holding the replay_mutex, which > > asserts when recording a trace. These are not guest visible so should > > be CLOCK_REALTIME like other

Re: [PATCH 02/17] replay: Fix migration replay_mutex locking

2024-12-20 Thread Nicholas Piggin
On Fri Dec 20, 2024 at 11:08 PM AEST, Fabiano Rosas wrote: > Nicholas Piggin writes: > > Hi Nick, > > I'm ignorant about replay, but we try to know why were taking the BQL in > the migration code, we move it around sometimes, etc. Can we be a bit > more strict with documentation here so we don't g

Re: [PATCH 1/4] tests/functional: Don't fail the whole test if a pre-cache fetch fails

2024-12-20 Thread Nicholas Piggin
On Fri Dec 20, 2024 at 8:38 PM AEST, Daniel P. Berrangé wrote: > On Fri, Dec 20, 2024 at 12:46:14PM +1000, Nicholas Piggin wrote: > > If any pre-cache downloads fail, the entire functional test run > > is failed. > > > > Signed-off-by: Nicholas Piggin > > --- > > tests/functional/qemu_test/asset

Re: [PATCH 13/17] hw/scsi: Convert to new bh API

2024-12-20 Thread Paolo Bonzini
Il ven 20 dic 2024, 11:44 Nicholas Piggin ha scritto: > Convert aio_bh_schedule_oneshot() to aio_bh_schedule_oneshot_event(), > which can specify the clock type, making it compatible with > record-replay. > > Operations on SCSI reqs do affect target machine state, so it should > use QEMU_CLOCK_VI

Re: [PATCH v2] physmem: allow cpu_memory_rw_debug to write to MMIO devices

2024-12-20 Thread vringar
On 20/12/2024 21:59, David Hildenbrand wrote: Good point, I suspect that will be problematic. Looking at flatview_write_continue I see no early exit, so maybe it would still try to get through everything and work as we are hoping, but that's why I'd like to write a test for it. I'm just not s

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-20 Thread Pierrick Bouvier
On 12/20/24 13:17, Pierrick Bouvier wrote: Hi Julian, On 12/20/24 03:47, Julian Ganz wrote: Hi Pierrick, December 5, 2024 at 12:33 AM, "Pierrick Bouvier" wrote: On 12/2/24 11:41, Julian Ganz wrote: +static void insn_exec(unsigned int vcpu_index, void *userdata) +{ + struct cpu_state

Re: [PATCH v2 08/13] qdev: Make qdev_get_machine() not use container_get()

2024-12-20 Thread Philippe Mathieu-Daudé
On 20/12/24 18:24, Peter Xu wrote: On Fri, Dec 20, 2024 at 12:25:44PM +0100, Philippe Mathieu-Daudé wrote: On 19/12/24 19:27, Philippe Mathieu-Daudé wrote: On 19/12/24 19:20, Philippe Mathieu-Daudé wrote: On 21/11/24 20:21, Peter Xu wrote: Currently, qdev_get_machine() has a slight misuse on

Re: [PATCH v3 5/5] accel/tcg: Always call tcg_flush_jmp_cache() on reset

2024-12-20 Thread Philippe Mathieu-Daudé
On 20/12/24 22:08, Michael Tokarev wrote: 13.08.2024 18:10, Philippe Mathieu-Daudé wrote: Has this change been forgotten, or is it not appropriate anymore? Not forgotten and still need to be fixed, however unfortunately this exposed a bug in user-mode SYS_exit_group when using plugins (see qe

[PATCH v4 5/6] hw/ppc/spapr: Convert DIRTY_HPTE() macro as hpte_set_dirty() method

2024-12-20 Thread Philippe Mathieu-Daudé
Convert DIRTY_HPTE() macro as hpte_set_dirty() method. sPAPR data structures including the hash page table are big-endian regardless of current CPU endian mode, so use the big-endian LD/ST API to access the hash PTEs. Reviewed-by: Nicholas Piggin Signed-off-by: Philippe Mathieu-Daudé --- hw/pp

[PATCH v4 2/6] hw/ppc/spapr: Convert HPTE_VALID() macro as hpte_is_valid() method

2024-12-20 Thread Philippe Mathieu-Daudé
Convert HPTE_VALID() macro as hpte_is_valid() method. sPAPR data structures including the hash page table are big-endian regardless of current CPU endian mode, so use the big-endian LD/ST API to access the hash PTEs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Nicholas Piggin --- hw/ppc

[PATCH v4 4/6] hw/ppc/spapr: Convert CLEAN_HPTE() macro as hpte_set_clean() method

2024-12-20 Thread Philippe Mathieu-Daudé
Convert CLEAN_HPTE() macro as hpte_set_clean() method. sPAPR data structures including the hash page table are big-endian regardless of current CPU endian mode, so use the big-endian LD/ST API to access the hash PTEs. Reviewed-by: Nicholas Piggin Signed-off-by: Philippe Mathieu-Daudé --- hw/pp

[PATCH v4 1/6] hw/ppc/spapr: Convert HPTE() macro as hpte_get_ptr() method

2024-12-20 Thread Philippe Mathieu-Daudé
Convert HPTE() macro as hpte_get_ptr() method. Reviewed-by: Nicholas Piggin Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/spapr.c | 38 ++ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3b022e8da9e..be

[PATCH v4 6/6] hw/ppc/epapr: Do not swap ePAPR magic value

2024-12-20 Thread Philippe Mathieu-Daudé
The ePAPR magic value in $r6 doesn't need to be byte swapped. See ePAPR-v1.1.pdf chapter 5.4.1 "Boot CPU Initial Register State" and the following mailing-list threads: https://lore.kernel.org/qemu-devel/cafeaca_nr4xw5dnl4nq7vnh4xrh5uwbhqcxulykqyk6_fcb...@mail.gmail.com/ https://lore.kernel.org/qe

[PATCH v4 3/6] hw/ppc/spapr: Convert HPTE_DIRTY() macro as hpte_is_dirty() method

2024-12-20 Thread Philippe Mathieu-Daudé
Convert HPTE_DIRTY() macro as hpte_is_dirty() method. sPAPR data structures including the hash page table are big-endian regardless of current CPU endian mode, so use the big-endian LD/ST API to access the hash PTEs. Reviewed-by: Nicholas Piggin Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc

[PATCH v4 0/6] hw/ppc: Remove tswap() calls

2024-12-20 Thread Philippe Mathieu-Daudé
Since v3: - Addressed Nick & Harsh review comments Remove the tswap() calls on ePAPR, and convert them to big-endian LD/ST API on sPAPR. Build-tested only. Philippe Mathieu-Daudé (6): hw/ppc/spapr: Convert HPTE() macro as hpte_get_ptr() method hw/ppc/spapr: Convert HPTE_VALID() macro as hpt

Re: [PATCH v3 2/7] hw/ppc/spapr: Convert HPTE() macro as hpte_get() method

2024-12-20 Thread Philippe Mathieu-Daudé
On 19/12/24 07:31, Harsh Prateek Bora wrote: Hi Philippe, On 12/18/24 23:51, Philippe Mathieu-Daudé wrote: Convert HPTE() macro as hpte_get() method. Signed-off-by: Philippe Mathieu-Daudé ---   hw/ppc/spapr.c | 38 ++   1 file changed, 22 insertions(+), 16 d

Re: [RFC PATCH v3 11/11] tests: add plugin asserting correctness of discon event's to_pc

2024-12-20 Thread Pierrick Bouvier
Hi Julian, On 12/20/24 03:47, Julian Ganz wrote: Hi Pierrick, December 5, 2024 at 12:33 AM, "Pierrick Bouvier" wrote: On 12/2/24 11:41, Julian Ganz wrote: +static void insn_exec(unsigned int vcpu_index, void *userdata) +{ + struct cpu_state *state = qemu_plugin_scoreboard_find(states, v

Re: [PATCH-for-9.1? v2 4/4] hw/sd/sdhci: Check ADMA descriptors can be accessed

2024-12-20 Thread Michael Tokarev
01.08.2024 00:25, Philippe Mathieu-Daudé wrote: Since malicious guest can write invalid addresses to the ADMASYSADDR register, we need to check whether the descriptor could be correctly filled or not. Ping? This has been about the 9.1 release, now 9.2 is out already and we're working on 10.0..

Re: [PATCH v3 5/5] accel/tcg: Always call tcg_flush_jmp_cache() on reset

2024-12-20 Thread Michael Tokarev
13.08.2024 18:10, Philippe Mathieu-Daudé wrote: Has this change been forgotten, or is it not appropriate anymore? Not forgotten and still need to be fixed, however unfortunately this exposed a bug in user-mode SYS_exit_group when using plugins (see qemu_plugin_disable_mem_helpers call in qemu_

Re: [PATCH] dma-helpers: Fix iovec alignment

2024-12-20 Thread Michael Tokarev
11.08.2024 20:47, Michael Tokarev пишет: 12.04.2024 18:25, Eric Blake wrote: On Fri, Apr 12, 2024 at 10:06:17AM +0200, Stefan Fritsch wrote: Commit 99868af3d0 changed the hardcoded constant BDRV_SECTOR_SIZE to a dynamic field 'align' but introduced a bug. qemu_iovec_discard_back() is now passed

Re: [PATCH v5 01/11 for v9.2?] i386/cpu: Mark avx10_version filtered when prefix is NULL

2024-12-20 Thread Michael Tokarev
06.11.2024 06:07, Zhao Liu wrote: In x86_cpu_filter_features(), if host doesn't support AVX10, the configured avx10_version should be marked as filtered regardless of whether prefix is NULL or not. Check prefix before warn_report() instead of checking for have_filtered_features. Cc: qemu-sta...

Re: [PATCH v2 0/2] Move net backend cleanup to NIC cleanup

2024-12-20 Thread Michael Tokarev
12.09.2024 19:54, Eugenio Pérez wrote: Commit a0d7215e33 ("vhost-vdpa: do not cleanup the vdpa/vhost-net structures if peer nic is present") effectively delayed the backend cleanup, allowing the frontend or the guest to access it resources as long as the frontend NIC is still visible to the guest

Re: [PATCH v2] physmem: allow cpu_memory_rw_debug to write to MMIO devices

2024-12-20 Thread David Hildenbrand
On 20.12.24 20:49, Stefan Zabka wrote: Resolves: https://gitlab.com/qemu-project/qemu/-/issues/213 Signed-off-by: Stefan Zabka --- Addressed initial review by David Hildenbrand The other change made more sense to me, so I'd like to write a test to verify that an AddressSpace like 0x00..0x0F MMIO

Re: [PATCH 54/71] hw/s390x: Constify all Property

2024-12-20 Thread Eric Farman
On Fri, 2024-12-13 at 13:07 -0600, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > hw/s390x/3270-ccw.c | 2 +- > hw/s390x/ccw-device.c | 2 +- > hw/s390x/css-bridge.c | 2 +- > hw/s390x/ipl.c| 2 +- > hw/s390x/s390-pci-bus.c | 2

Re: [PATCH 65/71] hw/vfio: Constify all Property

2024-12-20 Thread Eric Farman
On Fri, 2024-12-13 at 13:29 -0600, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > hw/vfio/ap.c | 2 +- > hw/vfio/ccw.c | 2 +- > hw/vfio/pci.c | 4 ++-- > hw/vfio/platform.c | 2 +- > 4 files changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Eric Farman

Re: [PATCH v2 40/51] tcg/optimize: Canonicalize s_mask in fold_exts, fold_sextract

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: Simply or'ing the an input s_mask with the mask implied by the sign extension operation may leave disconnected bits to the right. Use smask_from_smask to canonicalize. Signed-off-by: Richard Henderson --- tcg/optimize.c | 6 ++ 1 file changed,

Re: [PATCH v2 42/51] tcg/optimize: Simplify sign bit test in fold_shift

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: Merge the two conditions, sign != 0 && !(z_mask & sign), by testing ~z_mask & sign. If sign == 0, the logical and will produce false. Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH v2 35/51] tcg/optimize: Fix sign mask in fold_negsetcond

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: The sign mask is about repetitions, a la clrsb64(), so the lsb itself can never be a repetition. Thus ~1 not -1 is correct. Signed-off-by: Richard Henderson --- tcg/optimize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v2 29/51] tcg/optimize: Use fold_masks_zs in fold_qemu_ld

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: Avoid the use of the OptContext slots. Be careful not to call fold_masks_zs when the memory operation is wide enough to require multiple outputs, so split into two functions: fold_qemu_ld_1reg and fold_qemu_ld_2reg. Signed-off-by: Richard Henderson -

Re: [PATCH v2 13/51] tcg/optimize: Compute sign mask in fold_deposit

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: The input which overlaps the sign bit of the output can have its input s_mask propagated to the output s_mask. Signed-off-by: Richard Henderson --- tcg/optimize.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/t

Re: [PATCH v2 10/51] tcg/optimize: Use fold_masks_zs in fold_count_zeros

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: Avoid the use of the OptContext slots. Find TempOptInfo once. Compute s_mask from the union of the maximum count and the op2 fallback for op1 being zero. Signed-off-by: Richard Henderson --- tcg/optimize.c | 15 ++- 1 file changed, 10 i

Re: [PATCH v2 05/51] tcg/optimize: Augment s_mask from z_mask in fold_masks_zs

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: Consider the passed s_mask to be a minimum deduced from either existing s_mask or from a sign-extension operation. We may be able to deduce more from the set of known zeros. Remove identical logic from several opcode folders. Signed-off-by: Richard Hen

Re: [PATCH v2 04/51] tcg/optimize: Split out fold_masks_zs

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: Add a routine to which masks can be passed directly, rather than storing them into OptContext. To be used in upcoming patches. Signed-off-by: Richard Henderson --- tcg/optimize.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(

Re: [PATCH v2 02/51] tcg/optimize: Split out fold_affected_mask

2024-12-20 Thread Pierrick Bouvier
On 12/19/24 20:10, Richard Henderson wrote: There are only a few logical operations which can compute an "affected" mask. Split out handling of this optimization to a separate function, only to be called when applicable. Remove the a_mask field from OptContext, as the mask is no longer stored a

[PATCH v2] physmem: allow cpu_memory_rw_debug to write to MMIO devices

2024-12-20 Thread Stefan Zabka
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/213 Signed-off-by: Stefan Zabka --- Addressed initial review by David Hildenbrand The other change made more sense to me, so I'd like to write a test to verify that an AddressSpace like 0x00..0x0F MMIO Device A 0x10..0x1F ROM 0x20..0x2F MMIO

Re: Test assets not available anymore for tests/functional/test_rx_gdbsim.py

2024-12-20 Thread Pierrick Bouvier
On 12/20/24 02:50, Philippe Mathieu-Daudé wrote: On 19/12/24 20:47, Pierrick Bouvier wrote: Hi all, assets for tests/functional/test_rx_gdbsim.py are not available anymore. It seems that the directory "https://acc.dl.osdn.jp/users"; vanished from the web, and it's not a temporary issue. If som

Re: [PATCH v2] hw/misc/vmfwupdate: Introduce hypervisor fw-cfg interface support

2024-12-20 Thread Alexander Graf
On 20.12.24 14:31, Ani Sinha wrote: On Fri, Dec 20, 2024 at 5:03 PM Alexander Graf wrote: On 20.12.24 11:00, Ani Sinha wrote: Either add the I386 dependency or don't use PC_MACHINE, because on non-x86 targets PC_MACHINE(qdev_get_machine()) will crash. Ah this is where we have a disconnect.

Re: [PATCH v2] hw/misc/vmfwupdate: Introduce hypervisor fw-cfg interface support

2024-12-20 Thread Ani Sinha
On Fri, 20 Dec, 2024, 7:01 pm Ani Sinha, wrote: > On Fri, Dec 20, 2024 at 5:03 PM Alexander Graf wrote: > > > > > > On 20.12.24 11:00, Ani Sinha wrote: > > >>> Either add the I386 dependency or don't use PC_MACHINE, because on > > >>> non-x86 targets PC_MACHINE(qdev_get_machine()) will crash. >

Re: [PATCH v2 08/13] qdev: Make qdev_get_machine() not use container_get()

2024-12-20 Thread Peter Xu
On Fri, Dec 20, 2024 at 12:25:44PM +0100, Philippe Mathieu-Daudé wrote: > On 19/12/24 19:27, Philippe Mathieu-Daudé wrote: > > On 19/12/24 19:20, Philippe Mathieu-Daudé wrote: > > > On 21/11/24 20:21, Peter Xu wrote: > > > > Currently, qdev_get_machine() has a slight misuse on container_get(), as >

Re: [RFC 1/1 v2] target/riscv: use tcg ops generation to emulate whole reg rvv loads/stores.

2024-12-20 Thread Max Chou
+for (int i = 0; i < size; i += 16) { +addr = get_address(s, rs1, i); +if (is_load) { +tcg_gen_qemu_ld_i128(t16, addr, s->mem_idx, +MO_LE | MO_128 | atomicity); +tcg_gen_st_i128(t16, tcg_env, vreg_ofs(s, vd) +

Re: (Proposal) New TDX Global Metadata To Report FIXED0 and FIXED1 CPUID Bits

2024-12-20 Thread Sean Christopherson
On Fri, Dec 20, 2024, Xiaoyao Li wrote: > On 12/19/2024 10:33 AM, Sean Christopherson wrote: > > > > For all other CPUID bits, what the TDX Module thinks and/or presents to > > > > the guest > > > > is completely irrelevant, at least as far as KVM cares, and to some > > > > extent as far > > > >

Re: [PATCH v2 15/27] tests/functional/aarch64: add tests for FEAT_RME

2024-12-20 Thread Pierrick Bouvier
On 12/18/24 08:20, Alex Bennée wrote: From: Pierrick Bouvier This boot an OP-TEE environment, and launch a nested guest VM inside it using the Realms feature. We do it for virt and sbsa-ref platforms. Signed-off-by: Pierrick Bouvier Message-Id: <20241203213629.2482806-1-pierrick.bouv...@linar

[PATCH v6] tests/functional/aarch64: add tests for FEAT_RME

2024-12-20 Thread Pierrick Bouvier
This boot an OP-TEE environment, and launch a nested guest VM inside it using the Realms feature. We do it for virt and sbsa-ref platforms. Signed-off-by: Pierrick Bouvier - v2: - move test to its own file - add sbsa test - check output of `cca-workload-attestation report` v3: - build and

Re: [PATCH v2 19/22] tests/qtest/migration: Add migration-test-smoke

2024-12-20 Thread Fabiano Rosas
Peter Xu writes: > On Thu, Dec 19, 2024 at 04:31:04PM -0300, Fabiano Rosas wrote: >> We shouldn't change stuff that's also used by the rest of the >> community. People know about QEMU_TEST_FLAKY_TESTS and -m slow. These >> must continue to work the same. > > I see what I overlook; it's used much

Re: [PATCH 01/17] replay: Fix migration use of clock for statistics

2024-12-20 Thread Peter Xu
On Fri, Dec 20, 2024 at 08:42:03PM +1000, Nicholas Piggin wrote: > Migration reads CLOCK_HOST when not holding the replay_mutex, which > asserts when recording a trace. These are not guest visible so should > be CLOCK_REALTIME like other statistics in MigrationState, which do > not require the repl

Re: [PULL 00/17] Migration patches for 2024-12-17

2024-12-20 Thread Peter Xu
On Thu, Dec 19, 2024 at 03:53:22PM -0300, Fabiano Rosas wrote: > Stefan Hajnoczi writes: > > > Hi Fabiano, > > Please take a look at this CI failure: > > > MALLOC_PERTURB_=61 QTEST_QEMU_BINARY=./qemu-system-s390x > UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_st

Re: [PATCH v7 1/1] target/riscv: rvv: Use wider accesses for unit stride load/store

2024-12-20 Thread Richard Henderson
On 12/20/24 04:21, Craig Blackmore wrote: Use atomic load/store functions to access multiple elements from host. Co-authored-by: Paolo Savini Signed-off-by: Paolo Savini Signed-off-by: Craig Blackmore --- target/riscv/vector_helper.c | 107 +-- 1 file chang

[PULL 52/59] target/xtensa: Remove tswap() calls in semihosting simcall() helper

2024-12-20 Thread Philippe Mathieu-Daudé
In preparation of heterogeneous emulation where cores with different endianness can run concurrently, replace the pair of cpu_memory_rw_debug() + tswap() calls by put/get_user_u32() ones, which still do the same under the hood, but simplify the code maintenance (having less sites to do endianness c

[PULL 06/59] tests: Explicitly create containers in test_qom_partial_path()

2024-12-20 Thread Philippe Mathieu-Daudé
From: Peter Xu Drop one use of container_get(), instead switch to the explicit function to create a container. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Peter Xu Message-ID: <20241121192202.4155849-5-pet...@redhat.com> Signed-off-by: Philippe Mathieu-D

[PULL 59/59] util/qemu-timer: fix indentation

2024-12-20 Thread Philippe Mathieu-Daudé
From: Alex Bennée Purely cosmetic. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20241218162104.3493551-17-alex.ben...@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- util/qemu-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uti

[PULL 27/59] accel/tcg: Move page_[un]protect() to 'user/page-protection.h'

2024-12-20 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-7-phi...@linaro.org> --- accel/tcg/internal-target.h| 1 + include/exec/translate-all.h | 5 - include/user/page-protection.h | 20

[PULL 35/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4)

2024-12-20 Thread Philippe Mathieu-Daudé
Move declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-14-phi...@linaro.org> --- bsd-user/qemu.h

[PULL 12/59] system: Move 'exec/confidential-guest-support.h' to system/

2024-12-20 Thread Philippe Mathieu-Daudé
"exec/confidential-guest-support.h" is specific to system emulation, so move it under the system/ namespace. Mechanical change doing: $ sed -i \ -e 's,exec/confidential-guest-support.h,sysemu/confidential-guest-support.h,' \ $(git grep -l exec/confidential-guest-support.h) Signed-o

[PULL 07/59] ppc/e500: Avoid abuse of container_get()

2024-12-20 Thread Philippe Mathieu-Daudé
From: Peter Xu container_get() is going to become strict on not allowing to return a non-container. Switch the e500 user to use object_resolve_path_component() explicitly. Cc: Bharat Bhushan Cc: qemu-...@nongnu.org Reviewed-by: Cédric Le Goater Reviewed-by: Daniel P. Berrangé Signed-off-by:

[PULL 57/59] system/accel-ops: Remove unnecessary 'exec/cpu-common.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
Since commit c4b3f46c151 ("include/exec: Move vaddr defines to separate file") we only need to include "exec/vaddr.h" to get the 'vaddr' type definition, no need for "exec/cpu-common.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Message-Id: <2024

[PULL 17/59] exec/cpu-defs: Remove unnecessary headers

2024-12-20 Thread Philippe Mathieu-Daudé
"exec/cpu-defs.h" should be kept as minimal as possible; besides these includes don't seem necessary. Remove them. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Tested-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <20241114011310.3615-3-phi...@linaro.org> ---

[PULL 48/59] accel/tcg: Restrict curr_cflags() declaration to 'internal-common.h'

2024-12-20 Thread Philippe Mathieu-Daudé
curr_cflags() is only used within accel/tcg/, move its declaration to accel/tcg/internal-common.h. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20241216214030.59393-1-phi...@linaro.org> --- accel/tcg/internal-common.h | 3 +++

[PULL 30/59] accel/tcg: Un-inline log_pc()

2024-12-20 Thread Philippe Mathieu-Daudé
log_pc() is only used within cpu-exec.c, no need to expose it via "internal-target.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-10-phi...@linaro.org> --- accel/tcg/internal-target.h | 10 -- acce

[PULL 32/59] accel/tcg: Really restrict cpu_io_recompile() to system emulation

2024-12-20 Thread Philippe Mathieu-Daudé
Commit 38fc4b11e03 ("accel/tcg: Restrict cpu_io_recompile() to system emulation") inadvertently restricted cpu_io_recompile() to SoftMMU. Correct to restrict to system emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20241216160514.56630-1-phi...@linar

[PULL 39/59] user: Declare cpu_loop() once in 'user/cpu_loop.h'

2024-12-20 Thread Philippe Mathieu-Daudé
Declare cpu_loop() once in "user/cpu_loop.h". bsd-user gets the G_NORETURN attribute. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-18-phi...@linaro.org> --- bsd-user/aarch64/target_arch_cpu.h | 2 +- bsd-use

[PULL 42/59] target/sparc: Uninline cpu_get_tb_cpu_state()

2024-12-20 Thread Philippe Mathieu-Daudé
From: Anton Johansson Required to compile accel/tcg/translate-all.c once for softmmu targets. The function gets quite big for some targets so uninlining makes sense. Reviewed-by: Richard Henderson Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-14-a...@rev.ng> [PMD: Only take S

[PULL 58/59] meson: Do not define CONFIG_DEVICES on user emulation

2024-12-20 Thread Philippe Mathieu-Daudé
CONFIG_DEVICES is not generated on user emulation, so do not define it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20241218151256.68625-1-phi...@linaro.org> --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b

[PULL 38/59] user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h'

2024-12-20 Thread Philippe Mathieu-Daudé
"linux-user/cpu_loop-common.h" is generic enough to be used by bsd-user, so rename it as "user/cpu_loop.h". Mechanical change running: $ sed -i -e 's,cpu_loop-common.h,user/cpu_loop.h,' \ $(git grep -l cpu_loop-common.h) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierr

[PULL 54/59] target/mips: Drop left-over comment about Jazz machine

2024-12-20 Thread Philippe Mathieu-Daudé
Commit 3803b6b427 ("target/mips: Fold jazz behaviour into mips_cpu_do_transaction_failed") removed update on TCGCPUOps and commit 119065574d ("hw/core: Constify TCGCPUOps") made it const. Remove the now irrelevant comment. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed

Re: [PULL 00/18] loongarch-to-apply queue

2024-12-20 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

[PULL 55/59] hw/xen: Remove unnecessary 'exec/cpu-common.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
Nothing requires definitions from "exec/cpu-common.h", do not include this header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Message-Id: <20241217151305.29196-2-phi...@linaro.org> --- include/hw/xen/xen.h | 2 -- 1 file changed, 2 deletions(-)

[PULL 43/59] target/sparc: Move sparc_restore_state_to_opc() to cpu.c

2024-12-20 Thread Philippe Mathieu-Daudé
Most targets define their restore_state_to_opc() handler in cpu.c. In order to keep SPARC aligned, move sparc_restore_state_to_opc() from translate.c to cpu.c. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Message-Id: <20241115152053.66442-4-ph

[PULL 41/59] target/loongarch: Declare loongarch_cpu_dump_state() locally

2024-12-20 Thread Philippe Mathieu-Daudé
loongarch_cpu_dump_state() is not used outside of cpu.c, no need to expose its prototype. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson Message-Id: <20241115152053.66442-3-phi...@linaro.org> --- target/loongarch/internals.h | 2 -- target/loong

[PULL 49/59] accel/tcg: Move tcg_cflags_has/set() to 'exec/translation-block.h'

2024-12-20 Thread Philippe Mathieu-Daudé
The TranslationBlock flags are defined in 'exec/translation-block.h'. tcg_cflags_has/set() use them, it is more logical to declare them in the same place. Move them there too. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20241

[PULL 28/59] system: Remove unnecessary 'exec/translate-all.h' include

2024-12-20 Thread Philippe Mathieu-Daudé
At this point "exec/translate-all.h" only declare tb_check_watchpoint(), which isn't used by any of cpu-target.c or system/physmem.c, so remove its inclusion. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-8-ph

[PULL 01/59] hvf: arm: Ignore writes to CNTP_CTL_EL0

2024-12-20 Thread Philippe Mathieu-Daudé
From: Alexander Graf MacOS unconditionally disables interrupts of the physical timer on boot and then continues to use the virtual one. We don't really want to support a full physical timer emulation, so let's just ignore those writes. Signed-off-by: Alexander Graf Signed-off-by: Phil Dennis-Jo

[PULL 44/59] exec/cpu-all: Include 'cpu.h' earlier so MMU_USER_IDX is always defined

2024-12-20 Thread Philippe Mathieu-Daudé
Include "cpu.h" earlier to get the MMU_USER_IDX definition soon enough and avoid when refactoring unrelated headers: In file included from include/exec/translator.h:271, from ../../accel/tcg/translator.c:13: include/exec/cpu-all.h: In function ‘cpu_mmu_index’: include/exec

[PULL 24/59] include: Include missing 'qemu/clang-tsa.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
The next commit will remove "qemu/clang-tsa.h" of "exec/exec-all.h", however the following files indirectly include it: $ git grep -L qemu/clang-tsa.h $(git grep -wl TSA_NO_TSA) block/create.c include/block/block_int-common.h tests/unit/test-bdrv-drain.c tests/unit/test-block-iothread.c

[PULL 03/59] qom: Add TYPE_CONTAINER macro

2024-12-20 Thread Philippe Mathieu-Daudé
From: Peter Xu Provide a macro for the container type across QEMU source tree, rather than hard code it every time. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Peter Xu Message-ID: <20241121192202.4155849-2-pet...@redhat.com> Signed-off-by: Philippe Math

[PULL 40/59] user: Move various declarations out of 'exec/exec-all.h'

2024-12-20 Thread Philippe Mathieu-Daudé
Move various declarations related to user emulation from "exec/exec-all.h" to "user/cpu_loop.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-19-phi...@linaro.org> --- include/exec/exec-all.h | 55 +-

[PULL 29/59] accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h'

2024-12-20 Thread Philippe Mathieu-Daudé
"exec/translate-all.h" is only useful to TCG accelerator, so move it to accel/tcg/, after renaming it 'tb-internal.h'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-9-phi...@linaro.org> --- accel/tcg/internal

[PULL 51/59] accel/tcg: Un-inline translator_is_same_page()

2024-12-20 Thread Philippe Mathieu-Daudé
Remove the single target-specific definition used in "exec/translator.h" (TARGET_PAGE_MASK) by un-inlining is_same_page(). Rename the method as translator_is_same_page() and improve its documentation. Use it in translator_use_goto_tb(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard H

[PULL 53/59] target/mips: Remove tswap() calls in semihosting uhi_fstat_cb()

2024-12-20 Thread Philippe Mathieu-Daudé
In preparation of heterogeneous emulation where cores with different endianness can run concurrently, we need to remove the tswap() calls -- which use a fixed per-binary endianness. Get the endianness of the UHI CPU accessed using mips_env_is_bigendian() and replace the tswap() calls by bswap() on

[PULL 33/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (1/4)

2024-12-20 Thread Philippe Mathieu-Daudé
Move declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-12-phi...@linaro.org> --- include/exec/cpu-al

[PULL 18/59] exec/translation-block: Include missing 'exec/vaddr.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
'vaddr' type is declared in "exec/vaddr.h". "exec/translation-block.h" uses this type without including the corresponding header. It works because this header is indirectly included, but won't work when the other headers are refactored: include/exec/translation-block.h:56:5: error: unknown type

[PULL 22/59] target/arm/mte: Restrict 'exec/ram_addr.h' to system emulation

2024-12-20 Thread Philippe Mathieu-Daudé
"exec/ram_addr.h" contains system specific declarations. Restrict its inclusion to sysemu to avoid build errors when refactoring. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241114011310.3615-10-phi...@linaro.org> --- target

[PULL 50/59] accel/tcg: Include missing 'exec/translation-block.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
TB compile flags, tb_page_addr_t type, tb_cflags() and few other methods are defined in "exec/translation-block.h". All these files don't include "exec/translation-block.h" but include "exec/exec-all.h" which include it. Explicitly include "exec/translation-block.h" to be able to remove it from "e

[PULL 16/59] exec/cpu-all: Include missing 'exec/cpu-defs.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
TARGET_PAGE_BITS is defined in each target "cpu-param.h", itself included by "exec/cpu-defs.h". Include the latter in order to avoid when refactoring: In file included from ../../system/watchpoint.c:23: include/exec/cpu-all.h:356:19: error: use of undeclared identifier 'TARGET_PAGE_BITS'

[PULL 26/59] accel/tcg: Use tb_page_addr_t type in page_unprotect()

2024-12-20 Thread Philippe Mathieu-Daudé
Match with the page_protect() prototype, use a tb_page_addr_t argument instead of target_ulong. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-6-phi...@linaro.org> --- include/exec/translate-all.h | 2 +- acce

[PULL 56/59] system/numa: Remove unnecessary 'exec/cpu-common.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
Nothing requires definitions from "exec/cpu-common.h", do not include this header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Message-Id: <20241217151305.29196-3-phi...@linaro.org> --- include/system/numa.h | 1 - 1 file changed, 1 deletion(-) d

[PULL 45/59] accel/tcg: Declare cpu_loop_exit_requested() in 'exec/cpu-common.h'

2024-12-20 Thread Philippe Mathieu-Daudé
Move cpu_loop_exit_requested() declaration to "exec/cpu-common.h", along with the related cpu_loop_exit_noexc(), cpu_loop_exit(), cpu_loop_exit_atomic() and cpu_loop_exit_restore() methods. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Message-Id:

[PULL 34/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4)

2024-12-20 Thread Philippe Mathieu-Daudé
Move declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-13-phi...@linaro.org> --- bsd-user/bsd-mem.h

[PULL 47/59] qemu/coroutine: Include missing 'qemu/atomic.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
Commit 944f3d5dd21 ("coroutine: Add qemu_co_mutex_assert_locked") added an inline method which uses qatomic_read(), itself declared in "qemu/atomic.h". Explicitly include it now to avoid issue when refactoring unrelated headers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson

[PULL 46/59] exec/translation-block: Include missing 'qemu/atomic.h' header

2024-12-20 Thread Philippe Mathieu-Daudé
When moving tb_cflags() in commit 88d4b5138a8 ("tcg: Make tb_cflags() usable from target-agnostic code") we forgot to include "qemu/atomic.h", which declares qatomic_read(). Explicitly include it now to avoid issue when refactoring unrelated headers. Signed-off-by: Philippe Mathieu-Daudé Reviewed

[PULL 36/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4)

2024-12-20 Thread Philippe Mathieu-Daudé
Move declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-15-phi...@linaro.org> --- include/exec/cpu-al

[PULL 37/59] user: Forward declare target_cpu_copy_regs structure

2024-12-20 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-16-phi...@linaro.org> --- linux-user/cpu_loop-common.h | 5 - linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-us

[PULL 31/59] accel/tcg: Move TranslationBlock declarations to 'tb-internal.h'

2024-12-20 Thread Philippe Mathieu-Daudé
Move declarations related to TranslationBlock out of the generic "internal-target.h" to "tb-internal.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241212185341.2857-11-phi...@linaro.org> --- accel/tcg/internal-target.h | 3

Re: [PATCH RFCv2 00/20] kvm/arm: Introduce a customizable aarch64 KVM host model

2024-12-20 Thread Cornelia Huck
On Fri, Dec 20 2024, Kashyap Chamarthy wrote: > Related tangent on CPU feature discoverability on ARM: > > Speaking of "Neoverse-N1", looking at a system that I have access to, > the `lscpu` output does not say anything about who the integrator is; it > only says: > > ... > Vendor ID:

[PULL 15/59] accel/tcg: Have tlb_vaddr_to_host() use vaddr type

2024-12-20 Thread Philippe Mathieu-Daudé
abi_ptr is expected to be used in user emulation. tlb_vaddr_to_host() uses it, but can be used in system emulation. Replace the type by 'vaddr' which is equivalent on user emulation but also works on system. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard

  1   2   3   >