alistair23-linux/drivers/acpi
Jiang Liu 1fb01ca93a ACPI / PCI: Fix regressions caused by resource_size_t overflow with 32-bit kernel
Zoltan Boszormenyi reported this regression:
  "There's a Realtek RTL8111/8168/8411 (PCI ID 10ec:8168, Subsystem ID
   1565:230e) network chip on the mainboard. After the r8169 driver loaded
   the IRQs in the machine went berserk. Keyboard keypressed arrived with
   considerable latency and duplicated, so no real work was possible.
   The machine responded to the power button but didn't actually power
   down. It just stuck at the powering down message. I had to press the
   power button for 4 seconds to power it down.

   The computer is a POS machine with a big battery inside. Because of this,
   either ACPI or the Realtek chip kept the bad state and after rebooting,
   the network chip didn't even show up in lspci. Not even the PXE ROM
   announced itself during boot. I had to disconnect the battery to beat
   some sense back to the computer.

   The regression happens with 4.0.5, 4.1.0-rc8 and 4.1.0-final. 3.18.16 was
   good."

The regression is caused by commit 593669c2ac (x86/PCI/ACPI: Use common
ACPI resource interfaces to simplify implementation). Since commit
593669c2ac, x86 PCI ACPI host bridge driver validates ACPI resources by
first converting an ACPI resource to a 'struct resource' structure and
then applying checks against the converted resource structure. The 'start'
and 'end' fields in 'struct resource' are defined to be type of
resource_size_t, which may be 32 bits or 64 bits depending on
CONFIG_PHYS_ADDR_T_64BIT.

This may cause incorrect resource validation results with 32-bit kernels
because 64-bit ACPI resource descriptors may get truncated when converting
to 32-bit 'start' and 'end' fields in 'struct resource'. It eventually
affects PCI resource allocation subsystem and makes some PCI devices and
the system behave abnormally due to incorrect resource assignment.

So enhance the ACPI resource parsing interfaces to ignore ACPI resource
descriptors with address/offset above 4G when running in 32-bit mode.

With the fix applied, the behavior of the machine was restored to how
3.18.16 worked, i.e. the memory range that is over 4GB is ignored again,
and lspci -vvxxx shows that everything is at the same memory window as
they were with 3.18.16.

Reported-and-tested-by: Boszormenyi Zoltan <zboszor@pr.hu>
Fixes: 593669c2ac (x86/PCI/ACPI: Use common ACPI resource interfaces to simplify implementation)
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: 4.0+ <stable@vger.kernel.org> # 4.0+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2015-07-10 02:46:52 +02:00
..
acpica Revert 'Revert "ACPICA: Permanently set _REV to the value '2'."' 2015-07-03 01:06:04 +02:00
apei Power management and ACPI material for v4.2-rc1 2015-06-23 14:18:07 -07:00
pmic ACPI/PMIC: Fix typo in MODULE_DESCRIPTION in intel_pmic_crc.c 2015-03-26 21:34:51 +01:00
ac.c ACPI / AC: constify DMI system id table 2015-06-15 14:14:49 +02:00
acpi_apd.c
acpi_cmos_rtc.c
acpi_extlog.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpss.c ACPI / LPSS: constify device descriptors 2015-06-15 14:26:25 +02:00
acpi_memhotplug.c
acpi_pad.c sched/topology: Rename topology_thread_cpumask() to topology_sibling_cpumask() 2015-05-27 15:22:15 +02:00
acpi_platform.c ACPI / scan: Parse _CCA and setup device coherency 2015-06-15 14:40:48 +02:00
acpi_pnp.c ACPI / PNP: add two IDs to list for PNPACPI device enumeration 2015-05-04 16:03:12 +02:00
acpi_processor.c ACPI / processor: Introduce invalid_phys_cpuid() 2015-05-13 23:28:16 +02:00
acpi_video.c ACPI / video: Make acpi_video_unregister_backlight() private 2015-06-19 01:12:50 +02:00
battery.c ACPI / battery: mark DMI table as __initconst 2015-06-15 14:23:44 +02:00
battery.h
bgrt.c
blacklist.c ACPI / init: Make it possible to override _REV 2015-07-03 01:06:00 +02:00
bus.c ACPI / init: Switch over platform to the ACPI mode later 2015-06-10 23:51:27 +02:00
button.c
cm_sbs.c
container.c
custom_method.c
debugfs.c
device_pm.c ACPI / PM: Add missing pm_generic_complete() invocation 2015-06-10 01:32:38 +02:00
dock.c driver core / ACPI: Represent ACPI companions using fwnode_handle 2015-03-16 23:49:03 +01:00
ec.c ACPI / EC: Fix a code coverity issue when QR_EC transactions are failed. 2015-06-15 14:35:59 +02:00
ec_sys.c
event.c
fan.c ACPI / PM: Rework device power management to follow ACPI 6 2015-05-16 01:55:35 +02:00
glue.c ACPI / scan: Parse _CCA and setup device coherency 2015-06-15 14:40:48 +02:00
gsi.c ACPI: move arm64 GSI IRQ model to generic GSI IRQ layer 2015-03-26 15:13:09 +00:00
hed.c ACPI / HED: constify ACPI device ids 2015-06-15 14:28:32 +02:00
int340x_thermal.c
internal.h Additional ACPICA material for v4.2-rc1 2015-07-02 17:11:28 -07:00
ioapic.c
Kconfig Additional ACPICA material for v4.2-rc1 2015-07-02 17:11:28 -07:00
Makefile The libnvdimm sub-system introduces, in addition to the libnvdimm-core, 2015-06-29 10:34:42 -07:00
nfit.c libnvdimm: Add sysfs numa_node to NVDIMM devices 2015-06-26 11:23:38 -04:00
nfit.h libnvdimm, nfit: handle unarmed dimms, mark namespaces read-only 2015-06-26 11:23:38 -04:00
numa.c acpi: Add acpi_map_pxm_to_online_node() 2015-06-26 11:23:38 -04:00
nvs.c
osl.c Additional ACPICA material for v4.2-rc1 2015-07-02 17:11:28 -07:00
pci_irq.c Power management and ACPI material for v4.2-rc1 2015-06-23 14:18:07 -07:00
pci_link.c
pci_root.c PCI: Don't clear ASPM bits when the FADT declares it's unsupported 2015-04-09 14:20:11 -05:00
pci_slot.c
power.c ACPI / PM: Turn power resources on and off in the right order during resume 2015-05-25 23:59:54 +02:00
proc.c
processor_core.c ACPI / processor: Introduce invalid_phys_cpuid() 2015-05-13 23:28:16 +02:00
processor_driver.c
processor_idle.c ACPI / processor: constify DMI system id table 2015-06-15 14:29:48 +02:00
processor_pdc.c ACPI / processor: Introduce invalid_logical_cpuid() 2015-05-13 23:28:14 +02:00
processor_perflib.c
processor_thermal.c
processor_throttling.c
property.c ACPI / property: Define a symbol for PRP0001 2015-05-22 23:57:14 +02:00
reboot.c
resource.c ACPI / PCI: Fix regressions caused by resource_size_t overflow with 32-bit kernel 2015-07-10 02:46:52 +02:00
sbs.c ACPI / SBS: Enable battery manager when present 2015-04-29 00:04:29 +02:00
sbshc.c ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook 2015-04-30 23:18:11 +02:00
sbshc.h
scan.c Merge branch 'acpi-cca' 2015-06-19 01:17:35 +02:00
sleep.c ACPI / PM: Enable all wakeup GPEs in suspend-to-idle 2015-03-30 01:52:02 +02:00
sleep.h ACPI / sleep: Drop acpi_suspend() which is not used 2015-03-18 12:53:21 +01:00
sysfs.c ACPI / sysfs: Treat the count field of counter_show() as unsigned 2015-03-10 01:03:30 +01:00
tables.c ACPI / table: Print GIC information when MADT is parsed 2015-03-25 11:49:31 +00:00
thermal.c thermal: of: fix cooling device weights in device tree 2015-05-04 21:27:50 -07:00
utils.c acpi-video-detect: video: Make video_detect code part of the video module 2015-06-19 01:10:36 +02:00
video_detect.c ACPI / video: Make acpi_video_unregister_backlight() private 2015-06-19 01:12:50 +02:00
wakeup.c