[PATCH v3] nbd/server: do not poll within a coroutine context

2024-04-03 Thread Eric Blake
From: Zhu Yangyang Coroutines are not supposed to block. Instead, they should yield. The client performs TLS upgrade outside of an AIOContext, during synchronous handshake; this still requires g_main_loop. But the server responds to TLS upgrade inside a coroutine, so a nested g_main_loop is wro

Re: [PATCH v10 2/2] memory tier: create CPUless memory tiers after obtaining HMAT info

2024-04-03 Thread Ho-Ren (Jack) Chuang
Hi Jonathan, Thank you for your feedback. I will fix them (inlined) in the next V11. On Wed, Apr 3, 2024 at 10:04 AM Jonathan Cameron wrote: > > A few minor comments inline. > > > diff --git a/include/linux/memory-tiers.h b/include/linux/memory-tiers.h > > index a44c03c2ba3a..16769552a338 100644

[PATCH] hw/usb: Check cycle bit before trace call

2024-04-03 Thread Ian Moffett
Signed-off-by: Ian Moffett --- hw/usb/hcd-xhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index ad40232eb6..ea5bc64b26 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -710,13 +710,13 @@ static TRBType xhci_ring_fetch

Re: [PATCH v10 1/2] memory tier: dax/kmem: introduce an abstract layer for finding, allocating, and putting memory types

2024-04-03 Thread Ho-Ren (Jack) Chuang
Hi Jonathan, Thanks for your feedback. I will fix them (inlined) in the next V11. No worries, it's never too late! On Wed, Apr 3, 2024 at 9:52 AM Jonathan Cameron wrote: > > On Tue, 2 Apr 2024 00:17:37 + > "Ho-Ren (Jack) Chuang" wrote: > > > Since different memory devices require finding,

Re: Point where target instructions are read

2024-04-03 Thread Richard Henderson
On 4/3/24 08:15, Gautam Bhat wrote: On Tue, Apr 2, 2024 at 2:01 AM Richard Henderson wrote: The boot process must cooperate somehow. When using loader, you must link the image such that it loads at the pc reset address defined by the architecture manual. r~ I changed my loading options t

Re: Point where target instructions are read

2024-04-03 Thread BALATON Zoltan
On Wed, 3 Apr 2024, Gautam Bhat wrote: On Tue, Apr 2, 2024 at 2:01 AM Richard Henderson wrote: The boot process must cooperate somehow. When using loader, you must link the image such that it loads at the pc reset address defined by the architecture manual. r~ I changed my loading option

Re: TCG change broke MorphOS boot on sam460ex

2024-04-03 Thread BALATON Zoltan
On Wed, 3 Apr 2024, Nicholas Piggin wrote: On Tue Apr 2, 2024 at 9:32 PM AEST, BALATON Zoltan wrote: On Thu, 21 Mar 2024, BALATON Zoltan wrote: On 27/2/24 17:47, BALATON Zoltan wrote: Hello, Commit 18a536f1f8 (accel/tcg: Always require can_do_io) broke booting MorphOS on sam460ex (this was be

Hermetic virtio-vsock in QEMU

2024-04-03 Thread Roman Kiryanov
Hi Peter, Alex and QEMU, I work in Android Studio Emulator and we use virtio-vsock to emulate devices (e.g. sensors) which live in the Emulator binary. We need to run on Windows and in environments without CONFIG_VHOST_VSOCK, that is why we cannot use vhost-vsock and invented our implementation. I

Re: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-04-03 Thread Vladimir Sementsov-Ogievskiy
On 03.04.24 20:50, Eric Blake wrote: On Wed, Apr 03, 2024 at 01:24:11PM +0400, Marc-André Lureau wrote: Unfortunately, it doesn't work in all cases. It seems to have issues with some guards: ../block/stream.c: In function ‘stream_run’: ../block/stream.c:216:12: error: ‘ret’ may be used uninitial

Re: [PATCH 1/1] migration/multifd: solve zero page causing multiple page faults

2024-04-03 Thread Peter Xu
On Tue, Apr 02, 2024 at 09:57:49AM -0300, Fabiano Rosas wrote: > Yuan Liu writes: > > > Implemented recvbitmap tracking of received pages in multifd. > > > > If the zero page appears for the first time in the recvbitmap, this > > page is not checked and set. > > > > If the zero page has already a

riscv disassembler error with pmpcfg0

2024-04-03 Thread Eric DeVolder
I've been using QEMU8 to collect instruction information on U-Boot + OpenSBI. I'm running QEMU in this fashion to collect the information: # qemu-system-riscv64 -plugin file=qemu/build/contrib/plugins/libexeclog.so -singlestep -d plugin,nochain -D execlog.txt ... When examining the instruction

Re: [PATCH v2] e1000: Convert debug macros into tracepoints.

2024-04-03 Thread Austin Clements
At this point there's not much of my original code left. :D Don, you're welcome to take the credit in the commit. On Wed, Apr 3, 2024, 9:46 AM Don Porter wrote: > From: Austin Clements > > The E1000 debug messages are very useful for developing drivers. > Make these available to users without r

Re: Intention to work on GSoC project

2024-04-03 Thread Eugenio Perez Martin
On Wed, Apr 3, 2024 at 4:36 PM Sahil wrote: > > Hi, > > Thank you for the reply. > > On Tuesday, April 2, 2024 5:08:24 PM IST Eugenio Perez Martin wrote: > > [...] > > > > > Q2. > > > > > In the Red Hat article, just below the first listing ("Memory layout > > > > > of a > > > > > packed virtqueu

Re: [PATCH v3] input-linux: Add option to not grab a device upon guest startup

2024-04-03 Thread Markus Armbruster
Justinien Bouron writes: >> Again, QAPI schema > > Pardon my ignorance, but are you writing this because there is a problem with > the QAPI schema changes that I would need to fix and re-submit? > Or is it just here to indicate that you've reviewed the change made to the > schema? The latter. R

Re: [PATCH v6 09/12] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents

2024-04-03 Thread Gregory Price
On Mon, Mar 25, 2024 at 12:02:27PM -0700, nifan@gmail.com wrote: > From: Fan Ni > > To simulate FM functionalities for initiating Dynamic Capacity Add > (Opcode 5604h) and Dynamic Capacity Release (Opcode 5605h) as in CXL spec > r3.1 7.6.7.6.5 and 7.6.7.6.6, we implemented two QMP interfaces

Re: [PATCH] target/hppa: Fix IIAOQ, IIASQ for pa2.0

2024-04-03 Thread Helge Deller
On 4/2/24 03:25, Richard Henderson wrote: The contents of IIAOQ depend on PSW_W. Follow the text in "Interruption Instruction Address Queues", pages 2-13 through 2-15. Reported-by: Sven Schnelle Fixes: b10700d826c ("target/hppa: Update IIAOQ, IIASQ for pa2.0") Signed-off-by: Richard Henderson

Re: Point where target instructions are read

2024-04-03 Thread Gautam Bhat
On Tue, Apr 2, 2024 at 2:01 AM Richard Henderson wrote: > The boot process must cooperate somehow. > > When using loader, you must link the image such that it loads at the pc reset > address > defined by the architecture manual. > > > r~ I changed my loading options to the following now to have

Re: [PATCH v2] e1000: Convert debug macros into tracepoints.

2024-04-03 Thread Richard Henderson
On 4/3/24 03:45, Don Porter wrote: From: Austin Clements The E1000 debug messages are very useful for developing drivers. Make these available to users without recompiling QEMU. Signed-off-by: Austin Clements [geo...@ldpreload.com: Rebased on top of 2.9.0] Signed-off-by: Geoffrey Thomas Signed-

Re: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-04-03 Thread Eric Blake
On Wed, Apr 03, 2024 at 01:24:11PM +0400, Marc-André Lureau wrote: > > > Unfortunately, it doesn't work in all cases. It seems to have issues > > > with some guards: > > > ../block/stream.c: In function ‘stream_run’: > > > ../block/stream.c:216:12: error: ‘ret’ may be used uninitialized > > > [-Wer

Re: [PATCH v10 2/2] memory tier: create CPUless memory tiers after obtaining HMAT info

2024-04-03 Thread Jonathan Cameron via
A few minor comments inline. > diff --git a/include/linux/memory-tiers.h b/include/linux/memory-tiers.h > index a44c03c2ba3a..16769552a338 100644 > --- a/include/linux/memory-tiers.h > +++ b/include/linux/memory-tiers.h > @@ -140,12 +140,13 @@ static inline int mt_perf_to_adistance(struct > acces

Re: [PATCH v10 1/2] memory tier: dax/kmem: introduce an abstract layer for finding, allocating, and putting memory types

2024-04-03 Thread Jonathan Cameron via
On Tue, 2 Apr 2024 00:17:37 + "Ho-Ren (Jack) Chuang" wrote: > Since different memory devices require finding, allocating, and putting > memory types, these common steps are abstracted in this patch, > enhancing the scalability and conciseness of the code. > > Signed-off-by: Ho-Ren (Jack) Ch

Re: [RFC v2 1/5] virtio: Initialize sequence variables

2024-04-03 Thread Jonah Palmer
On 4/3/24 6:18 AM, Eugenio Perez Martin wrote: On Thu, Mar 28, 2024 at 5:22 PM Jonah Palmer wrote: Initialize sequence variables for VirtQueue and VirtQueueElement structures. A VirtQueue's sequence variables are initialized when a VirtQueue is being created or reset. A VirtQueueElement's s

Re: [PULL v2 0/6] lsi, vga fixes for 2024-04-02

2024-04-03 Thread Peter Maydell
On Wed, 3 Apr 2024 at 11:07, Paolo Bonzini wrote: > > The following changes since commit 7fcf7575f3d201fc84ae168017ffdfd6c86257a6: > > Merge tag 'pull-target-arm-20240402' of > https://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-04-02 > 11:34:49 +0100) > > are available in the G

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-03 Thread Peter Xu
On Wed, Apr 03, 2024 at 04:04:21PM +, Wang, Wei W wrote: > On Wednesday, April 3, 2024 10:42 PM, Peter Xu wrote: > > On Wed, Apr 03, 2024 at 04:35:35PM +0800, Wang, Lei wrote: > > > We should change the following line from > > > > > > while (!qemu_sem_timedwait(&mis->postcopy_qemufile_dst_don

RE: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-03 Thread Wang, Wei W
On Wednesday, April 3, 2024 10:42 PM, Peter Xu wrote: > On Wed, Apr 03, 2024 at 04:35:35PM +0800, Wang, Lei wrote: > > We should change the following line from > > > > while (!qemu_sem_timedwait(&mis->postcopy_qemufile_dst_done, > 100)) { > > > > to > > > > while (qemu_sem_timedwait(&mis->p

Re: [PATCH v3] input-linux: Add option to not grab a device upon guest startup

2024-04-03 Thread Justinien Bouron
> Again, QAPI schema Pardon my ignorance, but are you writing this because there is a problem with the QAPI schema changes that I would need to fix and re-submit? Or is it just here to indicate that you've reviewed the change made to the schema? Regards, Justinien Bouron

[PATCH net v4] virtio_net: Do not send RSS key if it is not supported

2024-04-03 Thread Breno Leitao
There is a bug when setting the RSS options in virtio_net that can break the whole machine, getting the kernel into an infinite loop. Running the following command in any QEMU virtual machine with virtionet will reproduce this problem: # ethtool -X eth0 hfunc toeplitz This is how the proble

Re: [PATCH v3 2/2] xen: fix stubdom PCI addr

2024-04-03 Thread Anthony PERARD
On Wed, Mar 27, 2024 at 04:05:15AM +0100, Marek Marczykowski-Górecki wrote: > When running in a stubdomain, the config space access via sysfs needs to > use BDF as seen inside stubdomain (connected via xen-pcifront), which is > different from the real BDF. For other purposes (hypercall parameters >

Re: [PATCH v3 1/2] hw/xen: detect when running inside stubdomain

2024-04-03 Thread Anthony PERARD
On Wed, Mar 27, 2024 at 04:05:14AM +0100, Marek Marczykowski-Górecki wrote: > Introduce global xen_is_stubdomain variable when qemu is running inside > a stubdomain instead of dom0. This will be relevant for subsequent > patches, as few things like accessing PCI config space need to be done > diffe

Re: [PATCH v2] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-03 Thread Xiaoyao Li
On 4/3/2024 11:12 PM, Igor Mammedov wrote: On Wed, 3 Apr 2024 10:59:53 -0400 Xiaoyao Li wrote: A value 1 of PCAT_COMPAT (bit 0) of MADT.Flags indicates that the system also has a PC-AT-compatible dual-8259 setup, i.e., the PIC. When PIC is not enabled (pic=off) for x86 machine, the PCAT_COMP

Re: [PATCH v2] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-03 Thread Igor Mammedov
On Wed, 3 Apr 2024 10:59:53 -0400 Xiaoyao Li wrote: > A value 1 of PCAT_COMPAT (bit 0) of MADT.Flags indicates that the system > also has a PC-AT-compatible dual-8259 setup, i.e., the PIC. > > When PIC is not enabled (pic=off) for x86 machine, the PCAT_COMPAT bit > needs to be cleared. Otherwis

Re: [RFC PATCH v2 4/6] cxl/core: report poison when injecting from debugfs

2024-04-03 Thread Shiyang Ruan via
在 2024/3/30 9:52, Dan Williams 写道: Shiyang Ruan wrote: Poison injection from debugfs is silent too. Add calling cxl_mem_report_poison() to make it able to do memory_failure(). Why does this needs to be signalled? It is a debug interface, the debugger can also trigger a read after the injec

[PATCH v2] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-03 Thread Xiaoyao Li
A value 1 of PCAT_COMPAT (bit 0) of MADT.Flags indicates that the system also has a PC-AT-compatible dual-8259 setup, i.e., the PIC. When PIC is not enabled (pic=off) for x86 machine, the PCAT_COMPAT bit needs to be cleared. Otherwise, the guest thinks there is a present PIC. Signed-off-by: Xiaoy

Re: [RFC PATCH v2 3/6] cxl/core: add report option for cxl_mem_get_poison()

2024-04-03 Thread Shiyang Ruan via
在 2024/3/30 9:50, Dan Williams 写道: Shiyang Ruan wrote: The GMER only has "Physical Address" field, no such one indicates length. So, when a poison event is received, we could use GET_POISON_LIST command to get the poison list. Now driver has cxl_mem_get_poison(), so reuse it and add a parame

Re: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-04-03 Thread Peter Xu
On Wed, Apr 03, 2024 at 04:35:35PM +0800, Wang, Lei wrote: > We should change the following line from > > while (!qemu_sem_timedwait(&mis->postcopy_qemufile_dst_done, 100)) { > > to > > while (qemu_sem_timedwait(&mis->postcopy_qemufile_dst_done, 100)) { Stupid me.. :( Thanks for fi

Re: Intention to work on GSoC project

2024-04-03 Thread Sahil
Hi, Thank you for the reply. On Tuesday, April 2, 2024 5:08:24 PM IST Eugenio Perez Martin wrote: > [...] > > > > Q2. > > > > In the Red Hat article, just below the first listing ("Memory layout of > > > > a > > > > packed virtqueue descriptor"), there's the following line referring to > > > >

[PATCH v2] e1000: Convert debug macros into tracepoints.

2024-04-03 Thread Don Porter
From: Austin Clements The E1000 debug messages are very useful for developing drivers. Make these available to users without recompiling QEMU. Signed-off-by: Austin Clements [geo...@ldpreload.com: Rebased on top of 2.9.0] Signed-off-by: Geoffrey Thomas Signed-off-by: Don Porter --- hw/net/e1

Re: [PATCH] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-03 Thread Kirill A. Shutemov
On Wed, Apr 03, 2024 at 10:03:15AM +0800, Xiaoyao Li wrote: > On 4/2/2024 10:31 PM, Michael S. Tsirkin wrote: > > On Tue, Apr 02, 2024 at 09:18:44PM +0800, Xiaoyao Li wrote: > > > On 4/2/2024 6:02 PM, Michael S. Tsirkin wrote: > > > > On Tue, Apr 02, 2024 at 04:25:16AM -0400, Xiaoyao Li wrote: > >

Re: [PATCH net v3] virtio_net: Do not send RSS key if it is not supported

2024-04-03 Thread Breno Leitao
On Sun, Mar 31, 2024 at 04:20:30PM -0400, Michael S. Tsirkin wrote: > On Fri, Mar 29, 2024 at 10:16:41AM -0700, Breno Leitao wrote: > > @@ -3814,13 +3815,24 @@ static int virtnet_set_rxfh(struct net_device *dev, > > return -EOPNOTSUPP; > > > > if (rxfh->indir) { > > + if

Re: [PATCH v3] input-linux: Add option to not grab a device upon guest startup

2024-04-03 Thread Markus Armbruster
Justinien Bouron writes: > Depending on your use-case, it might be inconvenient to have qemu grab > the input device from the host immediately upon starting the guest. > > Added a new bool option to input-linux: grab-on-startup. If true, the > device is grabbed as soon as the guest is started, ot

Re: [PATCH v11 18/23] hw/intc/arm_gicv3: Handle icv_nmiar1_read() for icc_nmiar1_read()

2024-04-03 Thread Peter Maydell
On Wed, 3 Apr 2024 at 04:16, Jinjie Ruan wrote: > On 2024/4/3 0:12, Peter Maydell wrote: > >> @@ -776,7 +811,11 @@ static uint64_t icv_iar_read(CPUARMState *env, const > >> ARMCPRegInfo *ri) > >> if (thisgrp == grp && icv_hppi_can_preempt(cs, lr)) { > >> intid = ich_lr_vinti

[PATCH v2 02/10] backends/confidential-guest-support: Add IGVM file parameter

2024-04-03 Thread Roy Hopkins
In order to add support for parsing IGVM files for secure virtual machines, a the path to an IGVM file needs to be specified as part of the guest configuration. It makes sense to add this to the ConfidentialGuestSupport object as this is common to all secure virtual machines that potentially could

[PATCH v2 10/10] docs/interop/firmware.json: Add igvm to FirmwareDevice

2024-04-03 Thread Roy Hopkins
Create an enum entry within FirmwareDevice for 'igvm' to describe that an IGVM file can be used to map firmware into memory as an alternative to pre-existing firmware devices. Signed-off-by: Roy Hopkins --- docs/interop/firmware.json | 9 - 1 file changed, 8 insertions(+), 1 deletion(-)

[PATCH v2 08/10] i386/sev: Implement ConfidentialGuestSupport functions for SEV

2024-04-03 Thread Roy Hopkins
The ConfidentialGuestSupport object defines a number of virtual functions that are called during processing of IGVM directives to query or configure initial guest state. In order to support processing of IGVM files, these functions need to be implemented by relevant isolation hardware support code

[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/v

[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 a

[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..572c

[PATCH v2 00/10] Introduce support for IGVM files

2024-04-03 Thread Roy Hopkins
Here is v2 of the set of patches to add support for IGVM files to QEMU. These address all of the comments on v1 [1]. These patches are also available to view on github: [2]. Changes in v2: * Fixed various spelling and documentation errors from Stefano. * Addressed readability and other sugges

[PATCH v9 15/20] virtio-net: Always set populate_hash

2024-04-03 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 86929c9e1fad..2de073ce18fd 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virt

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

2024-04-03 Thread Akihiko Odaki
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 is requested but not available. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 97 ++

[PATCH v2 05/10] i386/pc: Process IGVM file during PC initialization if present

2024-04-03 Thread Roy Hopkins
An IGVM file contains configuration of a guest that supports confidential computing hardware. As part of the PC system initialisation, the IGVM needs to be processed to apply this configuration before the guest is started. This patch introduces processing of a provided IGVM file at the end of the

[PATCH v2 07/10] i386/sev: Refactor setting of reset vector and initial CPU state

2024-04-03 Thread Roy Hopkins
When an SEV guest is started, the reset vector and state are extracted from metadata that is contained in the firmware volume. In preparation for using IGVM to setup the initial CPU state, the code has been refactored to populate vmcb_save_area for each CPU which is then applied during guest start

[PATCH v9 10/20] virtio-net: Shrink header byte swapping buffer

2024-04-03 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/v

[PATCH v9 03/20] net: Move virtio-net header length assertion

2024-04-03 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/ne

[PATCH v2 01/10] meson: Add optional dependency on IGVM library

2024-04-03 Thread Roy Hopkins
The IGVM library allows Independent Guest Virtual Machine files to be parsed and processed. IGVM files are used to configure guest memory layout, initial processor state and other configuration pertaining to secure virtual machines. This adds the --enable-igvm configure option, enabled by default,

[PATCH v9 19/20] ebpf: Refactor tun_rss_steering_prog()

2024-04-03 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 1006

[PATCH v9 11/20] virtio-net: Disable RSS on reset

2024-04-03 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 deletions(-) diff

[PATCH v9 02/20] tap: Remove qemu_using_vnet_hdr()

2024-04-03 Thread Akihiko Odaki
Since qemu_set_vnet_hdr_len() is always called when qemu_using_vnet_hdr() is called, we can merge them and save some code. For consistency, express that the virtio-net header is not in use by returning 0 with qemu_get_vnet_hdr_len() instead of having a dedicated function, qemu_get_using_vnet_hdr()

[PATCH v9 05/20] tap: Call tap_receive_iov() from tap_receive()

2024-04-03 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/tap.c index 99c59e

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

2024-04-03 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.skeleton.h | 1210 +++

[PATCH v9 14/20] virtio-net: Report RSS warning at device realization

2024-04-03 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 | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c

[PATCH v2 09/10] docs/system: Add documentation on support for IGVM

2024-04-03 Thread Roy Hopkins
IGVM support has been implemented for Confidential Guests that support AMD SEV and AMD SEV-ES. Add some documentation that gives some background on the IGVM format and how to use it to configure a confidential guest. Signed-off-by: Roy Hopkins --- docs/system/i386/amd-memory-encryption.rst | 2

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

2024-04-03 Thread Akihiko Odaki
Propagating ebpf-rss-fds errors has several problems. First, it makes device realization fail and disables the fallback to the conventional eBPF loading. Second, it leaks memory by making device realization fail without freeing memory already allocated. Third, the convention is to set an error w

[PATCH v2 03/10] backends/confidential-guest-support: Add functions to support IGVM

2024-04-03 Thread Roy Hopkins
In preparation for supporting the processing of IGVM files to configure guests, this adds a set of functions to ConfidentialGuestSupport allowing configuration of secure virtual machines that can be implemented for each supported isolation platform type such as Intel TDX or AMD SEV-SNP. These funct

[PATCH v2 06/10] i386/pc_sysfw: Ensure sysfw flash configuration does not conflict with IGVM

2024-04-03 Thread Roy Hopkins
When using an IGVM file the configuration of the system firmware is defined by IGVM directives contained in the file. In this case the user should not configure any pflash devices. This commit skips initialization of the ROM mode when pflash0 is not set then checks to ensure no pflash devices have

[PATCH v2 04/10] backends/igvm: Implement parsing and processing of IGVM files

2024-04-03 Thread Roy Hopkins
This commit adds an implementation of an IGVM loader which parses the file specified as a pararameter to ConfidentialGuestSupport and provides a function that uses the interface in the same object to configure and populate guest memory based on the contents of the file. The IGVM file is parsed whe

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

2024-04-03 Thread Akihiko Odaki
The peer buffer is qualified with const and not meant to be modified. It also prevents enabling VIRTIO_NET_F_HASH_REPORT for peers without virtio-net header support. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 36 +--- 1 file changed, 17 insertions(+),

[PATCH v9 06/20] tap: Shrink zeroed virtio-net header

2024-04-03 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 deletion(-) di

[PATCH v9 18/20] ebpf: Return 0 when configuration fails

2024-04-03 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 changed

[PATCH v9 04/20] net: Remove receive_raw()

2024-04-03 Thread Akihiko Odaki
While netmap implements virtio-net header, it does not implement receive_raw(). Instead of implementing receive_raw for netmap, add virtio-net headers in the common code and use receive_iov()/receive() instead. This also fixes the buffer size for the virtio-net header. Fixes: fbbdbddec0 ("tap: all

[PATCH v9 01/20] tap: Remove tap_probe_vnet_hdr_len()

2024-04-03 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 v9 08/20] virtio-net: Add only one queue pair when realizing

2024-04-03 Thread Akihiko Odaki
Multiqueue usage is not negotiated yet when realizing. If more than one queue is added and the guest never requests to enable multiqueue, the extra queues will not be deleted when unrealizing and leak. Fixes: f9d6dbf0bf6e ("virtio-net: remove virtio queues if the guest doesn't support multiqueue"

[PATCH v9 00/20] virtio-net RSS/hash report fixes and improvements

2024-04-03 Thread Akihiko Odaki
This series contains fixes and improvements for virtio-net RSS and hash reporting feature. V7 -> V8: Reset author email addresses. Rebased. V6 -> V7: Dropped patch "virtio-net: Do not clear VIRTIO_NET_F_HASH_REPORT". Dropped the changes to remove packet flags. Re-introduced tap_receive(

Re: [RFC PATCH 00/12] SMMUv3 nested translation support

2024-04-03 Thread Mostafa Saleh
Hi Nicolin, On Tue, Apr 02, 2024 at 03:28:12PM -0700, Nicolin Chen wrote: > Hi Mostafa, > > On Mon, Mar 25, 2024 at 10:13:56AM +, Mostafa Saleh wrote: > > > > Currently, QEMU supports emulating either stage-1 or stage-2 SMMUs > > but not nested instances. > > This patch series adds support f

[PATCH 6/6] bios-tables-test: Add data for complex numa test (GI, GP etc)

2024-04-03 Thread Jonathan Cameron via
Given this is a new configuration, there are affects on APIC, CEDT and DSDT, but the key elements are in SRAT (plus related data in HMAT). The configuration has node to exercise many different combinations. 0) CPUs + Memory 1) GI only 2) GP only 3) CPUS only 4) Memory only 5) CPUs + HP memory GI

[PATCH 5/6] bios-tables-test: Add complex SRAT / HMAT test for GI GP

2024-04-03 Thread Jonathan Cameron via
Add a test with 6 nodes to exercise most interesting corner cases of SRAT and HMAT generation including the new Generic Initiator and Generic Port Affinity structures. More details of the set up in the following patch adding the table data. Signed-off-by: Jonathan Cameron --- tests/qtest/bios-t

[PATCH 4/6] bios-tables-test: Allow for new acpihmat-generic-x test data.

2024-04-03 Thread Jonathan Cameron via
The test to be added exercises many corners of the SRAT and HMAT table generation. Signed-off-by: Jonathan Cameron --- tests/qtest/bios-tables-test-allowed-diff.h | 5 + tests/data/acpi/q35/APIC.acpihmat-generic-x | 0 tests/data/acpi/q35/CEDT.acpihmat-generic-x | 0 tests/data/acpi/q35/DSDT

[PATCH 3/6] hw/acpi: Generic Port Affinity Structure support

2024-04-03 Thread Jonathan Cameron via
These are very similar to the recently added Generic Initiators but instead of representing an initiator of memory traffic they represent an edge point beyond which may lie either targets or initiators. Here we add these ports such that they may be targets of hmat_lb records to describe the latenc

[PATCH 2/6] hw/acpi: Insert an acpi-generic-node base under acpi-generic-initiator

2024-04-03 Thread Jonathan Cameron via
This will simplify reuse when adding acpi-generic-port. Note that some error_printf() messages will now print acpi-generic-node whereas others will move to type specific cases in next patch so are left alone for now. Signed-off-by: Jonathan Cameron --- include/hw/acpi/acpi_generic_initiator.h |

[PATCH 1/6] hw/acpi/GI: Fix trivial parameter alignment issue.

2024-04-03 Thread Jonathan Cameron via
Before making additional modification, tidy up this misleading indentation. Signed-off-by: Jonathan Cameron --- hw/acpi/acpi_generic_initiator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/acpi_generic_initiator.c b/hw/acpi/acpi_generic_initiator.c index 17b9a052f

[PATCH 0/6 qemu] acpi: NUMA nodes for CXL HB as GP + complex NUMA test.

2024-04-03 Thread Jonathan Cameron via
ACPI 6.5 introduced Generic Port Affinity Structures to close a system description gap that was a problem for CXL memory systems. It defines an new SRAT Affinity structure (and hence allows creation of an ACPI Proximity Node which can only be defined via an SRAT structure) for the boundary between

[PATCH v12 20/23] hw/intc/arm_gicv3: Report the NMI interrupt in gicv3_cpuif_update()

2024-04-03 Thread Jinjie Ruan via
In CPU Interface, if the IRQ has the non-maskable property, report NMI to the corresponding PE. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell --- v12: - Add Reviewed-by. v10: - superprio -> nmi. - Update the commit message, superpriority -> non-maskable. v

[PATCH 1/2] scsi-disk: Introduce the migrate_emulate_scsi_request field

2024-04-03 Thread Hyman Huang
To indicate to the destination whether or not emulational SCSI requests are sent, introduce the migrate_emulate_scsi_request in struct SCSIDiskState. It seeks to achieve migration backend compatibility. This commit sets the stage for the next one, which addresses the crash of a VM configured with

[PATCH v12 18/23] hw/intc/arm_gicv3: Handle icv_nmiar1_read() for icc_nmiar1_read()

2024-04-03 Thread Jinjie Ruan via
Implement icv_nmiar1_read() for icc_nmiar1_read(), so add definition for ICH_LR_EL2.NMI and ICH_AP1R_EL2.NMI bit. If FEAT_GICv3_NMI is supported, ich_ap_write() should consider ICV_AP1R_EL1.NMI bit. In icv_activate_irq() and icv_eoir_write(), the ICV_AP1R_EL1.NMI bit should be set or clear accordi

[PATCH v12 12/23] target/arm: Handle NMI in arm_cpu_do_interrupt_aarch64()

2024-04-03 Thread Jinjie Ruan via
According to Arm GIC section 4.6.3 Interrupt superpriority, the interrupt with superpriority is always IRQ, never FIQ, so the NMI exception trap entry behave like IRQ. And VINMI(vIRQ with Superpriority) can be raised from the GIC or come from the hcrx_el2.HCRX_VINMI bit, VFNMI(vFIQ with Superpriori

[PATCH v12 01/23] target/arm: Handle HCR_EL2 accesses for bits introduced with FEAT_NMI

2024-04-03 Thread Jinjie Ruan via
FEAT_NMI defines another three new bits in HCRX_EL2: TALLINT, HCRX_VINMI and HCRX_VFNMI. When the feature is enabled, allow these bits to be written in HCRX_EL2. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson --- v12: - Remove the redundant blank line. v9: - Declare cpu variable to re

[PATCH v12 23/23] hw/arm/virt: Add FEAT_GICv3_NMI feature support in virt GIC

2024-04-03 Thread Jinjie Ruan via
A PE that implements FEAT_NMI and FEAT_GICv3 also implements FEAT_GICv3_NMI. A PE that does not implement FEAT_NMI, does not implement FEAT_GICv3_NMI So included support FEAT_GICv3_NMI feature as part of virt platform GIC initialization if FEAT_NMI and FEAT_GICv3 supported. Signed-off-by: Jinjie

[PATCH v12 08/23] target/arm: Handle IS/FS in ISR_EL1 for NMI, VINMI and VFNMI

2024-04-03 Thread Jinjie Ruan via
Add IS and FS bit in ISR_EL1 and handle the read. With CPU_INTERRUPT_NMI or CPU_INTERRUPT_VINMI, both CPSR_I and ISR_IS must be set. With CPU_INTERRUPT_VFNMI, both CPSR_F and ISR_FS must be set. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson --- v9: - CPU_INTERRUPT_VNMI -> CPU_INTERRU

[PATCH 2/2] scsi-disk: Fix the migration crash of the CDROM device with USB bus

2024-04-03 Thread Hyman Huang
When configuring VMs with the CDROM device using the USB bus in Libvirt, do as follows: The destination Qemu process crashed, causing the VM migration to fail; the backtrace reveals the following: Program terminated with signal SIGSEGV, Segmentation fault. 0 __memmove_sse2_una

[PATCH v12 14/23] hw/intc/arm_gicv3: Add irq non-maskable property

2024-04-03 Thread Jinjie Ruan via
A SPI, PPI or SGI interrupt can have non-maskable property. So maintain non-maskable property in PendingIrq and GICR/GICD. Since add new device state, it also needs to be migrated, so also save NMI info in vmstate_gicv3_cpu and vmstate_gicv3. Signed-off-by: Jinjie Ruan Acked-by: Richard Henderson

[PATCH v12 21/23] hw/intc/arm_gicv3: Report the VINMI interrupt

2024-04-03 Thread Jinjie Ruan via
In vCPU Interface, if the vIRQ has the non-maskable property, report vINMI to the corresponding vPE. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell --- v12: - Do not check nmi_support repetitively. - Add Reviewed-by. v10: - Update the commit message, superp

[PATCH v12 06/23] target/arm: Add support for Non-maskable Interrupt

2024-04-03 Thread Jinjie Ruan via
This only implements the external delivery method via the GICv3. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson --- v12: - Correct the comment style in arm_cpu_initfn(). v10: - In arm_cpu_exec_interrupt(), if SCTLR_ELx.NMI is 0, NMI -> IRQ, VINMI -> VIRQ, VFNMI -> VFIQ. - Make arm_c

[PATCH v12 15/23] hw/intc/arm_gicv3_redist: Implement GICR_INMIR0

2024-04-03 Thread Jinjie Ruan via
Add GICR_INMIR0 register and support access GICR_INMIR0. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell --- v11: - Add new Reviewed-by. v10: - gicr_isuperprio -> gicr_inmir0. v6: - Add Reviewed-by. v4: - Make the GICR_INMIR0 implementation more clearer. ---

[PATCH v12 10/23] hw/arm/virt: Wire NMI and VINMI irq lines from GIC to CPU

2024-04-03 Thread Jinjie Ruan via
Wire the new NMI and VINMI interrupt line from the GIC to each CPU. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson --- v9: - Rename ARM_CPU_VNMI to ARM_CPU_VINMI. - Update the commit message. v4: - Add Reviewed-by. v3: - Also add VNMI wire. --- hw/arm/virt.c | 7 ++- 1 file chang

[PATCH v12 13/23] hw/intc/arm_gicv3: Add has-nmi property to GICv3 device

2024-04-03 Thread Jinjie Ruan via
Add a property has-nmi to the GICv3 device, and use this to set the NMI bit in the GICD_TYPER register. This isn't visible to guests yet because the property defaults to false and we won't set it in the board code until we've landed all of the changes needed to implement FEAT_GICV3_NMI. Signed-off

[PATCH v12 09/23] target/arm: Handle PSTATE.ALLINT on taking an exception

2024-04-03 Thread Jinjie Ruan via
Set or clear PSTATE.ALLINT on taking an exception to ELx according to the SCTLR_ELx.SPINTMASK bit. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson --- v9: - Not check SCTLR_NMI in arm_cpu_do_interrupt_aarch64(). v3: - Add Reviewed-by. --- target/arm/helper.c | 8 1 file chang

[PATCH v12 17/23] hw/intc/arm_gicv3: Add NMI handling CPU interface registers

2024-04-03 Thread Jinjie Ruan via
Add the NMIAR CPU interface registers which deal with acknowledging NMI. When introduce NMI interrupt, there are some updates to the semantics for the register ICC_IAR1_EL1 and ICC_HPPIR1_EL1. For ICC_IAR1_EL1 register, it should return 1022 if the intid has non-maskable property. And for ICC_NMIA

[PATCH v12 16/23] hw/intc/arm_gicv3: Implement GICD_INMIR

2024-04-03 Thread Jinjie Ruan via
Add GICD_INMIR, GICD_INMIRnE register and support access GICD_INMIR0. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell --- v11: - Add new Reviewed-by. v10: - superprio -> nmi. v4: - Make the GICD_INMIR implementation more clearer. - Udpate the commit message.

[PATCH v12 03/23] target/arm: Add support for FEAT_NMI, Non-maskable Interrupt

2024-04-03 Thread Jinjie Ruan via
Add support for FEAT_NMI. NMI (FEAT_NMI) is an mandatory feature in ARMv8.8-A and ARM v9.3-A. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson --- v3: - Add Reviewed-by. - Adjust to before the MSR patches. --- target/arm/internals.h | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v12 05/23] target/arm: Support MSR access to ALLINT

2024-04-03 Thread Jinjie Ruan via
Support ALLINT msr access as follow: mrs , ALLINT// read allint msr ALLINT, // write allint with imm Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson --- v9: - Move nmi_reginfo and related functions inside an existing ifdef TARGET_AARCH64 to solve the -

  1   2   >