Received: by 2002:a05:6a10:3150:0:0:0:0 with SMTP id m16csp3147171pxc; Tue, 12 Apr 2022 14:55:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypbgCY7HX4ZUq1RGjftTTa796YWWjfy0QQSgKA3OpCXPGLR1DkQaeeS2AWP7ZD6MYS8WJX X-Received: by 2002:a17:90a:6781:b0:1cb:11f0:9c51 with SMTP id o1-20020a17090a678100b001cb11f09c51mr7212770pjj.243.1649800503489; Tue, 12 Apr 2022 14:55:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649800503; cv=none; d=google.com; s=arc-20160816; b=wQqbcLdsLDcT7LjQ/Milcgytpc1gJy4Uk+dwQ7O9ZJIdCQ9IsEN7MW6sS4bALJi0EM l/yXB2jff0WEfA26iAxEP62bGKCkaYKNXs8R6qSGzbfPSOes3F8NRfE3wVpzMQfZPIbh J/pMitxECpxXVTXEZ1cW4a5adxJtjoK/IlETYbGf9W6Og1G84sxQkogSQ4ISgEPuAYv4 ZEa8zREkwgFukT5K1tBmmv0aj7SfjiX4mG3tyqyY5RgbQlj6AGpT7NkPTZfZg5zyym/m 5c5jJ/40Fsm3xMYvlvyQdiEE6j+wW8ZQqrz2D9mtCIp5qbuCtcHQ9/dW0xJPphIwqk8z JY3A== 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=UaNDfDtZrF6G9nBA9RDO8xMUJdj8q1bYX1cCWIIUT/8=; b=kaG98xrQ2unJJGqZp/OMqjKT4o+DdcAkbAG1zpM0gTZGWKy6iwoBbOzhaQz/HKdfKz zfUVZjwIO3TRp/DvnUuuY4w1x8Dd+ispm9XcndjzHRykxgZdtSZ6iquR4Q1Y9p9uxZdD 75LG7dUfQe95mRP3bEeBbaXs9RFgOprg1G73ZqLLlNgZ+cbamKAISdsStj4MutteGV0b 7NbAwsnqzIqfqJ1SGO5eCsSAgfH1eErc1lm2zDhlVlRJGmXTxavlQ5A1TpUsNYiC8gVv wPYn54vilbydbTdynT2s1DLaUJnNmcacOEJXnaD02+dRLnHLmjlYAemSiG9lOiKXyMxm KdWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d27QDrMU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x12-20020a1709027c0c00b00153b2d165c4si12000559pll.460.2022.04.12.14.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:55:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d27QDrMU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69921123438; Tue, 12 Apr 2022 13:48:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242543AbiDLQvc (ORCPT + 99 others); Tue, 12 Apr 2022 12:51:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357832AbiDLQva (ORCPT ); Tue, 12 Apr 2022 12:51:30 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7E16CDEAB for ; Tue, 12 Apr 2022 09:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649782146; 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=UaNDfDtZrF6G9nBA9RDO8xMUJdj8q1bYX1cCWIIUT/8=; b=d27QDrMU/JM/hHs5j3GIfqdbm/Dgw5R5pn3XXymmwT5yiZyWjueUyoKFQxHBoXZZcJZvSp INmvJ0s9hKGybTxajEXLMmvmdEFKh8R8iqlYIiIpZW7b9UavGtxSYLpy5vw0ix0Q+QcyHr RIIh/8QjrroOYXbhrFtfjl/4Q6RSEbQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-5-0_C0awwMMxmhlkf01iFzdw-1; Tue, 12 Apr 2022 12:48:59 -0400 X-MC-Unique: 0_C0awwMMxmhlkf01iFzdw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AF6DA3C01B97; Tue, 12 Apr 2022 16:48:58 +0000 (UTC) Received: from localhost (unknown [10.39.193.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EEEA02024CD2; Tue, 12 Apr 2022 16:48:48 +0000 (UTC) From: Cornelia Huck To: Halil Pasic Cc: Jason Wang , "Michael S. Tsirkin" , "Paul E. McKenney" , Peter Zijlstra , Marc Zyngier , linux-kernel , virtualization , Thomas Gleixner , Halil Pasic Subject: Re: [PATCH V2 4/5] virtio-pci: implement synchronize_vqs() In-Reply-To: <20220412020145.32e26e5a.pasic@linux.ibm.com> Organization: Red Hat GmbH References: <20220406083538.16274-1-jasowang@redhat.com> <20220406083538.16274-5-jasowang@redhat.com> <20220406075952-mutt-send-email-mst@kernel.org> <87wng2e527.fsf@redhat.com> <20220408150307.24b6b99f.pasic@linux.ibm.com> <20220410034556-mutt-send-email-mst@kernel.org> <877d7vbspu.fsf@redhat.com> <20220412020145.32e26e5a.pasic@linux.ibm.com> User-Agent: Notmuch/0.34 (https://notmuchmail.org) Date: Tue, 12 Apr 2022 18:48:47 +0200 Message-ID: <87r1629rio.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, Apr 12 2022, Halil Pasic wrote: > On Mon, 11 Apr 2022 16:27:41 +0200 > Cornelia Huck wrote: >> My main concern is that we would need to synchronize against a single >> interrupt that covers all kinds of I/O interrupts, not just a single >> device... >> > > Could we synchronize on struct airq_info's lock member? If we were > to grab all of these that might be involved... Hm, that could possibly narrow the sync down to a subset, which seems better. For devices still using classic interrupts, per-device sync would be easy. > > AFAIU for the synchronize implementation we need a lock or a set of locks > that contain all the possible vring_interrupt() calls with the queuues > that belong to the given device as a critical section. That way, one > has the acquire's and release's in place so that the vrign_interrupt() > either guaranteed to finish before the change of driver_ready is > guaranteed to be complete, or it is guaranteed to see the change. > > In any case, I guess we should first get clear on the first part. I.e. > when do we want to allow host->guest notifications. Also, whether we just care about vring interrupts, or general device interrupts (not sure if a config change interrupt may also trigger things we do not want to trigger?)