Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp812836iog; Wed, 15 Jun 2022 12:57:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tNLRhkj5+A6XcjdAizfhqg9Tx1YxpW4VOPoGKgmz4hi6UucdieF/ZU2igaUxC7m8okhGy6 X-Received: by 2002:a17:906:73dd:b0:715:777c:b7a8 with SMTP id n29-20020a17090673dd00b00715777cb7a8mr1297554ejl.607.1655323031937; Wed, 15 Jun 2022 12:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655323031; cv=none; d=google.com; s=arc-20160816; b=eNiQBsFFKcG7VMb1KSPg36ujtfyAeQFvAYWih3a6WuyfrGxeEwEVZl6jCuN1cbmtmW +3O3woIrKJXMap7cJSYXqV1dpegoQIrp17P6nQqmri9OMVlLHMb+aoFwycOBNUTu3vWe MBJHvFG+ygr07tIeZl0FRv323NMo/Dvbu4s51SbGkiAYlfvKd9CKrjzzUYb9dyqGd7hh KHcPPzmPc6cxG72D54AtVNuXmZAlQMRDJIK77EDBY82tDpFVyk0Iblylb3+JzHk9qEB5 ehu1Z0u8UW4daBoeOiMYS6uN3/pTzzFGIJ5Duo2NGP7tjyszr90Avd7cm0/2MjcwfTYd HPRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jpuyRPyRY7NsS1FEfLtcPQJVS1eCfpJhWImQIJHhMfI=; b=IGq4WLtJpb4ppW587e9fNigfkiHGu5mxeF/xJ+a+I1JJDB9uUOv2xNaYywv32k5daJ ELy+p6TXujadvZ32OcKgV8WAPf7Cbkw1vODoXf/9WoG6xgsw0lcpxQgWJyLwSPvnloUc iokBQfrIZf0KgqUR4kD8Pwu0COVAjom8ovYQVz6UsqXdAX1vIA1hHPGrGWh+0GkKeKSe uKbhcKd0VIrKMJ2GIWKFihgkeEpUxvZyeSi5hncVSSnY1qN5/EA//cqKqXxEiQe7qJ2Z Xb2PLG0smXqOC4m0LblR2uaESjM3/MSWiwDigp2CoMxYVRzL6QnlLwVv6iiMcvEMsx1j YK/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e11-20020a170906648b00b00711d61d0e1csi15199419ejm.109.2022.06.15.12.56.46; Wed, 15 Jun 2022 12:57:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358315AbiFOSYZ (ORCPT + 99 others); Wed, 15 Jun 2022 14:24:25 -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: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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