Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp740735pxk; Thu, 17 Sep 2020 15:10:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS5U9mi/u1FDGsX2+YJ0OlEJ13W4hzxrJbpzGw7ri6ofy3tJ7mM7WZ1NfgA9PtlUmnH3LB X-Received: by 2002:aa7:cf96:: with SMTP id z22mr36408402edx.120.1600380603983; Thu, 17 Sep 2020 15:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600380603; cv=none; d=google.com; s=arc-20160816; b=XUxsbIPV69UtZRrTP7pjNV5UQbRf9ZI99mfHgKuDmNq9NtkzaW4bUsH9Rf2opCyxln JzB81Upa/xAEkfrBg12887ZD9A+BfkWF6I3OA3Y4TO4CKrAzhTZ6Vx8DAmAroM8lyGuF nCg5dW5Y5yj82as4bW3JeSnwrUNGKPpObl/G7n86otplmF3IAfH8HFAlMyb64UhQxA8Z JS7hfD+60miKyo/YiPx/3ADVU3eeZD347hPAScFEw0DnbK8hsKxwI/ruyZo2IYHgLHSU dIfMhNG7HOx1FCL3EAGPC0Tci39N9qfNJoy8wCBxki1ygWA5CTM6ZTQbhTE5p4frf2gW uZIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=aViMg+Pc+E39KYInTit03KCHA+7VqkV7P3uI8wkBDXE=; b=ClqfGE8/UCAiUtkv5/3IgLLeuLvpHcwDo1GJt3lt6mxjhIBacFsQEbr8P0Ca5q6rva BWK8km7vZFf7QlIX88Yh+JJ+MAgXpXI0A2erPN9K/051MoBedKTLuhMvuSUog2QPPl4x jH234H0f/R/6PBGZQGG5ajLpIOXDrqZtJsPfBclfACSlM4lnzsOaoJSmY+QNYmQ1vhsG 2WTUCCzidkvSgGRpllcjJU1Aa8E1yf9K9ldMZ94AjMXMBLv1o2JkIrBT/KonIA8WhP1C EmhD4fOWDaG25/CJ4ugUYVuKDwwy489C1fW53hh5+SDt3P1c8ob9RJZUhqUHYQh2cl6E p0Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OgISkzbS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt8si846089ejb.159.2020.09.17.15.09.40; Thu, 17 Sep 2020 15:10:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OgISkzbS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726174AbgIQWHv (ORCPT + 99 others); Thu, 17 Sep 2020 18:07:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44137 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725874AbgIQWHu (ORCPT ); Thu, 17 Sep 2020 18:07:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600380469; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aViMg+Pc+E39KYInTit03KCHA+7VqkV7P3uI8wkBDXE=; b=OgISkzbScbpqCLS4majy65JC8lyYJSnyqO9/mXeKFjsi82LDyCsgG/Qk75RDwCwij4jv5/ jTfU4GYqyS7HG7AAVEurF+edyVKmA5hG21NAbUI20PgJzuGnFK28Icl1krAc7f1Bt/R2ed vALymO94YOp2eyaxeDvmNiY1ub2AuPc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-545-brqZ6OWuMAuh19u2m6FVMg-1; Thu, 17 Sep 2020 18:07:44 -0400 X-MC-Unique: brqZ6OWuMAuh19u2m6FVMg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30B77801AF5; Thu, 17 Sep 2020 22:07:43 +0000 (UTC) Received: from x1.home (ovpn-112-71.phx2.redhat.com [10.3.112.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F19B55761; Thu, 17 Sep 2020 22:07:42 +0000 (UTC) Date: Thu, 17 Sep 2020 16:07:42 -0600 From: Alex Williamson To: Cornelia Huck Cc: Zenghui Yu , , , Subject: Re: [PATCH 2/2] vfio/pci: Remove bardirty from vfio_pci_device Message-ID: <20200917160742.4e4d6efd@x1.home> In-Reply-To: <20200917133537.17af2ef3.cohuck@redhat.com> References: <20200917033128.872-1-yuzenghui@huawei.com> <20200917033128.872-2-yuzenghui@huawei.com> <20200917133537.17af2ef3.cohuck@redhat.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 17 Sep 2020 13:35:37 +0200 Cornelia Huck wrote: > On Thu, 17 Sep 2020 11:31:28 +0800 > Zenghui Yu wrote: > > > It isn't clear what purpose the @bardirty serves. It might be used to avoid > > the unnecessary vfio_bar_fixup() invoking on a user-space BAR read, which > > is not required when bardirty is unset. > > > > The variable was introduced in commit 89e1f7d4c66d ("vfio: Add PCI device > > driver") but never actually used, so it shouldn't be that important. Remove > > it. > > > > Signed-off-by: Zenghui Yu > > --- > > drivers/vfio/pci/vfio_pci_config.c | 7 ------- > > drivers/vfio/pci/vfio_pci_private.h | 1 - > > 2 files changed, 8 deletions(-) > > Yes, it seems to have been write-only all the time. I suspect the intent was that vfio_bar_fixup() could test vdev->bardirty to avoid doing work if no BARs had been written since they were last read. As it is now we regenerate vconfig for all the BARs every time any offset of any of them are read. BARs aren't re-read regularly and config space is not a performance path, but maybe we should instead test if we see any regressions from returning without doing any work in vfio_bar_fixup() if vdev->bardirty is false. Thanks, Alex