Skip to content

Commit

Permalink
Merge tag 'acpi-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/rafael/linux-pm

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
  • Loading branch information
torvalds committed Jan 18, 2022
2 parents e3a8b6a + e3daa26 commit 6a8d7fb
Show file tree
Hide file tree
Showing 19 changed files with 1,997 additions and 62 deletions.
1 change: 1 addition & 0 deletions Documentation/userspace-api/ioctl/ioctl-number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ Code Seq# Include File Comments
<mailto:[email protected]>
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:[email protected]>
0xF6 all LTTng Linux Trace Toolkit Next Generation
Expand Down
23 changes: 22 additions & 1 deletion arch/x86/kernel/resource.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/dmi.h>
#include <linux/ioport.h>
#include <asm/e820/api.h>

Expand All @@ -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];

Expand Down
22 changes: 22 additions & 0 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpi_apd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpi_pcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct pcc_data {
struct acpi_pcc_info ctx;
};

struct acpi_pcc_info pcc_ctx;
static struct acpi_pcc_info pcc_ctx;

static void pcc_rx_callback(struct mbox_client *cl, void *m)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
int early_acpi_osi_init(void);
int acpi_osi_init(void);
acpi_status acpi_os_initialize1(void);
int acpi_scan_init(void);
void acpi_scan_init(void);
#ifdef CONFIG_PCI
void acpi_pci_root_init(void);
void acpi_pci_link_init(void);
Expand Down
Loading

0 comments on commit 6a8d7fb

Please sign in to comment.