Re: [PATCH] hw/nvme: Add iothread support

2022-08-26 Thread Klaus Jensen
On Jul 20 17:00, Jinhao Fan wrote: > Add an option "iothread=x" to do emulation in a seperate iothread. > This improves the performance because QEMU's main loop is responsible > for a lot of other work while iothread is dedicated to NVMe emulation. > Moreover, emulating in iothread brings the poten

Re: slirp: Can I get IPv6-only DHCP working?

2022-08-26 Thread Thomas Huth
On 26/08/2022 01.15, Peter Delevoryas wrote: On Fri, Aug 26, 2022 at 12:56:10AM +0200, Samuel Thibault wrote: Hello, Peter Delevoryas, le jeu. 25 août 2022 15:38:53 -0700, a ecrit: It seems like there's support for an IPv6 dns proxy, and there's literally a file called "dhcpv6.c" in slirp, but

Re: [PATCH 15/20] disas/nanomips: Replace exception handling

2022-08-26 Thread Milica Lazarevic
Any comments on this patch? From: Milica Lazarevic Sent: Monday, August 15, 2022 9:31 AM To: th...@redhat.com Cc: qemu-devel@nongnu.org ; cfont...@suse.de ; berra...@redhat.com ; pbonz...@redhat.com ; vince.delvecc...@mediatek.com ; richard.hender...@linaro.org

Re: [PATCH] gitlab-ci: Only use one process in Windows jobs for compilation

2022-08-26 Thread Bin Meng
On Fri, Aug 26, 2022 at 3:33 AM Thomas Huth wrote: > > The Windows jobs are currently aborting at weird places - and > there's the suspicion that it's due to memory constraints in > the Windows containers. Let's switch to single-threaded compilation > to decrease the pressure on the memory load, a

Re: [PATCH] hw/nvme: Add iothread support

2022-08-26 Thread Jinhao Fan
Sure. I’ve already reworked this iothread patch upon the new irqfd patch. I think I can post a v2 patch today. Do you mean I include irqfd v3 in the new iothread patch series? 发自我的iPhone > 在 2022年8月26日,15:12,Klaus Jensen 写道: > > On Jul 20 17:00, Jinhao Fan wrote: >> Add an option "iothread=x

Re: [PATCH] chardev: fix segfault in finalize

2022-08-26 Thread Marc-André Lureau
Hi On Thu, Aug 25, 2022 at 9:02 PM Maksim Davydov wrote: > If finalize chardev-msmouse or chardev-wctable is called immediately after > init it cases QEMU to crash with segfault. This happens because of > QTAILQ_REMOVE in qemu_input_handler_unregister tries to dereference > NULL pointer. > For

Re: [PATCH 4/5] virtio-net: Update virtio-net curr_queue_pairs in vdpa backends

2022-08-26 Thread Eugenio Perez Martin
On Fri, Aug 26, 2022 at 6:29 AM Si-Wei Liu wrote: > > > > On 8/24/2022 11:19 PM, Eugenio Perez Martin wrote: > > On Thu, Aug 25, 2022 at 2:38 AM Si-Wei Liu wrote: > >> > >> > >> On 8/23/2022 9:27 PM, Jason Wang wrote: > >>> 在 2022/8/20 01:13, Eugenio Pérez 写道: > It was returned as error befo

Re: [PATCH] hw/nvme: Add iothread support

2022-08-26 Thread Klaus Jensen
On Aug 26 16:15, Jinhao Fan wrote: > Sure. I’ve already reworked this iothread patch upon the new irqfd > patch. I think I can post a v2 patch today. Do you mean I include > irqfd v3 in the new iothread patch series? > Yes, please include irqfd-v3 in the series. signature.asc Description: PGP s

Re: [PATCH 0/7] configure: fix misc shellcheck warnings

2022-08-26 Thread Marc-André Lureau
Hi On Thu, Aug 25, 2022 at 7:09 PM Peter Maydell wrote: > Currently if you run shellcheck on our configure script it > generates a ton of warnings. This patchset fixes some of the > easier ones. I wasn't aiming for completeness or consistency; > I just wanted to zap some of the ones where the fi

Re: [PATCH v2 1/1] virtio-gpu: CONTEXT_INIT feature

2022-08-26 Thread Marc-André Lureau
Hi On Thu, Aug 25, 2022 at 8:10 PM Antonio Caggiano < antonio.caggi...@collabora.com> wrote: > Create virgl renderer context with flags using context_id when valid. > > v2: > - The feature can be enabled via the context_init config option. > - A warning message will be emitted and the feature wil

Re: [PATCH v1 20/40] i386/tdvf: Introduce function to parse TDVF metadata

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:30PM +0800, Xiaoyao Li wrote: > From: Isaku Yamahata > > TDX VM needs to boot with its specialized firmware, Trusted Domain > Virtual Firmware (TDVF). QEMU needs to parse TDVF and map it in TD > guest memory prior to running the TDX VM. > > A TDVF Metadata in TDVF i

RE: [PATCH v5 1/2] Update AVX512 support for xbzrle_encode_buffer

2022-08-26 Thread Xu, Ling1
Hi, juan, Thanks for your time and suggestions on this patch. We have revised our code according to your nice comments. We will submit patch v6 to update these modifications. Best Regards Ling -Original Message- From: Juan Quintela Sent: Wednesday, August 24, 2022 4:42 PM To: X

Re: [PATCH v1 22/40] i386/tdx: Skip BIOS shadowing setup

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:32PM +0800, Xiaoyao Li wrote: > TDX doesn't support map different GPAs to same private memory. Thus, > aliasing top 128KB of BIOS as isa-bios is not supported. > > On the other hand, TDX guest cannot go to real mode, it can work fine > without isa-bios. > > Signed-of

Re: [PATCH v1 26/40] headers: Add definitions from UEFI spec for volumes, resources, etc...

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:36PM +0800, Xiaoyao Li wrote: > Add UEFI definitions for literals, enums, structs, GUIDs, etc... that > will be used by TDX to build the UEFI Hand-Off Block (HOB) that is passed > to the Trusted Domain Virtual Firmware (TDVF). > > All values come from the UEFI specifi

Re: [PATCH v1 25/40] i386/tdx: Track RAM entries for TDX VM

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:35PM +0800, Xiaoyao Li wrote: > The RAM of TDX VM can be classified into two types: > > - TDX_RAM_UNACCEPTED: default type of TDX memory, which needs to be >accepted by TDX guest before it can be used and will be all-zeros >after being accepted. > > - TDX_R

Re: [PATCH 1/2] dump: simplify a bit kdump get_next_page()

2022-08-26 Thread David Hildenbrand
On 25.08.22 15:21, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > This should be functionally equivalent, but slightly easier to read, > with simplified paths and checks at the end of the function. > > The following patch is a major rewrite to get rid of the assert(). > > Sign

[PATCH v1 1/2] hw/loongarch: Support memory hotplug

2022-08-26 Thread Xiaojuan Yang
Add hotplug/unplug interface for memory device. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig | 2 + hw/loongarch/acpi-build.c | 32 +--- hw/loongarch/virt.c | 105 +- 3 files changed, 132 insertions(+), 7 deletions(-) diff --git

[PATCH v1 2/2] hw/loongarch: Improve acpi dsdt table

2022-08-26 Thread Xiaojuan Yang
Cleanup the previous pci information in acpi dsdt table. And using the common acpi_dsdt_add_gpex function to build the gpex and pci information. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 159 +--- hw/loongarch/virt.c | 1 + include/h

[PATCH v1 0/2] Add mem hotplug and improve acpi dsdt

2022-08-26 Thread Xiaojuan Yang
This series based on the 'Add funtions for LoongArch virt machine patch'(11 Aug) and 'Fix acpi ged irq number in dsdt table patch'(19 Aug). Changes for v1: 1.Support memory hotplug 2.Improve acpi dsdt table Xiaojuan Yang (2): hw/loongarch: Support memory hotplug hw/loongarch: Improve acpi dsd

[PATCH v6 0/2] This patch updates AVX512 support for xbzrle

2022-08-26 Thread ling xu
This patch updates code of avx512 support for xbzrle_encode_buffer function. We modified code of algorithm and check of avx512. Besides, we provide benchmark in xbzrle-bench.c for performance comparison. Signed-off-by: ling xu Co-authored-by: Zhou Zhao Co-authored-by: Jun Jin ling xu (2): U

[PATCH v6 1/2] Update AVX512 support for xbzrle_encode_buffer

2022-08-26 Thread ling xu
This commit updates code of avx512 support for xbzrle_encode_buffer function to accelerate xbzrle encoding speed. Runtime check of avx512 support and benchmark for this feature are added. Compared with C version of xbzrle_encode_buffer function, avx512 version can achieve 50%-70% performance improv

Re: [PATCH 1/2] dump: simplify a bit kdump get_next_page()

2022-08-26 Thread David Hildenbrand
On 26.08.22 11:56, Marc-André Lureau wrote: > Hi > > On Fri, Aug 26, 2022 at 1:45 PM David Hildenbrand wrote: >> >> On 25.08.22 15:21, marcandre.lur...@redhat.com wrote: >>> From: Marc-André Lureau >>> >>> This should be functionally equivalent, but slightly easier to read, >>> with simplified p

Re: [PATCH 2/2] dump: fix kdump to work over non-aligned blocks

2022-08-26 Thread David Hildenbrand
On 25.08.22 15:21, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Rewrite get_next_page() to work over non-aligned blocks. When it > encounters non aligned addresses, it will allocate a zero-page and try > to fill it. Could we simplify by using one global helper page (or caller

Re: [PATCH 1/2] dump: simplify a bit kdump get_next_page()

2022-08-26 Thread Marc-André Lureau
Hi On Fri, Aug 26, 2022 at 1:45 PM David Hildenbrand wrote: > > On 25.08.22 15:21, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > This should be functionally equivalent, but slightly easier to read, > > with simplified paths and checks at the end of the function. > > > >

[PATCH v6 2/2] Unit test code and benchmark code

2022-08-26 Thread ling xu
Unit test code is in test-xbzrle.c, and benchmark code is in xbzrle-bench.c for performance benchmarking. Signed-off-by: ling xu Co-authored-by: Zhou Zhao Co-authored-by: Jun Jin --- tests/bench/meson.build| 4 + tests/bench/xbzrle-bench.c | 465 + tes

Re: [PATCH 2/2] dump: fix kdump to work over non-aligned blocks

2022-08-26 Thread Marc-André Lureau
Hi On Fri, Aug 26, 2022 at 2:01 PM David Hildenbrand wrote: > On 25.08.22 15:21, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Rewrite get_next_page() to work over non-aligned blocks. When it > > encounters non aligned addresses, it will allocate a zero-page and try >

Re: [PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents()

2022-08-26 Thread Christian Schoenebeck
On Mittwoch, 24. August 2022 11:39:47 CEST Bin Meng wrote: > From: Bin Meng > > Use the same g_mkdir_with_parents() call to create a directory on > all platforms. The same would be g_mkdir(), not g_mkdir_with_parents(), so please use that instead. > Signed-off-by: Bin Meng > --- > > fsdev/v

Re: [PATCH 2/2] dump: fix kdump to work over non-aligned blocks

2022-08-26 Thread David Hildenbrand
On 26.08.22 12:02, Marc-André Lureau wrote: > Hi > > > On Fri, Aug 26, 2022 at 2:01 PM David Hildenbrand > wrote: > > On 25.08.22 15:21, marcandre.lur...@redhat.com > wrote: > > From: Marc-André Lureau

Re: [PATCH 2/2] dump: fix kdump to work over non-aligned blocks

2022-08-26 Thread David Hildenbrand
On 26.08.22 12:07, David Hildenbrand wrote: > On 26.08.22 12:02, Marc-André Lureau wrote: >> Hi >> >> >> On Fri, Aug 26, 2022 at 2:01 PM David Hildenbrand > > wrote: >> >> On 25.08.22 15:21, marcandre.lur...@redhat.com >> wrote:

[PATCH v3 1/1] virtio-gpu: CONTEXT_INIT feature

2022-08-26 Thread Antonio Caggiano
Create virgl renderer context with flags using context_id when valid. v2: - The feature can be enabled via the context_init config option. - A warning message will be emitted and the feature will not be used when linking with virglrenderer versions without context_init support. v3: Define HAVE_

[PATCH v3 0/1] virtio-gpu: CONTEXT_INIT feature

2022-08-26 Thread Antonio Caggiano
This is a different attempt at upstreaming the work I have been doing to enable support for the Venus Virtio-GPU Vulkan driver. I believe the previous one [0] was a bit too much stuff in one place, therefore with this I would like to try a more fine-grained approach. I will just start by the CONT

Re: [PATCH v3 1/1] virtio-gpu: CONTEXT_INIT feature

2022-08-26 Thread Marc-André Lureau
Hi On Fri, Aug 26, 2022 at 2:12 PM Antonio Caggiano < antonio.caggi...@collabora.com> wrote: > Create virgl renderer context with flags using context_id when valid. > > v2: > - The feature can be enabled via the context_init config option. > - A warning message will be emitted and the feature wil

Re: [PATCH v7 1/2] target/s390x: support SHA-512 extensions

2022-08-26 Thread Thomas Huth
Finally, I'm also having some spare minutes to have a look on this ... First, thank you for your work here, it's very appreciated! Some more comments inline below (mostly cosmetics since I'm not very much into this crypto stuff)... On 09/08/2022 17.03, Jason A. Donenfeld wrote: In order to

Re: [PATCH v1 27/40] i386/tdx: Setup the TD HOB list

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:37PM +0800, Xiaoyao Li wrote: > The TD HOB list is used to pass the information from VMM to TDVF. The TD > HOB must include PHIT HOB and Resource Descriptor HOB. More details can > be found in TDVF specification and PI specification. > > Build the TD HOB in TDX's mach

Re: [PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents()

2022-08-26 Thread Bin Meng
On Fri, Aug 26, 2022 at 6:09 PM Christian Schoenebeck wrote: > > On Mittwoch, 24. August 2022 11:39:47 CEST Bin Meng wrote: > > From: Bin Meng > > > > Use the same g_mkdir_with_parents() call to create a directory on > > all platforms. > > The same would be g_mkdir(), not g_mkdir_with_parents(),

Re: [PATCH v1 36/40] i386/tdx: Don't synchronize guest tsc for TDs

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:46PM +0800, Xiaoyao Li wrote: > From: Isaku Yamahata > > TSC of TDs is not accessible and KVM doesn't allow access of > MSR_IA32_TSC for TDs. To avoid the assert() in kvm_get_tsc, make > kvm_synchronize_all_tsc() noop for TDs, > > Signed-off-by: Isaku Yamahata > Re

Re: [PATCH v1 38/40] i386/tdx: Skip kvm_put_apicbase() for TDs

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:48PM +0800, Xiaoyao Li wrote: > KVM doesn't allow wirting to MSR_IA32_APICBASE for TDs. > > Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann

Re: [PATCH v1 34/40] hw/i386: add eoi_intercept_unsupported member to X86MachineState

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:44PM +0800, Xiaoyao Li wrote: > Add a new bool member, eoi_intercept_unsupported, to X86MachineState > with default value false. Set true for TDX VM. > > Inability to intercept eoi causes impossibility to emulate level > triggered interrupt to be re-injected when leve

Re: [PATCH v1 39/40] i386/tdx: Don't get/put guest state for TDX VMs

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:49PM +0800, Xiaoyao Li wrote: > From: Sean Christopherson > > Don't get/put state of TDX VMs since accessing/mutating guest state of > production TDs is not supported. > > Note, it will be allowed for a debug TD. Corresponding support will be > introduced when debug

Re: [PATCH v1 35/40] hw/i386: add option to forcibly report edge trigger in acpi tables

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:45PM +0800, Xiaoyao Li wrote: > From: Isaku Yamahata > > When level trigger isn't supported on x86 platform, > forcibly report edge trigger in acpi tables. > > Signed-off-by: Isaku Yamahata > Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann

Re: [PATCH v1 40/40] docs: Add TDX documentation

2022-08-26 Thread Gerd Hoffmann
On Tue, Aug 02, 2022 at 03:47:50PM +0800, Xiaoyao Li wrote: > Add docs/system/i386/tdx.rst for TDX support, and add tdx in > confidential-guest-support.rst > > Signed-off-by: Xiaoyao Li Acked-by: Gerd Hoffmann

Re: [PATCH 34/51] tests/qtest: bios-tables-test: Adapt the case for win32

2022-08-26 Thread Bin Meng
On Wed, Aug 24, 2022 at 8:42 PM Ani Sinha wrote: > > > > On Wed, 24 Aug 2022, Bin Meng wrote: > > > From: Bin Meng > > > > Single quotes in the arguments (oem_id='CRASH ') are not removed in > > the Windows environment before it is passed to the QEMU executable. > > The space in the argument caus

Re: [PATCH v3 1/1] virtio-gpu: CONTEXT_INIT feature

2022-08-26 Thread Antonio Caggiano
Hi Marc-André, On 26/08/2022 12:16, Marc-André Lureau wrote: Hi On Fri, Aug 26, 2022 at 2:12 PM Antonio Caggiano mailto:antonio.caggi...@collabora.com>> wrote: Create virgl renderer context with flags using context_id when valid. v2: - The feature can be enabled via the context

[PATCH v4 1/1] virtio-gpu: CONTEXT_INIT feature

2022-08-26 Thread Antonio Caggiano
Create virgl renderer context with flags using context_id when valid. v2: - The feature can be enabled via the context_init config option. - A warning message will be emitted and the feature will not be used when linking with virglrenderer versions without context_init support. v3: Define HAVE_

[PATCH v4 0/1] virtio-gpu: CONTEXT_INIT feature

2022-08-26 Thread Antonio Caggiano
This is a different attempt at upstreaming the work I have been doing to enable support for the Venus Virtio-GPU Vulkan driver. I believe the previous one [0] was a bit too much stuff in one place, therefore with this I would like to try a more fine-grained approach. I will just start by the CONT

Re: [PATCH 37/51] tests/qtest: migration-test: Disable IO redirection for win32

2022-08-26 Thread Bin Meng
On Thu, Aug 25, 2022 at 2:53 AM Dr. David Alan Gilbert wrote: > > * Bin Meng (bmeng...@gmail.com) wrote: > > From: Bin Meng > > > > On Windows the QEMU executable is created via CreateProcess() and IO > > redirection does not work, so we need to set MigrateStart::hide_stderr > > to false to disab

Re: [PATCH v3 1/1] virtio-gpu: CONTEXT_INIT feature

2022-08-26 Thread Marc-André Lureau
Hi On Fri, Aug 26, 2022 at 2:45 PM Antonio Caggiano < antonio.caggi...@collabora.com> wrote: > Hi Marc-André, > > On 26/08/2022 12:16, Marc-André Lureau wrote: > > Hi > > > > On Fri, Aug 26, 2022 at 2:12 PM Antonio Caggiano > > mailto:antonio.caggi...@collabora.com>> > > > wrote: > > > > Crea

[PATCH 0/8] Support VIRTIO_F_RING_RESET for vhost-user in virtio pci-modern

2022-08-26 Thread Kangjie Xu
This patch set is based on the patch set that supports VIRTIO_F_RING_RESET for vhost-kernel: https://lore.kernel.org/qemu-devel/cover.1661414345.git.kangjie...@linux.alibaba.com/T/ The virtio queue reset function has already been defined in the virtio spec 1.2. The relevant virtio spec infor

[PATCH 1/8] docs: vhost-user: add VHOST_USER_RESET_VRING message

2022-08-26 Thread Kangjie Xu
To support the reset operation for an individual virtqueue, we introduce a new message VHOST_USER_RESET_VRING. This message is submitted by the front-end to reset an individual virtqueue to initial states in the back-end. The reply is needed to ensure that the reset operation is complete. Signed-o

[PATCH 3/8] vhost-user: add op to enable or disable a single vring

2022-08-26 Thread Kangjie Xu
There is only vhost_set_dev_enable op in VhostOps. Thus, we introduce the interface vhost_set_vring_enable to set the enable status for a single vring. Resetting a single vq will rely on this interface. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/vhost-user.c|

[PATCH 8/8] vhost: vhost-user: enable vq reset feature

2022-08-26 Thread Kangjie Xu
Add virtqueue reset feature for vhost-user. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 13b9c11e68..745cb4375b 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c

[PATCH 2/8] net: virtio: rename vhost_set_vring_enable to vhost_set_dev_enable

2022-08-26 Thread Kangjie Xu
Previously, vhost_set_vring_enable will enable/disable all vrings in a device, which causes ambiguity. So we rename it to vhost_set_dev_enable. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- backends/cryptodev-vhost.c| 12 ++-- hw/net/vhost_net-stub.c | 2 +-

[PATCH 5/8] vhost-net: vhost-user: update vhost_net_virtqueue_reset()

2022-08-26 Thread Kangjie Xu
Update vhost_net_virtqueue_reset() for vhost-user scenario. In order to reuse some functions, we process the idx for vhost-user scenario because vhost_get_vq_index behave differently for vhost-user. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 13 +++-- 1

[PATCH 7/8] virtio-net: vhost-user: update queue_reset and queue_enable

2022-08-26 Thread Kangjie Xu
Update virtio_net_queue_reset() and virtio_net_queue_enable() for vhost-user scenario. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/virtio-net.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 6ab796b399.

[PATCH 4/8] vhost-user: introduce vhost_reset_vring() interface

2022-08-26 Thread Kangjie Xu
Introduce the interface vhost_reset_vring(). The interface is a wrapper to send a VHOST_USER_RESET_VRING message to the back-end. It will reset an individual vring in the back-end. Meanwhile, it will wait for a reply to ensure the reset has been completed. Signed-off-by: Kangjie Xu Signed-off-by:

[PATCH 6/8] vhost-net: vhost-user: update vhost_net_virtqueue_restart()

2022-08-26 Thread Kangjie Xu
Update vhost_net_virtqueue_restart() for vhost-user scenario. In order to reuse some functions, we process the idx for vhost-user case. It is because vhost_get_vq_index behave differently in vhost-user. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 12

[PATCH] KVM: dirty ring: add missing memory barrier

2022-08-26 Thread Paolo Bonzini
The KVM_DIRTY_GFN_F_DIRTY flag ensures that the entry is valid. If the read of the fields are not ordered after the read of the flag, QEMU might see stale values. Cc: Peter Xu Cc: Gavin Shan Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents()

2022-08-26 Thread Christian Schoenebeck
On Freitag, 26. August 2022 12:30:20 CEST Bin Meng wrote: > On Fri, Aug 26, 2022 at 6:09 PM Christian Schoenebeck > > wrote: > > On Mittwoch, 24. August 2022 11:39:47 CEST Bin Meng wrote: > > > From: Bin Meng > > > > > > Use the same g_mkdir_with_parents() call to create a directory on > > > al

[PATCH 0/3] iothread and irqfd support

2022-08-26 Thread Jinhao Fan
This patch series adds support for using a seperate iothread for NVMe IO emulation, which brings the potential of applying polling. The first two patches implements support for irqfd, which solves thread safety problems for interrupt emulation outside the main loop thread. Jinhao Fan (3): hw/nvm

Re: [PATCH 50/51] .gitlab-ci.d/windows.yml: Increase the timeout to the runner limit

2022-08-26 Thread Bin Meng
On Thu, Aug 25, 2022 at 4:18 PM Thomas Huth wrote: > > On 24/08/2022 11.40, Bin Meng wrote: > > From: Bin Meng > > > > commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using > > --without-default-devices" > > changed to compile QEMU with the --without-default-devices switch for >

Re: [PATCH 50/51] .gitlab-ci.d/windows.yml: Increase the timeout to the runner limit

2022-08-26 Thread Daniel P . Berrangé
On Thu, Aug 25, 2022 at 10:18:06AM +0200, Thomas Huth wrote: > On 24/08/2022 11.40, Bin Meng wrote: > > From: Bin Meng > > > > commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using > > --without-default-devices" > > changed to compile QEMU with the --without-default-devices swit

[PATCH] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by defualt

2022-08-26 Thread Daniel P . Berrangé
The 'qemu64' CPU model implements the least featureful x86_64 CPU that's possible. Historically this hasn't been an issue since it was rare for OS distros to build with a higher mandatory CPU baseline. With RHEL-9, however, the entire distro is built for the x86_64-v2 ABI baseline: https://dev

[PATCH] tests/x86: Add 'q35' machine type to hotplug tests

2022-08-26 Thread Michael Labiuk via
Add pci bridge setting to run hotplug tests on q35 machine type. Hotplug tests was bounded to 'pc' machine type by commit 7b172333f1b Signed-off-by: Michael Labiuk --- tests/qtest/device-plug-test.c | 26 ++ tests/qtest/drive_del-test.c | 111 + tests/qtest/hd-geo-

[PATCH 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-26 Thread Jinhao Fan
When the new option 'irq-eventfd' is turned on, the IO emulation code signals an eventfd when it want to (de)assert an irq. The main loop eventfd handler does the actual irq (de)assertion. This paves the way for iothread support since QEMU's interrupt emulation is not thread safe. Asserting and d

[PATCH 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Jinhao Fan
Use KVM's irqfd to send interrupts when possible. This approach is thread safe. Moreover, it does not have the inter-thread communication overhead of plain event notifiers since handler callback are called in the same system call as irqfd write. Signed-off-by: Jinhao Fan Signed-off-by: Klaus Jens

Re: [PATCH v7 2/2] target/s390x: support PRNO_TRNG instruction

2022-08-26 Thread Thomas Huth
On 09/08/2022 17.03, Jason A. Donenfeld wrote: In order for hosts running inside of TCG to initialize the kernel's random number generator, we should support the PRNO_TRNG instruction, backed in the usual way with the qemu_guest_getrandom helper. This is confirmed working on Linux 5.19. Cc: Thom

Re: [PATCH v2 0/3] Fix hugepages with memfd on s390x and clean up related code

2022-08-26 Thread Thomas Huth
On 10/08/2022 14.57, Thomas Huth wrote: The first patch fixes the problem that hugepages cannot be used via the "memory-backend-memfd" object on s390x. The second and third patch are some clean-ups that can be done after generalizing the code in the first patch. v2: - Use qemu_ram_pagesize(mem

[PATCH 3/3] hw/nvme: add iothread support

2022-08-26 Thread Jinhao Fan
Add an option "iothread=x" to do emulation in a seperate iothread. This improves the performance because QEMU's main loop is responsible for a lot of other work while iothread is dedicated to NVMe emulation. Moreover, emulating in iothread brings the potential of polling on SQ/CQ doorbells, which I

Re: [PATCH] fw_cfg: Don't set callback_opaque NULL in fw_cfg_modify_bytes_read()

2022-08-26 Thread Laszlo Ersek
On 08/25/22 18:18, Shameer Kolothum wrote: > Hi > > On arm/virt platform, Chen Xiang reported a Guest crash while > attempting the below steps, > > 1. Launch the Guest with nvdimm=on > 2. Hot-add a NVDIMM dev > 3. Reboot > 4. Guest boots fine. > 5. Reboot again. > 6. Guest boot fails. > > QEMU_E

Re: [PATCH 07/18] i386: Rewrite simple integer vector helpers

2022-08-26 Thread Paolo Bonzini
On 8/26/22 02:01, Richard Henderson wrote: -#if SHIFT == 0 -SSE_HELPER_W(helper_pmulhrw, FMULHRW) -#endif   SSE_HELPER_W(helper_pmulhuw, FMULHUW)   SSE_HELPER_W(helper_pmulhw, FMULHW) +#if SHIFT == 0 +void glue(helper_pmulhrw, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +{ +    d->W(0) = FMULHRW(d

Re: [PATCH] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by defualt

2022-08-26 Thread Richard W.M. Jones
On Fri, Aug 26, 2022 at 12:39:00PM +0100, Daniel P. Berrangé wrote: > The 'qemu64' CPU model implements the least featureful x86_64 CPU that's > possible. Historically this hasn't been an issue since it was rare for > OS distros to build with a higher mandatory CPU baseline. > > With RHEL-9, howev

RE: [PATCH] fw_cfg: Don't set callback_opaque NULL in fw_cfg_modify_bytes_read()

2022-08-26 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: 26 August 2022 13:07 > To: Shameerali Kolothum Thodi ; > qemu-devel@nongnu.org; qemu-...@nongnu.org > Cc: imamm...@redhat.com; peter.mayd...@linaro.org; Linuxarm > ; chenxiang (M) ; Ard > Biesheuvel (kernel.org a

Re: [PATCH] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by defualt

2022-08-26 Thread Claudio Fontana
On 8/26/22 13:39, Daniel P. Berrangé wrote: > The 'qemu64' CPU model implements the least featureful x86_64 CPU that's > possible. Historically this hasn't been an issue since it was rare for > OS distros to build with a higher mandatory CPU baseline. > > With RHEL-9, however, the entire distro is

Re: [PATCH v7 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-26 Thread Sam Li
Damien Le Moal 于2022年8月17日周三 01:50写道: > > On 2022/08/15 23:25, Sam Li wrote: > > By adding zone management operations in BlockDriver, storage controller > > emulation can use the new block layer APIs including Report Zone and > > four zone management operations (open, close, finish, reset). > > >

Re: [PATCH] fw_cfg: Don't set callback_opaque NULL in fw_cfg_modify_bytes_read()

2022-08-26 Thread Laszlo Ersek
+Ard +Gerd, one pointer at the bottom On 08/26/22 13:59, Laszlo Ersek wrote: > On 08/25/22 18:18, Shameer Kolothum wrote: >> Hi >> >> On arm/virt platform, Chen Xiang reported a Guest crash while >> attempting the below steps, >> >> 1. Launch the Guest with nvdimm=on >> 2. Hot-add a NVDIMM dev >>

Re: [PATCH] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by defualt

2022-08-26 Thread Daniel P . Berrangé
On Fri, Aug 26, 2022 at 01:05:13PM +0100, Richard W.M. Jones wrote: > On Fri, Aug 26, 2022 at 12:39:00PM +0100, Daniel P. Berrangé wrote: > > The 'qemu64' CPU model implements the least featureful x86_64 CPU that's > > possible. Historically this hasn't been an issue since it was rare for > > OS di

Re: [PATCH] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by defualt

2022-08-26 Thread Daniel P . Berrangé
On Fri, Aug 26, 2022 at 01:50:40PM +0200, Claudio Fontana wrote: > On 8/26/22 13:39, Daniel P. Berrangé wrote: > > The 'qemu64' CPU model implements the least featureful x86_64 CPU that's > > possible. Historically this hasn't been an issue since it was rare for > > OS distros to build with a highe

Re: [PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents()

2022-08-26 Thread Bin Meng
On Fri, Aug 26, 2022 at 7:16 PM Christian Schoenebeck wrote: > > On Freitag, 26. August 2022 12:30:20 CEST Bin Meng wrote: > > On Fri, Aug 26, 2022 at 6:09 PM Christian Schoenebeck > > > > wrote: > > > On Mittwoch, 24. August 2022 11:39:47 CEST Bin Meng wrote: > > > > From: Bin Meng > > > > > >

Re: [PATCH] tests/x86: Add 'q35' machine type to hotplug tests

2022-08-26 Thread Denis V. Lunev
On 26.08.2022 13:41, Michael Labiuk wrote: Add pci bridge setting to run hotplug tests on q35 machine type. Hotplug tests was bounded to 'pc' machine type by commit 7b172333f1b Signed-off-by: Michael Labiuk --- tests/qtest/device-plug-test.c | 26 ++ tests/qtest/drive_del-test.c | 111

Re: [PATCH v6 01/10] parallels: Out of image offset in BAT leads to image inflation

2022-08-26 Thread Denis V. Lunev
On 25.08.2022 16:31, Alexander Ivanov wrote: data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or the image will be truncated to this offset on close. This is defin

Re: [PATCH v6 02/10] parallels: Fix high_off calculation in parallels_co_check()

2022-08-26 Thread Denis V. Lunev
On 25.08.2022 16:31, Alexander Ivanov wrote: Don't let high_off be more than the file size even if we don't fix the image. Signed-off-by: Alexander Ivanov --- block/parallels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index

Re: [PATCH v6 03/10] parallels: Fix data_end after out-of-image check

2022-08-26 Thread Denis V. Lunev
On 25.08.2022 16:31, Alexander Ivanov wrote: Set data_end to the end of the last cluster inside the image. In such a way we can be shure that corrupted offsets in the BAT s/shure/sure/ can't affect on the image size. Signed-off-by: Alexander Ivanov --- block/parallels.c | 2 ++ 1 file chan

Re: [PATCH] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by defualt

2022-08-26 Thread Claudio Fontana
On 8/26/22 14:29, Daniel P. Berrangé wrote: > On Fri, Aug 26, 2022 at 01:50:40PM +0200, Claudio Fontana wrote: >> On 8/26/22 13:39, Daniel P. Berrangé wrote: >>> The 'qemu64' CPU model implements the least featureful x86_64 CPU that's >>> possible. Historically this hasn't been an issue since it wa

Re: [PATCH v6 07/10] parallels: Move check of cluster outside image to a separate function

2022-08-26 Thread Denis V. Lunev
On 25.08.2022 16:31, Alexander Ivanov wrote: We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov --- block/parallels.c | 59 +

Re: [PATCH 40/51] chardev/char-file: Add FILE_SHARE_WRITE when openning the file for win32

2022-08-26 Thread Bin Meng
On Thu, Aug 25, 2022 at 3:59 PM Marc-André Lureau wrote: > > Hi > > On Wed, Aug 24, 2022 at 1:43 PM Bin Meng wrote: > > > > From: Xuzhou Cheng > > > > The combination of GENERIC_WRITE and FILE_SHARE_READ options does > > not allow the same file to be opened again by CreateFile() from > > another

[PATCH v11 04/21] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED

2022-08-26 Thread Emanuele Giuseppe Esposito
Same as AIO_WAIT_WHILE macro, but if we are in the Main loop do not release and then acquire ctx_ 's aiocontext. Once all Aiocontext locks go away, this macro will replace AIO_WAIT_WHILE. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi Reviewed-by: Vladimir Sementsov-Ogie

[PATCH v11 08/21] jobs: add job lock in find_* functions

2022-08-26 Thread Emanuele Giuseppe Esposito
Both blockdev.c and job-qmp.c have TOC/TOU conditions, because they first search for the job and then perform an action on it. Therefore, we need to do the search + action under the same job mutex critical section. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed

[PATCH v11 00/21] job: replace AioContext lock with job_mutex

2022-08-26 Thread Emanuele Giuseppe Esposito
In this series, we want to remove the AioContext lock and instead use the already existent job_mutex to protect the job structures and list. This is part of the work to get rid of AioContext lock usage in favour of smaller granularity locks. In order to simplify reviewer's job, job lock/unlock fun

[PATCH v11 01/21] job.c: make job_mutex and job_lock/unlock() public

2022-08-26 Thread Emanuele Giuseppe Esposito
job mutex will be used to protect the job struct elements and list, replacing AioContext locks. Right now use a shared lock for all jobs, in order to keep things simple. Once the AioContext lock is gone, we can introduce per-job locks. To simplify the switch from aiocontext to job lock, introduce

[PATCH v11 12/21] job: detect change of aiocontext within job coroutine

2022-08-26 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini We want to make sure access of job->aio_context is always done under either BQL or job_mutex. The problem is that using aio_co_enter(job->aiocontext, job->co) in job_start and job_enter_cond makes the coroutine immediately resume, so we can't hold the job lock. And caching it

[PATCH v11 07/21] blockjob: introduce block_job _locked() APIs

2022-08-26 Thread Emanuele Giuseppe Esposito
Just as done with job.h, create _locked() functions in blockjob.h These functions will be later useful when caller has already taken the lock. All blockjob _locked functions call job _locked functions. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed-off-by: Ema

[PATCH v11 03/21] job.c: API functions not used outside should be static

2022-08-26 Thread Emanuele Giuseppe Esposito
job_event_* functions can all be static, as they are not used outside job.c. Same applies for job_txn_add_job(). Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf --- include/qemu/job.h | 18 --

[PATCH v11 02/21] job.h: categorize fields in struct Job

2022-08-26 Thread Emanuele Giuseppe Esposito
Categorize the fields in struct Job to understand which ones need to be protected by the job mutex and which don't. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- include/qemu/job.h | 61

[PATCH v11 16/21] blockjob: protect iostatus field in BlockJob struct

2022-08-26 Thread Emanuele Giuseppe Esposito
iostatus is the only field (together with .job) that needs protection using the job mutex. It is set in the main loop (GLOBAL_STATE functions) but read in I/O code (block_job_error_action). In order to protect it, change block_job_iostatus_set_err to block_job_iostatus_set_err_locked(), always ca

[PATCH v11 05/21] job.c: add job_lock/unlock while keeping job.h intact

2022-08-26 Thread Emanuele Giuseppe Esposito
With "intact" we mean that all job.h functions implicitly take the lock. Therefore API callers are unmodified. This means that: - many static functions that will be always called with job lock held become _locked, and call _locked functions - all public functions take the lock internally if need

[PATCH v11 10/21] block/mirror.c: use of job helpers in drivers

2022-08-26 Thread Emanuele Giuseppe Esposito
Once job lock is used and aiocontext is removed, mirror has to perform job operations under the same critical section, Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed-off-by: Emanuele Giuseppe Esposito --- block/mirror.c | 13 + 1 file changed, 9 in

[PATCH v11 17/21] job.h: categorize JobDriver callbacks that need the AioContext lock

2022-08-26 Thread Emanuele Giuseppe Esposito
Some callbacks implementation use bdrv_* APIs that assume the AioContext lock is held. Make sure this invariant is documented. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job.h | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/include

[PATCH v11 15/21] blockjob: rename notifier callbacks as _locked

2022-08-26 Thread Emanuele Giuseppe Esposito
They all are called with job_lock held, in job_event_*_locked() Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf --- blockjob.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletion

[PATCH v11 19/21] block_job_query: remove atomic read

2022-08-26 Thread Emanuele Giuseppe Esposito
Not sure what the atomic here was supposed to do, since job.busy is protected by the job lock. Since the whole function is called under job_mutex, just remove the atomic. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Stefan Hajnoczi Reviewed-by

[PATCH v11 14/21] blockjob.h: categorize fields in struct BlockJob

2022-08-26 Thread Emanuele Giuseppe Esposito
The same job lock is being used also to protect some of blockjob fields. Categorize them just as done in job.h. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Emanuele Giuseppe Esposito --- include/block/blockjob.h | 32 ++-- 1 file changed, 26 insertions(+

  1   2   3   4   >