[PATCH 1/2] PCI: Fix off by one error in VTBAR exclusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In commit 847584ba2ae3e6c6678610af998692e0ef6ab82d I introduced an off
by one error in the case where a VTBAR window intersects with the end
of the IOH's Local MMIOL range.

  In example, if the Local MMIOL range is 0xb4000000 - 0xb4ffffff and
  the VTBAR window is at 0xb4ffe000 - 0xb4ffffff then the Local MMIOL's
  range needs to be truncated so as not to include the VTBAR registers.
  The result of the Local MMIOL truncation should be 0xb4000000 -
  0xb4ffdfff (0xb4ffe000 - 1).  Due to the off by one error the Local
  MMIOL resultant range is incorrectly 0xb4000000 - 0xb4ffe000.

I discovered this when replying to Yinghai Lu's feedback - Thanks Yinghai.

Signed-off-by: Myron Stowe <myron.stowe@xxxxxx>
---

 arch/x86/pci/intel_bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/pci/intel_bus.c b/arch/x86/pci/intel_bus.c
index 9d91b1e..8be4e1d 100644
--- a/arch/x86/pci/intel_bus.c
+++ b/arch/x86/pci/intel_bus.c
@@ -87,7 +87,7 @@ static void __devinit pci_root_bus_res(struct pci_dev *dev)
 		if (vtbar <= mmiol_base)
 			mmiol_base = vtbar + IOH_VTSIZE;
 		else if (mmiol_end <= vtbar + IOH_VTSIZE - 1)
-			mmiol_end = vtbar;
+			mmiol_end = vtbar - 1;
 		else {
 			update_res(info, mmiol_base, vtbar - 1,
 				   IORESOURCE_MEM, 0);

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux