Re: [PATCH v22 14/20] tests/avocado: s390x cpu topology core

2023-09-04 Thread Nina Schoetterl-Glausch
On Fri, 2023-09-01 at 17:58 +0200, Nina Schoetterl-Glausch wrote: > From: Pierre Morel > > Introduction of the s390x cpu topology core functions and > basic tests. > > We test the correlation between the command line and > the QMP results in query-cpus-fast for various CPU topology. > > Signed-

Re: [PATCH v22 15/20] tests/avocado: s390x cpu topology polarization

2023-09-04 Thread Nina Schoetterl-Glausch
On Fri, 2023-09-01 at 17:58 +0200, Nina Schoetterl-Glausch wrote: > From: Pierre Morel > > Polarization is changed on a request from the guest. > Let's verify the polarization is accordingly set by QEMU. > > Signed-off-by: Pierre Morel > Co-developed-by: Nina Schoetterl-Glausch > Signed-off-by

Re: [PATCH v22 16/20] tests/avocado: s390x cpu topology entitlement tests

2023-09-04 Thread Nina Schoetterl-Glausch
On Fri, 2023-09-01 at 17:58 +0200, Nina Schoetterl-Glausch wrote: > From: Pierre Morel > > Test changes in the entitlement from both a guest and a host point of > view, depending on the polarization. > > Signed-off-by: Pierre Morel > Co-developed-by: Nina Schoetterl-Glausch > Signed-off-by: Ni

Re: [PATCH v22 17/20] tests/avocado: s390x cpu topology test dedicated CPU

2023-09-04 Thread Nina Schoetterl-Glausch
On Fri, 2023-09-01 at 17:58 +0200, Nina Schoetterl-Glausch wrote: > From: Pierre Morel > > A dedicated CPU in vertical polarization can only have > a high entitlement. > Let's check this from both host and guest point of view. > > Signed-off-by: Pierre Morel > Co-developed-by: Nina Schoetterl-G

Re: [PATCH v8 02/12] Add virtio-sound-pci device

2023-09-04 Thread Volker Rümelin
Am 04.09.23 um 12:26 schrieb Manos Pitsidianakis: On Mon, 04 Sep 2023 09:32, Volker Rümelin wrote: +static Property virtio_snd_pci_properties[] = { +    DEFINE_AUDIO_PROPERTIES(VirtIOSoundPCI, vdev.card), I think DEFINE_AUDIO_PROPERTIES should be moved back to virtio-snd.c. The audiodev prop

Re: [PATCH v8 10/12] virtio-sound: implement audio output (TX)

2023-09-04 Thread Volker Rümelin
Am 04.09.23 um 12:34 schrieb Manos Pitsidianakis: On Mon, 04 Sep 2023 13:26, Philippe Mathieu-Daudé wrote: +/* + * AUD_* output callback. + * + * @data: VirtIOSoundPCMStream stream + * @available: number of bytes that can be written with AUD_write() + */ +static void virtio_snd_pcm_out_cb(voi

Re: [PATCH v5 01/20] tests/docker: Update docker-loongarch-cross toolchain

2023-09-04 Thread Richard Henderson
On 9/4/23 07:02, Alex Bennée wrote: Richard Henderson writes: Update from clfs 5.0 to clfs 8.1, which includes updates to binutils 2.41, gcc 13.2, and glibc 2.38. See https://github.com/loongson/build-tools Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Do you want this queu

Re: [PATCH 10/22] Implement shmid_ds conversion between host and target.

2023-09-04 Thread Richard Henderson
On 9/3/23 01:45, Kariiem Taha wrote: Richard Henderson writes: On 8/19/23 02:47, Karim Taha wrote: +if (!lock_user_struct(VERIFY_WRITE, target_sd, target_addr, 0)) { +return -TARGET_EFAULT; +} +if (host_to_target_ipc_perm(target_addr, &(host_sd->shm_perm))) { +retu

Re: [PATCH] softmmu/dirtylimit: Fix usleep early return on signal

2023-09-04 Thread alloc young
On 2023/9/4 21:27, Yong Huang wrote: On Fri, Sep 1, 2023 at 10:19 AM > wrote: From: alloc mailto:alloc.yo...@outlook.com>> Timeout functions like usleep can return early on signal, which reduces more dirty pages than expected. In dirtylimit case

Re: [PATCH v2 05/19] host-utils: Add muldiv64_round_up

2023-09-04 Thread Nicholas Piggin
On Mon Sep 4, 2023 at 11:30 PM AEST, Cédric Le Goater wrote: > On 9/4/23 15:07, Nicholas Piggin wrote: > > On Sat Sep 2, 2023 at 3:02 AM AEST, Richard Henderson wrote: > >> On 9/1/23 04:51, Cédric Le Goater wrote: > >>> Adding more reviewers since this patch is modifying a common service. > >>> > >

Re: [PATCH v2 06/22] target/tricore: Clean up local variable shadowing

2023-09-04 Thread Bastian Koppelmann
On Mon, Sep 04, 2023 at 06:12:18PM +0200, Philippe Mathieu-Daudé wrote: > Fix: > > target/tricore/translate.c:5016:18: warning: declaration of ‘temp’ shadows > a previous local [-Wshadow=compatible-local] >5016 | TCGv temp = tcg_constant_i32(const9); > |

Re: [PATCH 06/15] configure: remove boolean variables for targets

2023-09-04 Thread Paolo Bonzini
Il lun 4 set 2023, 10:15 Thomas Huth ha scritto: > It might look nicer to put the linux and solaris parts from above as > separate entries in the new case-esac statement. > True but it all disappears by the end of the series. Paolo > Anyway: > Reviewed-by: Thomas Huth > >

Re: [RFC PATCH 1/3] Python: Drop support for Python 3.7

2023-09-04 Thread Paolo Bonzini
Il lun 4 set 2023, 12:34 Philippe Mathieu-Daudé ha scritto: > > Since it is safe to under our supported platform policy, bump our > > Is 'under' a verb? This sentence is not obvious to me. > No, just drop "to". Paolo > > minimum supported version of Python to 3.8. The two most interesting >

Re: [PATCH v8 00/12] Add VIRTIO sound card

2023-09-04 Thread Volker Rümelin
Am 04.09.23 um 14:11 schrieb Alex Bennée: Manos Pitsidianakis writes: Hello Volker :) On Mon, 04 Sep 2023 10:20, Volker Rümelin wrote: All qemu_log_mask() format strings need a trailing \n. Thank you, will fix it! I still hear a lot of playback dropouts. I had planned to look at the play

Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-09-04 Thread Laszlo Ersek
Michael, On 8/30/23 17:37, Stefan Hajnoczi wrote: > On Wed, 30 Aug 2023 at 09:30, Laszlo Ersek wrote: >> >> On 8/30/23 14:10, Stefan Hajnoczi wrote: >>> On Sun, 27 Aug 2023 at 14:31, Laszlo Ersek wrote: (1) The virtio-1.0 specification

Re: [PATCH 00/16] tests: Add CPU topology related smbios test cases

2023-09-04 Thread Zhao Liu
Hi Michael, On Fri, Sep 01, 2023 at 12:55:33PM +0300, Michael Tokarev wrote: > Date: Fri, 1 Sep 2023 12:55:33 +0300 > From: Michael Tokarev > Subject: Re: [PATCH 00/16] tests: Add CPU topology related smbios test cases > > 25.08.2023 06:36, Zhao Liu wrote: > > From: Zhao Liu > > > > Hi all, >

Re: [PATCH v2 05/19] host-utils: Add muldiv64_round_up

2023-09-04 Thread Cédric Le Goater
On 9/5/23 05:56, Nicholas Piggin wrote: On Mon Sep 4, 2023 at 11:30 PM AEST, Cédric Le Goater wrote: On 9/4/23 15:07, Nicholas Piggin wrote: On Sat Sep 2, 2023 at 3:02 AM AEST, Richard Henderson wrote: On 9/1/23 04:51, Cédric Le Goater wrote: Adding more reviewers since this patch is modifyin

Re: [PATCH RESEND v5 24/26] contrib/plugins: Allow to log registers

2023-09-04 Thread Akihiko Odaki
On 2023/09/05 0:30, Alex Bennée wrote: Akihiko Odaki writes: On 2023/08/31 0:08, Alex Bennée wrote: Akihiko Odaki writes: 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 |

Re: [PATCH v8 00/12] Add VIRTIO sound card

2023-09-04 Thread Volker Rümelin
Am 04.09.23 um 12:01 schrieb Manos Pitsidianakis: Hello Volker :) On Mon, 04 Sep 2023 10:20, Volker Rümelin wrote: All qemu_log_mask() format strings need a trailing \n. Thank you, will fix it! I still hear a lot of playback dropouts. I had planned to look at the playback code, but I didn'

Re: [PATCH v8 00/12] Add VIRTIO sound card

2023-09-04 Thread Volker Rümelin
Am 28.08.23 um 21:54 schrieb Emmanouil Pitsidianakis: This patch series adds an audio device implementing the recent virtio sound spec (1.2) and a corresponding PCI wrapper device. Hi Manos, I have a few more general comments. All qemu_log_mask() format strings need a trailing \n. I still he

RE: [PATCH v1 3/4] vfio/pci: use an invalid fd to enable MSI-X

2023-09-04 Thread Liu, Jing2
Hi Igor, On Wed, August 30, 2023 6:49 PM, Igor Mammedov wrote: > > On Wed, 30 Aug 2023 10:03:33 + > "Liu, Jing2" wrote: > ... > > > > +/* > > > > + * Get MSI-X enabled, but no vector enabled, by setting vector 0 > > > > +with an invalid > > > > + * fd to kernel. > > > > + */ > > > > +stati

Re: [PATCH v9 04/20] target/riscv: add DEFINE_PROP_END_OF_LIST() to riscv_cpu_options[]

2023-09-04 Thread Philippe Mathieu-Daudé
On 1/9/23 21:46, Daniel Henrique Barboza wrote: Add DEFINE_PROP_END_OF_LIST() and eliminate the ARRAY_SIZE() usage when iterating in the riscv_cpu_options[] array, making it similar to what we already do when working with riscv_cpu_extensions[]. We also have a more sophisticated motivation behin

Re: [PATCH v9 07/20] target/riscv/cpu.c: add riscv_cpu_add_qdev_prop_array()

2023-09-04 Thread Philippe Mathieu-Daudé
On 1/9/23 21:46, Daniel Henrique Barboza wrote: The code inside riscv_cpu_add_user_properties() became quite repetitive after recent changes. Add a helper to hide the repetition away. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target/riscv/cpu.c | 29 +--

Re: [PATCH v9 14/20] target/riscv: make CPUCFG() macro public

2023-09-04 Thread Philippe Mathieu-Daudé
On 1/9/23 21:46, Daniel Henrique Barboza wrote: The RISC-V KVM driver uses a CPUCFG() macro that calculates the offset of a certain field in the struct RISCVCPUConfig. We're going to use this macro in target/riscv/cpu.c as well in the next patches. Make it public. Rename it to CPU_CFG_OFFSET() f

[PATCH 02/13] memory: Introduce memory_region_iommu_set_iova_ranges

2023-09-04 Thread Eric Auger
This helper will allow to convey information about valid IOVA ranges to virtual IOMMUS. Signed-off-by: Eric Auger --- include/exec/memory.h | 26 ++ softmmu/memory.c | 15 +++ 2 files changed, 41 insertions(+) diff --git a/include/exec/memory.h b/include

[PATCH 03/13] vfio: Collect container iova range info

2023-09-04 Thread Eric Auger
Collect iova range information if VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE capability is supported. This allows to propagate the information though the IOMMU MR set_iova_ranges() callback so that virtual IOMMUs get aware of those aperture constraints. Signed-off-by: Eric Auger --- include/hw/vfio/v

[PATCH 09/13] util/reserved-region: Add new ReservedRegion helpers

2023-09-04 Thread Eric Auger
Introduce resv_region_list_insert() helper which inserts a new ReservedRegion into a sorted list of reserved region. In case of overlap, the new region has higher priority and hides the existing overlapped segments. If the overlap is partial, new regions are created for parts which are not overlapp

[PATCH 05/13] virtio-iommu: Introduce per IOMMUDevice reserved regions

2023-09-04 Thread Eric Auger
For the time being the per device reserved regions are just a duplicate of IOMMU wide reserved regions. Subsequent patches will combine those with host reserved regions, if any. Signed-off-by: Eric Auger --- include/hw/virtio/virtio-iommu.h | 1 + hw/virtio/virtio-iommu.c | 42 +

[PATCH 12/13] virtio-iommu: Resize memory region according to the max iova info

2023-09-04 Thread Eric Auger
By default the virtio-iommu MR has a 64b span. As we intend to remove the VFIO assumption of 64b IOVA, let's make sure the MR is resized according to the actual GAW of the physical IOMMU. Otherwise we will get a failure on vfio vfio_find_hostwin(). Signed-off-by: Eric Auger --- hw/virtio/virtio-

[PATCH 10/13] virtio-iommu: Consolidate host reserved regions and property set ones

2023-09-04 Thread Eric Auger
Up to now we were exposing to the RESV_MEM probe requests the reserved memory regions set though the reserved-regions array property. Combine those with the host reserved memory regions if any. Those latter are tagged as RESERVED. We don't have more information about them besides then cannot be ma

[PATCH 01/13] memory: Let ReservedRegion use Range

2023-09-04 Thread Eric Auger
A reserved region is a range tagged with a type. Let's directly use the Range type in the prospect to reuse some of the library helpers shipped with the Range type. Signed-off-by: Eric Auger --- include/exec/memory.h| 4 ++-- hw/core/qdev-properties-system.c | 9 ++--- hw/virtio/

[PATCH 07/13] virtio-iommu: Implement set_iova_ranges() callback

2023-09-04 Thread Eric Auger
The implementation populates the array of per IOMMUDevice host reserved regions. Signed-off-by: Eric Auger --- include/hw/virtio/virtio-iommu.h | 2 ++ hw/virtio/virtio-iommu.c | 17 + 2 files changed, 19 insertions(+) diff --git a/include/hw/virtio/virtio-iommu.h b/inc

[PATCH 00/13] VIRTIO-IOMMU/VFIO: Don't assume 64b IOVA space

2023-09-04 Thread Eric Auger
On x86, when assigning VFIO-PCI devices protected with virtio-iommu we encounter the case where the guest tries to map IOVAs beyond 48b whereas the physical VTD IOMMU only supports 48b. This ends up with VFIO_MAP_DMA failures at qemu level because at kernel level, vfio_iommu_iova_dma_valid() check

[PATCH 11/13] test: Add some tests for range and resv-mem helpers

2023-09-04 Thread Eric Auger
Add unit tests for both resv_region_list_insert() and range_inverse_array(). Signed-off-by: Eric Auger --- tests/unit/test-resv-mem.c | 198 + tests/unit/meson.build | 1 + 2 files changed, 199 insertions(+) create mode 100644 tests/unit/test-resv-mem.c

[PATCH 13/13] vfio: Remove 64-bit IOVA address space assumption

2023-09-04 Thread Eric Auger
Now we retrieve the usable IOVA ranges from the host, let's remove the assumption of 64b IOVA space when calling vfio_host_win_add(). Make sure the vfio_find_hostwin() gets called after we get a chance to call set_iova_regions and resize the IOMMU MR according to the actual physical GAW. Signed-o

[PATCH 04/13] virtio-iommu: Rename reserved_regions into prop_resv_regions

2023-09-04 Thread Eric Auger
Rename VirtIOIOMMU (nb_)reserved_regions fields with the "prop_" prefix to highlight those fields are set through a property, at machine level. They are IOMMU wide. A subsequent patch will introduce per IOMMUDevice reserved regions that will include both those IOMMU wide property reserved regions

[PATCH 08/13] range: Make range_compare() public

2023-09-04 Thread Eric Auger
Let's expose range_compare() in the header so that it can be reused outside of util/range.c Signed-off-by: Eric Auger --- include/qemu/range.h | 6 ++ util/range.c | 6 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/qemu/range.h b/include/qemu/range.h i

[PATCH 06/13] range: Introduce range_inverse_array()

2023-09-04 Thread Eric Auger
This helper reverses an array of regions, turning original regions into holes and original holes into actual regions, covering the whole UINT64_MAX span. Signed-off-by: Eric Auger --- include/qemu/range.h | 3 +++ util/range.c | 35 +++ 2 files changed, 3

Re: [PATCH 02/15] meson: update unsupported host/CPU messages

2023-09-04 Thread Thomas Huth
On 02/09/2023 14.59, Paolo Bonzini wrote: Unsupported CPU and OSes are not really going away, but the project simply does not guarantee that they work. Rephrase the messages accordingly. While at it, move the warning for TCI performance at the end where it is more visible. Signed-off-by: Paolo

Re: [PATCH 01/13] memory: Let ReservedRegion use Range

2023-09-04 Thread Philippe Mathieu-Daudé
On 4/9/23 10:03, Eric Auger wrote: A reserved region is a range tagged with a type. Let's directly use the Range type in the prospect to reuse some of the library helpers shipped with the Range type. Signed-off-by: Eric Auger --- include/exec/memory.h| 4 ++-- hw/core/qdev-proper

Re: [PATCH 06/15] configure: remove boolean variables for targets

2023-09-04 Thread Thomas Huth
On 02/09/2023 14.59, Paolo Bonzini wrote: Just use $targetos always. Signed-off-by: Paolo Bonzini --- configure | 55 +-- 1 file changed, 13 insertions(+), 42 deletions(-) ... @@ -1718,7 +1687,7 @@ echo all: >> $config_host_mak if test

Re: [PATCH 06/13] range: Introduce range_inverse_array()

2023-09-04 Thread Philippe Mathieu-Daudé
On 4/9/23 10:03, Eric Auger wrote: This helper reverses an array of regions, turning original regions into holes and original holes into actual regions, covering the whole UINT64_MAX span. Signed-off-by: Eric Auger --- include/qemu/range.h | 3 +++ util/range.c | 35

Re: [PATCH] arm64: Restore trapless ptimer access

2023-09-04 Thread Claudio Fontana
Hi, I think this discussion from ~2015 could potentially be be historically relevant for context, at the time we had the problem with CNTVOFF IIRC so KVM_REG_ARM_TIMER_CNT being read and rewritten causing time warps in the guest: https://patchwork.kernel.org/project/linux-arm-kernel/patch/14351

Re: [PATCH 08/13] range: Make range_compare() public

2023-09-04 Thread Philippe Mathieu-Daudé
On 4/9/23 10:03, Eric Auger wrote: Let's expose range_compare() in the header so that it can be reused outside of util/range.c Signed-off-by: Eric Auger --- include/qemu/range.h | 6 ++ util/range.c | 6 +- 2 files changed, 7 insertions(+), 5 deletions(-) Reviewed-by: Phil

Re: [PATCH 12/13] virtio-iommu: Resize memory region according to the max iova info

2023-09-04 Thread Philippe Mathieu-Daudé
On 4/9/23 10:03, Eric Auger wrote: By default the virtio-iommu MR has a 64b span. As we intend to remove the VFIO assumption of 64b IOVA, let's make sure the MR is resized according to the actual GAW of the physical IOMMU. Otherwise we will get a failure on vfio vfio_find_hostwin(). Signed-off-b

Re: [PATCH v9 11/20] avocado, risc-v: add tuxboot tests for 'max' CPU

2023-09-04 Thread Philippe Mathieu-Daudé
On 1/9/23 21:46, Daniel Henrique Barboza wrote: Add smoke tests to ensure that we'll not break the 'max' CPU type when adding new frozen/ratified RISC-V extensions. Signed-off-by: Daniel Henrique Barboza --- tests/avocado/tuxrun_baselines.py | 32 +++ 1 file chang

Re: [PATCH v9 12/20] target/riscv: deprecate the 'any' CPU type

2023-09-04 Thread Philippe Mathieu-Daudé
On 1/9/23 21:46, Daniel Henrique Barboza wrote: The 'any' CPU type was introduced in commit dc5bd18fa5725 ("RISC-V CPU Core Definition"), being around since the beginning. It's not an easy CPU to use: it's undocumented and its name doesn't tell users much about what the CPU is supposed to bring.

[PATCH 1/2] blockdev: qmp_transaction: harden transaction properties for bitmaps

2023-09-04 Thread Andrey Zhadchenko via
Unlike other transaction commands, bitmap operations do not drain target bds. If we have an IOThread, this may result in some inconsistencies, as bitmap content may change during transaction command. Add bdrv_drained_begin()/end() to bitmap operations. Signed-off-by: Andrey Zhadchenko --- blockd

[PATCH 2/2] blockdev: qmp_transaction: remove bdrv_drain_all from transaction

2023-09-04 Thread Andrey Zhadchenko via
Now all transaction actions drain their respective bds Also, bdrv_drain_all() did not protect anything in case of IOThreads Signed-off-by: Andrey Zhadchenko --- blockdev.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index 7a376fce90..65932f9afb 100644 --- a/bloc

Re: [PATCH RESEND 0/2] block/qapi: Dead code cleanup

2023-09-04 Thread Kevin Wolf
Am 01.09.2023 um 20:46 hat Fabiano Rosas geschrieben: > Hi, > > I'm resending a couple of already reviewed patches that were part of a > larger series[1]. > > Thanks > > 1- https://lore.kernel.org/r/20230609201910.12100-1-faro...@suse.de > > Fabiano Rosas (2): > block: Remove bdrv_query_block

Re: [PATCH v2 0/4] block-backend: process I/O in the current AioContext

2023-09-04 Thread Kevin Wolf
Am 24.08.2023 um 01:59 hat Stefan Hajnoczi geschrieben: > v2 > - Add patch to remove AIOCBInfo->get_aio_context() [Kevin] > - Add patch to use qemu_get_current_aio_context() in block-coroutine-wrapper > so > that the wrappers use the current AioContext instead of > bdrv_get_aio_context(). > >

Re: [PATCH 20/20] target/riscv: add 'kvm_supported' class property

2023-09-04 Thread Andrew Jones
On Fri, Sep 01, 2023 at 05:57:46PM -0300, Daniel Henrique Barboza wrote: > > > On 8/31/23 09:47, Andrew Jones wrote: > > On Fri, Aug 25, 2023 at 10:08:53AM -0300, Daniel Henrique Barboza wrote: > > > This follows the same idea of 'tcg_support' property added in the > > > previous patch. Note that

[PULL 00/35] ppc queue

2023-09-04 Thread Cédric Le Goater
The following changes since commit 17780edd81d27fcfdb7a802efc870a99788bd2fc: Merge tag 'quick-fix-pull-request' of https://gitlab.com/bsdimp/qemu into staging (2023-08-31 10:06:29 -0400) are available in the Git repository at: https://github.com/legoater/qemu/ tags/pull-ppc-202

[PULL 02/35] ppc: Add stub implementation of TRIG SPRs

2023-09-04 Thread Cédric Le Goater
From: Joel Stanley Linux sets these to control cache flush behaviour on Power9. Supervisor and hypervisor are allowed to write, and reads are noops. Add implementations to avoid noisy messages when booting Linux under the pseries machine with guest_errors enabled. Reviewed-by: Nicholas Piggin

[PULL 16/35] target/ppc: Sign-extend large decrementer to 64-bits

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin When storing a large decrementer value with the most significant implemented bit set, it is to be treated as a negative and sign extended. This isn't hit for book3s DEC because of another bug, fixing it in the next patch exposes this one and can cause additional problems, s

[PULL 10/35] ppc/vof: Fix missed fields in VOF cleanup

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Failing to reset the of_instance_last makes ihandle allocation continue to increase, which causes record-replay replay fail to match the recorded trace. Not resetting claimed_base makes VOF eventually run out of memory after some resets. Cc: Alexey Kardashevskiy Fixes: fc

[PULL 04/35] target/ppc: Improve book3s branch trace interrupt for v2.07S

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Improve the emulation accuracy of the single step and branch trace interrupts for v2.07S. Set SRR1[33]=1, and set SIAR to completed instruction address. Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- target/ppc/helper.h | 1 + target/ppc/excp_he

[PULL 19/35] hw/ppc: Reset timebase facilities on machine reset

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Lower interrupts, delete timers, and set time facility registers back to initial state on machine reset. This is not so important for record-replay since timebase and decrementer are migrated, but it gives a cleaner reset state. Cc: Mark Cave-Ayland Cc: BALATON Zoltan Si

[PULL 03/35] target/ppc: Remove single-step suppression inside 0x100-0xf00

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Single-step interrupts are suppressed if the nip is between 0x100 and 0xf00. This has been the case for a long time and it's not clear what the intention is. Likely either an attempt to suppress trace interrupts for instructions that cause an interrupt on completion, or a wo

[PULL 12/35] hw/ppc: Introduce functions for conversion between timebase and nanoseconds

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin These calculations are repeated several times, and they will become a little more complicated with subsequent changes. Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- hw/ppc/ppc.c | 28 ++-- 1 file changed, 18 insertions(+), 10

[PULL 15/35] hw/ppc: Avoid decrementer rounding errors

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin The decrementer register contains a relative time in timebase units. When writing to DECR this is converted and stored as an absolute value in nanosecond units, reading DECR converts back to relative timebase. The tb<->ns conversion of the relative part can cause rounding s

[PULL 06/35] target/ppc: Implement breakpoint debug facility for v2.07S

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin ISA v2.07S introduced the breakpoint facility based on the CIABR SPR. Implement this in TCG. Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- target/ppc/cpu.h | 3 +++ target/ppc/helper.h | 1 + target/ppc/internal.h| 2 ++ target/pp

[PULL 25/35] tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin This the ppc64 record-replay test is able to replay the full kernel boot so try enabling it. Acked-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- tests/avocado/replay_kernel.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(

[PULL 17/35] hw/ppc: Always store the decrementer value

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin When writing a value to the decrementer that raises an exception, the irq is raised, but the value is not stored so the store doesn't appear to have changed the register when it is read again. Always store the write value to the register. Fixes: e81a982aa53 ("PPC: Clean up

[PULL 23/35] spapr: Fix machine reset deadlock from replay-record

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin When the machine is reset to load a new snapshot while being debugged with replay-record, it is done from another thread, so the CPU does not run the register setting operations. Set CPU registers directly in machine reset. Cc: Pavel Dovgalyuk Signed-off-by: Nicholas Piggi

[PULL 09/35] ppc/vhyp: reset exception state when handling vhyp hcall

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Convention is to reset the exception_index and error_code after handling an interrupt. The vhyp hcall handler fails to do this. This does not appear to have ill effects because cpu_handle_exception() clears exception_index later, but it is fragile and inconsistent. Reset the

[PULL 21/35] target/ppc: Fix CPU reservation migration for record-replay

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin ppc only migrates reserve_addr, so the destination machine can get a valid reservation with an incorrect reservation value of 0. Prior to commit 392d328abe753 ("target/ppc: Ensure stcx size matches larx"), this could permit a stcx. to incorrectly succeed. That commit inadver

[PULL 11/35] hw/ppc/ppc.c: Tidy over-long lines

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- hw/ppc/ppc.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 0e0a3d93c3bf..09b82f68a84e 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc

[PULL 28/35] target/ppc: Fix LQ, STQ register-pair order for big-endian

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin LQ, STQ have the same register-pair ordering as LQARX/STQARX., which is the even (lower) register contains the most significant bits. This is not implemented correctly for big-endian. do_ldst_quad() has variables low_addr_gpr and high_addr_gpr which is confusing because the

[PULL 05/35] target/ppc: Suppress single step interrupts on rfi-type instructions

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin BookS does not take single step interrupts on completion of rfi and similar (rfid, hrfid, rfscv). This is not a completely clean way to do it, but in general non-branch instructions that change NIP on completion are excluded. Signed-off-by: Nicholas Piggin Signed-off-by: C

[PULL 34/35] ppc/xive: Handle END triggers between chips with MMIOs

2023-09-04 Thread Cédric Le Goater
The notify page of the interrupt controller can either be used to receive trigger events from the HW controllers (PHB, PSI) or to reroute interrupts between Interrupt Controllers. In which case, the VSD table is used to determine the address of the notify page of the remote IC and the store data is

[PULL 22/35] target/ppc: Fix timebase reset with record-replay

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Timebase save uses a random number for a legacy vmstate field, which makes rr snapshot loading unbalanced. The easiest way to deal with this is just to skip the rng if record-replay is active. Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Signed-off-by: Cédr

[PULL 20/35] hw/ppc: Read time only once to perform decrementer write

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Reading the time more than once to perform an operation always increases complexity and fragility due to introduced deltas. Simplify the decrementer write by reading the clock once for the operation. Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- hw/p

[PULL 27/35] tests/avocado: ppc64 reverse debugging tests for pseries and powernv

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin These machines run reverse-debugging well enough to pass basic tests. Wire them up. Reviewed-by: Pavel Dovgalyuk Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- tests/avocado/reverse_debugging.py | 29 + 1 file changed, 29

[PULL 08/35] spapr: implement H_SET_MODE debug facilities

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin Wire up the H_SET_MODE debug resources to the CIABR and DAWR0 debug facilities in TCG. Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- hw/ppc/spapr_hcall.c | 57 1 file changed, 57 insertions(+) diff --git

[PULL 24/35] spapr: Fix record-replay machine reset consuming too many events

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin spapr_machine_reset gets a random number to populate the device-tree rng seed with. When loading a snapshot for record-replay, the machine is reset again, and that tries to consume the random event record again, crashing due to inconsistent record Fix this by saving the see

[PULL 01/35] target/ppc: Generate storage interrupts for radix RC changes

2023-09-04 Thread Cédric Le Goater
From: Shawn Anastasio Change radix model to always generate a storage interrupt when the R/C bits are not set appropriately in a PTE instead of setting the bits itself. According to the ISA both behaviors are valid, but in practice this change more closely matches behavior observed on the POWER9

[PULL 13/35] host-utils: Add muldiv64_round_up

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin This will be used for converting time intervals in different base units to host units, for the purpose of scheduling timers to emulate target timers. Timers typically must not fire before their requested expiry time but may fire some time afterward, so rounding up is the rig

[PULL 33/35] ppc/xive: Introduce a new XiveRouter end_notify() handler

2023-09-04 Thread Cédric Le Goater
It will help us model the END triggers on the PowerNV machine, which can be rerouted to another interrupt controller. Reviewed-by: Frederic Barrat Signed-off-by: Cédric Le Goater --- include/hw/ppc/xive.h | 2 ++ hw/intc/xive.c| 28 ++-- 2 files changed, 20 inse

[PULL 26/35] tests/avocado: reverse-debugging cope with re-executing breakpoints

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin The reverse-debugging test creates a trace, then replays it and: 1. Steps the first 10 instructions and records their addresses. 2. Steps backward and verifies their addresses match. 3. Runs to (near) the end of the trace. 4. Sets breakpoints on the first 10 instructions. 5

[PULL 14/35] hw/ppc: Round up the decrementer interval when converting to ns

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin The rule of timers is typically that they should never expire before the timeout, but some time afterward. Rounding timer intervals up when doing conversion is the right thing to do. Under most circumstances it is impossible observe the decrementer interrupt before the dec

[PULL 18/35] target/ppc: Migrate DECR SPR

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin TCG does not maintain the DEC reigster in the SPR array, so it does get migrated. TCG also needs to re-start the decrementer timer on the destination machine. Load and store the decrementer into the SPR when migrating. This works for the level-triggered (book3s) decrementer

[PULL 29/35] target/ppc: Flush inputs to zero with NJ in ppc_store_vscr

2023-09-04 Thread Cédric Le Goater
From: Richard Henderson Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1779 Signed-off-by: Richard Henderson Reviewed-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- target/ppc/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c index

[PULL 30/35] hw/ppc/e500: fix broken snapshot replay

2023-09-04 Thread Cédric Le Goater
From: Maksim Kostin ppce500_reset_device_tree is registered for system reset, but after c4b075318eb1 this function rerandomizes rng-seed via qemu_guest_getrandom_nofail. And when loading a snapshot, it tries to read EVENT_RANDOM that doesn't exist, so we have an error: qemu-system-ppc: Missing

[PULL 32/35] ppc/xive: Use address_space routines to access the machine RAM

2023-09-04 Thread Cédric Le Goater
to log an error in case of bad configuration of the XIVE tables by the FW. Reviewed-by: Frederic Barrat Signed-off-by: Cédric Le Goater --- hw/intc/pnv_xive.c | 27 +++ hw/intc/pnv_xive2.c | 27 +++ 2 files changed, 46 insertions(+), 8 deletions(

[PULL 31/35] target/ppc: Fix the order of kvm_enable judgment about kvmppc_set_interrupt()

2023-09-04 Thread Cédric Le Goater
From: jianchunfu It's unnecessary for non-KVM accelerators(TCG, for example), to call this function, so change the order of kvm_enable() judgment. The static inline function that returns -1 directly does not work in TCG's situation. Signed-off-by: jianchunfu Tested-by: Gautam Menghani Signed

[PULL 07/35] target/ppc: Implement watchpoint debug facility for v2.07S

2023-09-04 Thread Cédric Le Goater
From: Nicholas Piggin ISA v2.07S introduced the watchpoint facility based on the DAWR0 and DAWRX0 SPRs. Implement this in TCG. Signed-off-by: Nicholas Piggin Signed-off-by: Cédric Le Goater --- target/ppc/cpu.h | 4 +++ target/ppc/helper.h | 2 ++ target/ppc/internal.h| 1

[PULL 35/35] ppc/xive: Add support for the PC MMIOs

2023-09-04 Thread Cédric Le Goater
The XIVE interrupt contoller maintains various fields on interrupt targets in a structure called NVT. Each unit has a NVT cache, backed by RAM. When the NVT structure is not local (in RAM) to the chip, the XIVE interrupt controller forwards the memory operation to the owning chip using the PC MMIO

Re: [PATCH v9 15/20] target/riscv/cpu.c: introduce cpu_cfg_ext_auto_update()

2023-09-04 Thread Andrew Jones
On Fri, Sep 01, 2023 at 04:46:21PM -0300, Daniel Henrique Barboza wrote: > During realize() time we're activating a lot of extensions based on some > criteria, e.g.: > > if (cpu->cfg.ext_zk) { > cpu->cfg.ext_zkn = true; > cpu->cfg.ext_zkr = true; > cpu->cfg.ext_zkt = tr

Re: [PATCH v9 20/20] target/riscv/cpu.c: consider user option with RVG

2023-09-04 Thread Andrew Jones
On Fri, Sep 01, 2023 at 04:46:26PM -0300, Daniel Henrique Barboza wrote: > Enabling RVG will enable a set of extensions that we're not checking if > the user was okay enabling or not. And in this case we want to error > out, instead of ignoring, otherwise we will be inconsistent enabling RVG > with

Re: [PATCH v2 3/3] gdbstub: replace exit(0) with proper shutdown

2023-09-04 Thread Peter Maydell
On Wed, 23 Aug 2023 at 08:07, Clément Chigot wrote: > > This replaces the exit(0) call by a shutdown request, ensuring a proper > cleanup of Qemu. Otherwise, some connections could be broken without > being correctly flushed. > > Signed-off-by: Clément Chigot > --- > gdbstub/gdbstub.c | 3 +-- >

Re: [POC 2/2] add test exposing AHCI reset issue

2023-09-04 Thread Kevin Wolf
Am 25.08.2023 um 12:17 hat Fiona Ebner geschrieben: > Am 24.08.23 um 15:38 schrieb Fiona Ebner: > > Fails without the previous commit "hw/ide: reset: cancel async DMA > > operation before reseting state". > > > > I haven't ever written such a test before, but I wanted something to > > expose the p

Re: [PATCH v2 3/3] gdbstub: replace exit(0) with proper shutdown

2023-09-04 Thread Clément Chigot
On Mon, Sep 4, 2023 at 11:23 AM Peter Maydell wrote: > > On Wed, 23 Aug 2023 at 08:07, Clément Chigot wrote: > > > > This replaces the exit(0) call by a shutdown request, ensuring a proper > > cleanup of Qemu. Otherwise, some connections could be broken without > > being correctly flushed. > > >

Re: [PATCH v2 3/3] gdbstub: replace exit(0) with proper shutdown

2023-09-04 Thread Peter Maydell
On Mon, 4 Sept 2023 at 10:36, Clément Chigot wrote: > > On Mon, Sep 4, 2023 at 11:23 AM Peter Maydell > wrote: > > > > On Wed, 23 Aug 2023 at 08:07, Clément Chigot wrote: > > > > > > This replaces the exit(0) call by a shutdown request, ensuring a proper > > > cleanup of Qemu. Otherwise, some c

Re: [PATCH v3 16/16] tcg/loongarch64: Implement 128-bit load & store

2023-09-04 Thread bibo mao
在 2023/9/4 09:43, gaosong 写道: > Hi, yijun > > 在 2023/9/3 上午9:10, Jiajie Chen 写道: >> >> On 2023/9/3 09:06, Richard Henderson wrote: >>> On 9/1/23 22:02, Jiajie Chen wrote: If LSX is available, use LSX instructions to implement 128-bit load & store. >>> >>> Is this really guaranteed to

Re: [PATCH v2 2/3] hw/char: riscv_htif: replace exit(0) with proper shutdown

2023-09-04 Thread Peter Maydell
On Wed, 23 Aug 2023 at 08:07, Clément Chigot wrote: > > This replaces the exit(0) call by a shutdown request, ensuring a proper > cleanup of Qemu. Otherwise, some connections like gdb could be broken > without being correctly flushed. > > Signed-off-by: Clément Chigot > Reviewed-by: Alistair Fran

Re: [PATCH 4/8] hw/core/cpu: Return static value with gdb_arch_name()

2023-09-04 Thread Philippe Mathieu-Daudé
On 4/9/23 07:54, Michael Tokarev wrote: 03.09.2023 07:30, Akihiko Odaki wrote: All implementations of gdb_arch_name() returns dynamic duplicates of static strings. It's also unlikely that there will be an implementation of gdb_arch_name() that returns a truly dynamic value due to the nature of t

Re: [PATCH 26/67] ui/vc: move cursor_timer initialization to QemuTextConsole class

2023-09-04 Thread Marc-André Lureau
Hi On Fri, Sep 1, 2023 at 6:29 PM Daniel P. Berrangé wrote: > > On Wed, Aug 30, 2023 at 01:38:00PM +0400, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > The timer is only relevant when a text console exists. > > > > Signed-off-by: Marc-André Lureau > > --- > > ui/consol

[RFC PATCH 3/3] Revert "mkvenv: work around broken pip installations on Debian 10"

2023-09-04 Thread Paolo Bonzini
Debian 10 has Python 3.7, so it is not possible to use it anymore now that Python 3.8 is required. Signed-off-by: Paolo Bonzini --- python/scripts/mkvenv.py | 74 +--- 1 file changed, 16 insertions(+), 58 deletions(-) diff --git a/python/scripts/mkvenv.py b/p

[RFC PATCH 0/3] drop support for Python 3.7 and Debian 10

2023-09-04 Thread Paolo Bonzini
Debian 10 is not anymore a supported distro, since Debian 12 was released on June 10, 2023, and it is also the last distro that supports Python 3.7. Both Debian 10 and Python 3.7 required a substantial amount of code in mkvenv.py, and John also mentioned that asyncio had changes related to cance

<    1   2   3   4   >