From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FE86C433EF for ; Wed, 15 Jun 2022 18:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356371AbiFOSYY (ORCPT ); Wed, 15 Jun 2022 14:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245078AbiFOSYX (ORCPT ); Wed, 15 Jun 2022 14:24:23 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3CF5A252AC; Wed, 15 Jun 2022 11:24:22 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B2EF0153B; Wed, 15 Jun 2022 11:24:21 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B39013F73B; Wed, 15 Jun 2022 11:24:18 -0700 (PDT) Date: Wed, 15 Jun 2022 19:24:08 +0100 From: Cristian Marussi To: Jason Wang Cc: "Michael S. Tsirkin" , virtualization , linux-kernel , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" , Marc Zyngier , Halil Pasic , Cornelia Huck , eperezma , Cindy Lu , Stefano Garzarella , Xuan Zhuo , Vineeth Vijayan , Peter Oberparleiter , linux-s390@vger.kernel.org, conghui.chen@intel.com, Viresh Kumar , netdev , pankaj.gupta.linux@gmail.com, sudeep.holla@arm.com, Bjorn Andersson , Mathieu Poirier Subject: Re: [PATCH V6 8/9] virtio: harden vring IRQ Message-ID: References: <20220613041416-mutt-send-email-mst@kernel.org> <20220613045606-mutt-send-email-mst@kernel.org> <20220613052644-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jun 15, 2022 at 09:41:18AM +0800, Jason Wang wrote: > On Wed, Jun 15, 2022 at 12:46 AM Cristian Marussi > wrote: Hi Jason, > > > > On Tue, Jun 14, 2022 at 03:40:21PM +0800, Jason Wang wrote: > > > On Mon, Jun 13, 2022 at 5:28 PM Michael S. Tsirkin wrote: > > > > > > [snip] > > > > > > > arm_scmi > > > > > > It looks to me the singleton device could be used by SCMI immediately after > > > > > > /* Ensure initialized scmi_vdev is visible */ > > > smp_store_mb(scmi_vdev, vdev); > > > > > > So we probably need to do virtio_device_ready() before that. It has an > > > optional rx queue but the filling is done after the above assignment, > > > so it's safe. And the callback looks safe is a callback is triggered > > > after virtio_device_ready() buy before the above assignment. > > > > > > > I wanted to give it a go at this series testing it on the context of > > SCMI but it does not apply > > > > - not on a v5.18: > > > > 17:33 $ git rebase -i v5.18 > > 17:33 $ git am ./v6_20220527_jasowang_rework_on_the_irq_hardening_of_virtio.mbx > > Applying: virtio: use virtio_device_ready() in virtio_device_restore() > > Applying: virtio: use virtio_reset_device() when possible > > Applying: virtio: introduce config op to synchronize vring callbacks > > Applying: virtio-pci: implement synchronize_cbs() > > Applying: virtio-mmio: implement synchronize_cbs() > > error: patch failed: drivers/virtio/virtio_mmio.c:345 > > error: drivers/virtio/virtio_mmio.c: patch does not apply > > Patch failed at 0005 virtio-mmio: implement synchronize_cbs() > > > > - neither on a v5.19-rc2: > > > > 17:33 $ git rebase -i v5.19-rc2 > > 17:35 $ git am ./v6_20220527_jasowang_rework_on_the_irq_hardening_of_virtio.mbx > > Applying: virtio: use virtio_device_ready() in virtio_device_restore() > > error: patch failed: drivers/virtio/virtio.c:526 > > error: drivers/virtio/virtio.c: patch does not apply > > Patch failed at 0001 virtio: use virtio_device_ready() in > > virtio_device_restore() > > hint: Use 'git am --show-current-patch=diff' to see the failed patch > > When you have resolved this problem, run "git am --continue". > > > > ... what I should take as base ? > > It should have already been included in rc2, so there's no need to > apply patch manually. > I tested this series as included in v5.19-rc2 (WITHOUT adding a virtio_device_ready in SCMI virtio as you mentioned above ... if I got it right) and I have NOT seen any issue around SCMI virtio using my usual test setup (using both SCMI vqueues). No anomalies even when using SCMI virtio in atomic/polling mode. Adding a virtio_device_ready() at the end of the SCMI virtio probe() works fine either, it does not make any difference in my setup. (both using QEMU and kvmtool with this latter NOT supporting virtio_V1...not sure if it makes a difference but I thought was worth mentioning) Thanks, Cristian