diff options
author | Robert Mustacchi <rm@fingolfin.org> | 2021-11-15 09:56:23 -0800 |
---|---|---|
committer | Robert Mustacchi <rm@fingolfin.org> | 2021-11-20 17:51:34 +0000 |
commit | 671e12f2cf68dbd241dfc08296dc05fecc27127c (patch) | |
tree | e81bccef80c6d86857cb4a7efa89fa01324f59a3 /usr/src/uts/i86pc/io/pci/pci_tools.c | |
parent | b15548ab7300ec8625be47442fd92b71ed91c2cd (diff) | |
download | illumos-gate-671e12f2cf68dbd241dfc08296dc05fecc27127c.tar.gz |
14235 pcitool doesn't properly handle AMD Type 1 I/O space access
Reviewed by: Andy Fiddaman <andy@omnios.org>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Rich Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/uts/i86pc/io/pci/pci_tools.c')
-rw-r--r-- | usr/src/uts/i86pc/io/pci/pci_tools.c | 9 |
1 files changed, 5 insertions, 4 deletions
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); } |