Re: [PATCH for-9.0 v2 00/10] vfio: Introduce a VFIOIOMMUClass

2023-12-21 Thread Cédric Le Goater
On 12/20/23 21:35, Eric Farman wrote: On Tue, 2023-12-19 at 07:58 +0100, Cédric Le Goater wrote: Hello, The VFIO object hierarchy has some constraints because each VFIO type has a dual nature: a VFIO nature for passthrough support and a bus nature (PCI, AP, CCW, Platform) for its initial presen

Re: [PATCH v6 07/11] virtio-gpu: Handle resource blob commands

2023-12-21 Thread Akihiko Odaki
On 2023/12/19 16:53, Huang Rui wrote: From: Antonio Caggiano Support BLOB resources creation, mapping and unmapping by calling the new stable virglrenderer 0.10 interface. Only enabled when available and via the blob config. E.g. -device virtio-vga-gl,blob=true I have another concern about de

[PATCH] load_elf: fix iterator type in glue

2023-12-21 Thread Anastasia Belova
file_size is uint32_t, so j < file_size should be uint32_t too. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 7ef295ea5b ("loader: Add data swap option to load-elf") Signed-off-by: Anastasia Belova --- include/hw/elf_ops.h | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH] vfio/iommufd: Remove the use of stat() to check file existence

2023-12-21 Thread Cédric Le Goater
Using stat() before opening a file or a directory can lead to a time-of-check to time-of-use (TOCTOU) filesystem race, which is reported by coverity as a Security best practices violations. The sequence could be replaced by open and fdopendir but it doesn't add much in this case. Simply use opendir

Re: [PATCH v2 59/71] hw/vfio: Constify VMState

2023-12-21 Thread Cédric Le Goater
On 12/21/23 04:16, Richard Henderson wrote: Signed-off-by: Richard Henderson Reviewed-by: Cédric Le Goater I suppose you will include the patch in : https://lore.kernel.org/qemu-devel/20231221031652.119827-1-richard.hender...@linaro.org/ Thanks, C. --- hw/vfio/display.c | 2 +-

[PULL 1/2] hw/loongarch/virt: Align high memory base address with super page size

2023-12-21 Thread Song Gao
From: Bibo Mao With LoongArch virt machine, there is low memory space with region 0--0x1000, and high memory space with started from 0x9000. High memory space is aligned with 256M, it will be better if it is aligned with 1G, which is super page aligned for 4K page size. Currently linux k

[PULL 2/2] target/loongarch: Add timer information dump support

2023-12-21 Thread Song Gao
From: Bibo Mao Timer emulation sometimes is problematic especially when vm is running in kvm mode. This patch adds registers dump support relative with timer hardware, so that it is easier to find the problems. Signed-off-by: Bibo Mao Reviewed-by: Song Gao Message-Id: <20231206081839.2290178-1

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

2023-12-21 Thread Song Gao
-loongarch-20231221 for you to fetch changes up to be45144bee708d3b84c3c474a4d4aeb7e5c4733a: target/loongarch: Add timer information dump support (2023-12-21 16:07:47 +0800) pull-loongarc

Re: [PATCH for 9.0 08/12] vdpa: add vhost_vdpa_load_setup

2023-12-21 Thread Eugenio Perez Martin
On Thu, Dec 21, 2023 at 3:17 AM Jason Wang wrote: > > On Wed, Dec 20, 2023 at 3:07 PM Eugenio Perez Martin > wrote: > > > > On Wed, Dec 20, 2023 at 6:22 AM Jason Wang wrote: > > > > > > On Sat, Dec 16, 2023 at 1:28 AM Eugenio Pérez wrote: > > > > > > > > Callers can use this function to setup t

RE: [PATCH v3 1/6] target/i386: add support for FRED in CPUID enumeration

2023-12-21 Thread Li, Xin3
>> @@ -1552,6 +1552,14 @@ static FeatureDep feature_dependencies[] = { >> .from = { FEAT_VMX_SECONDARY_CTLS, >> VMX_SECONDARY_EXEC_ENABLE_USER_WAIT_PAUSE }, >> .to = { FEAT_7_0_ECX, CPUID_7_0_ECX_WAITPKG }, >> }, >> +{ >> +.from = { FEAT_7_1_EAX

Re: [PATCH v6 06/11] softmmu/memory: enable automatic deallocation of memory regions

2023-12-21 Thread Xenia Ragiadakou
On 21/12/23 09:50, Akihiko Odaki wrote: On 2023/12/21 16:35, Xenia Ragiadakou wrote: On 21/12/23 07:45, Akihiko Odaki wrote: On 2023/12/19 16:53, Huang Rui wrote: From: Xenia Ragiadakou When the memory region has a different life-cycle from that of her parent, could be automatically rele

Re: [PATCH v2 08/11] next-cube.c: move static old_scr2 variable to NeXTPC

2023-12-21 Thread Thomas Huth
Am Wed, 20 Dec 2023 19:36:27 + schrieb Mark Cave-Ayland : > On 20/12/2023 19:20, Thomas Huth wrote: > > > Am Wed, 20 Dec 2023 13:16:38 + > > schrieb Mark Cave-Ayland : > > > >> Move the old_scr2 variable to NeXTPC so that the old SCR2 register state is > >> stored along with the curren

Re: [PATCH v2 09/11] next-cube.c: move LED logic to new next_scr2_led_update() function

2023-12-21 Thread Thomas Huth
Am Wed, 20 Dec 2023 13:16:39 + schrieb Mark Cave-Ayland : > Ensure that the LED status is updated by calling next_scr2_led_update() > whenever > the SC2 register is written. > > Signed-off-by: Mark Cave-Ayland > --- > hw/m68k/next-cube.c | 22 +- > 1 file changed, 13 in

Re: [PATCH v2 10/11] next-cube.c: remove val and size arguments from nextscr2_write()

2023-12-21 Thread Thomas Huth
Am Wed, 20 Dec 2023 13:16:40 + schrieb Mark Cave-Ayland : > These are now redundant with the scr2 and old_scr2 fields in NeXTPC. Rename > the function from nextscr2_write() to next_scr2_rtc_update() to better > reflect its purpose. At the same time replace the manual bit manipulation with > th

Re: [PATCH] vfio/container: Rename vfio_init_container to vfio_set_iommu

2023-12-21 Thread Cédric Le Goater
On 12/21/23 03:45, Zhenzhong Duan wrote: vfio_container_init() and vfio_init_container() names are confusing especially when we see vfio_init_container() calls vfio_container_init(). vfio_container_init() operates on base container which is consistent with all routines handling 'VFIOContainerBas

Re: [PATCH v2] qdev: Report an error for machine without HotplugHandler

2023-12-21 Thread Markus Armbruster
Akihiko Odaki writes: > On 2023/12/21 1:46, Zhao Liu wrote: >> Hi Markus, >> On Wed, Dec 20, 2023 at 08:53:21AM +0100, Markus Armbruster wrote: >>> Date: Wed, 20 Dec 2023 08:53:21 +0100 >>> From: Markus Armbruster >>> Subject: Re: [PATCH v2] qdev: Report an error for machine without >>> Hotplu

RE: [PATCH] vfio/iommufd: Remove the use of stat() to check file existence

2023-12-21 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Thursday, December 21, 2023 4:10 PM >Subject: [PATCH] vfio/iommufd: Remove the use of stat() to check file >existence > >Using stat() before opening a file or a directory can lead to a >time-of-check to time-of-use (TOCTOU) filesystem ra

Re: [PATCH] vfio/iommufd: Remove the use of stat() to check file existence

2023-12-21 Thread Cédric Le Goater
Hello Zhenzhong On 12/21/23 09:55, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Sent: Thursday, December 21, 2023 4:10 PM Subject: [PATCH] vfio/iommufd: Remove the use of stat() to check file existence Using stat() before opening a file or a directory can lead to

RE: [PATCH] vfio/iommufd: Remove the use of stat() to check file existence

2023-12-21 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Thursday, December 21, 2023 5:16 PM >Subject: Re: [PATCH] vfio/iommufd: Remove the use of stat() to check file >existence > >Hello Zhenzhong > >On 12/21/23 09:55, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>> From: Cédr

Re: [PATCH v2] qdev: Report an error for machine without HotplugHandler

2023-12-21 Thread Akihiko Odaki
On 2023/12/21 17:49, Markus Armbruster wrote: Akihiko Odaki writes: On 2023/12/21 1:46, Zhao Liu wrote: Hi Markus, On Wed, Dec 20, 2023 at 08:53:21AM +0100, Markus Armbruster wrote: Date: Wed, 20 Dec 2023 08:53:21 +0100 From: Markus Armbruster Subject: Re: [PATCH v2] qdev: Report an error f

[RFC PATCH 3/4] target/riscv/kvm: handle the exit with debug reason

2023-12-21 Thread Chao Du
If the breakpoint belongs to the userspace then set the ret value. Signed-off-by: Chao Du --- target/riscv/kvm/kvm-cpu.c | 20 1 file changed, 20 insertions(+) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 94697b09bb..b1aed78780 100644 --- a/tar

[RFC PATCH 1/4] target/riscv/kvm: add software breakpoints support

2023-12-21 Thread Chao Du
This patch implements insert/remove software breakpoint process: Add an input parameter for kvm_arch_insert_sw_breakpoint() and kvm_arch_remove_sw_breakpoint() to pass the length information, which helps us to know whether it is a compressed instruction. For some remove cases, we do not have the l

[RFC PATCH 2/4] target/riscv/kvm: implement kvm_arch_update_guest_debug()

2023-12-21 Thread Chao Du
Set the control flag when there are active breakpoints. This will help KVM to know the status in the userspace. Signed-off-by: Chao Du --- target/riscv/kvm/kvm-cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c ind

[RFC PATCH 4/4] linux-headers: enable KVM GUEST DEBUG for RISC-V

2023-12-21 Thread Chao Du
Synchronize the kvm.h file which enables KVM GUEST DEBUG at QEMU side. Signed-off-by: Chao Du --- linux-headers/asm-riscv/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h index 992c5e4071..72942a7aaf 100644 --- a/linux-header

[RFC PATCH 0/4] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2023-12-21 Thread Chao Du
This series implements QEMU KVM Guest Debug on RISC-V. Currently, we can debug RISC-V KVM guest from the host side, with software breakpoints. A brief test was done on QEMU RISC-V hypervisor emulator. A TODO list which will be added later: 1. HW breakpoints support 2. Test cases This series is b

[PATCH v2 1/1] virgl: Implement resource_query_layout

2023-12-21 Thread Julia Zhang
From: Daniel Stone A new ioctl to shuttle information between host and guest about the actual buffer allocation, which can be used for interop between GL and Vulkan when supporting standard window systems. Signed-off-by: Daniel Stone Co-developed-by: Julia Zhang Signed-off-by: Julia Zhang ---

[PATCH v2 0/1] Implementation of resource_query_layout

2023-12-21 Thread Julia Zhang
Hi all, Sorry to late reply. This is v2 of the implementation of resource_query_layout. This adds a new ioctl to let guest query information of host resource, which is originally from Daniel Stone. We add some changes to support query the correct stride of host resource before it's created, which

RE: [PATCH v3 06/70] kvm: Introduce support for memory_attributes

2023-12-21 Thread Wang, Wei W
On Thursday, December 21, 2023 2:11 PM, Li, Xiaoyao wrote: > On 12/12/2023 9:56 PM, Wang, Wei W wrote: > > On Wednesday, November 15, 2023 3:14 PM, Xiaoyao Li wrote: > >> Introduce the helper functions to set the attributes of a range of > >> memory to private or shared. > >> > >> This is necessary

[PATCH 00/40] testing and plugin updates for 9.0

2023-12-21 Thread Alex Bennée
This brings in the first batch of testing updates for the next release. The main bulk of these is Daniel and Thomas' cleanups of the qtest timeouts and allowing meson control them. There are a few minor tweaks I've made to some avocado and gitlab tests. The big update is support for reading regist

[PATCH 11/40] qtest: bump prom-env-test timeout to 6 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The prom-env-test can take more than 5 minutes in a --enable-debug build on a loaded system. Bumping to 6 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé [thuth: Bump timeout to 6 minutes instead of 3] Signed-off-by: Thomas Huth Message-Id: <20231215

[PATCH 19/40] tests/fp: Bump fp-test-mulAdd test timeout to 3 minutes

2023-12-21 Thread Alex Bennée
From: Thomas Huth When running the tests in slow mode with --enable-debug on a very loaded system, the fp-test-mulAdd test can take longer than 2 minutes. Bump the timeout to three minutes to make sure it passes in such situations, too. Signed-off-by: Thomas Huth Message-Id: <20231215070357.10

[PATCH 12/40] qtest: bump boot-serial-test timeout to 3 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The boot-serial-test takes about 1 + 1/2 minutes in a --enable-debug build. Bumping to 3 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20230717182859.707658-9-berra...@redhat.com> Signed-off-by: Thomas Huth Me

[PATCH 38/40] contrib/plugins: fix imatch

2023-12-21 Thread Alex Bennée
We can't directly save the ephemeral imatch from argv as that memory will get recycled. Signed-off-by: Alex Bennée --- contrib/plugins/execlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c index 82dc2f584e2..f262ee

[PATCH 05/40] qtest: bump min meson timeout to 60 seconds

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé Even some of the relatively fast qtests can sometimes hit the 30 second timeout in GitLab CI under high parallelism/load conditions. Bump the min to 60 seconds to give a higher margin for reliability. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé Message-I

[PATCH 08/40] qtest: bump npcm7xx_pwn-test timeout to 5 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The npcm7xx_pwn-test takes 3 & 1/2 minutes in a --enable-debug build. Bumping to 5 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20230717182859.707658-5-berra...@redhat.com> Signed-off-by: Thomas Huth Message-

[PATCH 15/40] qtest: bump bios-table-test timeout to 9 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé This is reliably hitting the current 2 minute timeout in GitLab CI, and for the TCI job, it even hits a 6 minute timeout. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrangé Message-ID: <20230717182859.707658-12-berra...@redhat.com> Signed-off-by: Thomas Huth M

[PATCH 09/40] qtest: bump test-hmp timeout to 4 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The hmp test takes just under 3 minutes in a --enable-debug build. Bumping to 4 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20230717182859.707658-6-berra...@redhat.com> [thuth: fix copy-n-paste error in the d

[PATCH 5/6] target/riscv: Update address modify functions to take into account pointer masking

2023-12-21 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/translate.c | 21 +++-- target/riscv/vector_helper.c | 7 +++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 4c0d526b58..70bbead7

[PATCH 07/40] qtest: bump qom-test timeout to 15 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The qom-test is periodically hitting the 5 minute timeout when running on the aarch64 emulator under GitLab CI. With an --enable-debug build it can take over 10 minutes for arm/aarch64 targets. Setting timeout to 15 minutes gives enough headroom to hopefully make it relia

[PATCH 02/40] tests/avocado: use snapshot=on in kvm_xen_guest

2023-12-21 Thread Alex Bennée
This ensures the rootfs is never permanently changed as we don't need persistence between tests anyway. Signed-off-by: Alex Bennée --- tests/avocado/kvm_xen_guest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/avocado/kvm_xen_guest.py b/tests/avocado/kvm_xen_guest.p

[PATCH 10/40] qtest: bump pxe-test timeout to 10 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The pxe-test uses the boot_sector_test() function, and that already uses a timeout of 600 seconds. So adjust the timeout on the meson side accordingly. Signed-off-by: Daniel P. Berrangé [thuth: Bump timeout to 600s and adjust commit description] Signed-off-by: Thomas Hu

[PATCH 40/40] contrib/plugins: optimise the register value tracking

2023-12-21 Thread Alex Bennée
This adds an additional flag which attempts to optimise the register tracking by only instrumenting instructions which are likely to change its value. This relies on the disassembler showing up the register names in disassembly so is only enabled when asked for. Signed-off-by: Alex Bennée --- do

[PATCH 13/40] qtest: bump qos-test timeout to 2 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The qos-test takes just under 1 minute in a --enable-debug build. Bumping to 2 minutes will give more headroom. Signed-off-by: Daniel P. Berrangé Reviewed-by: Thomas Huth Message-ID: <20230717182859.707658-10-berra...@redhat.com> Signed-off-by: Thomas Huth Message-Id:

[PATCH 06/40] qtest: bump migration-test timeout to 8 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The migration test should take between 1 min 30 and 2 mins on reasonably modern hardware. The test is not especially compute bound, rather its running time is dominated by the guest RAM size relative to the bandwidth cap, which forces each iteration to take at least 30 se

[PATCH 04/40] chardev: use bool for fe_is_open

2023-12-21 Thread Alex Bennée
The function qemu_chr_fe_init already treats be->fe_open as a bool and if it acts like a bool it should be one. While we are at it make the variable name more descriptive and add kdoc decorations. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20231211145959.93759-1-

[PATCH 14/40] qtest: bump aspeed_smc-test timeout to 6 minutes

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé On a loaded system with --enable-debug, this test can take longer than 5 minutes. Raising the timeout to 6 minutes gives greater headroom for such situations. Signed-off-by: Daniel P. Berrangé [thuth: Increase the timeout to 6 minutes for very loaded systems] Signed-off

[PATCH 01/40] tests/avocado: Add a test for a little-endian microblaze machine

2023-12-21 Thread Alex Bennée
From: Thomas Huth We've already got a test for a big endian microblaze machine, but so far we lack one for a little endian machine. Now that the QEMU advent calendar featured such an image, we can test the little endian mode, too. Signed-off-by: Thomas Huth Message-Id: <20231215161851.71508-1-t

[PATCH 2/6] target/riscv: Add new CSR fields for S{sn, mn, m}pm extensions as part of Zjpm v0.8

2023-12-21 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h | 8 target/riscv/cpu_bits.h | 3 +++ target/riscv/cpu_cfg.h | 3 +++ target/riscv/csr.c | 11 +++ target/riscv/machine.c | 6 -- target/riscv/pmp.c | 13 ++--- target/riscv

[PATCH 6/6] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension

2023-12-21 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.c| 9 + target/riscv/cpu_helper.c | 1 + target/riscv/csr.c| 4 target/riscv/machine.c| 1 + target/riscv/pmp.c| 1 + 5 files changed, 16 insertions(+) diff --git a/target/riscv/cpu.c

[PATCH 03/40] gitlab: include microblazeel in testing

2023-12-21 Thread Alex Bennée
This reverts aeb5f8f248e (gitlab: build the correct microblaze target) now we actually have a little-endian test in avocado thanks to this years advent calendar. Signed-off-by: Alex Bennée --- .gitlab-ci.d/buildtest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.git

[PATCH 39/40] contrib/plugins: extend execlog to track register changes

2023-12-21 Thread Alex Bennée
With the new plugin register API we can now track changes to register values. Currently the implementation is fairly dumb which will slow down if a large number of register values are being tracked. This could be improved by only instrumenting instructions which mention registers we are interested

[PATCH 1/6] target/riscv: Remove obsolete pointer masking extension code.

2023-12-21 Thread Alexey Baturo
From: Alexey Baturo Zjpm v0.8 is almost frozen and it's much simplier compared to the existing one: The newer version doesn't allow to specify custom mask or base for masking. Instead it allows only certain options for masking top bits. Signed-off-by: Alexey Baturo --- target/riscv/cpu.c

[PATCH 0/6] Pointer Masking update for Zjpm v0.8

2023-12-21 Thread Alexey Baturo
From: Alexey Baturo Hi all, It looks like Zjpm v0.8 is almost frozen and we don't expect it change drastically anymore. Compared to the original implementation with explicit base and mask CSRs, we now only have several fixed options for number of masked bits which are set using existing CSRs.

[PATCH 37/40] plugins: add an API to read registers

2023-12-21 Thread Alex Bennée
We can only request a list of registers once the vCPU has been initialised so the user needs to use either call the get function on vCPU initialisation or during the translation phase. We don't expose the reg number to the plugin instead hiding it behind an opaque handle. This allows for a bit of

[PATCH 4/6] target/riscv: Add functions to calculate current number of masked bits for pointer masking

2023-12-21 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h| 2 ++ target/riscv/cpu_helper.c | 49 +++ 2 files changed, 51 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 2099168950..9a8e5bc022 100644 --- a/targe

[PATCH 36/40] gdbstub: expose api to find registers

2023-12-21 Thread Alex Bennée
Expose an internal API to QEMU to return all the registers for a vCPU. The list containing the details required to called gdb_read_register(). Based-on: <20231025093128.33116-15-akihiko.od...@daynix.com> Cc: Akihiko Odaki Signed-off-by: Alex Bennée --- v2 - just make gdb_get_register_list ret

[PATCH 3/6] target/riscv: Add pointer masking tb flags

2023-12-21 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo --- target/riscv/cpu.h| 19 +-- target/riscv/cpu_helper.c | 4 target/riscv/translate.c | 10 ++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index

Re: [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Kevin Wolf
Am 21.12.2023 um 02:49 hat Stefan Hajnoczi geschrieben: > NBDClient has a number of fields that are accessed by both the export > AioContext and the main loop thread. When the AioContext lock is removed > these fields will need another form of protection. > > Add NBDClient->lock and protect fields

[PATCH 21/40] hw/riscv: Use misa_mxl instead of misa_mxl_max

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki The effective MXL value matters when booting. Signed-off-by: Akihiko Odaki Message-Id: <20231213-riscv-v7-1-a760156a3...@daynix.com> Signed-off-by: Alex Bennée --- hw/riscv/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/boot.c b/hw/risc

[PATCH 31/40] gdbstub: Simplify XML lookup

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki Now we know all instances of GDBFeature that is used in CPU so we can traverse them to find XML. This removes the need for a CPU-specific lookup function for dynamic XMLs. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20231213-gdb-v17-7-777047380...@day

[PATCH 29/40] gdbstub: Use GDBFeature for GDBRegisterState

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki Simplify GDBRegisterState by replacing num_regs and xml members with one member that points to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20231213-gdb-v17-5-777047380...@daynix.com> Signed-off-by: Alex Bennée --- gdbstub/gdbstub.c | 14

[PATCH 25/40] target/arm: Use GDBFeature for dynamic XML

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Acked-by: Richard Henderson Message-Id: <20231213-gdb-v17-1-77704738

[PATCH 23/40] target/riscv: Move misa_mxl_max to class

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki misa_mxl_max is common for all instances of a RISC-V CPU class so they are better put into class. Signed-off-by: Akihiko Odaki Message-Id: <20231213-riscv-v7-3-a760156a3...@daynix.com> Signed-off-by: Alex Bennée --- target/riscv/cpu.h | 4 +- target/riscv/cpu.c

[PATCH 16/40] tests/qtest: Bump the device-introspect-test timeout to 12 minutes

2023-12-21 Thread Alex Bennée
From: Thomas Huth When running the test in slow mode on a very loaded system with the arm/aarch64 target and with --enable-debug, it can take longer than 10 minutes to finish the introspection test. Bump the timeout to twelve minutes to make sure that it also finishes in such situations. Signed-

[PATCH 22/40] target/riscv: Remove misa_mxl validation

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki It is initialized with a simple assignment and there is little room for error. In fact, the validation is even more complex. Signed-off-by: Akihiko Odaki Acked-by: LIU Zhiwei Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis Message-Id: <20231213-riscv-v7-2-

[PATCH 24/40] target/riscv: Validate misa_mxl_max only once

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki misa_mxl_max is now a class member and initialized only once for each class. This also moves the initialization of gdb_core_xml_file which will be referenced before realization in the future. Signed-off-by: Akihiko Odaki Message-Id: <20231213-riscv-v7-4-a760156a3...@daynix.c

[PATCH 20/40] mtest2make: stop disabling meson test timeouts

2023-12-21 Thread Alex Bennée
From: Daniel P. Berrangé The mtest2make.py script passes the arg '-t 0' to 'meson test' which disables all test timeouts. This is a major source of pain when running in GitLab CI and a test gets stuck. It will stall until GitLab kills the CI job. This leaves us with little easily consumable infor

[PATCH 18/40] tests/unit: Bump test-crypto-block test timeout to 5 minutes

2023-12-21 Thread Alex Bennée
From: Thomas Huth When running the tests in slow mode on a very loaded system and with --enable-debug, the test-crypto-block can take longer than 4 minutes. Bump the timeout to 5 minutes to make sure that it also passes in such situations. Signed-off-by: Thomas Huth Message-Id: <20231215070357.

[PATCH 26/40] target/ppc: Use GDBFeature for dynamic XML

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Reviewed-by: Richard Henderson Message-Id: <20231213-gdb-v17-2-77704

[PATCH 27/40] target/riscv: Use GDBFeature for dynamic XML

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki In preparation for a change to use GDBFeature as a parameter of gdb_register_coprocessor(), convert the internal representation of dynamic feature from plain XML to GDBFeature. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-3-777047380...@daynix.com> Signed-off-b

[PATCH 28/40] gdbstub: Use GDBFeature for gdb_register_coprocessor

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki This is a tree-wide change to introduce GDBFeature parameter to gdb_register_coprocessor(). The new parameter just replaces num_regs and xml parameters for now. GDBFeature will be utilized to simplify XML lookup in a following change. Signed-off-by: Akihiko Odaki Acked-by: A

[PATCH 17/40] tests/unit: Bump test-aio-multithread test timeout to 2 minutes

2023-12-21 Thread Alex Bennée
From: Thomas Huth When running the tests in slow mode on a very loaded system and with --enable-debug, the test-aio-multithread can take longer than 1 minute. Bump the timeout to two minutes to make sure that it also passes in such situations. Signed-off-by: Thomas Huth Message-Id: <20231215070

[PATCH 33/40] hw/core/cpu: Remove gdb_get_dynamic_xml member

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki This function is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée Message-Id: <20231213-gdb-v17-9-777047380...@daynix.com> Signed-off-by: Alex Bennée --- include/hw/core/cpu.h | 4 target/arm/cpu.h | 6 -- target/ppc/cpu.h | 1 -

[PATCH 35/40] plugins: Use different helpers when reading registers

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki This avoids optimizations incompatible when reading registers. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-12-777047380...@daynix.com> Signed-off-by: Alex Bennée --- accel/tcg/plugin-helpers.h | 3 ++- include/qemu/plugin.h | 1 + accel/tcg/plugin-gen

[PATCH 34/40] gdbstub: Add members to identify registers to GDBFeature

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki These members will be used to help plugins to identify registers. The added members in instances of GDBFeature dynamically generated by CPUs will be filled in later changes. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-10-777047380...@daynix.com> Signed-off-by:

[PATCH 32/40] gdbstub: Infer number of core registers from XML

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki GDBFeature has the num_regs member so use it where applicable to remove magic numbers. Signed-off-by: Akihiko Odaki Message-Id: <20231213-gdb-v17-8-777047380...@daynix.com> Signed-off-by: Alex Bennée --- include/hw/core/cpu.h | 3 ++- target/s390x/cpu.h | 2 -- gdbs

[PATCH 30/40] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb

2023-12-21 Thread Alex Bennée
From: Akihiko Odaki Align the parameters of gdb_get_reg_cb and gdb_set_reg_cb with the gdb_read_register and gdb_write_register members of CPUClass to allow to unify the logic to access registers of the core and coprocessors in the future. Signed-off-by: Akihiko Odaki Reviewed-by: Alex Bennée

Re: [PATCH v3 52/70] i386/tdx: handle TDG.VP.VMCALL

2023-12-21 Thread Daniel P . Berrangé
On Wed, Nov 15, 2023 at 02:15:01AM -0500, Xiaoyao Li wrote: > From: Isaku Yamahata > > For GetQuote, delegate a request to Quote Generation Service. > Add property "quote-generation-socket" to tdx-guest, whihc is a property > of type SocketAddress to specify Quote Generation Service(QGS). > > On

virtio-pci in qemu-system-arm is broken in 8.2

2023-12-21 Thread Michael Tokarev
It looks like virtio-pci is entirely broke in qemu-system-arm, at least in tcg mode running on x86. The guest (current linux system) just does not detect any virtio-pci devices at all. When 8.1 is booting, the following messages are displayed (debian initramfs): Loading, please wait... Starting

[PATCH v3 07/14] vdpa: move iotlb_batch_begin_sent to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 05/14] vdpa: use vdpa shared for tracing

2023-12-21 Thread Eugenio Pérez
By the end of this series dma_map and dma_unmap functions don't have the vdpa device for tracing. Movinge trace function to shared member one. Print it also in the vdpa initialization so log reader can relate them. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c |

[PATCH v3 01/14] vdpa: add VhostVDPAShared

2023-12-21 Thread Eugenio Pérez
It will hold properties shared among all vhost_vdpa instances associated with of the same device. For example, we just need one iova_tree or one memory listener for the entire device. Next patches will register the vhost_vdpa memory listener at the beginning of the VM migration at the destination

[PATCH v3 03/14] vdpa: move iova_range to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

Re: [PATCH v3 06/70] kvm: Introduce support for memory_attributes

2023-12-21 Thread Xiaoyao Li
On 12/21/2023 6:36 PM, Wang, Wei W wrote: On Thursday, December 21, 2023 2:11 PM, Li, Xiaoyao wrote: On 12/12/2023 9:56 PM, Wang, Wei W wrote: On Wednesday, November 15, 2023 3:14 PM, Xiaoyao Li wrote: Introduce the helper functions to set the attributes of a range of memory to private or shar

[PATCH v3 12/14] vdpa: use dev_shared in vdpa_iommu

2023-12-21 Thread Eugenio Pérez
The memory listener functions can call these too. Make vdpa_iommu work with VhostVDPAShared. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 2 +- hw/virtio/vhost-vdpa.c | 16 2 files changed, 9 insertions(+), 9 deletions(-) dif

[PATCH v3 11/14] vdpa: use VhostVDPAShared in vdpa_dma_map and unmap

2023-12-21 Thread Eugenio Pérez
The callers only have the shared information by the end of this series. Start converting this functions. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 4 +-- hw/virtio/vhost-vdpa.c | 50 +- net/vhost-vdpa.c

[PATCH v3 04/14] vdpa: move shadow_data to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 06/14] vdpa: move file descriptor to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 02/14] vdpa: move iova tree to the shared struct

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 00/14] Consolidate common vdpa members in VhostVDPAShared

2023-12-21 Thread Eugenio Pérez
Current memory operations like pinning may take a lot of time at the destination. Currently they are done after the source of the migration is stopped, and before the workload is resumed at the destination. This is a period where neigher traffic can flow, nor the VM workload can continue (downtim

[PATCH v3 14/14] vdpa: move memory listener to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 08/14] vdpa: move backend_cap to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

[PATCH v3 13/14] vdpa: factor out vhost_vdpa_last_dev

2023-12-21 Thread Eugenio Pérez
From: Si-Wei Liu Generalize duplicated condition check for the last vq of vdpa device to a common function. This is used in next patches. Signed-off-by: Si-Wei Liu Reviewed-by: Eugenio Pérez --- v3: Cherry-picked from Si-Wei's series --- hw/virtio/vhost-vdpa.c | 9 +++-- 1 file changed,

[PATCH v3 09/14] vdpa: remove msg type of vhost_vdpa

2023-12-21 Thread Eugenio Pérez
It is always VHOST_IOTLB_MSG_V2. We can always make it back per vhost_dev if needed. This change makes easier for vhost_vdpa_map and unmap not to depend on vhost_vdpa but only in VhostVDPAShared. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 1 - hw/vir

[PATCH v3 10/14] vdpa: move iommu_list to vhost_vdpa_shared

2023-12-21 Thread Eugenio Pérez
Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination QEMU is unaware of which vhost_vdpa device will re

Re: [PATCH 6/6] nbd/server: introduce NBDClient->lock to protect fields

2023-12-21 Thread Stefan Hajnoczi
On Thu, Dec 21, 2023 at 08:26:58AM +0100, Paolo Bonzini wrote: > On 12/21/23 02:49, Stefan Hajnoczi wrote: > > nbd_client_receive_next_request(client); > > + > > +qemu_mutex_unlock(&client->lock); > > + > > if (ret == -EIO) { > > goto disconnect; > > } > > I think I

Re: [PATCH RFC] linux-user: Allow gdbstub to ignore page protection

2023-12-21 Thread Ilya Leoshkevich
On Thu, Dec 21, 2023 at 10:33:51AM +1100, Richard Henderson wrote: > On 12/16/23 10:24, Ilya Leoshkevich wrote: > > @@ -377,22 +379,42 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, > > flags = page_get_flags(page); > > if (!(flags & PAGE_VALID)) > > return

[PATCH] hw/m68k/mcf5206: Embed m5206_timer_state in m5206_mbar_state

2023-12-21 Thread Thomas Huth
There's no need to explicitely allocate the memory here, we can simply embed it into the m5206_mbar_state instead. Signed-off-by: Thomas Huth --- hw/m68k/mcf5206.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c inde

Re: [PATCH v4 1/4] qdev-properties: alias all object class properties

2023-12-21 Thread Kevin Wolf
Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > qdev_alias_all_properties() aliases a DeviceState's qdev properties onto > an Object. This is used for VirtioPCIProxy types so that --device > virtio-blk-pci has properties of its embedded --device virtio-blk-device > object. > > Currently

Re: [PATCH v4 4/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-21 Thread Kevin Wolf
Am 20.12.2023 um 14:47 hat Stefan Hajnoczi geschrieben: > Add the iothread-vq-mapping parameter to assign virtqueues to IOThreads. > Store the vq:AioContext mapping in the new struct > VirtIOBlockDataPlane->vq_aio_context[] field and refactor the code to > use the per-vq AioContext instead of the B

  1   2   3   >