Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6717328iob; Wed, 11 May 2022 03:59:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjzgm+7ueOEVOioRM5XI+FCTqW4stbxsqgRVVBzB3A9ta0577Q3ZpUmVt9ZqcV5JNGH/0l X-Received: by 2002:a62:e80f:0:b0:50d:3693:43df with SMTP id c15-20020a62e80f000000b0050d369343dfmr24580670pfi.36.1652266755437; Wed, 11 May 2022 03:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652266755; cv=none; d=google.com; s=arc-20160816; b=DgizEUXa7TCeUdHT4rR31yiQmqQKJknpufQ936qN4zWiavRJdoOJLJyf2/TlXUb5lz 7ymhUtte4LdpqscbYy6vd/WykswFtlGjsFgUVYYjVilc3JEuNdxX36uVnTnID0He42zL xECRgDgBz3JvAUbthiJI3y7+kzhzvuHx3BB1Cq0UHRGu7y1zX3X0vsmOh5FjRtE2Uys9 0Rj84AMbBeULq6T6jLNrFneWqjWy7dy6yG371aY7cC232H2yFcocigLdhnEy83LliW3J lvBh7kayK3CNR/BaHXiZemR5i0Zg18EOQazkebd7tpxhBfMi0df9iLMKiXdM41VSPD0E F2MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:organization:in-reply-to:subject:cc:to:from :dkim-signature; bh=0WhNG2BFNpm3DlKnvpsKok4cmCLeGV6XphB375cBO7U=; b=CPEmo9pzwziqYBO8/Ii3zC6Hs0PK/JEOUGavOz9lsFHQ6sgTHZR/l6bw2mRsfK4EXP frxXtTZPZqrl0vI+aTd+S3dqrO+QfMGhSRaCdLr1Cu8UpNNQHgz6TaE1/Fn5eOg73BFm h6ZdgoH/t8wavlSmKA333TcAuu4212K1kXLbf1lESQWb2H9CkJczH+x227CJqBr0BvDr 8ywF2Daj/TReMie22R5qG92OL4vJibEKfUa1wnfXXGO3e159gPmTIe/TuQPMoPydzBNO pYG0II58MrhFsWYDlTpCfNzPtXwR5QMJnZY2Ki3rip/9GSbKMZR3BzmfBPrVW8BrP912 Jl2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VGRPrHzB; 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 q9-20020a170902f78900b00153b2d165e4si2020478pln.492.2022.05.11.03.59.01; Wed, 11 May 2022 03:59:15 -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=VGRPrHzB; 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 S232468AbiEKIRd (ORCPT + 99 others); Wed, 11 May 2022 04:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiEKIRc (ORCPT ); Wed, 11 May 2022 04:17:32 -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 931EF3FBCB for ; Wed, 11 May 2022 01:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652257048; 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=0WhNG2BFNpm3DlKnvpsKok4cmCLeGV6XphB375cBO7U=; b=VGRPrHzB9zM1+Gsk9omPkYIV0xG2XTHx5n5kgEPAN+St1ULf8QdMbOLwsuDeuh1l0vsz2h aTHwDAvMnH3bD3yJTU58bY9pIQc51aQSfxvj6k/w0VXSY7zvzyBxQFlsgqclUy9C6tQt/M emBn3P9eFahkvss5q09OFiU9QC9plLc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-362-naHtCBJcPk6b1wVTF8gDJg-1; Wed, 11 May 2022 04:17:25 -0400 X-MC-Unique: naHtCBJcPk6b1wVTF8gDJg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 05E3D185A794; Wed, 11 May 2022 08:17:25 +0000 (UTC) Received: from localhost (unknown [10.39.193.115]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73F97145BF03; Wed, 11 May 2022 08:17:24 +0000 (UTC) From: Cornelia Huck To: Jason Wang , "Michael S. Tsirkin" Cc: virtualization , linux-kernel , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" , Marc Zyngier , Halil Pasic , eperezma , Cindy Lu , Stefano Garzarella , Xuan Zhuo Subject: Re: [PATCH V4 6/9] virtio-ccw: implement synchronize_cbs() In-Reply-To: Organization: Red Hat GmbH References: <20220507071954.14455-1-jasowang@redhat.com> <20220507071954.14455-7-jasowang@redhat.com> <20220510072451-mutt-send-email-mst@kernel.org> User-Agent: Notmuch/0.34 (https://notmuchmail.org) Date: Wed, 11 May 2022 10:17:22 +0200 Message-ID: <87r150bi0d.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-3.4 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 Wed, May 11 2022, Jason Wang wrote: > On Tue, May 10, 2022 at 7:28 PM Michael S. Tsirkin wrote: >> >> On Sat, May 07, 2022 at 03:19:51PM +0800, Jason Wang wrote: >> > @@ -1106,6 +1130,7 @@ static void virtio_ccw_int_handler(struct ccw_device *cdev, >> > vcdev->err = -EIO; >> > } >> > virtio_ccw_check_activity(vcdev, activity); >> > + read_lock_irqsave(&vcdev->irq_lock, flags); >> > for_each_set_bit(i, indicators(vcdev), >> > sizeof(*indicators(vcdev)) * BITS_PER_BYTE) { >> > /* The bit clear must happen before the vring kick. */ >> >> Cornelia sent a lockdep trace on this. >> >> Basically I think this gets the irqsave/restore logic wrong. >> It attempts to disable irqs in the handler (which is an interrupt >> anyway). > > The reason I use irqsave/restore is that it can be called from process > context (if I was not wrong), e.g from io_subchannel_quiesce(). io_subchannel_quiesce() should disable interrupts, though? Otherwise, it would be a bug.