Re: Re: [PATCH v2 1/4] virtio-crypto: wait ctrl queue instead of busy polling

2022-04-20 Thread zhenwei pi
On 4/20/22 11:32, Jason Wang wrote: 在 2022/4/18 17:00, zhenwei pi 写道: Originally, after submitting request into virtio crypto control queue, the guest side polls the result from the virt queue. This allows all of the requests share a single request buffer in struct virtio_crypto(ctrl&input&ctrl

Re: virtio-net: Unpermitted usage of virtqueue before virtio driver initialization

2022-04-20 Thread Jason Wang
On Thu, Apr 21, 2022 at 4:18 AM Michael S. Tsirkin wrote: > > On Wed, Apr 20, 2022 at 08:57:18PM +0200, Maciej Szymański wrote: > > On 20.04.2022 19:54, Michael S. Tsirkin wrote: > > > On Wed, Apr 20, 2022 at 04:58:51PM +0200, Maciej Szymański wrote: > > > > On 20.04.2022 13:10, Michael S. Tsirkin

Re: [PATCH v3 1/4] PCI: Clean up pci_scan_slot()

2022-04-20 Thread Bjorn Helgaas
Hi Niklas, I'm sure this makes good sense, but I need a little more hand-holding. Sorry this is long and rambling. On Tue, Apr 19, 2022 at 12:28:00PM +0200, Niklas Schnelle wrote: > While determining the next PCI function is factored out of > pci_scan_slot() into next_fn() the former still handle

PING: [PATCH v4 0/8] Introduce akcipher service for virtio-crypto

2022-04-20 Thread zhenwei pi
Hi Daniel, Could you please review this series? On 4/11/22 18:43, zhenwei pi wrote: v3 -> v4: - Coding style fix: Akcipher -> AkCipher, struct XXX -> XXX, Rsa -> RSA, XXX-alg -> XXX-algo. - Change version info in qapi/crypto.json, from 7.0 -> 7.1. - Remove ecdsa from qapi/crypto.json, it would

RE: [PATCH 5/5] Drivers: hv: vmbus: Refactor the ring-buffer iterator functions

2022-04-20 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 20, 2022 1:07 PM > > With no users of hv_pkt_iter_next_raw() and no "external" users of > hv_pkt_iter_first_raw(), the iterator functions can be refactored > and simplified to remove some indirection/code. > > Signed-off-by: Andrea Parri (Mi

RE: [PATCH 4/5] Drivers: hv: vmbus: Accept hv_sock offers in isolated guests

2022-04-20 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 20, 2022 1:07 PM > > So that isolated guests can communicate with the host via hv_sock > channels. > > Signed-off-by: Andrea Parri (Microsoft) > --- > drivers/hv/channel_mgmt.c | 8 ++-- > include/linux/hyperv.h| 8 ++-- > 2 fi

RE: [PATCH 3/5] hv_sock: Add validation for untrusted Hyper-V values

2022-04-20 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 20, 2022 1:07 PM > > For additional robustness in the face of Hyper-V errors or malicious > behavior, validate all values that originate from packets that Hyper-V > has sent to the guest in the host-to-guest ring buffer. Ensure that > invali

RE: [PATCH 2/5] hv_sock: Copy packets sent by Hyper-V out of the ring buffer

2022-04-20 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 20, 2022 1:07 PM > > Pointers to VMbus packets sent by Hyper-V are used by the hv_sock driver > within the guest VM. Hyper-V can send packets with erroneous values or > modify packet fields after they are processed by the guest. To defend >

RE: [PATCH 1/5] hv_sock: Check hv_pkt_iter_first_raw()'s return value

2022-04-20 Thread Michael Kelley (LINUX) via Virtualization
From: Andrea Parri (Microsoft) Sent: Wednesday, April 20, 2022 1:07 PM > > The function returns NULL if the ring buffer doesn't contain enough > readable bytes to constitute a packet descriptor. The ring buffer's > write_index is in memory which is shared with the Hyper-V host, an > erroneous o

Re: virtio-net: Unpermitted usage of virtqueue before virtio driver initialization

2022-04-20 Thread Michael S. Tsirkin
On Wed, Apr 20, 2022 at 08:57:18PM +0200, Maciej Szymański wrote: > On 20.04.2022 19:54, Michael S. Tsirkin wrote: > > On Wed, Apr 20, 2022 at 04:58:51PM +0200, Maciej Szymański wrote: > > > On 20.04.2022 13:10, Michael S. Tsirkin wrote: > > > > On Wed, Apr 20, 2022 at 10:17:27AM +0200, Maciej Szym

Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-20 Thread Kees Cook
On Sun, Apr 17, 2022 at 05:52:05PM +0200, Peter Zijlstra wrote: > On Thu, Apr 14, 2022 at 01:30:50PM -0700, Andrew Morton wrote: > > On Thu, 14 Apr 2022 17:21:01 +0200 Peter Zijlstra > > wrote: > > > > > > +/* The + 1 below places the pointers within the range of their array */ > > > > #define

Re: virtio-net: Unpermitted usage of virtqueue before virtio driver initialization

2022-04-20 Thread Michael S. Tsirkin
On Wed, Apr 20, 2022 at 04:58:51PM +0200, Maciej Szymański wrote: > On 20.04.2022 13:10, Michael S. Tsirkin wrote: > > On Wed, Apr 20, 2022 at 10:17:27AM +0200, Maciej Szymański wrote: > > > > > > > > Hmm so we have this: > > > > > > > > > > > > > > > > > > > > > > > > if ((dev->feature

Re: [PATCH v7 01/12] driver: platform: Add helper for safer setting of driver_override

2022-04-20 Thread Rafael J. Wysocki
On Tue, Apr 19, 2022 at 1:34 PM Krzysztof Kozlowski wrote: > > Several core drivers and buses expect that driver_override is a > dynamically allocated memory thus later they can kfree() it. > > However such assumption is not documented, there were in the past and > there are already users setting

Re: [PATCH 4/4] virtio-blk: remove deprecated ida_simple_XXX()

2022-04-20 Thread Stefan Hajnoczi
On Tue, Apr 19, 2022 at 09:10:53PM -0700, Chaitanya Kulkarni wrote: > Replace deprecated ida_simple_get() and ida_simple_remove() with > ida_alloc_max() and ida_free(). > > Signed-off-by: Chaitanya Kulkarni > --- > drivers/block/virtio_blk.c | 8 > 1 file changed, 4 insertions(+), 4 del

Re: [PATCH 3/4] virtio-blk: avoid function call in the fast path

2022-04-20 Thread Stefan Hajnoczi
On Tue, Apr 19, 2022 at 09:10:52PM -0700, Chaitanya Kulkarni wrote: > We can avoid a function call virtblk_map_data() in the fast path if > block layer request has no physical segments by moving the call > blk_rq_nr_phys_segments() from virtblk_map_data() to virtio_queue_rq(). > > Signed-off-by: C

Re: [PATCH 2/4] virtio-blk: don't add a new line

2022-04-20 Thread Stefan Hajnoczi
On Tue, Apr 19, 2022 at 09:10:51PM -0700, Chaitanya Kulkarni wrote: > Don't split sector assignment line for REQ_OP_READ and REQ_OP_WRITE in > the virtblk_setup_cmd() which fits in one line perfectly. > > Signed-off-by: Chaitanya Kulkarni > --- > drivers/block/virtio_blk.c | 6 ++ > 1 file c

Re: [PATCH 1/4] virtio-blk: remove additional check in fast path

2022-04-20 Thread Stefan Hajnoczi
On Tue, Apr 19, 2022 at 09:10:50PM -0700, Chaitanya Kulkarni wrote: > The function virtblk_setup_cmd() calls > virtblk_setup_discard_write_zeroes() once we process the block layer > request operation setup in the switch. Even though it saves duplicate > call for REQ_OP_DISCARD and REQ_OP_WRITE_ZERO

Re: [PATCH net-next] net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO

2022-04-20 Thread Willem de Bruijn
On Wed, Apr 20, 2022 at 4:28 AM Hangbin Liu wrote: > > Currently, the kernel drops GSO VLAN tagged packet if it's created with > socket(AF_PACKET, SOCK_RAW, 0) plus virtio_net_hdr. > > The reason is AF_PACKET doesn't adjust the skb network header if there is > a VLAN tag. Then after virtio_net_hdr

Re: [PATCH net 2/2] virtio_net: check L3 protocol for VLAN packets

2022-04-20 Thread Willem de Bruijn
On Tue, Apr 19, 2022 at 9:16 PM Hangbin Liu wrote: > > Hi Willem, > > On Tue, Apr 19, 2022 at 09:52:46AM -0400, Willem de Bruijn wrote: > > Segmentation offload requires checksum offload. Packets that request > > OK, makes sense. > > > GSO but not NEEDS_CSUM are an aberration. We had to go out of

Re: virtio-net: Unpermitted usage of virtqueue before virtio driver initialization

2022-04-20 Thread Michael S. Tsirkin
On Wed, Apr 20, 2022 at 10:17:27AM +0200, Maciej Szymański wrote: > > > > > > Hmm so we have this: > > > > > > > > > > > > > > > > > > if ((dev->features ^ features) & NETIF_F_GRO_HW) { > > > > > > if (vi->xdp_enabled) > > > > > > return -EBUSY;

Re: virtio-net: Unpermitted usage of virtqueue before virtio driver initialization

2022-04-20 Thread Jason Wang
在 2022/4/20 15:32, Maciej Szymański 写道: On 20.04.2022 08:35, Michael S. Tsirkin wrote: On Wed, Apr 20, 2022 at 11:07:00AM +0800, Jason Wang wrote: On Tue, Apr 19, 2022 at 11:03 PM Michael S. Tsirkin wrote: On Tue, Apr 19, 2022 at 04:12:31PM +0200, Maciej Szymański wrote: Hello, I've found

Re: virtio-net: Unpermitted usage of virtqueue before virtio driver initialization

2022-04-20 Thread Jason Wang
在 2022/4/20 14:35, Michael S. Tsirkin 写道: On Wed, Apr 20, 2022 at 11:07:00AM +0800, Jason Wang wrote: On Tue, Apr 19, 2022 at 11:03 PM Michael S. Tsirkin wrote: On Tue, Apr 19, 2022 at 04:12:31PM +0200, Maciej Szymański wrote: Hello, I've found a problem in virtio-net driver. If virtio-net