Re: [PATCH v2 17/24] vhost: vhost-user: update vhost_dev_virtqueue_restart()

2022-08-23 Thread Kangjie Xu
在 2022/8/24 12:03, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_dev_virtqueue_restart() for vhost-user scenario. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo ---   hw/virtio/vhost.c | 26 ++   1 file changed, 22 insertions(+), 4 deletions(-)

Re: [PATCH v2 16/24] vhost: vhost-user: update vhost_dev_virtqueue_stop()

2022-08-23 Thread Kangjie Xu
在 2022/8/24 11:56, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_dev_virtqueue_stop() for vhost-user scenario. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo ---   hw/virtio/vhost.c | 19 +++   1 file changed, 19 insertions(+) diff --git

Re: [PATCH v2 18/24] vhost-net: vhost-user: update vhost_net_virtqueue_stop()

2022-08-23 Thread Kangjie Xu
在 2022/8/24 12:05, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_net_virtqueue_stop() for vhost-user scenario. Let's explain why it is needed now or why it doesn't cause any issue or it's a bug fix or not. Thanks This patch is to suppport vq reset for vhost-user. We

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

2022-08-23 Thread Jason Wang
在 2022/8/20 01:13, Eugenio Pérez 写道: It was returned as error before. Instead of it, simply update the corresponding field so qemu can send it in the migration data. Signed-off-by: Eugenio Pérez --- Looks correct. Adding Si Wei for double check. Thanks hw/net/virtio-net.c | 17

Re: [PATCH 2/5] vdpa: Add vhost_vdpa_net_load_mq

2022-08-23 Thread Jason Wang
在 2022/8/20 01:13, Eugenio Pérez 写道: Same way as with the MAC, restore the expected number of queues at device's start. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 33 + 1 file changed, 33 insertions(+) diff --git a/net/vhost-vdpa.c

Re: [PATCH 1/5] vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load

2022-08-23 Thread Jason Wang
在 2022/8/20 01:13, Eugenio Pérez 写道: Since there may be many commands we need to issue to load the NIC state, let's split them in individual functions Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- net/vhost-vdpa.c | 39 +-- 1 file

Re: [PATCH 00/24] Support VIRTIO_F_RING_RESET for virtio-net, vhost-user, vhost-kernel in virtio pci-modern

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: Host Kernel Patch: https://github.com/middaywords/linux/commit/19a91e0d7167b2031e46078c6215c213b89cb2c3 Btw, this patch could be posted right now. Then it would be more easier for people to try you series. Thanks

Re: [PATCH 00/24] Support VIRTIO_F_RING_RESET for virtio-net, vhost-user, vhost-kernel in virtio pci-modern

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: The virtio queue reset function has already been defined in the virtio spec 1.2. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 This patch set is

Re: [PATCH v2 19/24] vhost-net: vhost-user: update vhost_net_virtqueue_restart()

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_net_virtqueue_restart() for vhost-user scenario. Similar to previous patch, let's explain why it it needed. Thanks Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 4 1 file changed, 4 insertions(+)

Re: [PATCH v2 18/24] vhost-net: vhost-user: update vhost_net_virtqueue_stop()

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_net_virtqueue_stop() for vhost-user scenario. Let's explain why it is needed now or why it doesn't cause any issue or it's a bug fix or not. Thanks Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 4

Re: [PATCH v2 17/24] vhost: vhost-user: update vhost_dev_virtqueue_restart()

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_dev_virtqueue_restart() for vhost-user scenario. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/vhost.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost.c

Re: [PATCH v2 16/24] vhost: vhost-user: update vhost_dev_virtqueue_stop()

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: Update vhost_dev_virtqueue_stop() for vhost-user scenario. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/vhost.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index

Re: [PATCH v2 11/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_stop()

2022-08-23 Thread Kangjie Xu
在 2022/8/24 10:40, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_virtqueue_stop(), which can reset the virtqueue in the device. Then it will unmap vrings and the desc of the virtqueue. This patch only considers the case for vhost-kernel, when NetClientDriver is

Re: [PATCH v2 0/4] hw/arm/virt: Improve address assignment for high memory regions

2022-08-23 Thread Gavin Shan
Hi Marc, On 8/15/22 4:29 PM, Gavin Shan wrote: There are three high memory regions, which are VIRT_HIGH_REDIST2, VIRT_HIGH_PCIE_ECAM and VIRT_HIGH_PCIE_MMIO. Their base addresses are floating on highest RAM address. However, they can be disabled in several cases. (1) One specific high

Re: [PATCH v2 15/24] vhost-user: add op to enable or disable a single vring

2022-08-23 Thread Kangjie Xu
在 2022/8/24 10:53, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: The interface to set enable status for a single vring is lacked in VhostOps, since the vhost_set_vring_enable_op will manipulate all virtqueues in a device. Resetting a single vq will rely on this interface. Signed-off-by:

Re: [PATCH v2 14/24] vhost-user: introduce vhost_reset_vring() interface

2022-08-23 Thread Kangjie Xu
在 2022/8/24 10:50, Jason Wang 写道: 在 2022/8/16 09:06, 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

Re: [PATCH v2 15/24] vhost-user: add op to enable or disable a single vring

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: The interface to set enable status for a single vring is lacked in VhostOps, since the vhost_set_vring_enable_op will manipulate all virtqueues in a device. Resetting a single vq will rely on this interface. Signed-off-by: Kangjie Xu Signed-off-by: Xuan

Re: [PATCH v2 12/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-08-23 Thread Kangjie Xu
在 2022/8/24 10:44, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_net_virtqueue_restart(), which can restart the virtqueue when the vhost net started running before. If it fails to restart the virtqueue, the device will be stopped. This patch only considers the case for

Re: [PATCH v2 14/24] vhost-user: introduce vhost_reset_vring() interface

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, 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.

Re: [PATCH v2 11/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_stop()

2022-08-23 Thread Kangjie Xu
在 2022/8/24 10:40, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_virtqueue_stop(), which can reset the virtqueue in the device. Then it will unmap vrings and the desc of the virtqueue. This patch only considers the case for vhost-kernel, when NetClientDriver is

Re: [PATCH v2 13/24] docs: vhost-user: add VHOST_USER_RESET_VRING message

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, 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

Re: [PATCH v2 10/24] vhost: introduce vhost_dev_virtqueue_restart()

2022-08-23 Thread Kangjie Xu
在 2022/8/24 10:37, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_dev_virtqueue_restart(), which can restart the virtqueue when the vhost has already started running. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo ---   hw/virtio/vhost.c | 13 +  

Re: [PATCH v2 12/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_net_virtqueue_restart(), which can restart the virtqueue when the vhost net started running before. If it fails to restart the virtqueue, the device will be stopped. This patch only considers the case for vhost-kernel, when NetClientDriver is

Re: [PATCH v2 09/24] vhost: introduce vhost_dev_virtqueue_stop()

2022-08-23 Thread Jason Wang
在 2022/8/23 16:03, Kangjie Xu 写道: 在 2022/8/23 15:52, Jason Wang 写道: 在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_dev_virtqueue_stop(), which can ummap the vrings and the desc of it. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo ---   hw/virtio/vhost.c | 9 +  

Re: [PATCH v2 11/24] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_stop()

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_virtqueue_stop(), which can reset the virtqueue in the device. Then it will unmap vrings and the desc of the virtqueue. This patch only considers the case for vhost-kernel, when NetClientDriver is NET_CLIENT_DRIVER_TAP. Signed-off-by: Kangjie

Re: [PATCH v2 10/24] vhost: introduce vhost_dev_virtqueue_restart()

2022-08-23 Thread Jason Wang
在 2022/8/16 09:06, Kangjie Xu 写道: Introduce vhost_dev_virtqueue_restart(), which can restart the virtqueue when the vhost has already started running. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/virtio/vhost.c | 13 + include/hw/virtio/vhost.h | 2 ++

Re: [PATCH v10 00/12] NIC vhost-vdpa state restore via Shadow CVQ

2022-08-23 Thread Jason Wang
在 2022/8/24 02:30, Eugenio Pérez 写道: CVQ of net vhost-vdpa devices can be intercepted since the addition of x-svq. The virtio-net device model is updated. The migration was blocked because although the state can be megrated between VMM it was not possible to restore on the destination NIC.

Re: [PATCH] net: tulip: Restrict DMA engine to memories

2022-08-23 Thread Jason Wang
在 2022/8/24 10:26, Jason Wang 写道: On Sun, Aug 21, 2022 at 8:29 PM Zheyu Ma wrote: The DMA engine is started by I/O access and then itself accesses the I/O registers, triggering a reentrancy bug. The following log can reveal it: ==5637==ERROR: AddressSanitizer: stack-overflow #0

Re: [PATCH] net: tulip: Restrict DMA engine to memories

2022-08-23 Thread Jason Wang
On Sun, Aug 21, 2022 at 8:29 PM Zheyu Ma wrote: > > The DMA engine is started by I/O access and then itself accesses the > I/O registers, triggering a reentrancy bug. > > The following log can reveal it: > ==5637==ERROR: AddressSanitizer: stack-overflow > #0 0x5595435f6078 in

EBUSY when using NVMe Block Driver with multiple devices in the same IOMMU group

2022-08-23 Thread Martin Oliveira
Hello, I'm trying to use the QEMU NVMe userspace driver and I'm hitting an error when trying to use more than one device from an IOMMU group: Failed to open VFIO group file: /dev/vfio/39: Device or resource busy If devices belong to different IOMMU groups, then it works as expected. For

Re: [PATCH 1/9] hw/isa/vt82c686: QOM'ify Super I/O creation

2022-08-23 Thread BALATON Zoltan
On Tue, 23 Aug 2022, Bernhard Beschow wrote: On Tue, Aug 23, 2022 at 2:35 AM BALATON Zoltan wrote: On Tue, 23 Aug 2022, Bernhard Beschow wrote: The object creation now happens in chip-specific init methods which allows the realize methods to be consolidated into one method. Shifting the

Re: [PATCH 8/9] hw/isa/vt82c686: QOM'ify RTC creation

2022-08-23 Thread BALATON Zoltan
On Tue, 23 Aug 2022, Bernhard Beschow wrote: On Tue, Aug 23, 2022 at 2:20 AM BALATON Zoltan wrote: On Tue, 23 Aug 2022, Bernhard Beschow wrote: Signed-off-by: Bernhard Beschow --- hw/isa/vt82c686.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git

Re: [PATCH 7/9] hw/isa/vt82c686: QOM'ify ac97 and mc97 creation

2022-08-23 Thread BALATON Zoltan
On Tue, 23 Aug 2022, Bernhard Beschow wrote: On Tue, Aug 23, 2022 at 2:44 AM BALATON Zoltan wrote: On Tue, 23 Aug 2022, Bernhard Beschow wrote: Resolves duplicate code in the boards. Signed-off-by: Bernhard Beschow --- hw/isa/vt82c686.c | 16 hw/mips/fuloong2e.c | 4

[PATCH v7 16/20] accel/tcg: Add fast path for translator_ld*

2022-08-23 Thread Richard Henderson
Cache the translation from guest to host address, so we may use direct loads when we hit on the primary translation page. Look up the second translation page only once, during translation. This obviates another lookup of the second page within tb_gen_code after translation. Fixes a bug in that

[PATCH v7 17/20] target/s390x: Make translator stop before the end of a page

2022-08-23 Thread Richard Henderson
From: Ilya Leoshkevich Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id:

[PATCH v7 15/20] accel/tcg: Add pc and host_pc params to gen_intermediate_code

2022-08-23 Thread Richard Henderson
Pass these along to translator_loop -- pc may be used instead of tb->pc, and host_pc is currently unused. Adjust all targets at one time. Acked-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 1

[PATCH v7 14/20] accel/tcg: Remove translator_ldsw

2022-08-23 Thread Richard Henderson
The only user can easily use translator_lduw and adjust the type to signed during the return. Reviewed-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/exec/translator.h | 1 - target/i386/tcg/translate.c | 2 +- 2

[PATCH v7 18/20] target/i386: Make translator stop before the end of a page

2022-08-23 Thread Richard Henderson
From: Ilya Leoshkevich Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. An implementation, like the one arm and s390x have, would require an i386 length

[PATCH v7 19/20] target/riscv: Add MAX_INSN_LEN and insn_len

2022-08-23 Thread Richard Henderson
These will be useful in properly ending the TB. Reviewed-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/riscv/translate.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git

[PATCH v7 20/20] target/riscv: Make translator stop before the end of a page

2022-08-23 Thread Richard Henderson
Right now the translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1155 Reviewed-by: Alistair Francis Acked-by: Ilya

[PATCH v7 05/20] linux-user: Clear translations and tb_jmp_cache on mprotect()

2022-08-23 Thread Richard Henderson
From: Ilya Leoshkevich Currently it's possible to execute pages that do not have PAGE_EXEC if there is an existing translation block. Fix by clearing tb_jmp_cache and invalidating TBs, which forces recheck of permission bits. Signed-off-by: Ilya Leoshkevich Message-Id:

[PATCH v7 12/20] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp

2022-08-23 Thread Richard Henderson
Simplify the implementation of get_page_addr_code_hostp by reusing the existing probe_access infrastructure. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 76 -- 1 file changed, 26

[PATCH v7 13/20] accel/tcg: Document the faulting lookup in tb_lookup_cmp

2022-08-23 Thread Richard Henderson
It was non-obvious to me why we can raise an exception in the middle of a comparison function, but it works. While nearby, use TARGET_PAGE_ALIGN instead of open-coding. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-)

[PATCH v7 07/20] accel/tcg: Introduce is_same_page()

2022-08-23 Thread Richard Henderson
From: Ilya Leoshkevich Introduce a function that checks whether a given address is on the same page as where disassembly started. Having it improves readability of the following patches. Reviewed-by: Alistair Francis Signed-off-by: Ilya Leoshkevich Message-Id:

[PATCH v7 06/20] tests/tcg/i386: Move smc_code2 to an executable section

2022-08-23 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to put this code into a section that is both writable and executable. Note that this test did not run on hardware beforehand either. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson

[PATCH v7 10/20] accel/tcg: Make tb_htable_lookup static

2022-08-23 Thread Richard Henderson
The function is not used outside of cpu-exec.c. Move it and its subroutines up in the file, before the first use. Reviewed-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 3 - accel/tcg/cpu-exec.c

[PATCH v7 11/20] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c

2022-08-23 Thread Richard Henderson
The base qemu_ram_addr_from_host function is already in softmmu/physmem.c; move the nofail version to be adjacent. Reviewed-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/exec/cpu-common.h | 1 + accel/tcg/cputlb.c

[PATCH v7 04/20] linux-user: Honor PT_GNU_STACK

2022-08-23 Thread Richard Henderson
Map the stack executable if required by default or on demand. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- include/elf.h| 1 + linux-user/qemu.h| 1 + linux-user/elfload.c | 19 ++- 3 files changed, 20 insertions(+),

[PATCH v7 03/20] linux-user/x86_64: Allocate vsyscall page as a commpage

2022-08-23 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to the vsyscall page executable. We had been special casing this entirely within translate. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- linux-user/elfload.c | 23

[PATCH v7 08/20] accel/tcg: Properly implement get_page_addr_code for user-only

2022-08-23 Thread Richard Henderson
The current implementation is a no-op, simply returning addr. This is incorrect, because we ought to be checking the page permissions for execution. Make get_page_addr_code inline for both implementations. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Acked-by: Alistair Francis

[PATCH v7 09/20] accel/tcg: Unlock mmap_lock after longjmp

2022-08-23 Thread Richard Henderson
The mmap_lock is held around tb_gen_code. While the comment is correct that the lock is dropped when tb_gen_code runs out of memory, the lock is *not* dropped when an exception is raised reading code for translation. Acked-by: Alistair Francis Acked-by: Ilya Leoshkevich Tested-by: Ilya

[PATCH v7 00/20] linux-user: Fix siginfo_t contents when jumping to non-readable pages

2022-08-23 Thread Richard Henderson
Changes from v6: * Fix an unintentional behaviour change in patches 8 & 12, which had inspired the old patches 13 & 14 to fix (removed). * Added a new documentation patch 13. r~ Ilya Leoshkevich (4): linux-user: Clear translations and tb_jmp_cache on mprotect() accel/tcg: Introduce

[PATCH v7 01/20] linux-user/arm: Mark the commpage executable

2022-08-23 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to mark the commpage executable. We had been placing the commpage outside of reserved_va, which was incorrect and lead to an abort. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson ---

[PATCH v7 02/20] linux-user/hppa: Allocate page zero as a commpage

2022-08-23 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to mark page zero executable. We had been special casing this entirely within translate. Acked-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- linux-user/elfload.c | 34

Re: [PATCH 0/2] target/arm: armv7m_load_kernel() improvements

2022-08-23 Thread Richard Henderson
On 8/23/22 09:04, Peter Maydell wrote: Two small patches to armv7m_load_kernel(). The first is just getting rid of some dead code, that I noticed while working on the function. The second is to make boards pass armv7m_load_kernel() the base address for loading guest (non-ELF) binaries. At the

Re: [PATCH v2 00/10] target/arm: Implement FEAT_PMUv3p5

2022-08-23 Thread Richard Henderson
On Mon, 22 Aug 2022 at 06:24, Peter Maydell wrote: > > This patchset implements the Armv8.5 feature FEAT_PMUv3p5, which is > a set of minor enhancements to the PMU: > * EL2 and EL3 can now prohibit the cycle counter from counting >when in EL2 or when Secure, using new MDCR_EL2.HCCD and >

Re: [PATCH 0/6] target/arm: Fix v8 AArch32 RAZ ID regs; implement FEAT_ETS

2022-08-23 Thread Richard Henderson
On 8/19/22 04:00, Peter Maydell wrote: The main aim of this patchset is to implement FEAT_ETS. FEAT_ETS provides tighter guarantees on some memory orderings involving translation table walks that permit guest code to skip the context-synchronization event they would otherwise need to do after a

Re: [PATCH] hw/arm/bcm2835_property: Add support for RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS

2022-08-23 Thread Richard Henderson
On 8/12/22 07:35, Enrik Berkhan wrote: In more recent Raspbian OS Linux kernels, the fb driver gives up immediately if RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS fails or no displays are reported. This change simply always reports one display. It makes bcm2835_fb work again with these more

Re: [PATCH v2] target/arm: Add cortex-a35

2022-08-23 Thread Richard Henderson
On 8/18/22 17:20, Hao Wu wrote: Add cortex A35 core and enable it for virt board. Signed-off-by: Hao Wu Reviewed-by: Joe Komlodi --- docs/system/arm/virt.rst | 1 + hw/arm/virt.c| 1 + target/arm/cpu64.c | 80 3 files changed,

[PATCH 2/2] target/s390x: Align __excp_addr in s390_probe_access

2022-08-23 Thread Richard Henderson
Per the comment in s390_cpu_record_sigsegv, the saved address is always page aligned. Signed-off-by: Richard Henderson --- target/s390x/tcg/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index

[PATCH 1/2] Revert "target/s390x: Use probe_access_flags in s390_probe_access"

2022-08-23 Thread Richard Henderson
This reverts commit db9aab5783a2fb62250e12f0c4cfed5e1778c189. This patch breaks the contract of s390_probe_access, in that it no longer returns an exception code, nor set __excp_addr. Reported-by: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/tcg/mem_helper.c | 18

[PATCH 0/2] target/s390x: s390_probe_access fixes

2022-08-23 Thread Richard Henderson
First, as pointed out by David; second by inspection. I really wish there were a better way to structure this, but alas, I don't see any alternatives that aren't just different but similar amounts of ugly. r~ Richard Henderson (2): Revert "target/s390x: Use probe_access_flags in

Re: [PULL 1/6] tests/avocado: push default timeout to QemuBaseTest

2022-08-23 Thread Richard Henderson
On 8/23/22 08:25, Alex Bennée wrote: All of the QEMU tests eventually end up derrived from this class. Move the default timeout from LinuxTest to ensure we catch them all. As 15 minutes is fairly excessive we drop the default down to 2 minutes which is a more reasonable target for tests to aim

Re: [PATCH 2/2] target/arm: Make boards pass base address to armv7m_load_kernel()

2022-08-23 Thread Richard Henderson
On 8/23/22 09:04, Peter Maydell wrote: Currently armv7m_load_kernel() takes the size of the block of memory where it should load the initial guest image, but assumes that it should always load it at address 0. This happens to be true of all our M-profile boards at the moment, but it isn't

Re: [PATCH 1/2] target/arm: Remove useless TARGET_BIG_ENDIAN check in armv7m_load_kernel()

2022-08-23 Thread Richard Henderson
On 8/23/22 09:04, Peter Maydell wrote: Arm system emulation targets always have TARGET_BIG_ENDIAN clear, so there is no need to have handling in armv7m_load_kernel() for the case when it is defined. Remove the unnecessary code. Side notes: * our M-profile implementation is always

Re: [PATCH v9 1/3] hw/intc: Move mtimer/mtimecmp to aclint

2022-08-23 Thread Alistair Francis
On Thu, Aug 11, 2022 at 4:57 AM Atish Patra wrote: > > Historically, The mtime/mtimecmp has been part of the CPU because > they are per hart entities. However, they actually belong to aclint > which is a MMIO device. > > Move them to the ACLINT device. This also emulates the real hardware > more

[PATCH] gitlab-ci/custom-runners: Disable -static-pie for ubuntu-20.04-aarch64

2022-08-23 Thread Richard Henderson
The project has reached the magic size at which we see /usr/aarch64-linux-gnu/lib/libc.a(init-first.o): in function `__libc_init_first': (.text+0x10): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against \ symbol `__environ' defined in .bss section in

Re: [PATCH v13 3/6] target/riscv: Add few cache related PMU events

2022-08-23 Thread Alistair Francis
On Wed, Aug 24, 2022 at 5:19 AM Atish Kumar Patra wrote: > > > > On Mon, Aug 22, 2022 at 5:38 PM Alistair Francis wrote: >> >> On Wed, Aug 17, 2022 at 9:24 AM Atish Patra wrote: >> > >> > From: Atish Patra >> > >> > Qemu can monitor the following cache related PMU events through >> > tlb_fill

Re: [RFC v4 00/11] blkio: add libblkio BlockDriver

2022-08-23 Thread Stefan Hajnoczi
On Tue, Aug 23, 2022 at 08:31:03PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 8/23/22 01:23, Stefan Hajnoczi wrote: > > The remainder of the patch series reworks the existing QEMU > > bdrv_register_buf() > > API so virtio-blk emulation efficiently map guest RAM for libblkio - some > >

Re: [RFC v4 11/11] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint

2022-08-23 Thread Stefan Hajnoczi
On Tue, Aug 23, 2022 at 10:01:59AM +0200, David Hildenbrand wrote: > On 23.08.22 00:24, Stefan Hajnoczi wrote: > > Register guest RAM using BlockRAMRegistrar and set the > > BDRV_REQ_REGISTERED_BUF flag so block drivers can optimize memory > > accesses in I/O requests. > > > > This is for

Re: [PATCH v13 3/6] target/riscv: Add few cache related PMU events

2022-08-23 Thread Atish Kumar Patra
On Mon, Aug 22, 2022 at 5:38 PM Alistair Francis wrote: > On Wed, Aug 17, 2022 at 9:24 AM Atish Patra wrote: > > > > From: Atish Patra > > > > Qemu can monitor the following cache related PMU events through > > tlb_fill functions. > > > > 1. DTLB load/store miss > > 3. ITLB prefetch miss > > >

Re: [PULL 0/1] Block layer patches

2022-08-23 Thread Richard Henderson
On 8/23/22 07:04, Kevin Wolf wrote: The following changes since commit ba58ccbef60338d0b7334c714589a6423a3e7f91: Merge tag 'for-7.1-hppa' of https://github.com/hdeller/qemu-hppa into staging (2022-08-19 09:35:29 -0700) are available in the Git repository at:

Re: [PATCH 7/9] hw/isa/vt82c686: QOM'ify ac97 and mc97 creation

2022-08-23 Thread Bernhard Beschow
On Tue, Aug 23, 2022 at 2:44 AM BALATON Zoltan wrote: > On Tue, 23 Aug 2022, Bernhard Beschow wrote: > > Resolves duplicate code in the boards. > > > > Signed-off-by: Bernhard Beschow > > --- > > hw/isa/vt82c686.c | 16 > > hw/mips/fuloong2e.c | 4 > > hw/ppc/pegasos2.c

[PATCH v10 12/12] vdpa: Delete CVQ migration blocker

2022-08-23 Thread Eugenio Pérez
We can restore the device state in the destination via CVQ now. Remove the migration blocker. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- include/hw/virtio/vhost-vdpa.h | 1 - hw/virtio/vhost-vdpa.c | 15 --- net/vhost-vdpa.c | 2 -- 3 files

Re: [PATCH 1/9] hw/isa/vt82c686: QOM'ify Super I/O creation

2022-08-23 Thread Bernhard Beschow
On Tue, Aug 23, 2022 at 2:35 AM BALATON Zoltan wrote: > On Tue, 23 Aug 2022, Bernhard Beschow wrote: > > The object creation now happens in chip-specific init methods which > > allows the realize methods to be consolidated into one method. Shifting > > the logic into the init methods has the

[PATCH v10 11/12] vdpa: Add virtio-net mac address via CVQ at start

2022-08-23 Thread Eugenio Pérez
This is needed so the destination vdpa device see the same state a the guest set in the source. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v9: * Use guest acked features instead of device's. * Constify vhost_vdpa and VirtIONet variables. * Delete unneeded increment of cursor. v8: *

Re: [PATCH] audio: exit(1) if audio backend failed to be found or initialized

2022-08-23 Thread Volker Rümelin
From: Marc-André Lureau If you specify a known backend but it isn't compiled in, or failed to initialize, you get a simple warning and the "none" backend as a fallback, and QEMU runs happily: $ qemu-system-x86_64 -audiodev id=audio,driver=dsound audio: Unknown audio driver `dsound' audio:

[PATCH v10 09/12] vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail

2022-08-23 Thread Eugenio Pérez
So we can reuse it to inject state messages. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang -- v7: * Remove double free error v6: * Do not assume in buffer sent to the device is sizeof(virtio_net_ctrl_ack) v5: * Do not use an artificial !NULL VirtQueueElement * Use only out size instead of

[PATCH v10 10/12] vhost_net: add NetClientState->load() callback

2022-08-23 Thread Eugenio Pérez
It allows per-net client operations right after device's successful start. In particular, to load the device status. Vhost-vdpa net will use it to add the CVQ buffers to restore the device status. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v5: Rename start / load, naming it more

Re: [PATCH 8/9] hw/isa/vt82c686: QOM'ify RTC creation

2022-08-23 Thread Bernhard Beschow
On Tue, Aug 23, 2022 at 2:20 AM BALATON Zoltan wrote: > On Tue, 23 Aug 2022, Bernhard Beschow wrote: > > Signed-off-by: Bernhard Beschow > > --- > > hw/isa/vt82c686.c | 12 +++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c

[PATCH v10 08/12] vdpa: Move command buffers map to start of net device

2022-08-23 Thread Eugenio Pérez
As this series will reuse them to restore the device state at the end of a migration (or a device start), let's allocate only once at the device start so we don't duplicate their map and unmap. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v10: Solve conflict on vhost_iova_tree_remove

[PATCH v10 04/12] vhost: Do not depend on !NULL VirtQueueElement on vhost_svq_flush

2022-08-23 Thread Eugenio Pérez
Since QEMU will be able to inject new elements on CVQ to restore the state, we need not to depend on a VirtQueueElement to know if a new element has been used by the device or not. Instead of check that, check if there are new elements only using used idx on vhost_svq_flush. Signed-off-by:

[PATCH v10 02/12] vhost: use SVQ element ndescs instead of opaque data for desc validation

2022-08-23 Thread Eugenio Pérez
Since we're going to allow SVQ to add elements without the guest's knowledge and without its own VirtQueueElement, it's easier to check if an element is a valid head checking a different thing than the VirtQueueElement. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang ---

[PATCH v10 07/12] vdpa: add net_vhost_vdpa_cvq_info NetClientInfo

2022-08-23 Thread Eugenio Pérez
Next patches will add a new info callback to restore NIC status through CVQ. Since only the CVQ vhost device is needed, create it with a new NetClientInfo. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v5: Create a new NetClientInfo instead of reusing the dataplane one. ---

[PATCH v10 03/12] vhost: Delete useless read memory barrier

2022-08-23 Thread Eugenio Pérez
As discussed in previous series [1], this memory barrier is useless with the atomic read of used idx at vhost_svq_more_used. Deleting it. [1] https://lists.nongnu.org/archive/html/qemu-devel/2022-07/msg02616.html Signed-off-by: Eugenio Pérez Acked-by: Jason Wang ---

[PATCH v10 00/12] NIC vhost-vdpa state restore via Shadow CVQ

2022-08-23 Thread Eugenio Pérez
CVQ of net vhost-vdpa devices can be intercepted since the addition of x-svq. The virtio-net device model is updated. The migration was blocked because although the state can be megrated between VMM it was not possible to restore on the destination NIC. This series add support for SVQ to inject

[PATCH v10 06/12] vhost_net: Add NetClientInfo stop callback

2022-08-23 Thread Eugenio Pérez
Used by the backend to perform actions after the device is stopped. In particular, vdpa net use it to unmap CVQ buffers to the device, cleaning the actions performed in prepare(). Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v9: Replace performend by performed in patch message ---

[PATCH v10 05/12] vhost_net: Add NetClientInfo start callback

2022-08-23 Thread Eugenio Pérez
This is used by the backend to perform actions before the device is started. In particular, vdpa net use it to map CVQ buffers to the device, so it can send control commands using them. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v9: Rename also in patch message v8: Rename

[PATCH v10 01/12] vhost: stop transfer elem ownership in vhost_handle_guest_kick

2022-08-23 Thread Eugenio Pérez
It was easier to allow vhost_svq_add to handle the memory. Now that we will allow qemu to add elements to a SVQ without the guest's knowledge, it's better to handle it in the caller. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-shadow-virtqueue.c | 10 -- 1

[PATCH v2 6/7] vhost: Always store new kick fd on vhost_svq_set_svq_kick_fd

2022-08-23 Thread Eugenio Pérez
We can unbind twice a file descriptor if we call twice vhost_svq_set_svq_kick_fd because of this. Since it comes from vhost and not from SVQ, that file descriptor could be a different thing that guest's vhost notifier. Likewise, it can happens the same if a guest start and stop the device

[PATCH v2 3/7] util: accept iova_tree_remove_parameter by value

2022-08-23 Thread Eugenio Pérez
It's convenient to call iova_tree_remove from a map returned from iova_tree_find or iova_tree_find_iova. With the current code this is not possible, since we will free it, and then we will try to search for it again. Fix it making accepting the map by value, forcing a copy of the argument. Not

[PATCH v2 7/7] vdpa: Use ring hwaddr at vhost_vdpa_svq_unmap_ring

2022-08-23 Thread Eugenio Pérez
Reduce code duplication. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index e208dd000e..23ae5ef48b 100644 ---

[PATCH v2 2/7] vdpa: do not save failed dma maps in SVQ iova tree

2022-08-23 Thread Eugenio Pérez
If a map fails for whatever reason, it must not be saved in the tree. Otherwise, qemu will try to unmap it in cleanup, leaving to more errors. Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Reported-by: Lei Yang Signed-off-by: Eugenio Pérez Acked-by: Jason Wang ---

[PATCH v2 0/7] vDPA shadow virtqueue iova tree fixes.

2022-08-23 Thread Eugenio Pérez
Collection of iova tree fixes detected preparing live migration with real devices and multiqueue. These cannot be triggered in simple setups (vdpa_sim_net, no display, no device reset with different features) but it's possible to trigger them with real devices or if the kernel fails some step

[PATCH v2 5/7] vdpa: Make SVQ vring unmapping return void

2022-08-23 Thread Eugenio Pérez
Nothing actually reads the return value, but an error in cleaning some entries could cause device stop to abort, making a restart impossible. Better ignore explicitely the return value. Reported-by: Lei Yang Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Signed-off-by: Eugenio

[PATCH v2 4/7] vdpa: Remove SVQ vring from iova_tree at shutdown

2022-08-23 Thread Eugenio Pérez
Although the device will be reset before usage, the right thing to do is to clean it. Reported-by: Lei Yang Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Signed-off-by: Eugenio Pérez --- v2: * Call vhost_iova_tree_remove with the map as value. * report_error on

[PATCH v2 1/7] vdpa: Skip the maps not in the iova tree

2022-08-23 Thread Eugenio Pérez
Next patch will skip the registering of dma maps that the vdpa device rejects in the iova tree. We need to consider that here or we cause a SIGSEGV accessing result. Reported-by: Lei Yang Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c | 4 1 file changed, 4

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-23 Thread Daniel Henrique Barboza
On 8/23/22 05:58, Alexey Kardashevskiy wrote: On 22/08/2022 20:30, Daniel Henrique Barboza wrote: On 8/22/22 00:29, Alexey Kardashevskiy wrote: On 22/08/2022 13:05, David Gibson wrote: On Fri, Aug 19, 2022 at 06:42:34AM -0300, Daniel Henrique Barboza wrote: On 8/18/22 23:11,

Leif's email issues resolved

2022-08-23 Thread Leif Lindholm
Hi everyone, As some of you might have noticed, my email setup broke a little over a month ago. At the time I was on leave, so did not notice for a while. And upon my return, it turned out it had broken in New and Exciting ways - so it took some time to restore. This has now been achieved, and I

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-23 Thread Gupta, Pankaj
Actually the current version allows you to delay the allocation to a later time (e.g. page fault time) if you don't call fallocate() on the private fd. fallocate() is necessary in previous versions because we treat the existense in the fd as 'private' but in this version we track

  1   2   3   >