acpi/processor: sanitize _OSC/_PDC capabilities for Xen dom0
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 8 Nov 2023 21:25:15 +0000 (16:25 -0500)
committerJuergen Gross <jgross@suse.com>
Mon, 13 Nov 2023 06:22:00 +0000 (07:22 +0100)
commitbfa993b355d33a438a746523e7129391c8664e8a
treeb7d8f9f5be4bbdc3638b1a5c7242bd8bbde6e821
parente64e7c74b99ec9e439abca75f522f4b98f220bd1
acpi/processor: sanitize _OSC/_PDC capabilities for Xen dom0

The Processor capability bits notify ACPI of the OS capabilities, and
so ACPI can adjust the return of other Processor methods taking the OS
capabilities into account.

When Linux is running as a Xen dom0, the hypervisor is the entity
in charge of processor power management, and hence Xen needs to make
sure the capabilities reported by _OSC/_PDC match the capabilities of
the driver in Xen.

Introduce a small helper to sanitize the buffer when running as Xen
dom0.

When Xen supports HWP, this serves as the equivalent of commit
a21211672c9a ("ACPI / processor: Request native thermal interrupt
handling via _OSC") to avoid SMM crashes.  Xen will set bit
ACPI_PROC_CAP_COLLAB_PROC_PERF (bit 12) in the capability bits and the
_OSC/_PDC call will apply it.

[ jandryuk: Mention Xen HWP's need.  Support _OSC & _PDC ]
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Michal Wilczynski <michal.wilczynski@intel.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20231108212517.72279-1-jandryuk@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/x86/include/asm/acpi.h
arch/x86/include/asm/xen/hypervisor.h
drivers/xen/pcpu.c