Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6845463iob; Wed, 11 May 2022 06:38:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVqur7VXUM8r3Cyk7GP4qYo/3woBqcsRF9Y7VXwYj8l/cyzCwsTrlSJ70SNoWohp6uNJW2 X-Received: by 2002:a5d:9817:0:b0:65a:f20b:db2c with SMTP id a23-20020a5d9817000000b0065af20bdb2cmr7331617iol.118.1652276331217; Wed, 11 May 2022 06:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652276331; cv=none; d=google.com; s=arc-20160816; b=F0bhHMR2w6AkHyhwcrkRdNfy4qwSYDqm7PJycCPsuwbKUO8E5jLNdrBQZczsKAa3Bm No1S8I4c0A6Xrj5LQI2I2EAXWv0OnE9+Z9bHFCQzg4REL+JB6Yw42VGNNvhHlsKiDUN3 ARcnlLExg1uRetCobzdOhwtz+XYYGt/7RvluTzvwIPXD4EjOzJbVAn8087Kzvma/dY/r m5I6R2Ou+JDxZkuh/rBTuBgr85eymmmMqUmv6PJHzaNy+1V+LQ6l3QQgnxmzenDDZlLs LI9MFevVVYyjL46naibI1LhkUw1bcnKjqkwe5qWZABdSvAxPxPOGk86J0ajU7OMLX8jX nylA== 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=fnj3eCg7s0TS1ramQcFiuiKen3jow8jquS3FS71SHPU=; b=DWGF7gJ4KbgLWU7hVGca+0L9SHhB8AEhnbtGBFDh827AWGQkrJfUfCt1l7KBcn83zR fBV5f5Dpw0Allwl/o3l4teijmMoauZ2hFdhdursdYSiosAAQWyew2zdWcA0AzZguOVG3 7MK4AC8ncAl623bR9z6vf5UXAATGBlArqFH17ejk7ICkahQYPGvfv6u50N2SjfT9pMiI WrRx5lGYKIN60rEAkgEmDHLaQQHPe2gKkT/cDLZy0Qx03w5Mm9jvfMgJ8rPjGoT9H6ts Vkw8KS43lbewEh16oWQdgZ94yprkKYw/OhGXq3swxEDG755pgJNA59XQ/DMQOy3to6e4 g+mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="JVKo/laJ"; 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 q21-20020a056638239500b0031a88e99aa2si2613043jat.90.2022.05.11.06.38.35; Wed, 11 May 2022 06:38:51 -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="JVKo/laJ"; 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 S238018AbiEKJ2i (ORCPT + 99 others); Wed, 11 May 2022 05:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235938AbiEKJ2e (ORCPT ); Wed, 11 May 2022 05:28:34 -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 D39951053CC for ; Wed, 11 May 2022 02:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652261305; 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=fnj3eCg7s0TS1ramQcFiuiKen3jow8jquS3FS71SHPU=; b=JVKo/laJclZuOYvJ0E/rKaF6sxuVu7hXeZC8ZG1pw/Utsvi7ihCMN6mL1V9S+gsgyxC+Tb lzPAbSI/YsKR2HvRB9/uwItAyqdLVjUR+qHX7ngAlGFHCBkSkQWsRp2QpEpp+zXHb9qteZ c7eALQCPG+zwLgUYAIXYnwi4gjEqYyg= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-TxdCz70UOt6lystG6d0Z2w-1; Wed, 11 May 2022 05:28:24 -0400 X-MC-Unique: TxdCz70UOt6lystG6d0Z2w-1 Received: by mail-lf1-f69.google.com with SMTP id n3-20020ac242c3000000b00473d8af3a0cso576699lfl.21 for ; Wed, 11 May 2022 02:28:24 -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=fnj3eCg7s0TS1ramQcFiuiKen3jow8jquS3FS71SHPU=; b=qsBvTRSwoCTp9quIr8XR0k2wd+U+hl9nGfKfnF+UunIQpWJmc/IgI8AfAbw9hrH+yA JBzV2ev07dWOvb6gPRPiid6kH5vhNJh1l2STkt2TPSNJIyU51soRYzty/82TSJ3DHecc nHhMpUifU9Q7UlQuvSZ+T87qR1DK9BLuIRBukdtHDolSwoUMTsZkwmLTweCVDeoIiV+1 VN3TIl3p6YLJjEHuz3UeZFNq6maExp2u51T45JWr9DnhCH1hN3CHWNCCeGmMR79W6+KR g+WgoMH8QCsHHwaWFy+zEuCDn7nLdEW9vrhXudJbguCMk380mxD3AZmhF4/kgwMTQ4RG QQnw== X-Gm-Message-State: AOAM533+1/C+V8eHF41cgpr9oyqYRITWJnn3nqpqAnwMJcPHDwqQV2os jA142F2ijfYlkOB1e79k+IyWREoM+jJYxwh9h56Ikcac73UfxEKlydih1ZPUj/QpnhziLIE/VFd F/da/ya7bk7LBRcy/Dnq/cG7S3qbLb/q3DKBFsMaB X-Received: by 2002:a05:6512:1395:b0:446:d382:79a5 with SMTP id p21-20020a056512139500b00446d38279a5mr18757583lfa.210.1652261303108; Wed, 11 May 2022 02:28:23 -0700 (PDT) X-Received: by 2002:a05:6512:1395:b0:446:d382:79a5 with SMTP id p21-20020a056512139500b00446d38279a5mr18757555lfa.210.1652261302901; Wed, 11 May 2022 02:28:22 -0700 (PDT) MIME-Version: 1.0 References: <20220507071954.14455-1-jasowang@redhat.com> <20220507071954.14455-7-jasowang@redhat.com> <20220510072451-mutt-send-email-mst@kernel.org> <87r150bi0d.fsf@redhat.com> <87lev8bffh.fsf@redhat.com> In-Reply-To: <87lev8bffh.fsf@redhat.com> From: Jason Wang Date: Wed, 11 May 2022 17:28:11 +0800 Message-ID: Subject: Re: [PATCH V4 6/9] virtio-ccw: implement synchronize_cbs() To: Cornelia Huck Cc: "Michael S. Tsirkin" , virtualization , linux-kernel , Thomas Gleixner , Peter Zijlstra , "Paul E. McKenney" , Marc Zyngier , Halil Pasic , eperezma , Cindy Lu , Stefano Garzarella , Xuan Zhuo , Vineeth Vijayan , Peter Oberparleiter Content-Type: text/plain; charset="UTF-8" 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 at 5:13 PM Cornelia Huck wrote: > > On Wed, May 11 2022, Jason Wang wrote: > > > On Wed, May 11, 2022 at 4:17 PM Cornelia Huck wrote: > >> > >> 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. > > > > Right, it was protected by a spin_lock_irq(), but I can see other > > cdev->handler() in e.g device_fsm.c, the irq status is not obvious, do > > they have the same assumption which IRQ is disabled? > > Yes, that should be the case for any invocations via the fsm as well. > Ok. > It's been some time since I've worked on that part of the code, though, > so let's cc: the s390 cio maintainers so that they can speak up if I'm > wrong. Ok, I will do that. Thanks >