Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp114432pxk; Wed, 16 Sep 2020 20:49:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgvzggQYah1oYQXw6tMC95XNjDtvvAQs+GLF56d3zjkHimJeSY58XfKTpLGU5t1tRhlyy0 X-Received: by 2002:a17:906:2b4f:: with SMTP id b15mr29649752ejg.477.1600314598853; Wed, 16 Sep 2020 20:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600314598; cv=none; d=google.com; s=arc-20160816; b=msoeIfXfILbxB98HGERj6clTyxraQjAA2VTIryz8pcoqsNh6KgLhF9tV0eFAGsIFrm 6qYJdiFsHONpcmDvui9v6LmoImdiRMB3LUe78WgLZxcdPV5KDNdsuJoyVJPQEoLc6wIl I23/PWn3scE6idEtWmheBLXdFfPHh6FQePAY3rncF49WyhyGxlAlx4qTxLEOSSbF0fUV 9qpu2HXHkHEP/RStiaNMF7tTQ2phxwnabcC74UWhMGGj+cAtdRDrW+YYKXU4YYVb/RQJ Py624CwQmhMrHP6pmsz4ChscjaZzW3RhLycuN4P6vLTFA7j2+hkY6QKfU3Mz4DE+5lR3 dIoQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=QgBwQTErVnW/mxxCUCrBHDXOFS2jF0LBheIyPKJyGnc=; b=Q2it3yAG5b94N0R+rD1nr4NiazdlPKahIl1r1R9ShArKYak+IeVrI6snbXEJ5YcIxr eR+D/P0GcE8wYFYvOyq24dshhlhbxzAE14iFvO5ELQlqAzs40ACS2yR2bC8fJ1TnR/ls /thVbOPSqcl54AeOhio21YM9ZiCDd1ro9zR7p7DdqECIVhud8h06n5Vr0yo1rae+Tx66 slp17DQgD9GOh+cw4Ku2HVHIiN5yx3meanwxehWEaaGxp8otn/87sems/yeZHUp/1IU5 oc0+FqbktCfXSLkGJyQaB3K1ECLX2XuO33175XtNpHg5Uuqv3uTa5aWb3VPjiR/LDoBx wSJg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si12267675ejq.467.2020.09.16.20.49.35; Wed, 16 Sep 2020 20:49:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726199AbgIQDs3 (ORCPT + 99 others); Wed, 16 Sep 2020 23:48:29 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12772 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726118AbgIQDs0 (ORCPT ); Wed, 16 Sep 2020 23:48:26 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DE49E15AE79EDA874EF2; Thu, 17 Sep 2020 11:32:18 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.174.185.226) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 17 Sep 2020 11:32:08 +0800 From: Zenghui Yu To: , CC: , , , Zenghui Yu Subject: [PATCH 2/2] vfio/pci: Remove bardirty from vfio_pci_device Date: Thu, 17 Sep 2020 11:31:28 +0800 Message-ID: <20200917033128.872-2-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 In-Reply-To: <20200917033128.872-1-yuzenghui@huawei.com> References: <20200917033128.872-1-yuzenghui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.185.226] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index d98843feddce..e93b287fea02 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -507,8 +507,6 @@ static void vfio_bar_fixup(struct vfio_pci_device *vdev) *vbar &= cpu_to_le32((u32)mask); } else *vbar = 0; - - vdev->bardirty = false; } static int vfio_basic_config_read(struct vfio_pci_device *vdev, int pos, @@ -633,9 +631,6 @@ static int vfio_basic_config_write(struct vfio_pci_device *vdev, int pos, } } - if (is_bar(offset)) - vdev->bardirty = true; - return count; } @@ -1697,8 +1692,6 @@ int vfio_config_init(struct vfio_pci_device *vdev) if (ret) goto out; - vdev->bardirty = true; - /* * XXX can we just pci_load_saved_state/pci_restore_state? * may need to rebuild vconfig after that diff --git a/drivers/vfio/pci/vfio_pci_private.h b/drivers/vfio/pci/vfio_pci_private.h index 61ca8ab165dc..dc96a0fda548 100644 --- a/drivers/vfio/pci/vfio_pci_private.h +++ b/drivers/vfio/pci/vfio_pci_private.h @@ -122,7 +122,6 @@ struct vfio_pci_device { bool virq_disabled; bool reset_works; bool extended_caps; - bool bardirty; bool has_vga; bool needs_reset; bool nointx; -- 2.19.1