Re: [PATCH v3 3/3] meson: Drop the .fa library prefix

2024-05-24 Thread Akihiko Odaki
On 2024/05/22 22:45, Paolo Bonzini wrote: On Wed, May 22, 2024 at 12:49 PM Akihiko Odaki wrote: The non-standard .fa library prefix breaks the link source de-duplication done by Meson so drop it. Can you show the difference in the command lines? Without this patch: clang -o qemu-io qemu

[PATCH RFC 0/2] meson: Pass objects to declare_dependency()

2024-05-24 Thread Akihiko Odaki
mu/build/../block/vmdk.c:1865) >>> qemu-img.lto.o:(vmdk_write_extent) ld.lld: error: undefined symbol: inflateReset >>> referenced by cloop.c:240 (/home/me/q/var/qemu/build/../block/cloop.c:240) >>> qemu-img.lto.o:(cloop_read_blo

[PATCH RFC 2/2] Revert "meson: Propagate gnutls dependency"

2024-05-24 Thread Akihiko Odaki
This reverts commit 3eacf70bb5a83e4775ad8003cbca63a40f70c8c2. Signed-off-by: Akihiko Odaki --- meson.build| 4 ++-- block/meson.build | 2 +- io/meson.build | 2 +- storage-daemon/meson.build | 2 +- ui/meson.build | 2 +- 5 files changed, 6

[PATCH RFC 1/2] meson: Pass objects to declare_dependency()

2024-05-24 Thread Akihiko Odaki
(). This requires Meson 1.1.0 or later. Signed-off-by: Akihiko Odaki --- docs/devel/build-system.rst | 2 +- meson.build | 27 ++- gdbstub/meson.build | 4 ++-- subprojects/libvhost-user/meson.build | 2 +- tests/qtest/libqos

[PATCH v4 3/4] qapi: Do not cast function pointers

2024-05-23 Thread Akihiko Odaki
-fsanitize=undefined complains if function pointers are casted. It also prevents enabling teh strict mode of CFI which is currently disabled with -fsanitize-cfi-icall-generalize-pointers. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2346 Signed-off-by: Akihiko Odaki --- include/qapi

[PATCH v4 0/4] Fix sanitizer errors with clang 18.1.1

2024-05-23 Thread Akihiko Odaki
ent Vivier To: Paolo Bonzini To: Marc-André Lureau To: Daniel P. Berrangé To: Thomas Huth To: Philippe Mathieu-Daudé To: Alex Bennée To: Wainer dos Santos Moschetta To: Beraldo Leal To: Richard Henderson To: Laurent Vivier Cc: qemu-devel@nongnu.org Signed-off-by: Akihiko Odaki Cha

[PATCH v4 4/4] meson: Drop the .fa library suffix

2024-05-23 Thread Akihiko Odaki
ard suffix. The occurences of the suffix were detected and removed by performing a tree-wide search with 'fa' and .fa (note the quotes and dot). Signed-off-by: Akihiko Odaki --- docs/devel/build-system.rst | 5 - meson.build | 17 ++--- stubs/blk-exp-c

[PATCH v4 2/4] lockable: Do not cast function pointers

2024-05-23 Thread Akihiko Odaki
-fsanitize=undefined complains if function pointers are casted. It also prevents enabling teh strict mode of CFI which is currently disabled with -fsanitize-cfi-icall-generalize-pointers. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2345 Signed-off-by: Akihiko Odaki --- include/qemu

[PATCH v4 1/4] qemu-keymap: Make references to allocations static

2024-05-23 Thread Akihiko Odaki
LeakSanitizer complains about allocations whose references are held only by automatic variables. It is possible to free them to suppress the complaints, but it is a chore to make sure they are freed in all exit paths so make them static instead. Signed-off-by: Akihiko Odaki --- qemu-keymap.c

Re: [PATCH v3 1/3] qemu-keymap: Free xkb allocations

2024-05-23 Thread Akihiko Odaki
On 2024/05/22 23:36, Peter Maydell wrote: On Wed, 22 May 2024 at 12:47, Daniel P. Berrangé wrote: On Wed, May 22, 2024 at 12:35:23PM +0100, Peter Maydell wrote: On Wed, 22 May 2024 at 11:49, Akihiko Odaki wrote: This fixes LeakSanitizer complaints with xkbcommon 1.6.0. Signed-off

[PATCH v3 3/3] meson: Drop the .fa library prefix

2024-05-22 Thread Akihiko Odaki
ard prefix. The occurences of the prefix were detected and removed by performing a tree-wide search with 'fa' and .fa (note the quotes and dot). Signed-off-by: Akihiko Odaki --- docs/devel/build-system.rst | 5 - meson.build | 17 ++--- stubs/blk-exp-c

[PATCH v3 2/3] meson: Add -fno-sanitize=function

2024-05-22 Thread Akihiko Odaki
-by: Akihiko Odaki --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 91a0aa64c640..3c3ad0d5f5eb 100644 --- a/meson.build +++ b/meson.build @@ -298,7 +298,7 @@ endforeach qemu_common_flags = [ '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64

[PATCH v3 1/3] qemu-keymap: Free xkb allocations

2024-05-22 Thread Akihiko Odaki
This fixes LeakSanitizer complaints with xkbcommon 1.6.0. Signed-off-by: Akihiko Odaki --- qemu-keymap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-keymap.c b/qemu-keymap.c index 8c80f7a4ed65..7a9f38cf9863 100644 --- a/qemu-keymap.c +++ b/qemu-keymap.c @@ -237,6 +237,9 @@ int

[PATCH v3 0/3] Fix sanitizer errors with clang 18.1.1

2024-05-22 Thread Akihiko Odaki
ent Vivier To: Paolo Bonzini To: Marc-André Lureau To: Daniel P. Berrangé To: Thomas Huth To: Philippe Mathieu-Daudé To: Alex Bennée To: Wainer dos Santos Moschetta To: Beraldo Leal To: Richard Henderson To: Laurent Vivier Cc: qemu-devel@nongnu.org Signed-off-by: Akihiko Odaki Cha

[PATCH v2 0/3] Fix sanitizer errors with clang 18.1.1

2024-05-22 Thread Akihiko Odaki
ent Vivier To: Paolo Bonzini To: Marc-André Lureau To: Daniel P. Berrangé To: Thomas Huth To: Philippe Mathieu-Daudé To: Alex Bennée To: Wainer dos Santos Moschetta To: Beraldo Leal To: Richard Henderson To: Laurent Vivier Cc: qemu-devel@nongnu.org Signed-off-by: Akihiko Odaki Cha

[PATCH v2 3/3] meson: Drop the .fa library prefix

2024-05-22 Thread Akihiko Odaki
ard prefix. The occurances of the prefix was detected and removed by performing a tree-wide search with 'fa' and .fa (note the quotes and dot). Signed-off-by: Akihiko Odaki --- docs/devel/build-system.rst | 5 - stubs/blk-exp-close-all.c | 2 +- .gitlab-ci.d/buildtest-templa

[PATCH v2 1/3] qemu-keymap: Free xkb allocations

2024-05-22 Thread Akihiko Odaki
This fixes LeakSanitizer complaints with xkbcommon 1.6.0. Signed-off-by: Akihiko Odaki --- qemu-keymap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-keymap.c b/qemu-keymap.c index 8c80f7a4ed65..7a9f38cf9863 100644 --- a/qemu-keymap.c +++ b/qemu-keymap.c @@ -237,6 +237,9 @@ int

[PATCH v2 2/3] meson: Add -fno-sanitize=function

2024-05-22 Thread Akihiko Odaki
-by: Akihiko Odaki --- meson.build | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 91a0aa64c640..9eaf218609eb 100644 --- a/meson.build +++ b/meson.build @@ -298,7 +298,7 @@ endforeach qemu_common_flags = [ '-D_GNU_SOURCE

Re: [PATCH v12 10/13] virtio-gpu: Move fence_poll timer to VirtIOGPUGL

2024-05-19 Thread Akihiko Odaki
On 2024/05/20 6:27, Dmitry Osipenko wrote: Move fence_poll timer to VirtIOGPUGL for consistency with cmdq_resume_bh that are used only by GL device. Signed-off-by: Dmitry Osipenko Thanks for refacotoring. Please move this before "[PATCH v12 01/13] virtio-gpu: Unrealize GL device" so that

Re: [PATCH v12 09/13] virtio-gpu: Handle resource blob commands

2024-05-19 Thread Akihiko Odaki
On 2024/05/20 6:27, Dmitry Osipenko 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 Signed-off-by: Antonio

Re: [PATCH v2 1/1] riscv, gdbstub.c: fix reg_width in ricsv_gen_dynamic_vector_feature()

2024-05-18 Thread Akihiko Odaki
append_reg(). Cc: Akihiko Odaki Cc: Alex Bennée Reported-by: Robin Dapp Fixes: 33a24910ae ("target/riscv: Use GDBFeature for dynamic XML") Signed-off-by: Daniel Henrique Barboza Reviewed-by: LIU Zhiwei Acked-by: Alex Bennée Reviewed-by: Akihiko Odaki

Re: [PATCH v11 08/10] virtio-gpu: Handle resource blob commands

2024-05-15 Thread Akihiko Odaki
On 2024/05/16 2:15, Dmitry Osipenko wrote: On 5/15/24 20:04, Akihiko Odaki wrote: VIRTIO_GPU_CMD_RESOURCE_UNREF should also call virtio_gpu_virgl_async_unmap_resource_blob(). I guess that's the original intention of having a function for this instead of inlining the content of this function

Re: [PATCH v11 08/10] virtio-gpu: Handle resource blob commands

2024-05-15 Thread Akihiko Odaki
On 2024/05/16 2:01, Dmitry Osipenko wrote: On 5/15/24 19:42, Akihiko Odaki wrote: It may be better to actually implement unmapping instead of returning an error for consistency with the iov operation. Apparently crosvm also unmaps blobs with VIRTIO_GPU_CMD_RESOURCE_UNREF. Then I'll add back

Re: [PATCH v11 08/10] virtio-gpu: Handle resource blob commands

2024-05-15 Thread Akihiko Odaki
On 2024/05/16 1:39, Dmitry Osipenko wrote: On 5/13/24 12:18, Akihiko Odaki wrote:     static void virgl_cmd_resource_unref(VirtIOGPU *g, - struct virtio_gpu_ctrl_command *cmd) + struct virtio_gpu_ctrl_command *cmd

Re: [PATCH v11 01/10] virtio-gpu: Unrealize GL device

2024-05-15 Thread Akihiko Odaki
On 2024/05/16 1:18, Dmitry Osipenko wrote: On 5/13/24 11:44, Akihiko Odaki wrote: On 2024/05/12 3:22, Dmitry Osipenko wrote: Even though GL GPU doesn't support hotplugging today, free virgl resources when GL device is unrealized. For consistency. Signed-off-by: Dmitry Osipenko ---   hw

Re: [PATCH v11 09/10] virtio-gpu: Register capsets dynamically

2024-05-13 Thread Akihiko Odaki
On 2024/05/12 3:22, Dmitry Osipenko wrote: From: Pierre-Eric Pelloux-Prayer virtio_gpu_virgl_get_num_capsets will return "num_capsets", but we can't assume that capset_index 1 is always VIRGL2 once we'll support more capsets, like Venus and DRM capsets. Register capsets dynamically to avoid

Re: [PATCH v11 08/10] virtio-gpu: Handle resource blob commands

2024-05-13 Thread Akihiko Odaki
On 2024/05/12 3:22, Dmitry Osipenko 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 Signed-off-by: Antonio

Re: [PATCH v11 01/10] virtio-gpu: Unrealize GL device

2024-05-13 Thread Akihiko Odaki
On 2024/05/12 3:22, Dmitry Osipenko wrote: Even though GL GPU doesn't support hotplugging today, free virgl resources when GL device is unrealized. For consistency. Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-gl.c | 11 +++ hw/display/virtio-gpu-virgl.c | 9

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

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

Re: [PATCH] qemu-keymap: Free xkb allocations

2024-05-05 Thread Akihiko Odaki
On 2024/05/05 19:24, Michael Tokarev wrote: 01.05.2024 10:55, Akihiko Odaki wrote: This fixes LeakSanitizer complaints with xkbcommon 1.6.0. Signed-off-by: Akihiko Odaki ---   qemu-keymap.c | 3 +++   1 file changed, 3 insertions(+) diff --git a/qemu-keymap.c b/qemu-keymap.c index

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

2024-05-05 Thread Akihiko Odaki
On 2024/05/02 4:20, Dmitry Osipenko wrote: On 4/27/24 08:52, Akihiko Odaki wrote: On 2024/04/24 19:30, Dmitry Osipenko wrote: On 4/19/24 12:18, Akihiko Odaki wrote: @@ -61,6 +61,10 @@ struct virtio_gpu_simple_resource {    int dmabuf_fd;    uint8_t *remapped;    +    MemoryRegion

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

2024-05-05 Thread Akihiko Odaki
On 2024/05/02 4:02, Dmitry Osipenko wrote: On 4/27/24 08:48, Akihiko Odaki wrote: The VIRTIO_GPU_FILL_CMD() macro returns void and this macro is used by every function processing commands. Changing process_cmd() to return bool will require to change all those functions. Not worthwhile

Re: [PATCH v9 09/11] virtio-gpu: Register capsets dynamically

2024-05-03 Thread Akihiko Odaki
On 2024/05/02 4:52, Dmitry Osipenko wrote: On 5/1/24 22:38, Dmitry Osipenko wrote: On 5/1/24 22:31, Dmitry Osipenko wrote: On 4/27/24 10:12, Akihiko Odaki wrote:   int virtio_gpu_virgl_get_num_capsets(VirtIOGPU *g)   {   uint32_t capset2_max_ver, capset2_max_size; + +    if (g

[PATCH] qemu-keymap: Free xkb allocations

2024-05-01 Thread Akihiko Odaki
This fixes LeakSanitizer complaints with xkbcommon 1.6.0. Signed-off-by: Akihiko Odaki --- qemu-keymap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-keymap.c b/qemu-keymap.c index 8c80f7a4ed65..7a9f38cf9863 100644 --- a/qemu-keymap.c +++ b/qemu-keymap.c @@ -237,6 +237,9 @@ int

Re: [PATCH 0/3] virtio-net: Convert feature properties to OnOffAuto

2024-05-01 Thread Akihiko Odaki
On 2024/04/29 16:05, Michael S. Tsirkin wrote: On Sun, Apr 28, 2024 at 04:21:06PM +0900, Akihiko Odaki wrote: Based-on: <20240428-rss-v10-0-73cbaa91a...@daynix.com> ("[PATCH v10 00/18] virtio-net RSS/hash report fixes and improvements") Some features are not always available

Re: [PATCH 2/3] virtio-net: Convert feature properties to OnOffAuto

2024-05-01 Thread Akihiko Odaki
On 2024/05/01 0:02, Yuri Benditovich wrote: Question: How will libvirt (as an example) work with this change. In the existing semantic of libvirt profile the "on" means "on if possible" and using existing profile after qemu update will still use "on" with meaning "force"? > Typically this is

Re: [PATCH 1/3] qdev-properties: Add DEFINE_PROP_ON_OFF_AUTO_BIT64()

2024-05-01 Thread Akihiko Odaki
On 2024/04/30 23:41, Yuri Benditovich wrote: On Sun, Apr 28, 2024 at 10:21 AM Akihiko Odaki wrote: DEFINE_PROP_ON_OFF_AUTO_BIT64() corresponds to DEFINE_PROP_ON_OFF_AUTO() as DEFINE_PROP_BIT64() corresponds to DEFINE_PROP_BOOL(). The difference is that DEFINE_PROP_ON_OFF_AUTO_BIT64() exposes

Re: [PATCH 1/1] Fix safeAreaInsets not being available on OS X 10.13

2024-04-28 Thread Akihiko Odaki
, Akihiko Odaki Thanks in advance! Kind regards, Tobias Markus Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2314 Signed-off-by: Tobias Markus ---  ui/cocoa.m | 2 ++  1 file changed, 2 insertions(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index 25e0db9dd0..96992736ef 100644 --- a/ui

[PATCH 1/2] util/iov: Do not assert offset is in iov

2024-04-28 Thread Akihiko Odaki
the given offset. Signed-off-by: Akihiko Odaki --- include/qemu/iov.h | 5 +++-- util/iov.c | 5 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/qemu/iov.h b/include/qemu/iov.h index 63a1c01965d1..33548058d2ee 100644 --- a/include/qemu/iov.h +++ b/include/

[PATCH 2/2] Revert "hw/net/net_tx_pkt: Fix overrun in update_sctp_checksum()"

2024-04-28 Thread Akihiko Odaki
This reverts commit 83ddb3dbba2ee0f1767442ae6ee665058aeb1093. The added check is no longer necessary due to a change of iov_from_buf(). Signed-off-by: Akihiko Odaki --- hw/net/net_tx_pkt.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index

[PATCH 0/2] util/iov: Do not assert offset is in iov

2024-04-28 Thread Akihiko Odaki
the given offset. Signed-off-by: Akihiko Odaki --- Akihiko Odaki (2): util/iov: Do not assert offset is in iov Revert "hw/net/net_tx_pkt: Fix overrun in update_sctp_checksum()" include/qemu/iov.h | 5 +++-- hw/net/net_tx_pkt.c | 4 util/iov.c | 5 -

[PATCH RFC v4 1/7] hw/pci: Do not add ROM BAR for SR-IOV VF

2024-04-28 Thread Akihiko Odaki
A SR-IOV VF cannot have a ROM BAR. Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index cb5ac46e9f27..201ff64e11cc 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2359,6

[PATCH RFC v4 3/7] pcie_sriov: Ensure PF and VF are mutually exclusive

2024-04-28 Thread Akihiko Odaki
A device cannot be a SR-IOV PF and a VF at the same time. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 56523ab4e833..ec8fc0757b92 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci

[PATCH RFC v4 7/7] virtio-net: Implement SR-IOV VF

2024-04-28 Thread Akihiko Odaki
A virtio-net device can be added as a SR-IOV VF to another virtio-pci device that will be the PF. Signed-off-by: Akihiko Odaki --- hw/virtio/virtio-net-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-net-pci.c b/hw/virtio/virtio-net-pci.c index e03543a70a75

[PATCH RFC v4 0/7] virtio-net: add support for SR-IOV emulation

2024-04-28 Thread Akihiko Odaki
OV VFs with virtio-net-pci. [1] https://patchew.org/QEMU/1689731808-3009-1-git-send-email-yui.wash...@gmail.com/ [2] https://lore.kernel.org/all/5d46f455-f530-4e5e-9ae7-13a2297d4...@daynix.com/ Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- Changes in v4: - Added patch &qu

[PATCH RFC v4 4/7] pcie_sriov: Check PCI Express for SR-IOV PF

2024-04-28 Thread Akihiko Odaki
SR-IOV requires PCI Express. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index ec8fc0757b92..3af0cc7d560a 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -42,6 +42,11

[PATCH RFC v4 6/7] virtio-pci: Implement SR-IOV PF

2024-04-28 Thread Akihiko Odaki
Allow user to attach SR-IOV VF to a virtio-pci PF. Signed-off-by: Akihiko Odaki --- hw/virtio/virtio-pci.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index eaaf86402cfa..996bb2cbad20 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw

[PATCH RFC v4 5/7] pcie_sriov: Allow user to create SR-IOV device

2024-04-28 Thread Akihiko Odaki
-creatable VFs can be attached calls pcie_sriov_pf_init_from_user_created_vfs() during realization and pcie_sriov_pf_exit() when exiting. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci_device.h | 6 +- include/hw/pci/pcie_sriov.h | 19 +++ hw/pci/pci.c| 62 ++ hw/pci

[PATCH RFC v4 2/7] hw/pci: Fix SR-IOV VF number calculation

2024-04-28 Thread Akihiko Odaki
pci_config_get_bar_addr() had a division by vf_stride. vf_stride needs to be non-zero when there are multiple VFs, but the specification does not prohibit to make it zero when there is only one VF. Do not perform the division for the first VF to avoid division by zero. Signed-off-by: Akihiko

[PATCH 3/3] virtio-net: Report RSS warning at device realization

2024-04-28 Thread Akihiko Odaki
Warning about RSS fallback at device realization allows the user to notice the configuration problem early. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index

[PATCH 2/3] virtio-net: Convert feature properties to OnOffAuto

2024-04-28 Thread Akihiko Odaki
tting them "auto". QEMU will give an error if they are set "on". Signed-off-by: Akihiko Odaki --- include/hw/virtio/virtio-net.h | 2 +- hw/net/virtio-net.c| 247 + 2 files changed, 152 insertions(+), 97 deletions(-) diff --

[PATCH 1/3] qdev-properties: Add DEFINE_PROP_ON_OFF_AUTO_BIT64()

2024-04-28 Thread Akihiko Odaki
DEFINE_PROP_ON_OFF_AUTO_BIT64() corresponds to DEFINE_PROP_ON_OFF_AUTO() as DEFINE_PROP_BIT64() corresponds to DEFINE_PROP_BOOL(). The difference is that DEFINE_PROP_ON_OFF_AUTO_BIT64() exposes OnOffAuto instead of bool. Signed-off-by: Akihiko Odaki --- include/hw/qdev-properties.h | 18

[PATCH 0/3] virtio-net: Convert feature properties to OnOffAuto

2024-04-28 Thread Akihiko Odaki
o "on". Convert feature properties to OnOffAuto so that the user can explicitly tell QEMU to automatically select the value by setting them "auto". QEMU will give an error if they are set "on". Signed-off-by: Akihiko Odaki --- Akihiko Odaki (3): qdev

[PATCH v10 12/18] virtio-net: Unify the logic to update NIC state for RSS

2024-04-28 Thread Akihiko Odaki
The code to attach or detach the eBPF program to RSS were duplicated so unify them into one function to save some code. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 90 + 1 file changed, 36 insertions(+), 54 deletions(-) diff --git

[PATCH v10 10/18] virtio-net: Shrink header byte swapping buffer

2024-04-28 Thread Akihiko Odaki
Byte swapping is only performed for the part of header shared with the legacy standard and the buffer only needs to cover it. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net

[PATCH v10 07/18] virtio-net: Do not propagate ebpf-rss-fds errors

2024-04-28 Thread Akihiko Odaki
when a function returns false, but virtio_net_load_ebpf_fds() and virtio_net_load_ebpf() returns false without setting an error, which is confusing. Remove the propagation to fix these problems. Fixes: 0524ea0510a3 ("ebpf: Added eBPF initialization by fds.") Signed-off-by: Akihiko Odak

[PATCH v10 16/18] ebpf: Return 0 when configuration fails

2024-04-28 Thread Akihiko Odaki
The kernel interprets the returned value as an unsigned 32-bit so -1 will mean queue 4294967295, which is awkward. Return 0 instead. Signed-off-by: Akihiko Odaki --- ebpf/rss.bpf.skeleton.h | 1532 +++ tools/ebpf/rss.bpf.c|2 +- 2 files

[PATCH v10 11/18] virtio-net: Disable RSS on reset

2024-04-28 Thread Akihiko Odaki
RSS is disabled by default. Fixes: 590790297c ("virtio-net: implement RSS configuration command") Signed-off-by: Akihiko Odaki Reviewed-by: Michael Tokarev --- hw/net/virtio-net.c | 70 +++-- 1 file changed, 36 insertions(+), 34

[PATCH v10 17/18] ebpf: Refactor tun_rss_steering_prog()

2024-04-28 Thread Akihiko Odaki
This saves branches and makes later BPF program changes easier. Signed-off-by: Akihiko Odaki --- tools/ebpf/rss.bpf.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/tools/ebpf/rss.bpf.c b/tools/ebpf/rss.bpf.c index 77434435ac15..c989cb3cd82c

[PATCH v10 14/18] virtio-net: Do not write hashes to peer buffer

2024-04-28 Thread Akihiko Odaki
The peer buffer is qualified with const and not meant to be modified. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 36 +--- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 527aac3a0465

[PATCH v10 06/18] tap: Shrink zeroed virtio-net header

2024-04-28 Thread Akihiko Odaki
tap prepends a zeroed virtio-net header when writing a packet to a tap with virtio-net header enabled but not in use. This only happens when s->host_vnet_hdr_len == sizeof(struct virtio_net_hdr). Signed-off-by: Akihiko Odaki --- net/tap.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH v10 15/18] ebpf: Fix RSS error handling

2024-04-28 Thread Akihiko Odaki
calculate_rss_hash() was using hash value 0 to tell if it calculated a hash, but the hash value may be 0 on a rare occasion. Have a distinct bool value for correctness. Fixes: f3fa412de2 ("ebpf: Added eBPF RSS program.") Signed-off-by: Akihiko Odaki --- ebpf/rss.bpf.skeleto

[PATCH v10 18/18] ebpf: Add a separate target for skeleton

2024-04-28 Thread Akihiko Odaki
This generalizes the rule to generate the skeleton and allows to add another. Signed-off-by: Akihiko Odaki --- tools/ebpf/Makefile.ebpf | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/ebpf/Makefile.ebpf b/tools/ebpf/Makefile.ebpf index 3391e7ce0898

[PATCH v10 01/18] tap: Remove tap_probe_vnet_hdr_len()

2024-04-28 Thread Akihiko Odaki
It was necessary since an Linux older than 2.6.35 may implement the virtio-net header but may not allow to change its length. Remove it since such an old Linux is no longer supported. Signed-off-by: Akihiko Odaki Acked-by: Michael S. Tsirkin --- net/tap_int.h | 1 - net/tap-bsd.c | 5

[PATCH v10 08/18] virtio-net: Add only one queue pair when realizing

2024-04-28 Thread Akihiko Odaki
queue") Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 8ede38aadbbe..e33bdbfd84a5 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3759,9 +3759,7 @@ s

[PATCH v10 05/18] tap: Call tap_receive_iov() from tap_receive()

2024-04-28 Thread Akihiko Odaki
This will save duplicate logic found in both of tap_receive_iov() and tap_receive(). Suggested-by: "Zhang, Chen" Signed-off-by: Akihiko Odaki --- net/tap.c | 35 +-- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/net/tap.c b/net/t

[PATCH v10 13/18] virtio-net: Always set populate_hash

2024-04-28 Thread Akihiko Odaki
The member is not cleared during reset so may have a stale value. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 61b49e335dea..527aac3a0465 100644 --- a/hw/net/virtio-net.c +++ b/hw/net

[PATCH v10 09/18] virtio-net: Copy header only when necessary

2024-04-28 Thread Akihiko Odaki
The copied header is only used for byte swapping. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index e33bdbfd84a5..ca0fbf7b7654 100644 --- a/hw/net

[PATCH v10 00/18] virtio-net RSS/hash report fixes and improvements

2024-04-28 Thread Akihiko Odaki
: Add a separate target for skeleton". V2 -> V3: Added patch "tap: Remove tap_probe_vnet_hdr_len()". Added patch "tap: Remove qemu_using_vnet_hdr()". Added patch "net: Move virtio-net header length assertion". Added patch "net: Remove receive_raw(

[PATCH v10 03/18] net: Move virtio-net header length assertion

2024-04-28 Thread Akihiko Odaki
The virtio-net header length assertion should happen for any clients. Signed-off-by: Akihiko Odaki --- net/net.c | 5 + net/tap.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/net.c b/net/net.c index bd51037ebfb0..db096765f4b2 100644 --- a/net/net.c +++ b/net

[PATCH v10 02/18] tap: Remove qemu_using_vnet_hdr()

2024-04-28 Thread Akihiko Odaki
(). Signed-off-by: Akihiko Odaki --- include/net/net.h | 7 --- hw/net/e1000e.c | 1 - hw/net/igb.c| 1 - hw/net/net_tx_pkt.c | 4 ++-- hw/net/virtio-net.c | 3 --- hw/net/vmxnet3.c| 2 -- net/dump.c | 4 +--- net/net.c | 24

[PATCH v10 04/18] net: Remove receive_raw()

2024-04-28 Thread Akihiko Odaki
t;tap: allow extended virtio header with hash info") Signed-off-by: Akihiko Odaki --- include/net/net.h | 1 - net/net.c | 18 -- net/tap.c | 1 - 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 6f

Re: [PATCH v9 10/11] virtio-gpu: Support Venus context

2024-04-27 Thread Akihiko Odaki
On 2024/04/26 0:45, Dmitry Osipenko wrote: From: Antonio Caggiano Request Venus when initializing VirGL and if vulkan=true flag is set for virtio-gpu device. Naming it vulkan is a bit confusing as there is also GFXSTREAM_VULKAN capset though virgl does not support it. I think you can just

Re: [PATCH v9 11/11] migration/virtio: Add virtio-gpu section

2024-04-27 Thread Akihiko Odaki
On 2024/04/26 0:45, Dmitry Osipenko wrote: Document virtio-gpu migration specifics. Suggested-by: Akihiko Odaki Signed-off-by: Dmitry Osipenko --- docs/devel/migration/virtio.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/docs/devel/migration/virtio.rst b/docs/devel

Re: [PATCH v9 09/11] virtio-gpu: Register capsets dynamically

2024-04-27 Thread Akihiko Odaki
On 2024/04/26 0:45, Dmitry Osipenko wrote: From: Pierre-Eric Pelloux-Prayer virtio_gpu_virgl_get_num_capsets will return "num_capsets", but we can't assume that capset_index 1 is always VIRGL2 once we'll support more capsets, like Venus and DRM capsets. Register capsets dynamically to avoid

Re: [PATCH v9 08/11] virtio-gpu: Resource UUID

2024-04-27 Thread Akihiko Odaki
On 2024/04/26 0:45, Dmitry Osipenko wrote: From: Antonio Caggiano Enable resource UUID feature and implement command resource assign UUID. UUID feature availability is mandatory for Vulkan Venus context. UUID is intended for sharing dmabufs between virtio devices on host. Qemu doesn't have

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

2024-04-27 Thread Akihiko Odaki
On 2024/04/26 0:45, Dmitry Osipenko 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 Signed-off-by: Antonio

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

2024-04-26 Thread Akihiko Odaki
On 2024/04/24 19:30, Dmitry Osipenko wrote: On 4/19/24 12:18, Akihiko Odaki wrote: @@ -61,6 +61,10 @@ struct virtio_gpu_simple_resource {   int dmabuf_fd;   uint8_t *remapped;   +    MemoryRegion *mr; +    bool async_unmap_completed; +    bool async_unmap_in_progress; + Don't add

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

2024-04-26 Thread Akihiko Odaki
On 2024/04/24 18:43, Dmitry Osipenko wrote: On 4/19/24 11:53, Akihiko Odaki wrote: On 2024/04/19 4:00, Dmitry Osipenko wrote: Add new "suspended" flag to virtio_gpu_ctrl_command telling cmd processor that it should stop processing commands and retry again next time until flag is unse

Re: [PATCH v2 1/2] net: Provide MemReentrancyGuard * to qemu_new_nic()

2024-04-26 Thread Akihiko Odaki
On 2024/04/24 21:32, Thomas Huth wrote: On 24/04/2024 12.41, Prasad Pandit wrote: On Wednesday, 24 April, 2024 at 03:36:01 pm IST, Philippe Mathieu-Daudé wrote: On 1/6/23 05:18, Akihiko Odaki wrote: Recently MemReentrancyGuard was added to DeviceState to record that the device is engaging

Re: [PATCH v8 11/11] virtio-gpu: Support Venus context

2024-04-19 Thread Akihiko Odaki
On 2024/04/19 4:00, Dmitry Osipenko wrote: From: Antonio Caggiano Request Venus when initializing VirGL and if vulkan=true flag is set for virtio-gpu device. Signed-off-by: Antonio Caggiano Signed-off-by: Huang Rui Signed-off-by: Dmitry Osipenko --- hw/display/virtio-gpu-virgl.c | 14

Re: [PATCH v8 10/11] virtio-gpu: Register capsets dynamically

2024-04-19 Thread Akihiko Odaki
On 2024/04/19 4:00, Dmitry Osipenko wrote: From: Pierre-Eric Pelloux-Prayer virtio_gpu_virgl_get_num_capsets will return "num_capsets", but we can't assume that capset_index 1 is always VIRGL2 once we'll support more capsets, like Venus and DRM capsets. Register capsets dynamically to avoid

Re: [PATCH v8 09/11] virtio-gpu: Resource UUID

2024-04-19 Thread Akihiko Odaki
On 2024/04/19 4:00, Dmitry Osipenko wrote: From: Antonio Caggiano Enable resource UUID feature and implement command resource assign UUID. UUID feature availability is mandatory for Vulkan Venus context. UUID is intended for sharing dmabufs between virtio devices on host. Qemu doesn't have

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

2024-04-19 Thread Akihiko Odaki
On 2024/04/19 4:00, Dmitry Osipenko 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 Signed-off-by: Antonio

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

2024-04-19 Thread Akihiko Odaki
rl_command. suspended is just !finished in virtio-gpu.c. Only virtio_gpu_virgl_process_cmd() needs the distinction of suspended and !finished so it is not appropriate to add this flag the common structure. Regards, Akihiko Odaki

Re: [PATCH v9 13/20] virtio-net: Return an error when vhost cannot enable RSS

2024-04-16 Thread Akihiko Odaki
On 2024/04/16 13:00, Jason Wang wrote: On Mon, Apr 15, 2024 at 10:05 PM Yuri Benditovich wrote: On Wed, Apr 3, 2024 at 2:11 PM Akihiko Odaki wrote: vhost requires eBPF for RSS. When eBPF is not available, virtio-net implicitly disables RSS even if the user explicitly requests it. Return

Re: [PATCH v7 07/10] virtio-gpu: Handle resource blob commands

2024-04-15 Thread Akihiko Odaki
On 2024/04/15 17:49, Dmitry Osipenko wrote: On 4/15/24 11:13, Akihiko Odaki wrote: On 2024/04/15 17:03, Dmitry Osipenko wrote: Hello, On 4/13/24 14:57, Akihiko Odaki wrote: ... +static void +virtio_gpu_virgl_unmap_resource_blob(VirtIOGPU *g, + struct

Re: [PATCH v7 07/10] virtio-gpu: Handle resource blob commands

2024-04-15 Thread Akihiko Odaki
On 2024/04/15 17:03, Dmitry Osipenko wrote: Hello, On 4/13/24 14:57, Akihiko Odaki wrote: ... +static void +virtio_gpu_virgl_unmap_resource_blob(VirtIOGPU *g, + struct virtio_gpu_simple_resource *res) +{ +    VirtIOGPUBase *b = VIRTIO_GPU_BASE(g

Re: [PATCH v9 17/20] ebpf: Fix RSS error handling

2024-04-14 Thread Akihiko Odaki
On 2024/04/13 21:16, Yuri Benditovich wrote: On Wed, Apr 3, 2024 at 2:12 PM Akihiko Odaki wrote: calculate_rss_hash() was using hash value 0 to tell if it calculated a hash, but the hash value may be 0 on a rare occasion. Have a distinct bool value for correctness. This is interesting

Re: [PATCH v7 07/10] virtio-gpu: Handle resource blob commands

2024-04-13 Thread Akihiko Odaki
nted out. The memory region is asynchronously unmapped from the guest address space, but the backing memory on the host address space is unmapped synchronously before that. This results in use-after-free. The whole unmapping operation needs to be implemented in an asynchronous manner. Regards,

Re: [PATCH-for-9.0? v2] hw/net/net_tx_pkt: Fix overrun in update_sctp_checksum()

2024-04-10 Thread Akihiko Odaki
mu/-/issues/2273 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki --- Since v1: check at offset 8 (Akihiko) --- hw/net/net_tx_pkt.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index 2134a18c4c..b7b1de816d 100644 --- a/hw/

Re: [RFC PATCH-for-9.0?] hw/net/net_tx_pkt: Fix overrun in update_sctp_checksum()

2024-04-10 Thread Akihiko Odaki
n 0 in that case). Regards, Akihiko Odaki if (iov_from_buf(pl_start_frag, pkt->payload_frags, 8, , sizeof(csum)) < sizeof(csum)) { return false; }

Re: [PATCH v9 16/20] virtio-net: Do not write hashes to peer buffer

2024-04-08 Thread Akihiko Odaki
On 2024/04/08 17:06, Yuri Benditovich wrote: On Mon, Apr 8, 2024 at 10:57 AM Akihiko Odaki wrote: On 2024/04/08 16:54, Yuri Benditovich wrote: On Mon, Apr 8, 2024 at 10:42 AM Akihiko Odaki wrote: On 2024/04/08 16:40, Yuri Benditovich wrote: On Mon, Apr 8, 2024 at 4:30 AM Akihiko Odaki

Re: [PATCH v9 16/20] virtio-net: Do not write hashes to peer buffer

2024-04-08 Thread Akihiko Odaki
On 2024/04/08 16:54, Yuri Benditovich wrote: On Mon, Apr 8, 2024 at 10:42 AM Akihiko Odaki wrote: On 2024/04/08 16:40, Yuri Benditovich wrote: On Mon, Apr 8, 2024 at 4:30 AM Akihiko Odaki wrote: On 2024/04/08 7:09, Yuri Benditovich wrote: On Wed, Apr 3, 2024 at 2:12 PM Akihiko Odaki

Re: [PATCH v9 16/20] virtio-net: Do not write hashes to peer buffer

2024-04-08 Thread Akihiko Odaki
On 2024/04/08 16:40, Yuri Benditovich wrote: On Mon, Apr 8, 2024 at 4:30 AM Akihiko Odaki wrote: On 2024/04/08 7:09, Yuri Benditovich wrote: On Wed, Apr 3, 2024 at 2:12 PM Akihiko Odaki wrote: The peer buffer is qualified with const and not meant to be modified. IMHO, this buffer

Re: [PATCH v9 16/20] virtio-net: Do not write hashes to peer buffer

2024-04-07 Thread Akihiko Odaki
On 2024/04/08 7:09, Yuri Benditovich wrote: On Wed, Apr 3, 2024 at 2:12 PM Akihiko Odaki wrote: The peer buffer is qualified with const and not meant to be modified. IMHO, this buffer is not so 'const' (although the prototype states so), it is allocated in net.c btw, another procedure

Re: [PATCH v9 13/20] virtio-net: Return an error when vhost cannot enable RSS

2024-04-07 Thread Akihiko Odaki
On 2024/04/08 6:46, Yuri Benditovich wrote: On Wed, Apr 3, 2024 at 2:11 PM Akihiko Odaki wrote: vhost requires eBPF for RSS. When eBPF is not available, virtio-net implicitly disables RSS even if the user explicitly requests it. Return an error instead of implicitly disabling RSS if RSS

[PATCH v9 09/20] virtio-net: Copy header only when necessary

2024-04-03 Thread Akihiko Odaki
The copied header is only used for byte swapping. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index e33bdbfd84a5..ca0fbf7b7654 100644 --- a/hw/net

[PATCH v9 12/20] virtio-net: Unify the logic to update NIC state for RSS

2024-04-03 Thread Akihiko Odaki
The code to attach or detach the eBPF program to RSS were duplicated so unify them into one function to save some code. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 90 + 1 file changed, 36 insertions(+), 54 deletions(-) diff --git

[PATCH v9 20/20] ebpf: Add a separate target for skeleton

2024-04-03 Thread Akihiko Odaki
This generalizes the rule to generate the skeleton and allows to add another. Signed-off-by: Akihiko Odaki --- tools/ebpf/Makefile.ebpf | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/ebpf/Makefile.ebpf b/tools/ebpf/Makefile.ebpf index 3391e7ce0898

  1   2   3   4   5   6   7   8   9   10   >