Re: [RFC 0/2] Identify aliased maps in vdpa SVQ iova_tree

2024-05-09 Thread Eugenio Perez Martin
On Thu, May 9, 2024 at 8:27 AM Jason Wang wrote: > > On Thu, May 9, 2024 at 1:16 AM Eugenio Perez Martin > wrote: > > > > On Wed, May 8, 2024 at 4:29 AM Jason Wang wrote: > > > > > > On Tue, May 7, 2024 at 6:57 PM Eugenio Perez Martin > > > wrote: > > > > > > > > On Tue, May 7, 2024 at 9:29 A

[PULL 1/3] hw/loongarch: Refine default numa id calculation

2024-05-09 Thread Song Gao
From: Bibo Mao With numa_test test case, there is subcase named test_def_cpu_split(), there are 8 sockets and 2 numa nodes. Here is command line: "-machine smp.cpus=8,smp.sockets=8 -numa node,memdev=ram -numa node" The required result is: node 0 cpus: 0 2 4 6 node 1 cpus: 1 3 5 7 Test case n

[PULL 3/3] target/loongarch: Put cpucfg operation before CSR register

2024-05-09 Thread Song Gao
From: Bibo Mao On Loongarch, cpucfg is register for cpu feature, some other registers depend on cpucfg feature such as perf CSR registers. Here put cpucfg read/write operations before CSR register, so that KVM knows how many perf CSR registers are valid from pre-set cpucfg feature information. S

[PULL 2/3] target/loongarch: Add TCG macro in structure CPUArchState

2024-05-09 Thread Song Gao
From: Bibo Mao In structure CPUArchState some struct elements are only used in TCG mode, and it is not used in KVM mode. Macro CONFIG_TCG is added to make it simpiler in KVM mode, also there is the same modification in c code when these structure elements are used. When VM runs in KVM mode, TLB

[PULL 0/3] loongarch-to-apply queue

2024-05-09 Thread Song Gao
The following changes since commit 4e66a08546a2588a4667766a1edab9caccf24ce3: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-05-07 09:26:30 -0700) are available in the Git repository at: https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-202

Re: [PATCH 8/9] migration: Add support for fdset with multifd + file

2024-05-09 Thread Daniel P . Berrangé
On Wed, May 08, 2024 at 05:39:53PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Wed, May 08, 2024 at 09:53:48AM +0100, Daniel P. Berrangé wrote: > >> On Fri, Apr 26, 2024 at 11:20:41AM -0300, Fabiano Rosas wrote: > >> > Allow multifd to use an fdset when migrating to a file. This is us

Re: [PULL v2 00/28] Misc HW patches for 2024-05-08

2024-05-09 Thread Richard Henderson
On 5/9/24 00:15, Philippe Mathieu-Daudé wrote: v2: Updated Bernhard's patches The following changes since commit 4e66a08546a2588a4667766a1edab9caccf24ce3: Merge tag 'for-upstream' ofhttps://gitlab.com/bonzini/qemu into staging (2024-05-07 09:26:30 -0700) are available in the Git repositor

Re: [PATCH] gitlab: Update msys2-64bit runner tags

2024-05-09 Thread Richard Henderson
On 5/7/24 19:53, Richard Henderson wrote: Gitlab has deprecated and removed support for windows-1809 and shared-windows. Update to saas-windows-medium-amd64 per https://about.gitlab.com/blog/2024/01/22/windows-2022-support-for-gitlab-saas-runners/ Signed-off-by: Richard Henderson --- .gitla

Re: CXL numa error on arm64 qemu virt machine

2024-05-09 Thread Yuquan Wang
On Wed, May 08, 2024 at 01:02:52PM +0100, Jonathan Cameron wrote: > > > [0.00] ACPI: SRAT: Node 0 PXM 0 [mem 0x4000-0xbfff] > > [0.00] ACPI: SRAT: Node 1 PXM 1 [mem 0xc000-0x13fff] > > [0.00] ACPI: Unknown target node for memory at 0x100, > > assumi

[PATCH v2] tests/qtest: Add some test cases support on LoongArch

2024-05-09 Thread Bibo Mao
Add boot-serial-test and filter test cases support on LoongArch system. Signed-off-by: Bibo Mao --- v1 ... v2: 1. Refresh the changelog, adding filter test case support also. 2. Adjust order of loongarch qtest in alphabetical order. --- tests/qtest/boot-serial-test.c | 10 ++ tests/qte

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-05-09 Thread Zheng Chuan via
Hi, Peter,Lei,Jinpu. On 2024/5/8 0:28, Peter Xu wrote: > On Tue, May 07, 2024 at 01:50:43AM +, Gonglei (Arei) wrote: >> Hello, >> >>> -Original Message- >>> From: Peter Xu [mailto:pet...@redhat.com] >>> Sent: Monday, May 6, 2024 11:18 PM >>> To: Gonglei (Arei) >>> Cc: Daniel P. Berran

[PATCH v2 3/3] vfio/migration: Don't emit STOP_COPY VFIO migration QAPI event twice

2024-05-09 Thread Avihai Horon
When migrating a VFIO device that supports pre-copy, it is transitioned to STOP_COPY twice: once in vfio_vmstate_change() and second time in vfio_save_complete_precopy(). The second transition is harmless, as it's a STOP_COPY->STOP_COPY no-op transition. However, with the newly added VFIO migratio

[PATCH v2 2/3] vfio/migration: Emit VFIO migration QAPI event

2024-05-09 Thread Avihai Horon
Emit VFIO migration QAPI event when a VFIO device changes its migration state. This can be used by management applications to get updates on the current state of the VFIO device for their own purposes. A new per VFIO device capability, "migration-events", is added so events can be enabled only for

[PATCH v2 0/3] qapi/vfio: Add VFIO migration QAPI event

2024-05-09 Thread Avihai Horon
Hello, This series adds a new QAPI event for VFIO device migration state change. This event will be emitted when a VFIO device changes its state, for example, during migration or when stopping/starting the guest. This event can be used by management applications to get updates on the current sta

[PATCH v2 1/3] qapi/vfio: Add VFIO migration QAPI event

2024-05-09 Thread Avihai Horon
Add a new QAPI event for VFIO migration. This event will be emitted when a VFIO device changes its migration state, for example, during migration or when stopping/starting the guest. This event can be used by management applications to get updates on the current state of the VFIO device for their

Re: [PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-05-09 Thread Zhao Liu
Hi Daniel & Shaoqin, Since x86 also needs to implement PMU filter feature, though it uses the different KVM ioctl, we can still make the QEMU API as general as possible. To move forward with both ARM and x86, I'd like to discuss my API thinking with you. ;-) On Mon, Apr 15, 2024 at 06:29:25PM +0

Re: [PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-05-09 Thread Daniel P . Berrangé
On Thu, May 09, 2024 at 05:48:19PM +0800, Zhao Liu wrote: > Hi Daniel & Shaoqin, > > Since x86 also needs to implement PMU filter feature, though it uses > the different KVM ioctl, we can still make the QEMU API as general as > possible. > > To move forward with both ARM and x86, I'd like to disc

[PATCH v2] hw/virtio: Fix obtain the buffer id from the last descriptor

2024-05-09 Thread Wafer
The virtio-1.3 specification writes: 2.8.6 Next Flag: Descriptor Chaining Buffer ID is included in the last descriptor in the list. If the feature (_F_INDIRECT_DESC) has been negotiated, install only one descriptor in the virt

Re: [PATCH v8 08/11] virtio-gpu: Handle resource blob commands

2024-05-09 Thread Dmitry Osipenko
On 5/5/24 09:47, Akihiko Odaki wrote: > On 2024/05/02 4:20, Dmitry Osipenko wrote: >> On 4/27/24 08:52, Akihiko Odaki wrote: >>> On 2024/04/24 19:30, Dmitry Osipenko wrote: On 4/19/24 12:18, Akihiko Odaki wrote: >> @@ -61,6 +61,10 @@ struct virtio_gpu_simple_resource { >>     int d

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

2024-05-09 Thread Eugenio Perez Martin
On Mon, May 6, 2024 at 5:06 PM Jonah Palmer wrote: > > Add the boolean 'filled' member to the VirtQueueElement structure. The > use of this boolean will signify if the element has been written to the > used / descriptor ring or not. This boolean is used to support the > VIRTIO_F_IN_ORDER feature.

Re: [PATCH v8 07/11] virtio-gpu: Support suspension of commands processing

2024-05-09 Thread Dmitry Osipenko
On 5/5/24 09:37, Akihiko Odaki wrote: > On 2024/05/02 4:02, Dmitry Osipenko wrote: >> On 4/27/24 08:48, Akihiko Odaki wrote: The VIRTIO_GPU_FILL_CMD() macro returns void and this macro is used by every function processing commands. Changing process_cmd() to return bool will requ

[PATCH] hw/nvme: Add CLI options for PCI vendor/device IDs and IEEE-OUI ID

2024-05-09 Thread Saif Abrar
Add CLI options for user specified - PCI vendor, device, subsystem vendor and subsystem IDs - IEEE-OUI ID e.g. PCI IDs to be specified as follows: -device nvme,id_vendor=0xABCD,id_device=0xA0B0,id_subsys_vendor=0xEF00,id_subsys=0xEF01 IEEE-OUI ID (Identify Controller bytes 75:73) is to be specif

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

2024-05-09 Thread Eugenio Perez Martin
On Mon, May 6, 2024 at 5:06 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 > they

Re: [PATCH v2] target/loongarch/kvm: Fix VM recovery from disk failures

2024-05-09 Thread Peter Xu
On Wed, May 08, 2024 at 10:47:32AM +0800, Song Gao wrote: > vmstate does not save kvm_state_conter, > which can cause VM recovery from disk to fail. > > Signed-off-by: Song Gao Acked-by: Peter Xu -- Peter Xu

[PATCH] hw/loongarch/virt.c: Fixes memory leak in ramName during loop iterations

2024-05-09 Thread R.Samarasekara
This patch fixes a memory leak in the ramName variable within the hw/loongarch/virt.c file. The leak occurs due to repeated calls to g_strdup_printf within a loop, causing memory allocated for ramName on previous iterations to be unfreed. Signed-off-by: R.Samarasekara --- hw/loongarch/virt.c | 1

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

2024-05-09 Thread Peter Xu
On Thu, May 09, 2024 at 11:31:04AM +0800, Li Zhijian wrote: > - Explicitly show the missing module name: replication > - Fix capability name to x-colo > > Signed-off-by: Li Zhijian Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH 2/3] migration/colo: make colo_incoming_co() return void

2024-05-09 Thread Peter Xu
On Thu, May 09, 2024 at 11:31:05AM +0800, Li Zhijian via wrote: > 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 w

Re: [PATCH 3/3] migration/colo: Tidy up bql_unlock() around bdrv_activate_all()

2024-05-09 Thread Peter Xu
On Thu, May 09, 2024 at 11:31:06AM +0800, Li Zhijian via wrote: > Make the code more tight. > > Cc: Michael Tokarev > Signed-off-by: Li Zhijian Reviewed-by: Peter Xu > --- > This change/comment suggested by "Michael Tokarev " came > a bit late at that time, let's update it together in these m

Re: [PATCH] target/i386: remove PCOMMIT from TCG, deprecate property

2024-05-09 Thread Richard Henderson
On 5/8/24 17:44, Paolo Bonzini wrote: The PCOMMIT instruction was never included in any physical processor. TCG implements it as a no-op instruction, but its utility is debatable to say the least. Drop it from the decoder since it is only available with "-cpu max", which does not guarantee migra

Re: [PATCH] scripts/simpletrace: Mark output with unstable timestamp as WARN

2024-05-09 Thread Stefan Hajnoczi
On Thu, May 09, 2024 at 11:59:10AM +0800, Zhao Liu wrote: > On Wed, May 08, 2024 at 02:05:04PM -0400, Stefan Hajnoczi wrote: > > Date: Wed, 8 May 2024 14:05:04 -0400 > > From: Stefan Hajnoczi > > Subject: Re: [PATCH] scripts/simpletrace: Mark output with unstable > > timestamp as WARN > > > > On

Re: [PATCH v3] target/i386: Fix CPUID encoding of Fn8000001E_ECX

2024-05-09 Thread Michael Tokarev
03.05.2024 20:46, Babu Moger wrote: Observed the following failure while booting the SEV-SNP guest and the guest fails to boot with the smp parameters: "-smp 192,sockets=1,dies=12,cores=8,threads=2". qemu-system-x86_64: sev_snp_launch_update: SNP_LAUNCH_UPDATE ret=-5 fw_error=22 'Invalid parame

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

2024-05-09 Thread Eugenio Perez Martin
On Mon, May 6, 2024 at 5:05 PM Jonah Palmer wrote: > > Add VIRTIO_F_IN_ORDER feature support for virtqueue_fill operations. > > The goal of the virtqueue_fill operation when the VIRTIO_F_IN_ORDER > feature has been negotiated is to search for this now-used element, > set its length, and mark the e

Re: [PATCH v3] target/i386: Fix CPUID encoding of Fn8000001E_ECX

2024-05-09 Thread Daniel P . Berrangé
On Thu, May 09, 2024 at 04:54:16PM +0300, Michael Tokarev wrote: > 03.05.2024 20:46, Babu Moger wrote: > > Observed the following failure while booting the SEV-SNP guest and the > > guest fails to boot with the smp parameters: > > "-smp 192,sockets=1,dies=12,cores=8,threads=2". > > > > qemu-system

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-05-09 Thread Peter Xu
On Thu, May 09, 2024 at 04:58:34PM +0800, Zheng Chuan via wrote: > That's a good news to see the socket abstraction for RDMA! > When I was developed the series above, the most pain is the RDMA migration > has no QIOChannel abstraction and i need to take a 'fake channel' > for it which is awkward i

Re: [PATCH V1 09/26] migration: vmstate_register_named

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Define vmstate_register_named which takes the instance name as its first > parameter, instead of generating the name from VMStateIf of the Object. > This will be needed to register objects that are not Objects. Pass the > new name parameter to vmstate_register_with_alias_

Re: [PATCH V1 09/26] migration: vmstate_register_named

2024-05-09 Thread Fabiano Rosas
Fabiano Rosas writes: > Steve Sistare writes: > >> Define vmstate_register_named which takes the instance name as its first >> parameter, instead of generating the name from VMStateIf of the Object. >> This will be needed to register objects that are not Objects. Pass the >> new name parameter

Re: [PATCH 01/14] include/hw: add helpers for defining versioned machine types

2024-05-09 Thread Daniel P . Berrangé
On Thu, May 02, 2024 at 12:34:49PM +0200, Thomas Huth wrote: > On 01/05/2024 20.27, Daniel P. Berrangé wrote: > > The various targets which define versioned machine types have > > a bunch of obfuscated macro code for defining unique function > > and variable names using string concatenation. > > >

Re: [PATCH 01/14] include/hw: add helpers for defining versioned machine types

2024-05-09 Thread Daniel P . Berrangé
On Thu, May 02, 2024 at 09:57:21AM -0500, Eric Blake wrote: > On Wed, May 01, 2024 at 07:27:46PM +0100, Daniel P. Berrangé wrote: > > The various targets which define versioned machine types have > > a bunch of obfuscated macro code for defining unique function > > and variable names using string c

Re: [PATCH 08/14] include/hw: add macros for deprecation & removal of versioned machines

2024-05-09 Thread Daniel P . Berrangé
On Thu, May 02, 2024 at 12:59:05PM +0200, Thomas Huth wrote: > On 01/05/2024 20.27, Daniel P. Berrangé wrote: > > Versioned machines live for a long time to provide back compat for > > incoming migration and restore of saved images. To guide users away from > > usage of old machines, however, we wa

[PATCH] target/i386: rdpkru/wrpkru are no-prefix instructions

2024-05-09 Thread Paolo Bonzini
Reject 0x66/0xf3/0xf2 in front of them. Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 5366dc32dd3..3da4fdf64cc 10064

[PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt

2024-05-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/tcg/i386/test-i386.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index 864c4e620d5..ce3bf74b5a8 100644 --- a/tests/tcg/i386/test-i386.c +++ b/tests/tcg/i386/test-i386.

[PATCH] target/i386: fix operand size for DATA16 REX.W POPCNT

2024-05-09 Thread Paolo Bonzini
According to the manual, 32-bit vs 64-bit is governed by REX.W and REX ignores the 0x66 prefix. This can be confirmed with this program: #include int main() { int x = 0x1234; int y; asm("popcntl %1, %0" : "=r" (y) : "r" (x)); printf("%x\n", y); asm("mo

[PATCH] target/i386: move prefetch and multi-byte UD/NOP to new decoder

2024-05-09 Thread Paolo Bonzini
These are trivial to add, and moving them to the new decoder fixes some corner cases: raising #UD instead of an instruction fetch page fault for the undefined opcodes, and incorrectly rejecting 0F 18 prefetches with register operands (which are treated as reserved NOPs). Signed-off-by: Paolo Bonzi

[PATCH] target/i386: fix feature dependency for WAITPKG

2024-05-09 Thread Paolo Bonzini
The VMX feature bit depends on general availability of WAITPKG, not the other way round. Fixes: 33cc88261c3 ("target/i386: add support for VMX_SECONDARY_EXEC_ENABLE_USER_WAIT_PAUSE", 2023-08-28) Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 ++-- 1 file chang

[PATCH] target/i386: add feature dependency for XSAVE

2024-05-09 Thread Paolo Bonzini
The XSAVEOPT, XSAVEC, XGETBV1, XSAVES features make no sense if you cannot enable XSAVE in the first place. Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f2ea6899e39..6f5ff71c6ee 100644 --- a

[PATCH 04/13] s390x: select correct components for no-board build

2024-05-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- .gitlab-ci.d/buildtest.yml | 4 ++-- target/s390x/Kconfig | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 13afd0df1f0..f8502905203 100644 --- a/.gitlab-ci.d/buildtest.yml ++

[PATCH 09/13] i386: pc: remove unnecessary MachineClass overrides

2024-05-09 Thread Paolo Bonzini
There is no need to override these fields of MachineClass because they are already set to the right value in the superclass. Signed-off-by: Paolo Bonzini --- include/hw/i386/x86.h | 4 hw/i386/pc.c | 3 --- hw/i386/x86.c | 6 +++--- 3 files changed, 3 insertions(+), 10 dele

[PATCH 10/13] hw/i386: split x86.c in multiple parts

2024-05-09 Thread Paolo Bonzini
Keep the basic X86MachineState definition in x86.c. Move out functions that are only needed by other files: x86-common.c for the pc and microvm machines, x86-cpu.c for those used by accelerator code. Signed-off-by: Paolo Bonzini --- include/hw/i386/x86.h |6 +- hw/i386/x86-common.c | 1007

[PATCH 11/13] hw/i386: move rtc-reset-reinjection command out of hw/rtc

2024-05-09 Thread Paolo Bonzini
The rtc-reset-reinjection QMP command is specific to x86, other boards do not have the ACK tracking functionality that is needed for RTC interrupt reinjection. Therefore the QMP command is only included in x86, but qmp_rtc_reset_reinjection() is implemented by hw/rtc/mc146818rtc.c and requires tra

[PATCH 05/13] tests/qtest: s390x: fix operation in a build without any boards or devices

2024-05-09 Thread Paolo Bonzini
Do the bare minimum to ensure that at least a vanilla --without-default-devices build works for all targets except i386, x86_64 and ppc64. In particular this fixes s390x-softmmu; i386 and x86_64 have about a dozen failing tests that do not pass -M and therefore require a default machine type; ppc6

[PATCH 00/13] fix --without-default-devices build and (mostly) tests

2024-05-09 Thread Paolo Bonzini
The recent change to make boards "default y" made them go away from a --without-default-devices build, because the boards are not anymore enabled explicitly in configs/devices/. This is a problem for some targets that were not fully ready for this and have generic target code that needs symbols fr

[PATCH 02/13] s390_flic: add migration-enabled property

2024-05-09 Thread Paolo Bonzini
Instead of mucking with css_migration_enabled(), add a property specific to the FLIC device, similar to what is done for TYPE_S390_STATTRIB. Signed-off-by: Paolo Bonzini --- include/hw/s390x/s390_flic.h | 1 + hw/intc/s390_flic.c | 6 +- hw/s390x/s390-virtio-ccw.c | 1 + 3 files c

[PATCH 03/13] s390: move css_migration_enabled from machine to css.c

2024-05-09 Thread Paolo Bonzini
The CSS subsystem uses global variables, just face the truth and use a variable also for whether the CSS vmstate is in use; remove the indirection of fetching it from the machine type, which makes the TCG code depend unnecessarily on the virtio-ccw machine. Signed-off-by: Paolo Bonzini --- inclu

[PATCH 06/13] xen: initialize legacy backends from xen_bus_init()

2024-05-09 Thread Paolo Bonzini
Prepare for moving the calls to xen_be_register() under the control of xen_bus_init(), using the normal xen_backend_init() method that is used by the "modern" backends. This requires the xenstore global variable to be initialized, which is done by xen_be_init(). To ensure that everything is ready

[PATCH 07/13] xen: register legacy backends via xen_backend_init

2024-05-09 Thread Paolo Bonzini
It is okay to register legacy backends in the middle of xen_bus_init(). All that the registration does is record the existence of the backend in xenstore. This makes it possible to remove them from the build without introducing undefined symbols in xen_be_init(). It also removes the need for the

[PATCH 12/13] i386: select correct components for no-board build

2024-05-09 Thread Paolo Bonzini
The local APIC is a part of the CPU and has callbacks that are invoked from multiple accelerators. The IOAPIC on the other hand is optional, but ioapic_eoi_broadcast is used by common x86 code to implement the IOAPIC's implicit EOI mode. Add a stub in case the IOAPIC device is not included but the

[PATCH 08/13] i386: correctly select code in hw/i386 that depends on other components

2024-05-09 Thread Paolo Bonzini
fw_cfg.c and vapic.c are currently included unconditionally but depend on other components. vapic.c depends on the local APIC, while fw_cfg.c includes a piece of AML builder code that depends on CONFIG_ACPI. Signed-off-by: Paolo Bonzini --- hw/i386/fw_cfg.c| 2 ++ hw/i386/meson.build | 2 +-

[PATCH 01/13] s390x: move s390_cpu_addr2state to target/s390x/sigp.c

2024-05-09 Thread Paolo Bonzini
This function has no dependency on the virtio-ccw machine type, though it assumes that the CPU address corresponds to the core_id and the index. If there is any need of something different or more fancy (unlikely) S390 can include a MachineClass subclass and implement it there. For now, move it t

[PATCH 13/13] tests/qtest: arm: fix operation in a build without any boards or devices

2024-05-09 Thread Paolo Bonzini
ARM/aarch64 are easy to fix because they already have to pass a machine type by hand. Just guard the tests with a check that the machine actually exists. Signed-off-by: Paolo Bonzini --- tests/qtest/arm-cpu-features.c | 4 tests/qtest/migration-test.c | 6 ++ tests/qtest/numa-test.c

Re: [PATCH] target/riscv: Remove experimental prefix from "B" extension

2024-05-09 Thread Daniel Henrique Barboza
On 5/8/24 08:22, Andrew Jones wrote: On Tue, May 07, 2024 at 11:27:21AM GMT, Rob Bradford wrote: This extension has now been ratified: https://jira.riscv.org/browse/RVS-2006 so the "x-" prefix can be removed. Signed-off-by: Rob Bradford --- target/riscv/cpu.c | 2 +- 1 file changed, 1 in

[PATCH v5 8/8] hw/arm: xen: Enable use of grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/xen_arm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 15fa7dfa84..6fad829ede 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -125

[PATCH v5 1/8] xen: mapcache: Make MCACHE_BUCKET_SHIFT runtime configurable

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Make MCACHE_BUCKET_SHIFT runtime configurable per cache instance. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/xen/xen-mapcache.c | 54 ++- 1 file changed, 33 insertions(+), 21 deletions(-) diff --gi

[PATCH v5 4/8] softmmu: xen: Always pass offset + addr to xen_map_cache

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Always pass address with offset to xen_map_cache(). This is in preparation for support for grant mappings. Since this is within a block that checks for offset == 0, this has no functional changes. Signed-off-by: Edgar E. Iglesias --- system/physmem.c | 3 ++- 1 file

[PATCH v5 0/8] xen: Support grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Hi, Grant mappings are a mechanism in Xen for guests to grant each other permissions to map and share pages. These grants can be temporary so both map and unmaps must be respected. See here for more info: https://github.com/xen-project/xen/blob/master/docs/misc/grant-ta

[PATCH v5 7/8] xen: mapcache: Add support for grant mappings

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add a second mapcache for grant mappings. The mapcache for grants needs to work with XC_PAGE_SIZE granularity since we can't map larger ranges than what has been granted to us. Like with foreign mappings (xen_memory), machines using grants are expected to initialize the

[PATCH v5 3/8] xen: Add xen_mr_is_memory()

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Add xen_mr_is_memory() to abstract away tests for the xen_memory MR. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Acked-by: David Hildenbrand --- hw/xen/xen-hvm-common.c | 10 -- include/sysemu/xen.h| 8 ++

[PATCH v5 2/8] xen: mapcache: Unmap first entries in buckets

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" When invalidating memory ranges, if we happen to hit the first entry in a bucket we were never unmapping it. This was harmless for foreign mappings but now that we're looking to reuse the mapcache for transient grant mappings, we must unmap entries when invalidated. Sig

[PATCH v5 6/8] xen: mapcache: Pass the ram_addr offset to xen_map_cache()

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Pass the ram_addr offset to xen_map_cache. This is in preparation for adding grant mappings that need to compute the address within the RAMBlock. No functional changes. Signed-off-by: Edgar E. Iglesias --- hw/xen/xen-mapcache.c | 16 +++- include/

[PATCH v5 5/8] softmmu: Replace check for RAMBlock offset 0 with xen_mr_is_memory

2024-05-09 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" For xen, when checking for the first RAM (xen_memory), use xen_mr_is_memory() rather than checking for a RAMBlock with offset 0. All Xen machines create xen_memory first so this has no functional change for existing machines. Signed-off-by: Edgar E. Iglesias --- syst

Re: [PATCH V1 21/26] migration: migrate_add_blocker_mode

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Define a convenience function to add a migration blocker for a single mode. > > Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-09 Thread Peter Maydell
On Wed, 8 May 2024 at 16:29, Cord Amfmgm wrote: > On Wed, May 8, 2024 at 3:45 AM Thomas Huth wrote: >> >> Your Signed-off-by line does not match the From: line ... could you please >> fix this? (see >> https://www.qemu.org/docs/master/devel/submitting-a-patch.html#patch-emails-must-include-a-sign

Re: [PATCH V1 22/26] migration: ram block cpr-exec blockers

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Unlike cpr-reboot mode, cpr-exec mode cannot save volatile ram blocks in the > migration stream file and recreate them later, because the physical memory for > the blocks is pinned and registered for vfio. Add an exec-mode blocker for > volatile ram blocks. > > Also add a

Re: [PATCH V1 23/26] migration: misc cpr-exec blockers

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Add blockers for cpr-exec migration mode for devices and options that do > not support it. > > Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas

Re: [PATCH V1 24/26] seccomp: cpr-exec blocker

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > cpr-exec mode needs permission to exec. Block it if permission is denied. > > Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas

Re: hw/usb/hcd-ohci: Fix #1510, #303: pid not IN or OUT

2024-05-09 Thread Cord Amfmgm
On Thu, May 9, 2024 at 12:48 PM Peter Maydell wrote: > On Wed, 8 May 2024 at 16:29, Cord Amfmgm wrote: > > On Wed, May 8, 2024 at 3:45 AM Thomas Huth wrote: > >> > >> Your Signed-off-by line does not match the From: line ... could you > please > >> fix this? (see > >> > https://www.qemu.org/doc

Re: [PATCH 1/9] block: add persistent reservation in/out api

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:21PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations > at the block level. The following operations > are included: > > - read_keys:retrieves the list of registered keys. > - read_reservation: retrieves the current reservation status. >

Re: [PATCH 2/9] block/raw: add persistent reservation in/out driver

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:22PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations for raw driver. > The following methods are implemented: bdrv_co_pr_read_keys, > bdrv_co_pr_read_reservation, bdrv_co_pr_register, bdrv_co_pr_reserve, > bdrv_co_pr_release, bdrv_co_pr_clear an

Re: [PATCH 3/9] scsi/constant: add persistent reservation in/out protocol constants

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:23PM +0800, Changqi Lu wrote: > Add constants for the persistent reservation in/out protocol > in the scsi/constant module. The constants include the persistent > reservation command, type, and scope values defined in sections > 6.13 and 6.14 of the SCSI Primary Comman

Re: [PATCH 4/9] scsi/util: add helper functions for persistent reservation types conversion

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:24PM +0800, Changqi Lu wrote: > This commit introduces two helper functions > that facilitate the conversion between the > persistent reservation types used in the SCSI > protocol and those used in the block layer. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenw

Re: [PATCH V1 25/26] migration: fix mismatched GPAs during cpr-exec

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > For cpr-exec mode, ramblock_is_ignored is always true, and the address of > each migrated memory region must match the address of the statically > initialized region on the target. However, for a PCI rom block, the region > address is set when the guest writes to a BAR on

Re: [PATCH 5/9] hw/scsi: add persistent reservation in/out api for scsi device

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:25PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations in the > SCSI device layer. By introducing the persistent > reservation in/out api, this enables the SCSI device > to perform reservation-related tasks, including querying > keys, querying res

Re: [PATCH 6/9] block/nvme: add reservation command protocol constants

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:26PM +0800, Changqi Lu wrote: > Add constants for the NVMe persistent command protocol. > The constants include the reservation command opcode and > reservation type values defined in section 7 of the NVMe > 2.0 specification. > > Signed-off-by: Changqi Lu > Signed-o

Re: [PATCH 7/9] hw/nvme: add helper functions for converting reservation types

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:27PM +0800, Changqi Lu wrote: > This commit introduces two helper functions > that facilitate the conversion between the > reservation types used in the NVME protocol > and those used in the block layer. > > Signed-off-by: Changqi Lu > Signed-off-by: zhenwei pi > --

Re: [PATCH 0/9] Support persistent reservation operations

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:20PM +0800, Changqi Lu wrote: > Hi, > > I am going to introduce persistent reservation for QEMU block. > There are three parts in this series: > > Firstly, at the block layer, the commit abstracts seven APIs related to > the persistent reservation command. These APIs

Re: [PATCH 5/9] hw/scsi: add persistent reservation in/out api for scsi device

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 05:36:25PM +0800, Changqi Lu wrote: > Add persistent reservation in/out operations in the > SCSI device layer. By introducing the persistent > reservation in/out api, this enables the SCSI device > to perform reservation-related tasks, including querying > keys, querying res

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

2024-05-09 Thread Shivaprasad G Bhat
The commit 6ad359ec29 "(vfio/spapr: Move prereg_listener into spapr container)" began to use the newly introduced VFIOSpaprContainer structure. After several refactors, today the container_of(container, VFIOSpaprContainer, ABC) is used when VFIOSpaprContainer is actually not allocated. On PPC64 sy

Re: [PATCH V1 26/26] migration: only-migratable-modes

2024-05-09 Thread Fabiano Rosas
Steve Sistare writes: > Add the only-migratable-modes option as a generalization of only-migratable. > Only devices that support all requested modes are allowed. > > Signed-off-by: Steve Sistare > --- > include/migration/misc.h | 3 +++ > include/sysemu/sysemu.h| 1 - > migratio

Re: [PATCH v4 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-05-09 Thread Stefan Hajnoczi
On Wed, May 08, 2024 at 09:44:44AM +0200, Stefano Garzarella wrote: > v1: https://patchew.org/QEMU/20240228114759.44758-1-sgarz...@redhat.com/ > v2: https://patchew.org/QEMU/20240326133936.125332-1-sgarz...@redhat.com/ > v3: https://patchew.org/QEMU/20240404122330.92710-1-sgarz...@redhat.com/ > v4:

[PATCH v5 00/32] Misc PPC exception and BookE MMU clean ups

2024-05-09 Thread BALATON Zoltan
This series does some further clean up mostly around BookE MMU to untangle it from other MMU models. It also contains some other changes that I've come up with while working on this. The Simplify ppc_booke_xlate() part 1 and part 2 patches could be squashed together but left them separate for easie

[PATCH v5 09/32] target/ppc/mmu_common.c: Eliminate ret from mmu6xx_get_physical_address()

2024-05-09 Thread BALATON Zoltan
Return directly, which is simpler than dragging a return value through multpile if and else blocks. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 84 +++-- 1 file changed, 39 insertions(+), 45 deletions(-) diff --gi

[PATCH v5 04/32] target/ppc/mmu_common.c: Simplify checking for real mode

2024-05-09 Thread BALATON Zoltan
In get_physical_address_wtlb() the real_mode flag depends on either the MSR[IR] or MSR[DR] bit depending on access_type. Extract just the needed bit in a more straight forward way instead of doing unnecessary computation. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc

[PATCH v5 02/32] target/ppc/mmu_common.c: Move calculation of a value closer to its usage

2024-05-09 Thread BALATON Zoltan
In mmubooke_check_tlb() and mmubooke206_check_tlb() prot2 is calculated first but only used after an unrelated check that can return before tha value is used. Move the calculation after the check, closer to where it is used, to keep them together and avoid computing it when not needed. Signed-off-

[PATCH v5 01/32] target/ppc: Remove unused helper

2024-05-09 Thread BALATON Zoltan
The helper_rac function is defined but not used, remove it. Fixes: 005b69fdcc (target/ppc: Remove PowerPC 601 CPUs) Signed-off-by: BALATON Zoltan Reviwed-by: Nicholas Piggin --- target/ppc/helper.h | 2 -- target/ppc/mmu_helper.c | 24 2 files changed, 26 deletions

[PATCH v5 31/32] target/ppc: Move out BookE and related MMU functions from mmu_common.c

2024-05-09 Thread BALATON Zoltan
Add a new mmu-booke.c file for BookE and related MMU bits from mmu_common.c. Signed-off-by: BALATON Zoltan Acked-by: Nicholas Piggin --- target/ppc/cpu.h| 4 - target/ppc/meson.build | 1 + target/ppc/mmu-booke.c | 531 target/ppc/mmu-booke

[PATCH v5 14/32] target/ppc/mmu_common.c: Deindent ppc_jumbo_xlate()

2024-05-09 Thread BALATON Zoltan
Instead of putting a large block of code in an if, invert the condition and return early to be able to deindent the code block. Signed-off-by: BALATON Zoltan Acked-by: Nicholas Piggin --- target/ppc/mmu_common.c | 319 1 file changed, 159 insertions(+),

[PATCH v5 28/32] target/ppc/mmu-hash32.c: Drop a local variable

2024-05-09 Thread BALATON Zoltan
In ppc_hash32_xlate() the value of need_prop is checked in two places but precalculating it does not help because when we reach the first check we always return and not reach the second place so the value will only be used once. We can drop the local variable and calculate it when needed, which mak

[PATCH v5 22/32] target/ppc/mmu_common.c: Eliminate get_physical_address_wtlb()

2024-05-09 Thread BALATON Zoltan
Inline get_physical_address_wtlb() in its only caller and remove it. Signed-off-by: BALATON Zoltan --- target/ppc/internal.h | 5 +--- target/ppc/mmu_common.c | 66 + 2 files changed, 28 insertions(+), 43 deletions(-) diff --git a/target/ppc/internal.h

Re: [PATCH 1/3] target/riscv: Save counter values during countinhibit update

2024-05-09 Thread Atish Kumar Patra
On Thu, May 2, 2024 at 5:39 AM Andrew Jones wrote: > > On Tue, Apr 30, 2024 at 03:00:45PM GMT, Daniel Henrique Barboza wrote: > > > > > > On 4/29/24 16:28, Atish Patra wrote: > > > Currently, if a counter monitoring cycle/instret is stopped via > > > mcountinhibit we just update the state while th

[PATCH v5 30/32] target/ppc: Add a function to check for page protection bit

2024-05-09 Thread BALATON Zoltan
Checking if a page protection bit is set for a given access type is a common operation. Add a function to avoid repeating the same check at multiple places. As this relies on access type and page protection bit values having certain relation also add an assert to ensure that this assumption holds.

[PATCH v5 12/32] target/ppc/mmu_common.c: Inline and remove check_physical()

2024-05-09 Thread BALATON Zoltan
This function just does two assignments and and unnecessary check that is always true so inline it in the only caller left and remove it. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin --- target/ppc/mmu_common.c | 26 +++--- 1 file changed, 3 insertions(+), 23 d

  1   2   >