[PATCH v3 4/6] target/riscv: Split interrupt logic from riscv_cpu_update_mip.

2023-10-11 Thread Rajnesh Kanwal
This is to allow virtual interrupts to be inserted into S and VS modes. Given virtual interrupts will be maintained in separate mvip and hvip CSRs, riscv_cpu_update_mip will no longer be in the path and interrupts need to be triggered for these cases from rmw_hvip64 and rmw_mvip64 functions. Signe

[PATCH v3 5/6] target/riscv: Add M-mode virtual interrupt and IRQ filtering support.

2023-10-11 Thread Rajnesh Kanwal
This change adds support for inserting virtual interrupts from M-mode into S-mode using mvien and mvip csrs. IRQ filtering is a use case of this change, i-e M-mode can stop delegating an interrupt to S-mode and instead enable it in MIE and receive those interrupts in M-mode and then selectively inj

[PATCH v3 2/6] target/riscv: Check for async flag in case of RISCV_EXCP_SEMIHOST.

2023-10-11 Thread Rajnesh Kanwal
RISCV_EXCP_SEMIHOST is set to 0x10, which can be a local interrupt id as well. This change moves RISCV_EXCP_SEMIHOST to switch case so that async flag check is performed before invoking semihosting logic. Signed-off-by: Rajnesh Kanwal Reviewed-by: Alistair Francis --- target/riscv/cpu_helper.c

Re: [PATCH 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings()

2023-10-11 Thread BALATON Zoltan
On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: Hi Zoltan, On 11/10/23 15:31, BALATON Zoltan wrote: On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: Apparently l2sram_update_mappings() bit-rotted over time, when defining MAP_L2SRAM we get:  hw/ppc/ppc440_uc.c:83:17: error: no member name

[PATCH] target/i386: fix shadowed variable pasto

2023-10-11 Thread Paolo Bonzini
Commit a908985971a ("target/i386/seg_helper: introduce tss_set_busy", 2023-09-26) failed to use the tss_selector argument of the new function, which was therefore unused. This shows up as a #GP fault when booting old versions of 32-bit Linux. Fixes: a908985971a ("target/i386/seg_helper: introduce

Re: [PATCH V4 00/10] Add architecture agnostic code to support vCPU Hotplug

2023-10-11 Thread Vishnu Pajjuri
Hi Salil, On 10-10-2023 02:05, Salil Mehta wrote: Virtual CPU hotplug support is being added across various architectures[1][3]. This series adds various code bits common across all architectures: 1. vCPU creation and Parking code refactor [Patch 1] 2. Update ACPI GED framework to support vCPU

Re: [PATCH] target/i386: fix shadowed variable pasto

2023-10-11 Thread Philippe Mathieu-Daudé
On 11/10/23 15:53, Paolo Bonzini wrote: Commit a908985971a ("target/i386/seg_helper: introduce tss_set_busy", 2023-09-26) failed to use the tss_selector argument of the new function, which was therefore unused. This shows up as a #GP fault when booting old versions of 32-bit Linux. Fixes: a9089

[PATCH v2 0/2] hw/ppc/ppc440_uc: Maintain and remove dead code

2023-10-11 Thread Philippe Mathieu-Daudé
Series fully reviewed. v2: Removed few comments and added Zoltan R-b tags - Cover ppc440_uc in MAINTAINERS - Remove dead code Philippe Mathieu-Daudé (2): MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings() MAINTAINERS| 1

[PATCH v2 2/2] hw/ppc/ppc440_uc: Remove dead l2sram_update_mappings()

2023-10-11 Thread Philippe Mathieu-Daudé
Apparently l2sram_update_mappings() bit-rotted over time, when defining MAP_L2SRAM we get: hw/ppc/ppc440_uc.c:83:17: error: no member named 'isarc' in 'struct ppc4xx_l2sram_t' if (l2sram->isarc != isarc || ~~ ^ hw/ppc/ppc440_uc.c:84:18: error: no member named 'isacntl' in

[PATCH v2 1/2] MAINTAINERS: Cover hw/ppc/ppc440_uc.c with Sam460ex board

2023-10-11 Thread Philippe Mathieu-Daudé
hw/ppc/ppc440_uc.c implements the TYPE_PPC460EX_PCIE_HOST device, which is used by the aCube Sam460ex board. Signed-off-by: Philippe Mathieu-Daudé Acked-by: BALATON Zoltan --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9e7dec4a58..8c07d07927

Re: [PATCH v2 4/6] migration: Fix analyze-migration.py when ignore-shared is used

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > Juan Quintela writes: > >> Fabiano Rosas wrote: >>> The script is currently broken when the x-ignore-shared capability is >>> used: >>> >>> Traceback (most recent call last): >>> File "./scripts/analyze-migration.py", line 656, in >>> dump.read(dump_memory = args.me

Re: [PATCH 3/5] hw/ppc/ppc4xx_pci: Declare PPC4XX_PCI in Kconfig

2023-10-11 Thread Philippe Mathieu-Daudé
On 11/10/23 15:42, BALATON Zoltan wrote: On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé Should this be squashed with next patch? It looks strange to have config defined in hw/pci-host/Kconfig but used in hw/ppc/meson.build. OK. Regards, BALATON Z

Re: Accessing emulated CXL memory is unstable

2023-10-11 Thread Jonathan Cameron via
On Wed, 11 Oct 2023 09:50:07 +0900 Hyeonggon Yoo <42.hye...@gmail.com> wrote: > On Wed, Oct 11, 2023 at 12:54 AM Gregory Price > wrote: > > > > On Tue, Oct 10, 2023 at 10:35:03AM +0900, Hyeonggon Yoo wrote: > > > Hello folks, > > > > > > I experienced strange application crashes/internal KVM er

Re: [PATCH] vfio/pci: rename vfio_put_device to vfio_pci_put_device

2023-10-11 Thread Cédric Le Goater
On 10/11/23 15:02, Philippe Mathieu-Daudé wrote: Hi, On 22/9/23 04:52, Zhenzhong Duan wrote: vfio_put_device() is a VFIO PCI specific function, rename it with 'vfio_pci' prefix to avoid confusing. Why not, but what about the other functions? yes. Let's tackle that after the IOMMUFD earthqua

Re: [PULL 06/65] tests/qtest: migration: Add support for negative testing of qmp_migrate

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > Juan Quintela writes: > >> From: Fabiano Rosas >> >> There is currently no way to write a test for errors that happened in >> qmp_migrate before the migration has started. >> >> Add a version of qmp_migrate that ensures an error happens. To make >> use of it a test needs t

Re: [PATCH v2 1/9] tests/qtest: Allow qtest_qemu_binary to use a custom environment variable

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > We're adding support for testing migration using two different QEMU > binaries. We'll provide the second binary in a new environment > variable. > > Allow qtest_qemu_binary() to receive the name of the new variable. If > the new environment variable is not set, that's not an

[PULL 1/3] qga: Remove platform GUID definitions

2023-10-11 Thread Konstantin Kostiuk
From: Akihiko Odaki GUID_DEVINTERFACE_DISK and GUID_DEVINTERFACE_STORAGEPORT are already defined by MinGW-w64. They are not only unnecessary, but can lead to duplicate definition errors at link time with some unknown condition. Signed-off-by: Akihiko Odaki Reviewed-by: Konstantin Kostiuk Signe

[PULL 2/3] qga: Fix memory leak when output stream is unused

2023-10-11 Thread Konstantin Kostiuk
From: Daniel Xu If capture-output is requested but one of the channels goes unused (eg. we attempt to capture stderr but the command never writes to stderr), we can leak memory. guest_exec_output_watch() is (from what I understand) unconditionally called for both streams if output capture is req

Re: [PATCH v2 2/9] tests/qtest: Introduce qtest_init_with_env

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > Add a version of qtest_init() that takes an environment variable > containing the path of the QEMU binary. This allows tests to use more > than one QEMU binary. > > If no variable is provided or the environment variable does not exist, > that is not an error. Fallback to usi

[PULL 0/3] Misc QGA patches 2023-10-11

2023-10-11 Thread Konstantin Kostiuk
The following changes since commit cea3ea670fe265421131aad90c36fbb87bc4d206: Merge tag 'pull-vfio-20231009' of https://github.com/legoater/qemu into staging (2023-10-09 10:11:35 -0400) are available in the Git repository at: https://github.com/kostyanf14/qemu.git tags/qga-pull-2023-10-11 f

[PULL 3/3] qapi: qga: Clarify when out-data and err-data are populated

2023-10-11 Thread Konstantin Kostiuk
From: Daniel Xu If output is being captured for a guest-exec invocation, the out-data and err-data fields of guest-exec-status are only populated after the process is reaped. This is somewhat counter intuitive and too late to change. Thus, it would be good to document the behavior. Signed-off-by

Re: [PATCH v3 3/4] migration/qapi: Replace @MigrateSetParameters with @MigrationParameters

2023-10-11 Thread Markus Armbruster
Markus Armbruster writes: > Peter Xu writes: > >> Hi, Markus, >> >> On Tue, Oct 10, 2023 at 09:18:23PM +0200, Markus Armbruster wrote: >> >> [...] >> >>> >> The point I was trying to make is this. Before the patch, we reject >>> >> attempts to set the property value to null. Afterwards, we acc

Re: [PATCH v2 3/9] tests/qtest: Allow qtest_get_machines to use an alternate QEMU binary

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > We're adding support for using more than one QEMU binary in > tests. Modify qtest_get_machines() to take an environment variable > that contains the QEMU binary path. > > Since the function keeps a cache of the machines list in the form of a > static variable, refresh it any

Re: [PATCH v2 4/9] tests/qtest: Introduce qtest_has_machine_with_env

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > Add a variant of qtest_has_machine() that receives an environment > variable containing an alternate QEMU binary path. > > Signed-off-by: Fabiano Rosas Reviewed-by: Juan Quintela

Re: [PATCH v2 5/9] tests/qtest: Introduce qtest_resolve_machine_alias

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > The migration tests are being enhanced to test migration between > different QEMU versions. A requirement of migration is that the > machine type between source and destination matches, including the > version. > > We cannot hardcode machine types in the tests because those

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-11 Thread Peter Xu
On Wed, Oct 11, 2023 at 04:20:42PM +0300, Дмитрий Фролов wrote: > I do not insist on accepting this patch - it is more like RFC. > Also, i can add more verbose message and assert, if necessary. That's totally fine. It's just that then we should drop the Fixes line above because it doesn't need to

Re: [PATCH v2 6/9] tests/qtest/migration: Introduce find_common_machine_version

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > When using two different QEMU binaries for migration testing, we'll > need to find what is the machine version that will work with both > binaries. Add a helper for that. > > Signed-off-by: Fabiano Rosas Reviewed-by: Juan Quintela As it should never fails. > +if (qt

Re: [PATCH 4/5] hw/ppc/ppc4xx_pci: Move ppc4xx_pci.c to hw/pci-host/

2023-10-11 Thread Thomas Huth
On 11/10/2023 15.41, BALATON Zoltan wrote: On Wed, 11 Oct 2023, Philippe Mathieu-Daudé wrote: ppc4xx_pci.c is moved from the target specific ppc_ss[] meson source set to pci_ss[] which is common to all targets: the object is built once. At this point I'm not sure. This device is only used for

Re: [PATCH] misc/pca9552: Fix inverted input status

2023-10-11 Thread Cédric Le Goater
On 9/27/23 22:32, Glenn Miles wrote: The pca9552 INPUT0 and INPUT1 registers are supposed to hold the logical values of the LED pins. A logical 0 should be seen in the INPUT0/1 registers for a pin when its corresponding LSn bits are set to 0, which is also the state needed for turning on an LED

Re: [PATCH v2 7/9] tests/qtest/migration: Define a machine for all architectures

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > Stop relying on defaults and select a machine explicitly for every > architecture. > > This is a prerequisite for being able to select machine types for > migration using different QEMU binaries for source and destination. > > Signed-off-by: Fabiano Rosas > --- > tests/qte

Re: [PATCH v2 1/9] tests/qtest: Allow qtest_qemu_binary to use a custom environment variable

2023-10-11 Thread Thomas Huth
On 11/10/2023 16.17, Juan Quintela wrote: Fabiano Rosas wrote: We're adding support for testing migration using two different QEMU binaries. We'll provide the second binary in a new environment variable. Allow qtest_qemu_binary() to receive the name of the new variable. If the new environment

Re: [PATCH v2 8/9] tests/qtest/migration: Support more than one QEMU binary

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > We have strict rules around migration compatibility between different > QEMU versions but no test to validate the migration state between > different binaries. > > Add infrastructure to allow running the migration tests with two > different QEMU binaries as migration source

Re: [PATCH v2 9/9] tests/qtest: Don't print messages from query instances

2023-10-11 Thread Juan Quintela
Fabiano Rosas wrote: > Now that we can query more than one binary, the "starting QEMU..." > message can get a little noisy. Mute those messages unless we're > running with --verbose. > > Only affects qtest_init() calls from within libqtest. The tests > continue to output as usual. > > Signed-off-b

Re: [PATCH v2 1/9] tests/qtest: Allow qtest_qemu_binary to use a custom environment variable

2023-10-11 Thread Juan Quintela
Thomas Huth wrote: > On 11/10/2023 16.17, Juan Quintela wrote: >> Fabiano Rosas wrote: >>> We're adding support for testing migration using two different QEMU >>> binaries. We'll provide the second binary in a new environment >>> variable. >>> >>> Allow qtest_qemu_binary() to receive the name of

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-11 Thread Juan Quintela
Peter Xu wrote: > On Wed, Oct 11, 2023 at 04:20:42PM +0300, Дмитрий Фролов wrote: >> I do not insist on accepting this patch - it is more like RFC. >> Also, i can add more verbose message and assert, if necessary. > > That's totally fine. It's just that then we should drop the Fixes line > above b

[PATCH v11 00/11] Add VIRTIO sound card

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis This patch series adds an audio device implementing the recent virtio sound spec (1.2) and a corresponding PCI wrapper device. v11 can be found online at: https://gitlab.com/epilys/qemu/-/tree/virtio-snd-v11 Ref 885b01fe272541fdab5583780d4c3a59bfd8e734 Main diff

[PATCH v11 02/11] Add virtio-sound-pci device

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis This patch adds a PCI wrapper device for the virtio-sound device. It is necessary to instantiate a virtio-snd device in a guest. All sound logic will be added to the virtio-snd device in the following commits. To add this device with a guest, you'll need a >=5.13 ke

[PATCH v11 01/11] Add virtio-sound device stub

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis Add a new VIRTIO device for the virtio sound device id. Functionality will be added in the following commits. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Reviewed-by: Alex Bennée Signed-off-by: Igor Skalkin Signed

[PATCH v11 10/11] virtio-sound: implement audio capture (RX)

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis To perform audio capture we duplicate the TX logic of the previous commit with the following difference: we receive data from the QEMU audio backend and write it in the virt queue IO buffers the guest sends to QEMU. When they are full (i.e. they have `period_bytes` a

[PATCH v11 11/11] docs/system: add basic virtio-snd documentation

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis This commit adds basic documentation for using virtio-snd. Signed-off-by: Emmanouil Pitsidianakis Reviewed-by: Alex Bennée --- MAINTAINERS | 1 + docs/system/device-emulation.rst | 1 + docs/system/devices/virtio-snd.rst (ne

[PATCH v11 08/11] virtio-sound: handle VIRTIO_SND_R_PCM_RELEASE

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis Handle the PCM release control request, which is necessary for flushing pending sound IO. No IO is handled yet so currently it only replies to the request. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by:

[PATCH v11 03/11] virtio-sound: handle control messages and streams

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis Receive guest requests in the control (CTRL) queue of the virtio sound device and reply with a NOT SUPPORTED error to all control commands. The receiving handler is virtio_snd_handle_ctrl(). It stores all control messages in the queue in the device's command queue.

[PATCH v11 04/11] virtio-sound: handle VIRTIO_SND_R_PCM_INFO request

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis Respond to the VIRTIO_SND_R_PCM_INFO control request with the parameters of each requested PCM stream. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev Signed-o

[PATCH v11 05/11] virtio-sound: handle VIRTIO_SND_R_PCM_{START,STOP}

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis Handle the start and stop control messages for a stream_id. This request does nothing at the moment except for replying to it. Audio playback or capture will be started/stopped here in follow-up commits. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350e

[PATCH v11 09/11] virtio-sound: implement audio output (TX)

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis Handle output IO messages in the transmit (TX) virtqueue. It allocates a VirtIOSoundPCMBuffer for each IO message and copies the data buffer to it. When the IO buffer is written to the host's sound card, the guest will be notified that it has been consumed. The lif

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-11 Thread Дмитрий Фролов
On 11.10.2023 17:33, Juan Quintela wrote: Peter Xu wrote: On Wed, Oct 11, 2023 at 04:20:42PM +0300, Дмитрий Фролов wrote: I do not insist on accepting this patch - it is more like RFC. Also, i can add more verbose message and assert, if necessary. That's totally fine. It's just that then we s

[PATCH v11 06/11] virtio-sound: handle VIRTIO_SND_R_PCM_SET_PARAMS

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis Handle the set parameters control request. It reconfigures a stream based on a guest's preference if the values are valid and supported. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signe

[PATCH v11 07/11] virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE

2023-10-11 Thread Manos Pitsidianakis
From: Emmanouil Pitsidianakis Handles the PCM prepare control request. It initializes a PCM stream when the guests asks for it. Based-on: https://github.com/OpenSynergy/qemu/commit/5a2f350eec5d157b90d9c7b40a8e603f4da92471 Signed-off-by: Igor Skalkin Signed-off-by: Anton Yakovlev Signed-off-by

Re: [PATCH] qtest/migration: Add a test for the analyze-migration script

2023-10-11 Thread Juan Quintela
Thomas Huth wrote: > On 28/09/2023 15.32, Fabiano Rosas wrote: >> Thomas Huth writes: >> >>> On 27/09/2023 23.47, Fabiano Rosas wrote: Add a smoke test that migrates to a file and gives it to the script. It should catch the most annoying errors such as changes in the ram flags. >>

Re: [PATCH v2 7/9] tests/qtest/migration: Define a machine for all architectures

2023-10-11 Thread Fabiano Rosas
Juan Quintela writes: > Fabiano Rosas wrote: >> Stop relying on defaults and select a machine explicitly for every >> architecture. >> >> This is a prerequisite for being able to select machine types for >> migration using different QEMU binaries for source and destination. >> >> Signed-off-by:

Re: [PATCH] hw/ide/ahci: trigger either error IRQ or regular IRQ, not both

2023-10-11 Thread Michael Tokarev
11.10.2023 16:12, Niklas Cassel wrote: From: Niklas Cassel According to AHCI 1.3.1, 5.3.8.1 RegFIS:Entry, if ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or not. Thus, we should never raise a normal

RE: [PATCH v2] migration: refactor migration_completion

2023-10-11 Thread Wang, Wei W
On Wednesday, October 11, 2023 8:41 PM, Juan Quintela wrote: > Wei Wang wrote: > > Current migration_completion function is a bit long. Refactor the long > > implementation into different subfunctions: > > - migration_completion_precopy: completion code related to precopy > > - migration_completio

Re: [PATCH v2 7/9] tests/qtest/migration: Define a machine for all architectures

2023-10-11 Thread Daniel P . Berrangé
On Wed, Oct 11, 2023 at 04:28:41PM +0200, Juan Quintela wrote: > Fabiano Rosas wrote: > > Stop relying on defaults and select a machine explicitly for every > > architecture. > > > > This is a prerequisite for being able to select machine types for > > migration using different QEMU binaries for s

Re: [PATCH] hw/ide/ahci: trigger either error IRQ or regular IRQ, not both

2023-10-11 Thread Niklas Cassel
On Wed, Oct 11, 2023 at 05:44:28PM +0300, Michael Tokarev wrote: > 11.10.2023 16:12, Niklas Cassel wrote: > > From: Niklas Cassel > > > > According to AHCI 1.3.1, 5.3.8.1 RegFIS:Entry, if ERR_STAT is set, > > we jump to state ERR:FatalTaskfile, which will raise a TFES IRQ > > unconditionally, reg

[PATCH v2 1/6] target/riscv: Propagate error from PMU setup

2023-10-11 Thread Rob Bradford
More closely follow the QEMU style by returning an Error and propagating it there is an error relating to the PMU setup. Further simplify the function by removing the num_counters parameter as this is available from the passed in cpu pointer. Signed-off-by: Rob Bradford Reviewed-by: Alistair Fra

[PATCH v2 4/6] qemu/bitops.h: Add MAKE_32BIT_MASK macro

2023-10-11 Thread Rob Bradford
Add 32-bit version of mask generating macro and use it in the RISC-V PMU code. Signed-off-by: Rob Bradford --- include/qemu/bitops.h | 3 +++ target/riscv/pmu.c| 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h index cb3526d1f

[PATCH v2 5/6] target/riscv: Add "pmu-mask" property to replace "pmu-num"

2023-10-11 Thread Rob Bradford
Using a mask instead of the number of PMU devices supports the accurate emulation of platforms that have a discontinuous set of PMU counters. Generate a warning if the old property changed from the default but still go ahead and use it to generate the mask if the user has changed it from the defau

[PATCH v2 3/6] target/riscv: Use existing PMU counter mask in FDT generation

2023-10-11 Thread Rob Bradford
During the FDT generation use the existing mask containing the enabled counters rather then generating a new one. Using the existing mask will support the use of discontinuous counters. Signed-off-by: Rob Bradford --- hw/riscv/virt.c| 2 +- target/riscv/pmu.c | 6 +- target/riscv/pmu.h |

[PATCH v2 6/6] docs/about/deprecated: Document RISC-V "pmu-num" deprecation

2023-10-11 Thread Rob Bradford
This has been replaced by a "pmu-mask" property that provides much more flexibility. Signed-off-by: Rob Bradford --- docs/about/deprecated.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 8b136320e2..37f3414ef8 100644

[PATCH v2 0/6] Support discontinuous PMU counters

2023-10-11 Thread Rob Bradford
Currently the available PMU counters start at HPM3 and run through to the number specified by the "pmu-num" property. There is no requirement in the specification that the available counters be continously numbered. This series add suppport for specifying a discountinuous range of counters though a

[PATCH v2 2/6] target/riscv: Don't assume PMU counters are continuous

2023-10-11 Thread Rob Bradford
Check the PMU available bitmask when checking if a counter is valid rather than comparing the index against the number of PMUs. Signed-off-by: Rob Bradford --- target/riscv/csr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c inde

Re: [PATCH v2 1/9] tests/qtest: Allow qtest_qemu_binary to use a custom environment variable

2023-10-11 Thread Thomas Huth
On 06/10/2023 14.39, Fabiano Rosas wrote: We're adding support for testing migration using two different QEMU binaries. We'll provide the second binary in a new environment variable. Allow qtest_qemu_binary() to receive the name of the new variable. If the new environment variable is not set, th

Re: [PATCH v2 2/9] tests/qtest: Introduce qtest_init_with_env

2023-10-11 Thread Thomas Huth
On 06/10/2023 14.39, Fabiano Rosas wrote: Add a version of qtest_init() that takes an environment variable containing the path of the QEMU binary. This allows tests to use more than one QEMU binary. If no variable is provided or the environment variable does not exist, that is not an error. Fall

Re: [PATCH] target/i386: fix shadowed variable pasto

2023-10-11 Thread Markus Armbruster
Paolo Bonzini writes: > Commit a908985971a ("target/i386/seg_helper: introduce tss_set_busy", > 2023-09-26) failed to use the tss_selector argument of the new function, > which was therefore unused. > > This shows up as a #GP fault when booting old versions of 32-bit > Linux. > > Fixes: a90898597

Re: [PATCH v2 7/9] tests/qtest/migration: Define a machine for all architectures

2023-10-11 Thread Fabiano Rosas
Daniel P. Berrangé writes: > On Wed, Oct 11, 2023 at 04:28:41PM +0200, Juan Quintela wrote: >> Fabiano Rosas wrote: >> > Stop relying on defaults and select a machine explicitly for every >> > architecture. >> > >> > This is a prerequisite for being able to select machine types for >> > migratio

Re: [PATCH v2 4/9] tests/qtest: Introduce qtest_has_machine_with_env

2023-10-11 Thread Thomas Huth
On 06/10/2023 14.39, Fabiano Rosas wrote: Add a variant of qtest_has_machine() that receives an environment variable containing an alternate QEMU binary path. Signed-off-by: Fabiano Rosas --- tests/qtest/libqtest.c | 9 +++-- tests/qtest/libqtest.h | 9 + 2 files changed, 16 ins

Re: [PATCH v2 3/9] tests/qtest: Allow qtest_get_machines to use an alternate QEMU binary

2023-10-11 Thread Thomas Huth
On 06/10/2023 14.39, Fabiano Rosas wrote: We're adding support for using more than one QEMU binary in tests. Modify qtest_get_machines() to take an environment variable that contains the QEMU binary path. Since the function keeps a cache of the machines list in the form of a static variable, ref

[PATCH v5 06/10] hw/fsi: Aspeed APB2OPB interface

2023-10-11 Thread Ninad Palsule
This is a part of patchset where IBM's Flexible Service Interface is introduced. An APB-to-OPB bridge enabling access to the OPB from the ARM core in the AST2600. Hardware limitations prevent the OPB from being directly mapped into APB, so all accesses are indirect through the bridge. Signed-off-

[PATCH v5 00/10] Introduce model for IBM's FSI

2023-10-11 Thread Ninad Palsule
Hello, Please review the patch-set version 5. I have incorporated review comments from Cedric. Ninad Palsule (10): hw/fsi: Introduce IBM's Local bus hw/fsi: Introduce IBM's scratchpad hw/fsi: Introduce IBM's cfam,fsi-slave hw/fsi: Introduce IBM's FSI hw/fsi: IBM's On-chip Peripheral Bus

[PATCH v5 02/10] hw/fsi: Introduce IBM's scratchpad

2023-10-11 Thread Ninad Palsule
This is a part of patchset where scratchpad is introduced. The scratchpad provides a set of non-functional registers. The firmware is free to use them, hardware does not support any special management support. The scratchpad registers can be read or written from LBUS slave. In this model, The LBU

[PATCH v5 07/10] hw/arm: Hook up FSI module in AST2600

2023-10-11 Thread Ninad Palsule
This patchset introduces IBM's Flexible Service Interface(FSI). Time for some fun with inter-processor buses. FSI allows a service processor access to the internal buses of a host POWER processor to perform configuration or debugging. FSI has long existed in POWER processes and so comes with some

[PATCH v5 08/10] hw/fsi: Added qtest

2023-10-11 Thread Ninad Palsule
Added basic qtests for FSI model. Signed-off-by: Ninad Palsule --- v3: - Added new qtest as per Cedric's comment. V4: - Remove MAINTAINER and documentation changes from this commit --- tests/qtest/fsi-test.c | 210 tests/qtest/meson.build | 2 + 2 fi

[PATCH v5 05/10] hw/fsi: IBM's On-chip Peripheral Bus

2023-10-11 Thread Ninad Palsule
This is a part of patchset where IBM's Flexible Service Interface is introduced. The On-Chip Peripheral Bus (OPB): A low-speed bus typically found in POWER processors. This now makes an appearance in the ASPEED SoC due to tight integration of the FSI master IP with the OPB, mainly the existence of

[PATCH v5 04/10] hw/fsi: Introduce IBM's FSI

2023-10-11 Thread Ninad Palsule
This is a part of patchset where IBM's Flexible Service Interface is introduced. This commit models the FSI bus. CFAM is hanging out of FSI bus. The bus is model such a way that it is embedded inside the FSI master which is a bus controller. The FSI master: A controller in the platform service pr

Re: [PATCH v2 5/9] tests/qtest: Introduce qtest_resolve_machine_alias

2023-10-11 Thread Thomas Huth
On 06/10/2023 14.39, Fabiano Rosas wrote: The migration tests are being enhanced to test migration between different QEMU versions. A requirement of migration is that the machine type between source and destination matches, including the version. We cannot hardcode machine types in the tests bec

Re: [PATCH] MAINTANERS: Split vt82c686 out of fuloong2e

2023-10-11 Thread BALATON Zoltan
On Thu, 5 Oct 2023, Philippe Mathieu-Daudé wrote: On 5/10/23 20:18, BALATON Zoltan wrote: It is used by other machines not just fuloong2e so put it in a separate section and add myself as reviewer. Forgot to cc qemu-trivial. I thought maybe Philippe takes this but there were a bunch of these

Re: [PATCH] Add epmp to extensions list and rename it to smepmp

2023-10-11 Thread Mayuresh Chitale
On Wed, Oct 11, 2023 at 8:45 AM Alistair Francis wrote: > > On Mon, Sep 25, 2023 at 9:08 PM Mayuresh Chitale > wrote: > > > > From: Himanshu Chauhan > > > > Smepmp is a ratified extension which qemu refers to as epmp. > > Rename epmp to smepmp and add it to extension list so that > > it is added

Re: [PATCH v9 01/23] target/riscv: Move MISA limits to class

2023-10-11 Thread Alex Bennée
Akihiko Odaki writes: > MISA limits are common for all instances of a RISC-V CPU class so they > are better put into class. > > Signed-off-by: Akihiko Odaki > --- > target/riscv/cpu-qom.h | 2 + > target/riscv/cpu.h | 2 - > hw/riscv/boot.c | 2 +- > target/riscv/cpu.c

Re: [PATCH v2] target/riscv: pmp: Ignore writes when RW=01

2023-10-11 Thread Mayuresh Chitale
On Mon, Oct 9, 2023 at 6:56 AM Alistair Francis wrote: > > On Mon, Sep 25, 2023 at 9:11 PM Mayuresh Chitale > wrote: > > > > As per the Priv spec: "The R, W, and X fields form a collective WARL > > field for which the combinations with R=0 and W=1 are reserved." > > However currently such writes

Re: [PATCH v5 08/10] hw/fsi: Added qtest

2023-10-11 Thread Thomas Huth
On 11/10/2023 17.13, Ninad Palsule wrote: Added basic qtests for FSI model. Signed-off-by: Ninad Palsule --- v3: - Added new qtest as per Cedric's comment. V4: - Remove MAINTAINER and documentation changes from this commit --- tests/qtest/fsi-test.c | 210

[PATCH v5 10/10] hw/fsi: Update MAINTAINER list

2023-10-11 Thread Ninad Palsule
Added maintainer for IBM FSI model Signed-off-by: Ninad Palsule --- V4: - Added separate commit for MAINTAINER change. V5: - Use * instead of listing all files in dir --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6111b6b4d9..c69f

[PATCH v5 01/10] hw/fsi: Introduce IBM's Local bus

2023-10-11 Thread Ninad Palsule
This is a part of patchset where IBM's Flexible Service Interface is introduced. The LBUS is modelled to maintain the qdev bus hierarchy and to take advantage of the object model to automatically generate the CFAM configuration block. The configuration block presents engines in the order they are

[PATCH v5 03/10] hw/fsi: Introduce IBM's cfam,fsi-slave

2023-10-11 Thread Ninad Palsule
This is a part of patchset where IBM's Flexible Service Interface is introduced. The Common FRU Access Macro (CFAM), an address space containing various "engines" that drive accesses on busses internal and external to the POWER chip. Examples include the SBEFIFO and I2C masters. The engines hang o

Re: [PULL 02/13] hw/rdma/vmw/pvrdma_cmd: Use correct struct in query_port()

2023-10-11 Thread Stefan Hajnoczi
On Wed, 11 Oct 2023 at 07:23, Michael Tokarev wrote: > > From: Peter Maydell > > In query_port() we pass the address of a local pvrdma_port_attr > struct to the rdma_query_backend_port() function. Unfortunately, > rdma_backend_query_port() wants a pointer to a struct ibv_port_attr, > and the two

[PATCH v5 09/10] hw/fsi: Added FSI documentation

2023-10-11 Thread Ninad Palsule
Documentation for IBM FSI model. Signed-off-by: Ninad Palsule --- v4: - Added separate commit for documentation --- docs/specs/fsi.rst | 141 + 1 file changed, 141 insertions(+) create mode 100644 docs/specs/fsi.rst diff --git a/docs/specs/fsi.rst

[PATCH v3 01/11] tap: Remove tap_probe_vnet_hdr_len()

2023-10-11 Thread Akihiko Odaki
It was necessary since an Linux older than 2.6.35 may implement the virtio-net header but may not allow to change its length. Remove it since such an old Linux is no longer supported. Signed-off-by: Akihiko Odaki --- net/tap_int.h | 1 - net/tap-bsd.c | 5 - net/tap-linux.c | 20

[PATCH v3 10/11] virtio-net: Do not clear VIRTIO_NET_F_RSS

2023-10-11 Thread Akihiko Odaki
Even if eBPF is not available, virtio-net can perform RSS on the user-space if vhost is disabled although such a configuration results in a warning. If vhost is enabled, the configuration will be rejected when realizing the device. Therefore, VIRTIO_NET_F_RSS should not be cleared even if eBPF is n

[PATCH v3 09/11] virtio-net: Return an error when vhost cannot enable RSS

2023-10-11 Thread Akihiko Odaki
vhost requires eBPF for RSS. Even when eBPF is not available, virtio-net reported RSS availability, and raised a warning only after the guest requested RSS, and the guest could not know that RSS is not available. Check RSS availability during device realization and return an error if RSS is reques

[PATCH v3 02/11] tap: Remove qemu_using_vnet_hdr()

2023-10-11 Thread Akihiko Odaki
Since qemu_set_vnet_hdr_len() is always called when qemu_using_vnet_hdr() is called, we can merge them and save some code. For consistency, express that the virtio-net header is not in use by returning 0 with qemu_get_vnet_hdr_len() instead of having a dedicated function, qemu_get_using_vnet_hdr()

[PATCH v3 00/11] virtio-net RSS/hash report fixes

2023-10-11 Thread Akihiko Odaki
This series contains fixes and improvements for virtio-net RSS and hash reporting feature. V2 -> V3: Added patch "tap: Remove tap_probe_vnet_hdr_len()". Added patch "tap: Remove qemu_using_vnet_hdr()". Added patch "net: Move virtio-net header length assertion". Added patch "net: Remove rec

[PATCH v3 11/11] ebpf: Fix RSS error handling

2023-10-11 Thread Akihiko Odaki
calculate_rss_hash() was using hash value 0 to tell if it calculated a hash, but the hash value may be 0 on a rare occasion. Have a distinct bool value for correctness. Fixes: f3fa412de2 ("ebpf: Added eBPF RSS program.") Signed-off-by: Akihiko Odaki --- tools/ebpf/rss.bpf.c | 20 +++-

[PATCH v3 05/11] tap: Shrink zeroed virtio-net header

2023-10-11 Thread Akihiko Odaki
tap prepends a zeroed virtio-net header when writing a packet to a tap with virtio-net header enabled but not in use. This only happens when s->host_vnet_hdr_len == sizeof(struct virtio_net_hdr). Signed-off-by: Akihiko Odaki --- net/tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH v3 06/11] virtio-net: Copy header only when necessary

2023-10-11 Thread Akihiko Odaki
It is necessary to copy the header only for byte swapping. Worse, when byte swapping is not needed, the header can be larger than the buffer due to VIRTIO_NET_F_HASH_REPORT, which results in buffer overflow. Copy the header only when byte swapping is needed. Fixes: e22f0603fb ("virtio-net: refere

[PATCH v3 04/11] net: Remove receive_raw()

2023-10-11 Thread Akihiko Odaki
While netmap implements virtio-net header, it does not implement receive_raw(). Instead of implementing receive_raw for netmap, add virtio-net headers in the common code and use receive_iov()/receive() instead. This also fixes the buffer size for the virtio-net header. Fixes: fbbdbddec0 ("tap: all

[PATCH v3 07/11] virtio-net: Disable RSS on reset

2023-10-11 Thread Akihiko Odaki
RSS is disabled by default. Fixes: 590790297c ("virtio-net: implement RSS configuration command") Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 70 +++-- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/

[PATCH v3 08/11] virtio-net: Unify the logic to update NIC state for RSS

2023-10-11 Thread Akihiko Odaki
The code to attach or detach the eBPF program to RSS were duplicated so unify them into one function to save some code. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 90 ++--- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/hw/net/

[PATCH v3 03/11] net: Move virtio-net header length assertion

2023-10-11 Thread Akihiko Odaki
The virtio-net header length assertion should happen for any clients. Signed-off-by: Akihiko Odaki --- net/net.c | 5 + net/tap.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/net.c b/net/net.c index 1bb4f33a63..6d2fa8d40f 100644 --- a/net/net.c +++ b/net/net.c

Re: [PATCH v9 06/23] gdbstub: Introduce GDBFeatureBuilder

2023-10-11 Thread Alex Bennée
Akihiko Odaki writes: > 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 file

Re: [PATCH v2 1/7] tap: Fix virtio-net header buffer size

2023-10-11 Thread Akihiko Odaki
On 2023/10/11 15:43, Akihiko Odaki wrote: On 2023/10/10 16:56, Michael Tokarev wrote: 10.10.2023 05:59, Akihiko Odaki wrote: The largest possible virtio-net header is struct virtio_net_hdr_v1_hash. Fixes: fbbdbddec0 ("tap: allow extended virtio header with hash info") Signed-off-by: Akihiko Od

Re: [PATCH v2 5/9] tests/qtest: Introduce qtest_resolve_machine_alias

2023-10-11 Thread Thomas Huth
On 06/10/2023 14.39, Fabiano Rosas wrote: The migration tests are being enhanced to test migration between different QEMU versions. A requirement of migration is that the machine type between source and destination matches, including the version. We cannot hardcode machine types in the tests bec

<    1   2   3   4   5   6   >