linux/drivers/acpi
Rafael J. Wysocki b8fcd0e588 ACPICA: Preserve memory opregion mappings
The ACPICA's strategy with respect to the handling of memory mappings
associated with memory operation regions is to avoid mapping the
entire region at once which may be problematic at least in principle
(for example, it may lead to conflicts with overlapping mappings
having different attributes created by drivers).  It may also be
wasteful, because memory opregions on some systems take up vast
chunks of address space while the fields in those regions actually
accessed by AML are sparsely distributed.

For this reason, a one-page "window" is mapped for a given opregion
on the first memory access through it and if that "window" does not
cover an address range accessed through that opregion subsequently,
it is unmapped and a new "window" is mapped to replace it.  Next,
if the new "window" is not sufficient to acess memory through the
opregion in question in the future, it will be replaced with yet
another "window" and so on.  That may lead to a suboptimal sequence
of memory mapping and unmapping operations, for example if two fields
in one opregion separated from each other by a sufficiently wide
chunk of unused address space are accessed in an alternating pattern.

The situation may still be suboptimal if the deferred unmapping
introduced previously is supported by the OS layer.  For instance,
the alternating memory access pattern mentioned above may produce
a relatively long list of mappings to release with substantial
duplication among the entries in it, which could be avoided if
acpi_ex_system_memory_space_handler() did not release the mapping
used by it previously as soon as the current access was not covered
by it.

In order to improve that, modify acpi_ex_system_memory_space_handler()
to preserve all of the memory mappings created by it until the memory
regions associated with them go away.

Accordingly, update acpi_ev_system_memory_region_setup() to unmap all
memory associated with memory opregions that go away.

Reported-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Xiang Li <xiang.z.li@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-07-27 12:29:02 +02:00
..
acpica ACPICA: Preserve memory opregion mappings 2020-07-27 12:29:02 +02:00
apei ACPI updates for 5.8-rc1 2020-06-02 13:25:52 -07:00
arm64 ACPI/IORT: Remove the unused __get_pci_rid() 2020-05-26 20:43:33 +01:00
dptf ACPI: DPTF: Add battery participant driver 2020-05-25 12:05:26 +02:00
nfit libnvdimm for 5.8 2020-06-13 13:04:36 -07:00
numa virtio-mem: Allow to specify an ACPI PXM as nid 2020-06-04 15:36:52 -04:00
pmic ACPI / PMIC: Add i2c address for thermal control 2020-05-18 12:57:24 +02:00
x86 ACPI: Convert to new X86 CPU match macros 2020-03-24 21:30:50 +01:00
ac.c ACPI / AC: Cleanup DMI quirk table 2020-03-04 10:32:50 +01:00
acpi_adxl.c ACPI/ADXL: Add address translation interface using an ACPI DSM 2018-10-16 10:03:00 +02:00
acpi_amba.c Merge 5.2-rc6 into char-misc-next 2019-06-23 09:23:33 +02:00
acpi_apd.c ACPI / APD: Add clock frequency for Hisilicon Hip08-Lite I2C controller 2020-02-03 12:03:18 +01:00
acpi_cmos_rtc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
acpi_configfs.c ACPI: configfs: Disallow loading ACPI tables when locked down 2020-06-22 16:41:27 +02:00
acpi_dbg.c ACPI: debug: Make two functions static 2020-05-09 11:33:07 +02:00
acpi_extlog.c EDAC: Drop the EDAC report status checks 2020-04-14 16:01:01 +02:00
acpi_ipmi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
acpi_lpat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
acpi_lpit.c ACPI: LPIT: Put the low power idle table after using it 2020-05-09 11:29:16 +02:00
acpi_lpss.c PM: sleep: core: Rename dev_pm_smart_suspend_and_suspended() 2020-04-24 21:32:41 +02:00
acpi_memhotplug.c mm/memory_hotplug: rename walk_memory_range() and pass start+size instead of pfns 2019-07-18 17:08:06 -07:00
acpi_pad.c ACPI, x86: Add Zhaoxin processors support for NONSTOP TSC 2019-06-22 11:45:57 +02:00
acpi_platform.c ACPI: platform: Unregister stale platform devices 2019-10-17 23:48:39 +02:00
acpi_pnp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
acpi_processor.c ACPI: processor: Export acpi_processor_evaluate_cst() 2019-12-27 11:02:07 +01:00
acpi_tad.c PM: sleep: core: Rename DPM_FLAG_LEAVE_SUSPENDED 2020-04-24 21:34:22 +02:00
acpi_video.c ACPI: video: remove redundant assignments to variable result 2020-03-04 10:43:04 +01:00
acpi_watchdog.c ACPI: watchdog: Put the watchdog action table after parsing 2020-05-09 11:29:17 +02:00
battery.c ACPI / battery: Cleanup Lenovo Ideapad Miix 320 DMI table entry 2020-03-04 10:32:50 +01:00
bgrt.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
blacklist.c ACPI: blacklist: fix clang warning for unused DMI table 2019-07-11 22:45:00 +02:00
bus.c ACPI: bus: Fix NULL pointer check in acpi_bus_get_private_data() 2019-11-29 11:42:10 +01:00
button.c ACPI: Delete unused proc filename macros 2020-05-14 13:49:33 +02:00
cm_sbs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
container.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
cppc_acpi.c ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe() 2020-05-28 13:47:53 +02:00
custom_method.c Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-09-28 08:14:15 -07:00
debugfs.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
device_pm.c Merge branches 'pm-cpufreq' and 'pm-acpi' 2020-06-10 17:10:40 +02:00
device_sysfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
dock.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ec_sys.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
ec.c ACPI updates for 5.8-rc1 2020-06-02 13:25:52 -07:00
event.c ACPI: event: replace strcpy() by strscpy() 2019-04-23 10:54:26 +02:00
evged.c ACPI: GED: use correct trigger type field in _Exx / _Lxx handling 2020-05-27 17:51:49 +02:00
fan.c ACPI: fan: Use scnprintf() for avoiding potential buffer overflow 2020-03-14 11:11:58 +01:00
glue.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
hed.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
internal.h ACPI: EC: PM: Avoid premature returns from acpi_s2idle_wake() 2020-05-11 10:11:38 +02:00
ioapic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-07-08 11:01:13 -07:00
Kconfig ACPI: Add new tiny-power-button driver to directly signal init 2020-02-13 23:36:23 +01:00
Makefile ACPI: Add new tiny-power-button driver to directly signal init 2020-02-13 23:36:23 +01:00
nvs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
osi.c ACPI: OSI: Shoot duplicate word 2019-11-13 11:12:08 +01:00
osl.c ACPI: OSL: Implement deferred unmapping of ACPI memory 2020-07-27 12:28:53 +02:00
pci_irq.c ACPI / PCI: fix acpi_pci_irq_enable() memory leak 2019-09-03 09:41:25 +02:00
pci_link.c ACPI: Delete unused proc filename macros 2020-05-14 13:49:33 +02:00
pci_mcfg.c PCI: Constify struct pci_ecam_ops 2020-05-01 16:28:59 +01:00
pci_root.c Merge branch 'pci/misc' 2020-06-04 12:59:11 -05:00
pci_slot.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 491 2019-06-19 17:09:52 +02:00
power.c ACPI: Delete unused proc filename macros 2020-05-14 13:49:33 +02:00
pptt.c ACPI: PPTT: Consistently use unsigned int as parameter type 2020-01-07 11:46:36 +01:00
proc.c ACPI: list_for_each_safe() -> list_for_each_entry_safe() 2020-03-04 10:48:00 +01:00
processor_core.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
processor_driver.c cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
processor_idle.c ACPI: processor: idle: Allow probing on platforms with one ACPI C-state 2020-04-27 10:32:44 +02:00
processor_pdc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor_perflib.c ACPI: processor: Add QoS requests for all CPUs 2019-10-25 11:33:48 +02:00
processor_thermal.c ACPI: processor: Add QoS requests for all CPUs 2019-10-25 11:33:48 +02:00
processor_throttling.c x86: ACPI: fix CPU hotplug deadlock 2020-04-04 16:28:24 +02:00
property.c device property: Add a function to obtain a node's prefix 2019-10-11 11:26:55 +02:00
reboot.c ACPI: Allow CONFIG_PCI to be unset for reboot 2018-12-20 10:19:49 +01:00
resource.c acpi: Use pr_warn instead of pr_warning 2019-10-18 15:00:19 +02:00
sbs.c ACPI: Delete unused proc filename macros 2020-05-14 13:49:33 +02:00
sbshc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
sbshc.h ACPI: SBS: remove unused const variable 'SMBUS_PEC' 2019-08-23 12:55:09 +02:00
scan.c More power management updates for 5.8-rc1 2020-06-10 14:04:39 -07:00
sleep.c ACPI updates for 5.8-rc1 2020-06-02 13:25:52 -07:00
sleep.h ACPI: PM: Add acpi_[un]register_wakeup_handler() 2020-04-04 19:45:18 +02:00
spcr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sysfs.c ACPI: sysfs: Fix pm_profile_attr type 2020-06-22 17:13:38 +02:00
tables.c ACPICA: Add NHLT table signature 2020-03-30 14:52:33 +02:00
thermal.c ACPI: thermal: switch to use <linux/units.h> helpers 2020-01-31 10:30:39 -08:00
tiny-power-button.c ACPI: Add new tiny-power-button driver to directly signal init 2020-02-13 23:36:23 +01:00
utils.c ACPI: utils: Add acpi_evaluate_reg() helper 2020-05-09 11:40:25 +02:00
video_detect.c ACPI: video: Use native backlight on Acer TravelMate 5735Z 2020-05-25 11:58:51 +02:00
wakeup.c ACPI: PM: Add acpi_[un]register_wakeup_handler() 2020-04-04 19:45:18 +02:00