From b5cf5bc277244cdacc06d213322ec98e76ef8d89 Mon Sep 17 00:00:00 2001 From: Hans Rosenfeld Date: Mon, 26 Mar 2018 16:16:18 +0200 Subject: 9796 want support for PCI BAR size >= 4G Reviewed by: Jerry Jelinek Reviewed by: Patrick Mooney Reviewed by: Robert Mustacchi Reviewed by: Toomas Soome Reviewed by: Andy Fiddaman Reviewed by: Garrett D'Amore Approved by: Garrett D'Amore --- usr/src/uts/intel/io/pci/pci_pci.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'usr/src/uts/intel/io/pci/pci_pci.c') diff --git a/usr/src/uts/intel/io/pci/pci_pci.c b/usr/src/uts/intel/io/pci/pci_pci.c index b15c057371..eeb62a82ac 100644 --- a/usr/src/uts/intel/io/pci/pci_pci.c +++ b/usr/src/uts/intel/io/pci/pci_pci.c @@ -24,6 +24,7 @@ */ /* * Copyright 2012 Garrett D'Amore . All rights reserved. + * Copyright 2018 Joyent, Inc. */ /* @@ -561,12 +562,21 @@ ppb_ctlops(dev_info_t *dip, dev_info_t *rdip, if (ctlop == DDI_CTLOPS_NREGS) *(int *)result = totreg; else if (ctlop == DDI_CTLOPS_REGSIZE) { + uint64_t rs; + rn = *(int *)arg; if (rn >= totreg) { kmem_free(drv_regp, reglen); return (DDI_FAILURE); } - *(off_t *)result = drv_regp[rn].pci_size_low; + + rs = drv_regp[rn].pci_size_low | + ((uint64_t)drv_regp[rn].pci_size_hi << 32); + if (rs > OFF_MAX) { + kmem_free(drv_regp, reglen); + return (DDI_FAILURE); + } + *(off_t *)result = rs; } kmem_free(drv_regp, reglen); -- cgit v1.2.3