lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Sep 2020 11:31:28 +0800
From:   Zenghui Yu <yuzenghui@...wei.com>
To:     <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     <alex.williamson@...hat.com>, <cohuck@...hat.com>,
        <wanghaibin.wang@...wei.com>, Zenghui Yu <yuzenghui@...wei.com>
Subject: [PATCH 2/2] vfio/pci: Remove bardirty from vfio_pci_device

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 <yuzenghui@...wei.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ