From 671e12f2cf68dbd241dfc08296dc05fecc27127c Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Mon, 15 Nov 2021 09:56:23 -0800 Subject: 14235 pcitool doesn't properly handle AMD Type 1 I/O space access Reviewed by: Andy Fiddaman Reviewed by: Toomas Soome Approved by: Rich Lowe --- usr/src/uts/i86pc/io/pci/pci_tools.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr/src/uts/i86pc/io/pci/pci_tools.c') diff --git a/usr/src/uts/i86pc/io/pci/pci_tools.c b/usr/src/uts/i86pc/io/pci/pci_tools.c index 7fb496bc10..1141413f9f 100644 --- a/usr/src/uts/i86pc/io/pci/pci_tools.c +++ b/usr/src/uts/i86pc/io/pci/pci_tools.c @@ -57,6 +57,7 @@ #define SUCCESS 0 extern uint64_t mcfg_mem_base; +extern uint_t pci_iocfg_max_offset; int pcitool_debug = 0; /* @@ -600,7 +601,7 @@ pcitool_cfg_access(pcitool_reg_t *prg, boolean_t write_flag, */ if (io_access) - max_offset = 0xFF; + max_offset = pci_iocfg_max_offset; else max_offset = 0xFFF; if (prg->offset + size - 1 > max_offset) { @@ -651,10 +652,10 @@ pcitool_cfg_access(pcitool_reg_t *prg, boolean_t write_flag, } } /* - * Check if legacy IO config access is used, in which case - * only first 256 bytes are valid. + * Check if legacy I/O config access is used, in which case the valid + * range varies with the I/O space mechanism used. */ - if (req.ioacc && (prg->offset + size - 1 > 0xFF)) { + if (req.ioacc && (prg->offset + size - 1 > pci_iocfg_max_offset)) { prg->status = PCITOOL_INVALID_ADDRESS; return (ENOTSUP); } -- cgit v1.2.3