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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 16 Sep 2015 12:19:53 +0900
From:	Ethan Zhao <ethan.zhao@...cle.com>
To:	bhelgaas@...gle.com
Cc:	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	Ethan Zhao <ethan.zhao@...cle.com>
Subject: [PATCH v2] iov: restore NumVFs register to 0 before return from virtfn_max_buses()

After commit 4449f079722c ("PCI: Calculate maximum number of buses
required for VFs"),the initial value of NumVFs register was left to
non-zero after sriov_init() and no VFs was enabled in device driver.
this changed the behaviour of kernel exported by lspci and sysfs etc.
so this patch restore the NumVFs register to zero after the
calculation of max_VF_buses was done and before return from
virtfn_max_buses().

Tested on stable 4.1 and passed building on stable 4.3-rc1

Signed-off-by: Ethan Zhao <ethan.zhao@...cle.com>
Tested-by: Sriharsha Yadagudde <sriharsha.devdas@...cle.com>
---
v1..v2:
 -Suggestions from Bjorn Helgaas (move the restoration of NumVFs register
  to virtfn_max_buses())
---
 drivers/pci/iov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index ee0ebff..92cee06 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -71,6 +71,8 @@ static inline u8 virtfn_max_buses(struct pci_dev *dev)
 			max = busnr;
 	}
 
+	/* restore NumVFs register to 0 */
+	pci_iov_set_numvfs(dev, 0);
 	return max;
 }
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ