Commit 6a8d7fbf authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more ACPI updates from Rafael Wysocki:
 "The most significant item here is the Platform Firmware Runtime Update
  and Telemetry (PFRUT) support designed to allow certain pieces of the
  platform firmware to be updated on the fly, among other things.

  Also important is the e820 handling change on x86 that should work
  around PCI BAR allocation issues on some systems shipping since 2019.

  The rest is just a handful of assorted fixes and cleanups on top of
  the ACPI material merged previously.

  Specifics:

   - Add support for the the Platform Firmware Runtime Update and
     Telemetry (PFRUT) interface based on ACPI to allow certain pieces
     of the platform firmware to be updated without restarting the
     system and to provide a mechanism for collecting platform firmware
     telemetry data (Chen Yu, Dan Carpenter, Yang Yingliang).

   - Ignore E820 reservations covering PCI host bridge windows on
     sufficiently recent x86 systems to avoid issues with allocating PCI
     BARs on systems where the E820 reservations cover the entire PCI
     host bridge memory window returned by the _CRS object in the
     system's ACPI tables (Hans de Goede).

   - Fix and clean up acpi_scan_init() (Rafael Wysocki).

   - Add more sanity checking to ACPI SPCR tables parsing (Mark
     Langsdorf).

   - Fix up ACPI APD (AMD Soc) driver initialization (Jiasheng Jiang).

   - Drop unnecessary "static" from the ACPI PCC address space handling
     driver added recently (kernel test robot)"

* tag 'acpi-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: PCC: pcc_ctx can be static
  ACPI: scan: Rename label in acpi_scan_init()
  ACPI: scan: Simplify initialization of power and sleep buttons
  ACPI: scan: Change acpi_scan_init() return value type to void
  ACPI: SPCR: check if table->serial_port.access_width is too wide
  ACPI: APD: Check for NULL pointer after calling devm_ioremap()
  x86/PCI: Ignore E820 reservations for bridge windows on newer systems
  ACPI: pfr_telemetry: Fix info leak in pfrt_log_ioctl()
  ACPI: pfr_update: Fix return value check in pfru_write()
  ACPI: tools: Introduce utility for firmware updates/telemetry
  ACPI: Introduce Platform Firmware Runtime Telemetry driver
  ACPI: Introduce Platform Firmware Runtime Update device driver
  efi: Introduce EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and corresponding structures
parents e3a8b6a1 e3daa260
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ Code Seq# Include File Comments
                                                                     <mailto:aherrman@de.ibm.com>
0xE5  00-3F  linux/fuse.h
0xEC  00-01  drivers/platform/chrome/cros_ec_dev.h                   ChromeOS EC driver
0xEE  00-09  uapi/linux/pfrut.h                                      Platform Firmware Runtime Update and Telemetry
0xF3  00-3F  drivers/usb/misc/sisusbvga/sisusb.h                     sisfb (in development)
                                                                     <mailto:thomas@winischhofer.net>
0xF6  all                                                            LTTng Linux Trace Toolkit Next Generation
+22 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
#include <linux/dmi.h>
#include <linux/ioport.h>
#include <asm/e820/api.h>

@@ -23,11 +24,31 @@ static void resource_clip(struct resource *res, resource_size_t start,
		res->start = end + 1;
}

/*
 * Some BIOS-es contain a bug where they add addresses which map to
 * system RAM in the PCI host bridge window returned by the ACPI _CRS
 * method, see commit 4dc2287c1805 ("x86: avoid E820 regions when
 * allocating address space"). To avoid this Linux by default excludes
 * E820 reservations when allocating addresses since 2010.
 * In 2019 some systems have shown-up with E820 reservations which cover
 * the entire _CRS returned PCI host bridge window, causing all attempts
 * to assign memory to PCI BARs to fail if Linux uses E820 reservations.
 *
 * Ideally Linux would fully stop using E820 reservations, but then
 * the old systems this was added for will regress.
 * Instead keep the old behavior for old systems, while ignoring the
 * E820 reservations for any systems from now on.
 */
static void remove_e820_regions(struct resource *avail)
{
	int i;
	int i, year = dmi_get_bios_year();
	struct e820_entry *entry;

	if (year >= 2018)
		return;

	pr_info_once("PCI: Removing E820 reservations from host bridge windows\n");

	for (i = 0; i < e820_table->nr_entries; i++) {
		entry = &e820_table->entries[i];

+22 −0
Original line number Diff line number Diff line
@@ -520,6 +520,28 @@ config ACPI_CONFIGFS
	  userspace. The configurable ACPI groups will be visible under
	  /config/acpi, assuming configfs is mounted under /config.

config ACPI_PFRUT
	tristate "ACPI Platform Firmware Runtime Update and Telemetry"
	depends on 64BIT
	help
	  This mechanism allows certain pieces of the platform firmware
	  to be updated on the fly while the system is running (runtime)
	  without the need to restart it, which is key in the cases when
	  the system needs to be available 100% of the time and it cannot
	  afford the downtime related to restarting it, or when the work
	  carried out by the system is particularly important, so it cannot
	  be interrupted, and it is not practical to wait until it is complete.

	  The existing firmware code can be modified (driver update) or
	  extended by adding new code to the firmware (code injection).

	  Besides, the telemetry driver allows user space to fetch telemetry
	  data from the firmware with the help of the Platform Firmware Runtime
	  Telemetry interface.

	  To compile the drivers as modules, choose M here:
	  the modules will be called pfr_update and pfr_telemetry.

if ARM64
source "drivers/acpi/arm64/Kconfig"

+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ obj-$(CONFIG_ACPI_CPPC_LIB) += cppc_acpi.o
obj-$(CONFIG_ACPI_SPCR_TABLE)	+= spcr.o
obj-$(CONFIG_ACPI_DEBUGGER_USER) += acpi_dbg.o
obj-$(CONFIG_ACPI_PPTT) 	+= pptt.o
obj-$(CONFIG_ACPI_PFRUT)	+= pfr_update.o pfr_telemetry.o

# processor has its own "processor." module_param namespace
processor-y			:= processor_driver.o
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ static int fch_misc_setup(struct apd_private_data *pdata)
					      resource_size(rentry->res));
		break;
	}
	if (!clk_data->base)
		return -ENOMEM;

	acpi_dev_free_resource_list(&resource_list);

Loading