[PATCH v2 3/7] target/ppc: optimize hreg_compute_pmu_hflags_value

2024-05-22 Thread Harsh Prateek Bora
The second if-condition can be true only if the first one above is true. Enclose the latter into the former to avoid un-necessary check if first condition fails. Signed-off-by: Harsh Prateek Bora Reviewed-by: BALATON Zoltan --- target/ppc/helper_regs.c | 6 +++--- 1 file changed, 3

Re: [PATCH 6/6] target/ppc: redue code duplication across Power9/10 init code

2024-05-22 Thread Harsh Prateek Bora
Hi BALATON, On 5/20/24 17:22, BALATON Zoltan wrote: On Mon, 20 May 2024, Harsh Prateek Bora wrote: Power9/10 initialization code consists of a lot of logical OR of various flag bits as supported by respective Power platform during its initialization, most of which is duplicated and only

[PATCH v2 2/7] target/ppc: optimize hreg_compute_pmu_hflags_value

2024-05-22 Thread Harsh Prateek Bora
Cache env->spr[SPR_POWER_MMCR0] in a local variable as used in multiple conditions to avoid multiple indirect accesses. Signed-off-by: Harsh Prateek Bora --- target/ppc/helper_regs.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/ppc/helper_regs.c

[PATCH v2 6/7] target/ppc: reduce duplicate code between init_proc_POWER{9, 10}

2024-05-22 Thread Harsh Prateek Bora
Historically, the registration of sprs have been inherited alongwith every new Power arch support being added leading to a lot of code duplication. It's time to do necessary cleanups now to avoid further duplication with newer arch support being added. Signed-off-by: Harsh Prateek Bora ---

[PATCH v2 7/7] target/ppc: redue code duplication across Power9/10 init code

2024-05-22 Thread Harsh Prateek Bora
Power9/10 initialization code consists of a lot of logical OR of various flag bits as supported by respective Power platform during its initialization, most of which is duplicated and only selected bits are added or removed as needed with each new platform support being added. Remove the duplicate

[PATCH v2 0/7] target/ppc: misc ppc improvements/optimizations

2024-05-22 Thread Harsh Prateek Bora
This a set of misc ppc arch specific code improvements/optimizations. Although there exists similar instances for potential improvements in the legacy ppc code, however, that can be taken up later as well. Changelog: v2: addressed review comments from BALATON Zoltan v1: Initial patch Harsh

[PATCH v2 4/7] target/ppc: optimize p9 exception handling routines

2024-05-22 Thread Harsh Prateek Bora
Currently, p9 exception handling has multiple if-condition checks where it does an indirect access to pending_interrupts via env. Pass the value during entry to avoid multiple indirect accesses. Signed-off-by: Harsh Prateek Bora --- target/ppc/excp_helper.c | 47

[PATCH v2 5/7] target/ppc: optimize p9 exception handling routines for lpcr

2024-05-22 Thread Harsh Prateek Bora
Like pending_interrupts, env->spr[SPR_LPCR] is being used at multiple places across p9 exception handlers. Pass the value during entry and avoid multiple indirect accesses. Signed-off-by: Harsh Prateek Bora --- target/ppc/excp_helper.c | 33 ++--- 1 file changed, 18

[PATCH v2 1/7] target/ppc: use locally stored msr and avoid indirect access

2024-05-22 Thread Harsh Prateek Bora
hreg_compute_hflags_value already stores msr locally to be used in most of the logic in the routine however some instances are still using env->msr which is unnecessary. Use locally stored value as available. Signed-off-by: Harsh Prateek Bora --- target/ppc/helper_regs.c | 4 ++-- 1 file

[PATCH v2] meson.build: add -mcx16 flag for x86_64 host

2024-05-22 Thread Artyom Kunakovsky
Fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command Signed-off-by: Artyom Kunakovsky --- meson.build | 6 ++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index a9de71d450..e68fbfc662 100644 ---

Re: [PULL 0/9] Migration patches for 2024-05-22

2024-05-22 Thread Richard Henderson
/qemu.git tags/migration-20240522-pull-request for you to fetch changes up to 8f023a0bd946bb0c122543c64fe2b34bad0dd048: tests/qtest/migration-test: Fix the check for a successful run of analyze-migration.py (2024-05-22 17:34:41 -0300

[PULL 10/10] hw/loongarch/virt: Fix FDT memory node address width

2024-05-22 Thread Song Gao
From: Jiaxun Yang Higher bits for memory nodes were omitted at qemu_fdt_setprop_cells. Cc: qemu-sta...@nongnu.org Signed-off-by: Jiaxun Yang Reviewed-by: Song Gao Message-Id: <20240520-loongarch-fdt-memnode-v1-1-5ea9be939...@flygoat.com> Signed-off-by: Song Gao --- hw/loongarch/virt.c | 3

[PULL 04/10] hw/loongarch: Refine acpi srat table for numa memory

2024-05-22 Thread Song Gao
From: Bibo Mao One LoongArch virt machine platform, there is limitation for memory map information. The minimum memory size is 256M and minimum memory size for numa node0 is 256M also. With qemu numa qtest, it is possible that memory size of numa node0 is 128M. Limitations for minimum memory

[PULL 02/10] target/loongarch/kvm: fpu save the vreg registers high 192bit

2024-05-22 Thread Song Gao
On kvm side, get_fpu/set_fpu save the vreg registers high 192bits, but QEMU missing. Cc: qemu-sta...@nongnu.org Signed-off-by: Song Gao Reviewed-by: Bibo Mao Message-Id: <20240514110752.989572-1-gaos...@loongson.cn> --- target/loongarch/kvm/kvm.c | 6 ++ 1 file changed, 6 insertions(+)

[PULL 09/10] target/loongarch: Add loongarch vector property unconditionally

2024-05-22 Thread Song Gao
From: Bibo Mao Currently LSX/LASX vector property is decided by the default value. Instead vector property should be added unconditionally, and it is irrelative with its default value. If vector is disabled by default, vector also can be enabled from command line. Signed-off-by: Bibo Mao

[PULL 07/10] hw/loongarch: Refine system dram memory region

2024-05-22 Thread Song Gao
From: Bibo Mao For system dram memory region, it is not necessary to use numa node information. There is only low memory region and high memory region. Remove numa node information for ddr memory region here, it can reduce memory region number on LoongArch virt machine. Signed-off-by: Bibo Mao

[PULL 05/10] hw/loongarch: Refine fadt memory table for numa memory

2024-05-22 Thread Song Gao
From: Bibo Mao One LoongArch virt machine platform, there is limitation for memory map information. The minimum memory size is 256M and minimum memory size for numa node0 is 256M also. With qemu numa qtest, it is possible that memory size of numa node0 is 128M. Limitations for minimum memory

[PULL 01/10] target/loongarch/kvm: Fix VM recovery from disk failures

2024-05-22 Thread Song Gao
vmstate does not save kvm_state_conter, which can cause VM recovery from disk to fail. Cc: qemu-sta...@nongnu.org Signed-off-by: Song Gao Acked-by: Peter Xu Message-Id: <20240508024732.3127792-1-gaos...@loongson.cn> --- target/loongarch/machine.c | 6 -- 1 file changed, 4 insertions(+), 2

[PULL 08/10] hw/loongarch: Remove minimum and default memory size

2024-05-22 Thread Song Gao
From: Bibo Mao Some qtest test cases such as numa use default memory size of generic machine class, which is 128M by fault. Here generic default memory size is used, and also remove minimum memory size which is 1G originally. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id:

[PULL 03/10] hw/loongarch: Add VM mode in IOCSR feature register in kvm mode

2024-05-22 Thread Song Gao
From: Bibo Mao If VM runs in kvm mode, VM mode is added in IOCSR feature register. So guest can detect kvm hypervisor type and enable possible pv functions. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20240514025109.3238398-1-maob...@loongson.cn> Signed-off-by: Song Gao ---

[PULL 06/10] hw/loongarch: Refine fwcfg memory map

2024-05-22 Thread Song Gao
From: Bibo Mao Memory map table for fwcfg is used for UEFI BIOS, UEFI BIOS uses the first entry from fwcfg memory map as the first memory HOB, the second memory HOB will be used if the first memory HOB is used up. Memory map table for fwcfg does not care about numa node, however in generic the

[PULL 00/10] loongarch-to-apply queue

2024-05-22 Thread Song Gao
The following changes since commit 6af8037c42fdc3d20d5aa2686799ab356a9ee1a9: Merge tag 'pull-vfio-20240522' of https://github.com/legoater/qemu into staging (2024-05-22 06:02:06 -0700) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20240523

Re: [PATCH 09/14] target/s390x: Raise exception from helper_per_branch

2024-05-22 Thread Richard Henderson
On 5/22/24 15:45, Ilya Leoshkevich wrote: On Wed, 2024-05-01 at 22:44 -0700, Richard Henderson wrote: Drop from argument, since gbea has always been updated with this address.  Add ilen argument for setting int_pgm_ilen. Use update_cc_op before calling per_branch. By raising the exception

Re: [PATCH 09/14] target/s390x: Raise exception from helper_per_branch

2024-05-22 Thread Ilya Leoshkevich
On Wed, 2024-05-01 at 22:44 -0700, Richard Henderson wrote: > Drop from argument, since gbea has always been updated with > this address.  Add ilen argument for setting int_pgm_ilen. > Use update_cc_op before calling per_branch. > > By raising the exception here, we need not call >

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

2024-05-22 Thread Richard Henderson
On 5/21/24 21:04, Nicholas Piggin wrote: The crux of the problem being that dynamic exits from a TB would not count instructions previously executed in the TB. I don't know how important it is for PMU to count instructions exactly, however for instruction replay this can lead to different counts

Re: [PULL 00/47] vfio queue

2024-05-22 Thread Richard Henderson
://github.com/legoater/qemu/ tags/pull-vfio-20240522 for you to fetch changes up to b4e1670c494165d4186930d56f692857f4fec89b: vfio/igd: Use g_autofree in vfio_probe_igd_bar4_quirk() (2024-05-22 10:04:22 +0200) vfio queue

Re: [PATCH RISU 0/4] risugen/arm: Convert to use assembly

2024-05-22 Thread Richard Henderson
On 5/22/24 14:27, Richard Henderson wrote: Minor simplifications as well, which are all the easier for emitting assembly instead of binary. r~ Richard Henderson (4): risugen/arm: Convert to use assembly risugen/arm: Fill general regs with 64-bit random data risugen/arm: Switch to

[PULL 6/9] virtio-gpu: fix v2 migration

2024-05-22 Thread Fabiano Rosas
From: Marc-André Lureau Commit dfcf74fa ("virtio-gpu: fix scanout migration post-load") broke forward/backward version migration. Versioning of nested VMSD structures is not straightforward, as the wire format doesn't have nested structures versions. Introduce x-scanout-vmstate-version and a

[PULL 7/9] hw/core/machine: move compatibility flags for VirtIO-net USO to machine 8.1

2024-05-22 Thread Fabiano Rosas
From: Fiona Ebner Migration from an 8.2 or 9.0 binary to an 8.1 binary with machine version 8.1 can fail with: > kvm: Features 0x1c0010130afffa7 unsupported. Allowed features: 0x10179bfffe7 > kvm: Failed to load virtio-net:virtio > kvm: error while loading state for instance 0x0 of device >

[PULL 5/9] migration: fix a typo

2024-05-22 Thread Fabiano Rosas
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Peter Xu Reviewed-by: Fabiano Rosas Reviewed-by: Fiona Ebner Tested-by: Fiona Ebner Signed-off-by: Fabiano Rosas --- migration/vmstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PULL 9/9] tests/qtest/migration-test: Fix the check for a successful run of analyze-migration.py

2024-05-22 Thread Fabiano Rosas
From: Thomas Huth If analyze-migration.py cannot be run or crashes, the error is currently ignored since the code only checks for nonzero values in case the child exited properly. For example, if you run the test with a non-existing Python interpreter, it still succeeds: $ PYTHON=wrongpython

[PULL 1/9] migration/colo: Minor fix for colo error message

2024-05-22 Thread Fabiano Rosas
From: Li Zhijian - Explicitly show the missing module name: replication - Fix capability name to x-colo Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Signed-off-by: Li Zhijian Suggested-by: Michael Tokarev [fixed mangled author email address] Signed-off-by: Fabiano Rosas ---

[PULL 2/9] migration/colo: make colo_incoming_co() return void

2024-05-22 Thread Fabiano Rosas
From: Li Zhijian Currently, it always returns 0, no need to check the return value at all. In addition, enter colo coroutine only if migration_incoming_colo_enabled() is true. Once the destination side enters the COLO* state, the COLO process will take over the remaining processes until COLO

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

2024-05-22 Thread Fabiano Rosas
From: Thomas Huth On s390x, we recently had a regression that broke migration / savevm (see commit bebe9603fc ("hw/intc/s390_flic: Fix crash that occurs when saving the machine state"). The problem was merged without being noticed since we currently do not run any migration / savevm related

[PULL 3/9] migration/colo: Tidy up bql_unlock() around bdrv_activate_all()

2024-05-22 Thread Fabiano Rosas
From: Li Zhijian Make the code more tight. Suggested-by: Michael Tokarev Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Michael Tokarev [fixed mangled author email address] Signed-off-by: Fabiano Rosas --- migration/colo.c | 3 +-- 1 file changed,

[PULL 0/9] Migration patches for 2024-05-22

2024-05-22 Thread Fabiano Rosas
The following changes since commit 01782d6b294f95bcde334386f0aaac593cd28c0d: Merge tag 'hw-misc-20240517' of https://github.com/philmd/qemu into staging (2024-05-18 11:49:01 +0200) are available in the Git repository at: https://gitlab.com/farosas/qemu.git tags/migration-20240522-pull

[PULL 4/9] migration: add "exists" info to load-state-field trace

2024-05-22 Thread Fabiano Rosas
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Peter Xu Reviewed-by: Fiona Ebner Tested-by: Fiona Ebner Signed-off-by: Fabiano Rosas --- migration/trace-events | 2 +- migration/vmstate.c| 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git

Re: [PATCH 1/4] MAINTAINERS: drop audio maintainership

2024-05-22 Thread Manos Pitsidianakis
On Wed, 22 May 2024 at 15:54, Thomas Huth wrote: > > On 16/05/2024 14.03, Gerd Hoffmann wrote: > > Remove myself from audio (both devices and backend) entries. > > Flip status to "Orphan" for entries which have nobody else listed. > > > > Signed-off-by: Gerd Hoffmann > > --- > > MAINTAINERS |

Re: [PATCH] tests/qtest/migration-test: Fix the check for a successful run of analyze-migration.py

2024-05-22 Thread Fabiano Rosas
On Wed, 22 May 2024 11:23:01 +0200, Thomas Huth wrote: > If analyze-migration.py cannot be run or crashes, the error is currently > ignored since the code only checks for nonzero values in case the child > exited properly. For example, if you run the test with a non-existing > Python interpreter,

Re: [PATCH] hw/core/machine: move compatibility flags for VirtIO-net USO to machine 8.1

2024-05-22 Thread Fabiano Rosas
On Fri, 17 May 2024 09:53:36 +0200, Fiona Ebner wrote: > Migration from an 8.2 or 9.0 binary to an 8.1 binary with machine > version 8.1 can fail with: > > > kvm: Features 0x1c0010130afffa7 unsupported. Allowed features: 0x10179bfffe7 > > kvm: Failed to load virtio-net:virtio > > kvm: error while

Re: [PATCH v4 0/3] Fix "virtio-gpu: fix scanout migration post-load"

2024-05-22 Thread Fabiano Rosas
On Thu, 16 May 2024 12:40:19 +0400, marcandre.lur...@redhat.com wrote: > The aforementioned patch breaks virtio-gpu device migrations for versions > pre-9.0/9.0, both forwards and backwards. Versioning of `VMS_STRUCT` is more > complex than it may initially appear, as evidenced in the problematic

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

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

Re: [PATCH v2 1/3] migration/colo: Minor fix for colo error message

2024-05-22 Thread Fabiano Rosas
On Thu, 16 May 2024 11:45:15 +0800, Li Zhijian via wrote: > - Explicitly show the missing module name: replication > - Fix capability name to x-colo > > Queued, thanks!

Re: [PATCH 04/14] target/s390x: Record separate PER bits in TB flags

2024-05-22 Thread Ilya Leoshkevich
On Wed, 2024-05-01 at 22:44 -0700, Richard Henderson wrote: > Record successful-branching, instruction-fetching, and > store-using-real-address.  The other PER bits are not used > during translation.  Having checked these at translation time, > we can remove runtime tests from the helpers. > >

[PATCH RISU 1/4] risugen/arm: Convert to use assembly

2024-05-22 Thread Richard Henderson
Split random data and memory blocks into .data. Use ADR label+offset to address them. Fix some bugs in the (apparently unused) SVE memory addressing. Signed-off-by: Richard Henderson --- risugen_arm.pm | 719 + 1 file changed, 247 insertions(+),

[PATCH RISU 4/4] contrib/generate_all: Do not rely on ag

2024-05-22 Thread Richard Henderson
Use plain grep instead. Signed-off-by: Richard Henderson --- contrib/generate_all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/generate_all.sh b/contrib/generate_all.sh index 651cb23..5ff0b3e 100755 --- a/contrib/generate_all.sh +++

[PATCH RISU 0/4] risugen/arm: Convert to use assembly

2024-05-22 Thread Richard Henderson
Minor simplifications as well, which are all the easier for emitting assembly instead of binary. r~ Richard Henderson (4): risugen/arm: Convert to use assembly risugen/arm: Fill general regs with 64-bit random data risugen/arm: Switch to thumb mode only once contrib/generate_all: Do not

[PATCH RISU 2/4] risugen/arm: Fill general regs with 64-bit random data

2024-05-22 Thread Richard Henderson
Load from the memory block instead of movn + movk*3. Signed-off-by: Richard Henderson --- risugen_arm.pm | 81 -- 1 file changed, 32 insertions(+), 49 deletions(-) diff --git a/risugen_arm.pm b/risugen_arm.pm index cf0c1af..c7ca62b 100644 ---

[PATCH RISU 3/4] risugen/arm: Switch to thumb mode only once

2024-05-22 Thread Richard Henderson
With thumb2 we can avoid jumping back and forth between arm and thumb modes. Signed-off-by: Richard Henderson --- risugen_arm.pm | 85 +- 1 file changed, 21 insertions(+), 64 deletions(-) diff --git a/risugen_arm.pm b/risugen_arm.pm index

[PATCH V11 8/8] docs/specs/acpi_hw_reduced_hotplug: Add the CPU Hotplug Event Bit

2024-05-22 Thread Salil Mehta via
GED interface is used by many hotplug events like memory hotplug, NVDIMM hotplug and non-hotplug events like system power down event. Each of these can be selected using a bit in the 32 bit GED IO interface. A bit has been reserved for the CPU hotplug event. Signed-off-by: Salil Mehta

[PATCH V11 7/8] gdbstub: Add helper function to unregister GDB register space

2024-05-22 Thread Salil Mehta via
Add common function to help unregister the GDB register space. This shall be done in context to the CPU unrealization. Note: These are common functions exported to arch specific code. For example, for ARM this code is being referred in associated arch specific patch-set: Link:

[PATCH V11 6/8] physmem: Add helper function to destroy CPU AddressSpace

2024-05-22 Thread Salil Mehta via
Virtual CPU Hot-unplug leads to unrealization of a CPU object. This also involves destruction of the CPU AddressSpace. Add common function to help destroy the CPU AddressSpace. Signed-off-by: Salil Mehta Tested-by: Vishnu Pajjuri Reviewed-by: Gavin Shan Tested-by: Xianglai Li Tested-by:

[PATCH V11 4/8] hw/acpi: Update GED _EVT method AML with CPU scan

2024-05-22 Thread Salil Mehta via
OSPM evaluates _EVT method to map the event. The CPU hotplug event eventually results in start of the CPU scan. Scan figures out the CPU and the kind of event(plug/unplug) and notifies it back to the guest. Update the GED AML _EVT method with the call to \\_SB.CPUS.CSCN Also, macro

[PATCH V11 5/8] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2024-05-22 Thread Salil Mehta via
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is IO port based and existing CPUs AML code assumes _CRS objects would evaluate to a system resource which describes IO Port address. But on ARM arch CPUs control device(\\_SB.PRES) register interface is memory-mapped hence _CRS

[PATCH V11 3/8] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2024-05-22 Thread Salil Mehta via
ACPI GED (as described in the ACPI 6.4 spec) uses an interrupt listed in the _CRS object of GED to intimate OSPM about an event. Later then demultiplexes the notified event by evaluating ACPI _EVT method to know the type of event. Use ACPI GED to also notify the guest kernel about any CPU

[PATCH V11 1/8] accel/kvm: Extract common KVM vCPU {creation, parking} code

2024-05-22 Thread Salil Mehta via
KVM vCPU creation is done once during the vCPU realization when Qemu vCPU thread is spawned. This is common to all the architectures as of now. Hot-unplug of vCPU results in destruction of the vCPU object in QOM but the corresponding KVM vCPU object in the Host KVM is not destroyed as KVM doesn't

[PATCH V11 2/8] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2024-05-22 Thread Salil Mehta via
CPU ctrl-dev MMIO region length could be used in ACPI GED and various other architecture specific places. Move ACPI_CPU_HOTPLUG_REG_LEN macro to more appropriate common header file. Signed-off-by: Salil Mehta Reviewed-by: Alex Bennée Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan

[PATCH V11 0/8] Add architecture agnostic code to support vCPU Hotplug

2024-05-22 Thread Salil Mehta via
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 Hotplug [Patch 2,3] 3. ACPI CPUs AML code change

Re: [PATCH 03/14] target/s390x: Update CR9 bits

2024-05-22 Thread Ilya Leoshkevich
On Wed, 2024-05-01 at 22:44 -0700, Richard Henderson wrote: > Update from the PoO 14th edition. > > Signed-off-by: Richard Henderson > --- >  target/s390x/cpu.h | 18 +++--- >  target/s390x/tcg/misc_helper.c |  2 +- >  2 files changed, 12 insertions(+), 8 deletions(-)

Re: [PATCH 02/14] target/s390x: Move cpu_get_tb_cpu_state out of line

2024-05-22 Thread Ilya Leoshkevich
On Wed, 2024-05-01 at 22:44 -0700, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- >  target/s390x/cpu.h | 23 ++- >  target/s390x/cpu.c | 22 ++ >  2 files changed, 24 insertions(+), 21 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 01/14] target/s390x: Do not use unwind for per_check_exception

2024-05-22 Thread Ilya Leoshkevich
On Wed, 2024-05-01 at 22:44 -0700, Richard Henderson wrote: > Using exception unwind via tcg_s390_program_interrupt, > we discard the current value of psw.addr, which discards > the result of a branch. > > Pass in the address of the next instruction, which may > not be sequential.  Pass in ilen,

[PATCH v2 3/3] hw/arm: In STM32L4x5 SOC, connect USART devices to EXTI

2024-05-22 Thread Inès Varhol
The USART devices were previously connecting their outbound IRQs directly to the CPU because the EXTI wasn't handling direct lines interrupts. Now the USART connects to the EXTI inbound GPIOs, and the EXTI connects its IRQs to the CPU. The existing QTest for the USART

[PATCH v2 0/3] Connect STM32L4x5 USART devices to the EXTI

2024-05-22 Thread Inès Varhol
STM32L4x5 EXTI was handling only configurable interrupts (such as those coming from STM32L4x5 SYSCFG which was the only device connected to the EXTI). This patch adds support for direct line interrupts and connects the existing STM32L4x5 USART devices to the EXTI. The patch also corrects the

[PATCH v2 1/3] hw/misc: In STM32L4x5 EXTI, consolidate 2 constants

2024-05-22 Thread Inès Varhol
Up until now, the EXTI implementation had 16 inbound GPIOs connected to the 16 outbound GPIOs of STM32L4x5 SYSCFG. The EXTI actually handles 40 lines (namely 5 from STM32L4x5 USART devices which are already implemented in QEMU). In order to connect USART devices to EXTI, this commit consolidates

[PATCH v2 2/3] hw/misc: In STM32L4x5 EXTI, handle direct and configurable interrupts

2024-05-22 Thread Inès Varhol
The previous implementation for EXTI interrupts only handled "configurable" interrupts, like those originating from STM32L4x5 SYSCFG (the only device currently connected to the EXTI up until now). In order to connect STM32L4x5 USART to the EXTI, this commit adds handling for direct interrupts

[PATCH] meson.build: add -mcx16 flag

2024-05-22 Thread Artyom Kunakovsky
fix linker error if the project was configured by the './configure --cpu=unknown --target-list=riscv64-softmmu' command Signed-off-by: Artyom Kunakovsky --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a9de71d450..0c24878c86

Re: [PATCH 14/14] tests/tcg/s390x: Add per.S

2024-05-22 Thread Ilya Leoshkevich
On Wed, 2024-05-01 at 22:44 -0700, Richard Henderson wrote: > Add a small test to avoid regressions. > > Signed-off-by: Richard Henderson > --- >  tests/tcg/s390x/Makefile.softmmu-target |  1 + >  tests/tcg/s390x/per.S   | 82 > + >  2 files changed, 83

[PATCH] tests/tcg/s390x: Allow specifying extra QEMU options on the command line

2024-05-22 Thread Ilya Leoshkevich
The use case for this is `make check-tcg EXTFLAGS="-accel kvm"`, which allows validating the system TCG testcases on real hardware. EXTFLAGS name is borrowed from tests/tcg/xtensa/Makefile.softmmu-target. While at it, use += instead of = in order to be consistent with the other architectures.

Re: [PATCH v1 1/2] machine/microvm: support for loading EIF image

2024-05-22 Thread Dorjoy Chowdhury
Hi Daniel, Thanks for reviewing. On Wed, May 22, 2024 at 9:32 PM Daniel P. Berrangé wrote: > > On Sat, May 18, 2024 at 02:07:52PM +0600, Dorjoy Chowdhury wrote: > > An EIF (Enclave Image Format)[1] image is used to boot an AWS nitro > > enclave[2] virtual machine. The EIF file contains the

Re: [PATCH] accel/tcg: Init tb size and icount before plugin_gen_tb_end

2024-05-22 Thread Pierrick Bouvier
On 5/21/24 14:06, Richard Henderson wrote: When passing disassembly data to plugin callbacks, translator_st_len relies on db->tb->size having been set. Fixes: 4c833c60e047 ("disas: Use translator_st to get disassembly data") Reported-by: Bernhard Beschow Signed-off-by: Richard Henderson ---

[PATCH 3/7] hw/s390x/ccw: Remove local Error variable from s390_ccw_realize()

2024-05-22 Thread Cédric Le Goater
Use the 'Error **errp' argument of s390_ccw_realize() instead and remove the error_propagate() call. Signed-off-by: Cédric Le Goater --- hw/s390x/s390-ccw.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index

[PATCH 6/7] vfio/ccw: Fix the missed unrealize() call in error path

2024-05-22 Thread Cédric Le Goater
From: Zhenzhong Duan When get name failed, we should call unrealize() so that vfio_ccw_realize() is self contained. Fixes: 909a6254eda ("vfio/ccw: Make vfio cdev pre-openable by passing a file handle") Signed-off-by: Zhenzhong Duan --- hw/vfio/ccw.c | 3 ++- 1 file changed, 2 insertions(+),

[PATCH 7/7] vfio/{ap, ccw}: Use warn_report_err() for IRQ notifier registration errors

2024-05-22 Thread Cédric Le Goater
vfio_ccw_register_irq_notifier() and vfio_ap_register_irq_notifier() errors are currently reported using error_report_err(). Since they are not considered as failing conditions, using warn_report_err() is more appropriate. Signed-off-by: Cédric Le Goater --- hw/vfio/ap.c | 2 +- hw/vfio/ccw.c

[PATCH 4/7] s390x/css: Make S390CCWDeviceClass::realize return bool

2024-05-22 Thread Cédric Le Goater
Since the realize() handler of S390CCWDeviceClass takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. While at it, modify the call in vfio_ccw_realize(). Signed-off-by: Cédric Le Goater --- include/hw/s390x/s390-ccw.h | 2 +-

[PATCH 5/7] vfio/ccw: Use the 'Error **errp' argument of vfio_ccw_realize()

2024-05-22 Thread Cédric Le Goater
The local error variable is kept for vfio_ccw_register_irq_notifier() because it is not considered as a failing condition. We will change how error reporting is done in following changes. Remove the error_propagate() call. Cc: Zhenzhong Duan Signed-off-by: Cédric Le Goater --- hw/vfio/ccw.c |

[PATCH 0/7] s390x/ccw: Error reporting cleanups

2024-05-22 Thread Cédric Le Goater
Hello, The first patches of this series simply apply the practices described in the Rules section of the qapi/error.h file for routines taking an 'Error **' argument. The remaining patches are a fixup in the error path of vfio_ccw_realize() and some error reporting adjustements. Applies on top

[PATCH 1/7] hw/s390x/ccw: Make s390_ccw_get_dev_info() return a bool

2024-05-22 Thread Cédric Le Goater
Since s390_ccw_get_dev_info() takes an 'Error **' argument, best practices suggest to return a bool. See the qapi/error.h Rules section. While at it, modify the call in s390_ccw_realize(). Signed-off-by: Cédric Le Goater --- hw/s390x/s390-ccw.c | 12 ++-- 1 file changed, 6

[PATCH 2/7] s390x/css: Make CCWDeviceClass::realize return bool

2024-05-22 Thread Cédric Le Goater
Since the realize() handler of CCWDeviceClass takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. While at it, modify the call in s390_ccw_realize(). Signed-off-by: Cédric Le Goater --- hw/s390x/ccw-device.h | 2 +- hw/s390x/ccw-device.c | 3

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

2024-05-22 Thread Peter Xu
On Wed, May 22, 2024 at 11:12:55AM +0200, Thomas Huth wrote: > On s390x, we recently had a regression that broke migration / savevm > (see commit bebe9603fc ("hw/intc/s390_flic: Fix crash that occurs when > saving the machine state"). The problem was merged without being noticed > since we

Re: [PATCH] vfio: container: Fix missing allocation of VFIOSpaprContainer

2024-05-22 Thread Shivaprasad G Bhat
On 5/13/24 17:53, Cédric Le Goater wrote: Hello Shivaprasad, On 5/9/24 21:14, Shivaprasad G Bhat wrote: The commit 6ad359ec29 "(vfio/spapr: Move prereg_listener into spapr container)" began to use the newly introduced VFIOSpaprContainer structure. After several refactors, today the

Re: [PATCH] qga: Add an interactive mode to guest-exec via VSOCK for Linux

2024-05-22 Thread Daniel P . Berrangé
On Wed, May 22, 2024 at 05:06:57PM +0200, Alexander Ivanov wrote: > Add an interactive mode to the guest-exec command in the QEMU Guest Agent > using the VSOCK communication mechanism. It enables interactive sessions > with the executed command in the guest, allowing real-time input/output. > >

Re: [PATCH v2 3/6] virtio: virtqueue_ordered_fill - VIRTIO_F_IN_ORDER support

2024-05-22 Thread Eugenio Perez Martin
On Mon, May 20, 2024 at 3:01 PM Jonah Palmer wrote: > > Add VIRTIO_F_IN_ORDER feature support for the virtqueue_fill operation. > > The goal of the virtqueue_ordered_fill operation when the > VIRTIO_F_IN_ORDER feature has been negotiated is to search for this > now-used element, set its length,

Re: [PATCH] tests/qtest/migration-test: Fix the check for a successful run of analyze-migration.py

2024-05-22 Thread Peter Xu
On Wed, May 22, 2024 at 11:23:01AM +0200, Thomas Huth wrote: > If analyze-migration.py cannot be run or crashes, the error is currently > ignored since the code only checks for nonzero values in case the child > exited properly. For example, if you run the test with a non-existing > Python

Re: [PATCH v2 2/6] virtio: virtqueue_pop - VIRTIO_F_IN_ORDER support

2024-05-22 Thread Eugenio Perez Martin
On Mon, May 20, 2024 at 3:01 PM Jonah Palmer wrote: > > Add VIRTIO_F_IN_ORDER feature support in virtqueue_split_pop and > virtqueue_packed_pop. > > VirtQueueElements popped from the available/descritpor ring are added to > the VirtQueue's used_elems array in-order and in the same fashion as >

Re: [PATCH v2 1/6] virtio: Add bool to VirtQueueElement

2024-05-22 Thread Eugenio Perez Martin
On Mon, May 20, 2024 at 3:01 PM Jonah Palmer wrote: > > Add the boolean 'in_order_filled' member to the VirtQueueElement structure. > The use of this boolean will signify whether the element has been processed > and is ready to be flushed (so long as the element is in-order). This > boolean is

Re: [PATCH] qga: Add an interactive mode to guest-exec via VSOCK for Linux

2024-05-22 Thread Michal Prívozník
On 5/22/24 17:06, Alexander Ivanov wrote: > Add an interactive mode to the guest-exec command in the QEMU Guest Agent > using the VSOCK communication mechanism. It enables interactive sessions > with the executed command in the guest, allowing real-time input/output. > > Introduce "interactive"

[PATCH v6 3/3] Add support for RAPL MSRs in KVM/Qemu

2024-05-22 Thread Anthony Harivel
Starting with the "Sandy Bridge" generation, Intel CPUs provide a RAPL interface (Running Average Power Limit) for advertising the accumulated energy consumption of various power domains (e.g. CPU packages, DRAM, etc.). The consumption is reported via MSRs (model specific registers) like

[PATCH v6 1/3] qio: add support for SO_PEERCRED for socket channel

2024-05-22 Thread Anthony Harivel
The function qio_channel_get_peercred() returns a pointer to the credentials of the peer process connected to this socket. This credentials structure is defined in as follows: struct ucred { pid_t pid;/* Process ID of the sending process */ uid_t uid;/* User ID of the

[PATCH v6 2/3] tools: build qemu-vmsr-helper

2024-05-22 Thread Anthony Harivel
Introduce a privileged helper to access RAPL MSR. The privileged helper tool, qemu-vmsr-helper, is designed to provide virtual machines with the ability to read specific RAPL (Running Average Power Limit) MSRs without requiring CAP_SYS_RAWIO privileges or relying on external, out-of-tree patches.

[PATCH v6 0/3] Add support for the RAPL MSRs series

2024-05-22 Thread Anthony Harivel
Dear maintainers, First of all, thank you very much for your review of my patch [1]. In this version (v6), I have attempted to address all the problems addressed by Daniel and Paolo during the last review. However, two open questions remains unanswered that would require the attention of a

Re: [PATCH v1 1/2] machine/microvm: support for loading EIF image

2024-05-22 Thread Daniel P . Berrangé
On Sat, May 18, 2024 at 02:07:52PM +0600, Dorjoy Chowdhury wrote: > An EIF (Enclave Image Format)[1] image is used to boot an AWS nitro > enclave[2] virtual machine. The EIF file contains the necessary > kernel, cmdline, ramdisk(s) sections to boot. > > This commit adds support for loading EIF

Test scripts

2024-05-22 Thread Alexander Ivanov
There are two python scripts in the attachment: vsock_guest_exec_simple.py - simple example of a client; vsock_guest_exec_test.py - tests with different payload size. The last file should be copied to a guest VM. Edit SRV_PATH variable in the host copy of the script - there should be path to the

[PATCH] qga: Add an interactive mode to guest-exec via VSOCK for Linux

2024-05-22 Thread Alexander Ivanov
Add an interactive mode to the guest-exec command in the QEMU Guest Agent using the VSOCK communication mechanism. It enables interactive sessions with the executed command in the guest, allowing real-time input/output. Introduce "interactive" mode in the GuestExecCaptureOutputMode enumeration

Re: [PATCH v3 1/3] qemu-keymap: Free xkb allocations

2024-05-22 Thread Peter Maydell
On Wed, 22 May 2024 at 12:47, Daniel P. Berrangé wrote: > > On Wed, May 22, 2024 at 12:35:23PM +0100, Peter Maydell wrote: > > On Wed, 22 May 2024 at 11:49, Akihiko Odaki > > wrote: > > > > > > This fixes LeakSanitizer complaints with xkbcommon 1.6.0. > > > > > > Signed-off-by: Akihiko Odaki >

Re: [PULL 10/38] tests/qtest/migration: Add a test for the analyze-migration script

2024-05-22 Thread Alex Bennée
Fabiano Rosas writes: > Alex Bennée writes: > >> Juan Quintela writes: >> >>> From: Fabiano Rosas >>> >>> 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. >>> >>> After code has been merged

Re: [PATCH] target/i386: generate simpler code for ROL/ROR with immediate count

2024-05-22 Thread Richard Henderson
On 5/22/24 05:39, Paolo Bonzini wrote: gen_rot_carry and gen_rot_overflow are meant to be called with count == NULL if the count cannot be zero. However this is not done in gen_ROL and gen_ROR, and writing everywhere "can_be_zero ? count : NULL" is burdensome and less readable. Just pass

Re: [PATCH v3 3/3] meson: Drop the .fa library prefix

2024-05-22 Thread Paolo Bonzini
On Wed, May 22, 2024 at 3:45 PM Paolo Bonzini wrote: > > On Wed, May 22, 2024 at 12:49 PM Akihiko Odaki > wrote: > > The non-standard .fa library prefix breaks the link source > > de-duplication done by Meson so drop it. > > Can you show the difference in the command lines? > > One possibility

Re: [PATCH v3 3/3] meson: Drop the .fa library prefix

2024-05-22 Thread Paolo Bonzini
On Wed, May 22, 2024 at 12:49 PM Akihiko Odaki wrote: > The non-standard .fa library prefix breaks the link source > de-duplication done by Meson so drop it. Can you show the difference in the command lines? One possibility to force de-duplication of objects is to change "link_whole: foo" to

Re: [PATCH] target/i386: clean up AAM/AAD

2024-05-22 Thread Richard Henderson
On 5/22/24 05:39, Paolo Bonzini wrote: The 32-bit AAM/AAD opcodes are using helpers that read and write flags and env->regs[R_EAX]. Clean them up so that the table correctly includes AX as a 16-bit input and output. No real reason to do it to be honest, but they are nice one-output helpers and

Re: [PATCH] tests/qtest/migration-test: Fix the check for a successful run of analyze-migration.py

2024-05-22 Thread Fabiano Rosas
Thomas Huth writes: > If analyze-migration.py cannot be run or crashes, the error is currently > ignored since the code only checks for nonzero values in case the child > exited properly. For example, if you run the test with a non-existing > Python interpreter, it still succeeds: > > $

  1   2   3   >