Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3711963iob; Tue, 17 May 2022 05:58:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQE1dTDslQ3rm6ar+nRAGGCQQP3lUAdfPcWUcNuuP2ZCVCUgDS6ZMLeaf4umYdJRDM2XcM X-Received: by 2002:a05:6a00:2b6:b0:510:b7d7:ca88 with SMTP id q22-20020a056a0002b600b00510b7d7ca88mr22548309pfs.35.1652792317175; Tue, 17 May 2022 05:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652792317; cv=none; d=google.com; s=arc-20160816; b=ZH8Mp1RyKI7BjWNZ5bwWWiNsoAhkzippHNJxb8hV5pcYf7f7jFOhouzld9NKmNzgFm Mya3gUu4X8fYf+yNRG/hbB/KLIlLpAbIPueYVPcmlP2bRI+Hr5wMr7xBc2v72SDG3hgh CjWL3UiMpjJ/WftmkYNS/lbPydv8hjsVbV06JFTWqB5ZUseUX80h2aJzvYoAgD2GOTDa o84asG7gekxkP0V1vVG/Sra2184GPjhvb0HNUUoWoGLNc9V2nLRCMMD09jVI0vWgtFBq OKpkRbNZemjPY5tOU7plubqFJYfNBo4tjZ1eW8wNr/hzzJAs/5Zpisgb/DHtcZKwJw6l xN9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=378j+iYEEH5oqWnq5jjHkAR2MvwkVCfL/9+UoMi9JsE=; b=aUz/35Rh/eeTMxsGdb/x3xZvS8MbHYZqOsq+0spq3JWsUH3cWjB8DTC6CGEy+pupa2 p0UTgDpLpDUbzgrBB5/y4Wewb+r/HO82hxtEK6AkYMOwhJXGuFjSzWzgES4a+JPs8c2n iyq2YQBJMzef+11UWAUYlLzsUn+APF6PnPjRrz2KKfChkFhC2tUfVNvFweL/4ARXiY1h 7kPdix695QvlBWCHTlU+mkBSoJQvWRA4tjRippSTgTieumH0yt1RMAXJPtfJ+21QzJBR UFOPNoAtDj/6rq51QTUMMCqVAS8TqQtKUSLlfstDsF/sfWJ0Qr/0BbQL8156vfIK6IA+ RGvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G6vD86Ku; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p7-20020a1709028a8700b0015ce8cd506asi14705048plo.325.2022.05.17.05.58.24; Tue, 17 May 2022 05:58:37 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G6vD86Ku; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbiEQBAh (ORCPT + 99 others); Mon, 16 May 2022 21:00:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230177AbiEQBAf (ORCPT ); Mon, 16 May 2022 21:00:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2377944A18 for ; Mon, 16 May 2022 18:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652749234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=378j+iYEEH5oqWnq5jjHkAR2MvwkVCfL/9+UoMi9JsE=; b=G6vD86Ku2xw9xiZgNRp1IjAjB1MZtBZlyOmkrOAFdrrAXKExmdGj0/lV7FL06uzd2AP7CF eizHFjetIr8+razIqKBl24ityif2l74Wtdt0TtmXyM/fFH2lQYZxiCLI2A8BxyOMhq1xM5 OnzNb8tFsSzPVmfeoymX4oGcc5HIxA0= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-208-she8Aj1rMx2PzkuuwKaiIA-1; Mon, 16 May 2022 21:00:33 -0400 X-MC-Unique: she8Aj1rMx2PzkuuwKaiIA-1 Received: by mail-lf1-f70.google.com with SMTP id bp17-20020a056512159100b00472631eb445so7179531lfb.13 for ; Mon, 16 May 2022 18:00:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=378j+iYEEH5oqWnq5jjHkAR2MvwkVCfL/9+UoMi9JsE=; b=kYI+a8v3SVWrewUhGki4GgNpYBrBvhA0bnSBfBeaULfHTzvulW2NIMd1Di6PJHFu1o JBNGtkAH8DMX2A4+saa2UHeVJCLon4KjgQdJtbBGOsBI5TPgXUPbyc7qaaTvwT60beJ0 vK+ZsrMUMMu6AxCBtM5qmb2sMA3izDtpRRReKplnHy9XAHHm1e/U5zZJhHwr4zGxCtUx zNCKGKkA7JYgsOS327/PELhvTbAjDWrxcal8/znbjEl25XlhBz6iMEIUWraWAaN6WKpF DY4t3yU35ZtN4n/MCUu7gOz1uLFfWOSxd+A47LyJ1Mm3n7ci0QNQmLcNHkv6wIUnxIKy MvDw== X-Gm-Message-State: AOAM5317aN8r8Ti60+gWZ+O941AbcxdhoyKcicHck/rhMC6mIM31nl0L CwW2uxgn7JozT8qviX2QydhUpbl0e+V/mPjywwmatyd1SgIn252f3a+sIVGjfEkUM7qWiw7kTa7 3f6cMuc5VguHKbjUp2tgvXqvAwLBDehTS9Qckw4DK X-Received: by 2002:a05:651c:89:b0:250:87c9:d4e6 with SMTP id 9-20020a05651c008900b0025087c9d4e6mr13082336ljq.315.1652749231443; Mon, 16 May 2022 18:00:31 -0700 (PDT) X-Received: by 2002:a05:651c:89:b0:250:87c9:d4e6 with SMTP id 9-20020a05651c008900b0025087c9d4e6mr13082319ljq.315.1652749231249; Mon, 16 May 2022 18:00:31 -0700 (PDT) MIME-Version: 1.0 References: <20220507071954.14455-1-jasowang@redhat.com> <875ymd3fd1.fsf@redhat.com> <20220511160147.46cbf2fb.pasic@linux.ibm.com> <20220516132006.29d28fbe.pasic@linux.ibm.com> <20220516102425-mutt-send-email-mst@kernel.org> In-Reply-To: <20220516102425-mutt-send-email-mst@kernel.org> From: Jason Wang Date: Tue, 17 May 2022 09:00:20 +0800 Message-ID: Subject: Re: [PATCH V4 0/9] rework on the IRQ hardening of virtio To: "Michael S. Tsirkin" Cc: Halil Pasic , Cornelia Huck , virtualization , linux-kernel , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" , Marc Zyngier , eperezma , Cindy Lu , Stefano Garzarella , Xuan Zhuo Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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 Mon, May 16, 2022 at 10:25 PM Michael S. Tsirkin wrote: > > On Mon, May 16, 2022 at 01:20:06PM +0200, Halil Pasic wrote: > > On Thu, 12 May 2022 11:31:08 +0800 > > Jason Wang wrote: > > > > > > > It looks to me we need to use write_lock_irq()/write_unlock_irq() to > > > > > do the synchronization. > > > > > > > > > > And we probably need to keep the > > > > > read_lock_irqsave()/read_lock_irqrestore() logic since I can see the > > > > > virtio_ccw_int_handler() to be called from process context (e.g from > > > > > the io_subchannel_quiesce()). > > > > > > > > > > > > > Sounds correct. > > > > > > As Cornelia and Vineeth pointed out, all the paths the vring_interrupt > > > is called with irq disabled. > > > > > > So I will use spin_lock()/spin_unlock() in the next version. > > > > Can we do some sort of an assertion that if the kernel is built with > > the corresponding debug features will make sure this assumption holds > > (and warn if it does not)? That assertion would also document the fact. > > Lockdep will do this automatically if you get it wrong, just like it > did here. > > > If an assertion is not possible, I think we should at least place a > > strategic comment that documents our assumption. > > That can't hurt. I will add some comments here. Thanks > > > Regards, > > Halil > > > > > > > > Thanks >