[PATCH RFC v3 03/11] virtio-net: Move virtio_net_get_features() down

2024-09-14 Thread Akihiko Odaki
Move virtio_net_get_features() to the later part of the file so that it can call other functions. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 146 ++-- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/hw/net/virtio-net.c b

[PATCH RFC v3 11/11] docs/devel/ebpf_rss.rst: Update for peer RSS

2024-09-14 Thread Akihiko Odaki
eBPF RSS virtio-net support was written in assumption that there is only one alternative RSS implementation: 'in-qemu' RSS. It is no longer true, and we now have yet another implementation; namely the peer RSS. Signed-off-by: Akihiko Odaki --- docs/devel/ebpf_rss.rst | 23 ---

[PATCH RFC v3 08/11] virtio-net: Use qemu_set_vnet_hash()

2024-09-14 Thread Akihiko Odaki
This is necessary to offload hashing to tap. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 77 - 1 file changed, 64 insertions(+), 13 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 38ccd706f956..be6759d1c0f4

[PATCH RFC v3 09/11] virtio-net: Offload hashing without vhost

2024-09-14 Thread Akihiko Odaki
This is necessary to offload hashing to tap. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index be6759d1c0f4..72493b652bf5 100644 --- a/hw/net/virtio-net.c ++

[PATCH RFC v3 05/11] net/vhost-vdpa: Remove dummy SetSteeringEBPF

2024-09-14 Thread Akihiko Odaki
It is no longer used. Signed-off-by: Akihiko Odaki --- net/vhost-vdpa.c | 8 1 file changed, 8 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 4af87ea226b4..5d846db5e71f 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -245,12 +245,6 @@ static void vhost_vdpa

[PATCH RFC v3 02/11] net/vhost-vdpa: Report hashing capability

2024-09-14 Thread Akihiko Odaki
Report hashing capability so that virtio-net can deliver the correct capability information to the guest. Signed-off-by: Akihiko Odaki --- include/net/net.h | 3 +++ net/net.c | 9 + net/vhost-vdpa.c | 28 3 files changed, 40 insertions(+) diff --

[PATCH RFC v3 07/11] net: Allow configuring virtio hashing

2024-09-14 Thread Akihiko Odaki
This adds set_vnet_hash() to configure virtio hashing and implements it for Linux's tap. vDPA will have an empty function as configuring virtio hashing is done with the load(). Signed-off-by: Akihiko Odaki --- include/net/net.h | 17 + net/tap-linux.h | 1 + net/tap_int.h

[PATCH RFC v3 06/11] virtio-net: Add hash type options

2024-09-14 Thread Akihiko Odaki
By default, virtio-net limits the hash types that will be advertised to the guest so that all hash types are covered by the offloading capability the client provides. This change allows to override this behavior and to advertise hash types that require user-space hash calculation by specifying "on"

[PATCH RFC v3 01/11] qdev-properties: DEFINE_PROP_ON_OFF_AUTO_BIT()

2024-09-14 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- include/hw/qdev-properties.h | 18 hw/core/qdev-properties.c| 66 +++- 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 09aa04c

[PATCH RFC v3 10/11] tap: Report virtio-net hashing support on Linux

2024-09-14 Thread Akihiko Odaki
This allows offloading virtio-net hashing to tap on Linux. Signed-off-by: Akihiko Odaki --- net/tap-linux.h | 1 + net/tap_int.h | 1 + net/tap-bsd.c | 5 + net/tap-linux.c | 13 + net/tap-solaris.c | 5 + net/tap-stub.c| 5 + net/tap.c | 8 +

[PATCH RFC v3 04/11] virtio-net: Retrieve peer hashing capability

2024-09-14 Thread Akihiko Odaki
Retrieve peer hashing capability instead of hardcoding. Signed-off-by: Akihiko Odaki --- include/hw/virtio/virtio-net.h | 5 +++- hw/net/virtio-net.c| 67 ++ net/vhost-vdpa.c | 4 +-- 3 files changed, 60 insertions(+), 16 deleti

[PATCH RFC v3 00/11] virtio-net: Offload hashing without eBPF

2024-09-14 Thread Akihiko Odaki
Based-on: <20240915-queue-v1-0-b49bd49b9...@daynix.com> ("[PATCH 0/7] virtio-net fixes") I'm proposing to add a feature to offload virtio-net RSS/hash report to Linux. This series contain patches to utilize the proposed Linux feature. The patches for Linux are available at: https://lore.kernel.org

[PATCH 6/7] virtio-net: Copy received header to buffer

2024-09-14 Thread Akihiko Odaki
receive_header() used to cast the const qualifier of the pointer to the received packet away to modify the header. Avoid this by copying the received header to buffer. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 85 + 1 file changed,

[PATCH 1/7] net: checksum: Convert data to void *

2024-09-14 Thread Akihiko Odaki
Convert the data parameter of net_checksum_calculate() to void * to save unnecessary casts for callers. Signed-off-by: Akihiko Odaki --- include/net/checksum.h | 2 +- net/checksum.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/checksum.h b/include

[PATCH 5/7] virtio-net: Initialize hash reporting values

2024-09-14 Thread Akihiko Odaki
The specification says hash_report should be set to VIRTIO_NET_HASH_REPORT_NONE if VIRTIO_NET_F_HASH_REPORT is negotiated but not configured with VIRTIO_NET_CTRL_MQ_RSS_CONFIG. However, virtio_net_receive_rcu() instead wrote out the content of the extra_hdr variable, which is not uninitialized in s

[PATCH 3/7] virtio-net: Do not check for the queue before RSS

2024-09-14 Thread Akihiko Odaki
virtio_net_can_receive() checks if the queue is ready, but RSS will change the queue to use so, strictly speaking, we may still be able to receive the packet even if the queue initially provided is not ready. Perform RSS before virtio_net_can_receive() to cover such a case. Fixes: 4474e37a5b3a ("v

[PATCH 7/7] virtio-net: Fix num_buffers for version 1

2024-09-14 Thread Akihiko Odaki
The specification says the device MUST set num_buffers to 1 if VIRTIO_NET_F_MRG_RXBUF has not been negotiated. Fixes: df91055db5c9 ("virtio-net: enable virtio 1.0") Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/net/virtio-net.c b/hw

[PATCH 0/7] virtio-net fixes

2024-09-14 Thread Akihiko Odaki
Most of this series are fixes for software RSS and hash reporting, which should have no production user. However there is one exception; patch "virtio-net: Fix size check in dhclient workaround" fixes an out-of-bound access that can be triggered for anyone who don't use vhost. It has Cc: qemu-sta.

[PATCH 2/7] virtio-net: Fix size check in dhclient workaround

2024-09-14 Thread Akihiko Odaki
work_around_broken_dhclient() accesses IP and UDP headers to detect relevant packets and to calculate checksums, but it didn't check if the packet has size sufficient to accommodate them, causing out-of-bound access hazards. Fix this by correcting the size requirement. Fixes: 1d41b0c1ec66 ("Work a

[PATCH 4/7] virtio-net: Fix hash reporting when the queue changes

2024-09-14 Thread Akihiko Odaki
virtio_net_process_rss() fills the values used for hash reporting, but the values used to be thrown away with a recursive function call if the queue changes after RSS. Avoid the function call to keep the values. Fixes: a4c960eedcd2 ("virtio-net: Do not write hashes to peer buffer") Signed-off-by:

Re: [RFC PATCH] contrib/plugins: avoid hanging program

2024-09-14 Thread Richard Henderson
On 9/13/24 10:38, Alex Bennée wrote: Although we asks for instructions per second we work in quanta and that cannot be 0. Fail to load the plugin instead and report the minimum IPS we can handle. Signed-off-by: Alex Bennée Reported-by: Elisha Hollander --- contrib/plugins/ips.c | 5 + 1 f

[PATCH 1/2] hw/loongarch/boot: Refactor EFI booting protocol generation

2024-09-14 Thread Jiaxun Yang
Refector EFI style booting data structure generation to support 32bit EFI variant on LoongArch32 CPU. All data structs are filled with padding members if necessary and marked as QEMU_PACKED to avoid host ABI alignment impact. Host endian is being cared as well. It also fixed various problems in

[PATCH 2/2] hw/loongarch/boot: Rework boot code generation

2024-09-14 Thread Jiaxun Yang
Use stl_p to write instructions so that host endian conversion will be performed. Replace mailbox read/write on LoongArch32 systems with 32bit IOCSR instructions to prevent illegal instructions. Signed-off-by: Jiaxun Yang --- hw/loongarch/boot.c | 107 +--

[PATCH 0/2] hw/loongarch/booting: Booting protocol refactoring

2024-09-14 Thread Jiaxun Yang
change-id: 20240914-loongarch-booting-b5ae3f4976b7 Best regards, -- Jiaxun Yang

Re: [PATCH v10 9/9] rust: add PL011 device model

2024-09-14 Thread Junjie Mao
Junjie Mao writes: > Manos Pitsidianakis writes: > >> This commit adds a re-implementation of hw/char/pl011.c in Rust. >> >> How to build: >> >> 1. Configure a QEMU build with: >>--enable-system --target-list=aarch64-softmmu --enable-rust >> 2. Launching a VM with qemu-system-aarch64 should

[PATCH v1] hw/cxl: Fix background completion percentage calculation

2024-09-14 Thread ajay.opensrc
From: Ajay Joshi The current completion percentage calculation does not account for the relative time since the start of the background activity, this leads to showing incorrect start percentage vs what has actually been completed. This patch calculates the percentage based on the actual elapsed

[PATCH v2] i386/cpu: fixup number of addressable IDs for logical processors in the physical package

2024-09-14 Thread Chuang Xu
When QEMU is started with: -cpu host,migratable=on,host-cache-info=on,l3-cache=off -smp 180,sockets=2,dies=1,cores=45,threads=2 Execute "cpuid -1 -l 1 -r" in guest, we'll get: eax=0x000806f8 ebx=0x465a0800 ecx=0xfffaba1f edx=0x3fa9fbff CPUID.01H.EBX[23:16] is 90, while the expected value is 128.

Re: [RFC PATCH 0/2] qtest: Log verbosity changes

2024-09-14 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Fri, Sep 06, 2024 at 10:52:53AM +0100, Peter Maydell wrote: >> On Fri, 6 Sept 2024 at 09:14, Daniel P. Berrangé wrote: >> > >> > On Fri, Sep 06, 2024 at 08:16:31AM +0200, Thomas Huth wrote: >> > > On 05/09/2024 23.03, Fabiano Rosas wrote: >> > > > Hi, >> > > > >>

Re: [PULL 00/47] riscv-to-apply queue

2024-09-14 Thread Alistair Francis
On Fri, Sep 13, 2024 at 8:37 PM Peter Maydell wrote: > > On Thu, 12 Sept 2024 at 06:30, Alistair Francis wrote: > > > > The following changes since commit a4eb31c678400472de0b4915b9154a7c20d8332f: > > > > Merge tag 'pull-testing-gdbstub-oct-100924-1' of > > https://gitlab.com/stsquad/qemu into

-chardev with a JSON argument (was: [PATCH] chardev: introduce 'reconnect-ms' and deprecate 'reconnect')

2024-09-14 Thread Markus Armbruster
Peter Krempa writes: > This is a little off-topic: > > So I wanted to make libvirt use the new parameter to stay ahead > deprecation. I've applied this patch to qemu, dumped capabilities and > pretty much expected a bunch of test cases in libvirt fail as they'd be > using a deprecated field as li

Re: [PATCH v10 8/9] rust: add utility procedural macro crate

2024-09-14 Thread Junjie Mao
Manos Pitsidianakis writes: > This commit adds a helper crate library, qemu-api-macros for derive (and > other procedural) macros to be used along qemu-api. > > It needs to be a separate library because in Rust, procedural macros, or > macros that can generate arbitrary code, need to be special s

Re: [PATCH v10 9/9] rust: add PL011 device model

2024-09-14 Thread Junjie Mao
Manos Pitsidianakis writes: > This commit adds a re-implementation of hw/char/pl011.c in Rust. > > How to build: > > 1. Configure a QEMU build with: >--enable-system --target-list=aarch64-softmmu --enable-rust > 2. Launching a VM with qemu-system-aarch64 should use the Rust version >of th

Re: [RFC PATCH V2 5/5] hw/loongarch: Add KVM pch msi device support

2024-09-14 Thread maobibo
Hi Xianglai, I do not find any usage about function kvm_irqchip_commit_routes() in your patch-set, do I miss something? Regards Bibo Mao On 2024/9/10 下午8:18, Xianglai Li wrote: Added pch_msi interrupt controller handling during kernel emulation of irq chip. Signed-off-by: Xianglai Li --- C

Re: [PATCH v2] chardev: introduce 'reconnect-ms' and deprecate 'reconnect'

2024-09-14 Thread Markus Armbruster
Daniil Tatianin writes: > The 'reconnect' option only allows to specify the time in seconds, > which is way too long for certain workflows. > > We have a lightweight disk backend server, which takes about 20ms to > live update, but due to this limitation in QEMU, previously the guest > disk contr