Module Name: src
Committed By: jakllsch
Date: Fri Nov 13 18:58:17 UTC 2015
Modified Files:
src/sys/arch/arm/nvidia: tegra_pcie.c
Log Message:
Limit configuration space access to the non-emulated busses to legacy
PCI_CONF_SIZE. Extended configuration access is possible, we just have
to implement it without wasting up to 256MiB of KVA.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nvidia/tegra_pcie.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/nvidia/tegra_pcie.c
diff -u src/sys/arch/arm/nvidia/tegra_pcie.c:1.6 src/sys/arch/arm/nvidia/tegra_pcie.c:1.7
--- src/sys/arch/arm/nvidia/tegra_pcie.c:1.6 Fri Nov 13 18:52:16 2015
+++ src/sys/arch/arm/nvidia/tegra_pcie.c Fri Nov 13 18:58:17 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pcie.c,v 1.6 2015/11/13 18:52:16 jakllsch Exp $ */
+/* $NetBSD: tegra_pcie.c,v 1.7 2015/11/13 18:58:17 jakllsch Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -29,7 +29,7 @@
#include "locators.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.6 2015/11/13 18:52:16 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.7 2015/11/13 18:58:17 jakllsch Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -334,6 +334,8 @@ tegra_pcie_conf_read(void *v, pcitag_t t
reg = d * 0x1000 + offset;
bsh = sc->sc_bsh_a1;
} else {
+ if ((unsigned int)offset >= PCI_CONF_SIZE)
+ return (pcireg_t) -1;
reg = tag | offset;
bsh = sc->sc_bsh_a2;
}
@@ -360,6 +362,8 @@ tegra_pcie_conf_write(void *v, pcitag_t
reg = d * 0x1000 + offset;
bsh = sc->sc_bsh_a1;
} else {
+ if ((unsigned int)offset >= PCI_CONF_SIZE)
+ return;
reg = tag | offset;
bsh = sc->sc_bsh_a2;
}