Skip to content

Commit 1464677

Browse files
committed
Merge tag 'platform-drivers-x86-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver updates from Hans de Goede: "New drivers: - AMD Host System Management Port (HSMP) - Intel Software Defined Silicon Removed drivers (functionality folded into other drivers): - intel_cht_int33fe_microb - surface3_button amd-pmc: - s2idle bug-fixes - Support for AMD Spill to DRAM STB feature hp-wmi: - Fix SW_TABLET_MODE detection method (and other fixes) - Support omen thermal profile policy v1 serial-multi-instantiate: - Add SPI device support - Add support for CS35L41 amplifiers used in new laptops think-lmi: - syfs-class-firmware-attributes Certificate authentication support thinkpad_acpi: - Fixes + quirks - Add platform_profile support on AMD based ThinkPads x86-android-tablets: - Improve Asus ME176C / TF103C support - Support Nextbook Ares 8, Lenovo Tab 2 830 and 1050 tablets Lots of various other small fixes and hardware-id additions" * tag 'platform-drivers-x86-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (60 commits) platform/x86: think-lmi: Certificate authentication support Documentation: syfs-class-firmware-attributes: Lenovo Certificate support platform/x86: amd-pmc: Only report STB errors when STB enabled platform/x86: amd-pmc: Drop CPU QoS workaround platform/x86: amd-pmc: Output error codes in messages platform/x86: amd-pmc: Move to later in the suspend process ACPI / x86: Add support for LPS0 callback handler platform/x86: thinkpad_acpi: consistently check fan_get_status return. platform/x86: hp-wmi: support omen thermal profile policy v1 platform/x86: hp-wmi: Changing bios_args.data to be dynamically allocated platform/x86: hp-wmi: Fix 0x05 error code reported by several WMI calls platform/x86: hp-wmi: Fix SW_TABLET_MODE detection method platform/x86: hp-wmi: Fix hp_wmi_read_int() reporting error (0x05) platform/x86: amd-pmc: Validate entry into the deepest state on resume platform/x86: thinkpad_acpi: Don't use test_bit on an integer platform/x86: thinkpad_acpi: Fix compiler warning about uninitialized err variable platform/x86: thinkpad_acpi: clean up dytc profile convert platform/x86: x86-android-tablets: Depend on EFI and SPI platform/x86: amd-pmc: uninitialized variable in amd_pmc_s2d_init() platform/x86: intel-uncore-freq: fix uncore_freq_common_init() error codes ...
2 parents 50560ce + b49f72e commit 1464677

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4683
-1378
lines changed

Documentation/ABI/testing/sysfs-class-firmware-attributes

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,51 @@ Description:
246246
that is being referenced (e.g hdd0, hdd1 etc)
247247
This attribute defaults to device 0.
248248

249+
certificate:
250+
signature:
251+
save_signature:
252+
These attributes are used for certificate based authentication. This is
253+
used in conjunction with a signing server as an alternative to password
254+
based authentication.
255+
The user writes to the attribute(s) with a BASE64 encoded string obtained
256+
from the signing server.
257+
The attributes can be displayed to check the stored value.
258+
259+
Some usage examples:
260+
Installing a certificate to enable feature:
261+
echo <supervisor password > authentication/Admin/current_password
262+
echo <signed certificate> > authentication/Admin/certificate
263+
264+
Updating the installed certificate:
265+
echo <signature> > authentication/Admin/signature
266+
echo <signed certificate> > authentication/Admin/certificate
267+
268+
Removing the installed certificate:
269+
echo <signature> > authentication/Admin/signature
270+
echo '' > authentication/Admin/certificate
271+
272+
Changing a BIOS setting:
273+
echo <signature> > authentication/Admin/signature
274+
echo <save signature> > authentication/Admin/save_signature
275+
echo Enable > attribute/PasswordBeep/current_value
276+
277+
You cannot enable certificate authentication if a supervisor password
278+
has not been set.
279+
Clearing the certificate results in no bios-admin authentication method
280+
being configured allowing anyone to make changes.
281+
After any of these operations the system must reboot for the changes to
282+
take effect.
283+
284+
certificate_thumbprint:
285+
Read only attribute used to display the MD5, SHA1 and SHA256 thumbprints
286+
for the certificate installed in the BIOS.
287+
288+
certificate_to_password:
289+
Write only attribute used to switch from certificate based authentication
290+
back to password based.
291+
Usage:
292+
echo <signature> > authentication/Admin/signature
293+
echo <password> > authentication/Admin/certificate_to_password
249294

250295

251296
What: /sys/class/firmware-attributes/*/attributes/pending_reboot
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
What: /sys/bus/auxiliary/devices/intel_vsec.sdsi.X
2+
Date: Feb 2022
3+
KernelVersion: 5.18
4+
Contact: "David E. Box" <[email protected]>
5+
Description:
6+
This directory contains interface files for accessing Intel
7+
Software Defined Silicon (SDSi) features on a CPU. X
8+
represents the socket instance (though not the socket ID).
9+
The socket ID is determined by reading the registers file
10+
and decoding it per the specification.
11+
12+
Some files communicate with SDSi hardware through a mailbox.
13+
Should the operation fail, one of the following error codes
14+
may be returned:
15+
16+
Error Code Cause
17+
---------- -----
18+
EIO General mailbox failure. Log may indicate cause.
19+
EBUSY Mailbox is owned by another agent.
20+
EPERM SDSI capability is not enabled in hardware.
21+
EPROTO Failure in mailbox protocol detected by driver.
22+
See log for details.
23+
EOVERFLOW For provision commands, the size of the data
24+
exceeds what may be written.
25+
ESPIPE Seeking is not allowed.
26+
ETIMEDOUT Failure to complete mailbox transaction in time.
27+
28+
What: /sys/bus/auxiliary/devices/intel_vsec.sdsi.X/guid
29+
Date: Feb 2022
30+
KernelVersion: 5.18
31+
Contact: "David E. Box" <[email protected]>
32+
Description:
33+
(RO) The GUID for the registers file. The GUID identifies
34+
the layout of the registers file in this directory.
35+
Information about the register layouts for a particular GUID
36+
is available at http://github.com/intel/intel-sdsi
37+
38+
What: /sys/bus/auxiliary/devices/intel_vsec.sdsi.X/registers
39+
Date: Feb 2022
40+
KernelVersion: 5.18
41+
Contact: "David E. Box" <[email protected]>
42+
Description:
43+
(RO) Contains information needed by applications to provision
44+
a CPU and monitor status information. The layout of this file
45+
is determined by the GUID in this directory. Information about
46+
the layout for a particular GUID is available at
47+
http://github.com/intel/intel-sdsi
48+
49+
What: /sys/bus/auxiliary/devices/intel_vsec.sdsi.X/provision_akc
50+
Date: Feb 2022
51+
KernelVersion: 5.18
52+
Contact: "David E. Box" <[email protected]>
53+
Description:
54+
(WO) Used to write an Authentication Key Certificate (AKC) to
55+
the SDSi NVRAM for the CPU. The AKC is used to authenticate a
56+
Capability Activation Payload. Mailbox command.
57+
58+
What: /sys/bus/auxiliary/devices/intel_vsec.sdsi.X/provision_cap
59+
Date: Feb 2022
60+
KernelVersion: 5.18
61+
Contact: "David E. Box" <[email protected]>
62+
Description:
63+
(WO) Used to write a Capability Activation Payload (CAP) to the
64+
SDSi NVRAM for the CPU. CAPs are used to activate a given CPU
65+
feature. A CAP is validated by SDSi hardware using a previously
66+
provisioned AKC file. Upon successful authentication, the CPU
67+
configuration is updated. A cold reboot is required to fully
68+
activate the feature. Mailbox command.
69+
70+
What: /sys/bus/auxiliary/devices/intel_vsec.sdsi.X/state_certificate
71+
Date: Feb 2022
72+
KernelVersion: 5.18
73+
Contact: "David E. Box" <[email protected]>
74+
Description:
75+
(RO) Used to read back the current State Certificate for the CPU
76+
from SDSi hardware. The State Certificate contains information
77+
about the current licenses on the CPU. Mailbox command.

Documentation/ABI/testing/sysfs-platform-lg-laptop

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Date: October 2018
1717
KernelVersion: 4.20
1818
Contact: "Matan Ziv-Av <[email protected]>
1919
Description:
20+
Deprecated use /sys/class/power_supply/CMB0/charge_control_end_threshold
2021
Maximal battery charge level. Accepted values are 80 or 100.
2122

2223
What: /sys/devices/platform/lg-laptop/fan_mode

Documentation/admin-guide/laptops/lg-laptop.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ FN lock.
3838
Battery care limit
3939
------------------
4040

41-
Writing 80/100 to /sys/devices/platform/lg-laptop/battery_care_limit
41+
Writing 80/100 to /sys/class/power_supply/CMB0/charge_control_end_threshold
4242
sets the maximum capacity to charge the battery. Limiting the charge
4343
reduces battery capacity loss over time.
4444

Documentation/userspace-api/ioctl/ioctl-number.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ Code Seq# Include File Comments
375375
376376
0xF6 all LTTng Linux Trace Toolkit Next Generation
377377
378+
0xF8 all arch/x86/include/uapi/asm/amd_hsmp.h AMD HSMP EPYC system management interface driver
379+
378380
0xFD all linux/dm-ioctl.h
379381
0xFE all linux/isst_if.h
380382
==== ===== ======================================================= ================================================================

Documentation/x86/amd_hsmp.rst

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
============================================
4+
AMD HSMP interface
5+
============================================
6+
7+
Newer Fam19h EPYC server line of processors from AMD support system
8+
management functionality via HSMP (Host System Management Port).
9+
10+
The Host System Management Port (HSMP) is an interface to provide
11+
OS-level software with access to system management functions via a
12+
set of mailbox registers.
13+
14+
More details on the interface can be found in chapter
15+
"7 Host System Management Port (HSMP)" of the family/model PPR
16+
Eg: https://www.amd.com/system/files/TechDocs/55898_B1_pub_0.50.zip
17+
18+
HSMP interface is supported on EPYC server CPU models only.
19+
20+
21+
HSMP device
22+
============================================
23+
24+
amd_hsmp driver under the drivers/platforms/x86/ creates miscdevice
25+
/dev/hsmp to let user space programs run hsmp mailbox commands.
26+
27+
$ ls -al /dev/hsmp
28+
crw-r--r-- 1 root root 10, 123 Jan 21 21:41 /dev/hsmp
29+
30+
Characteristics of the dev node:
31+
* Write mode is used for running set/configure commands
32+
* Read mode is used for running get/status monitor commands
33+
34+
Access restrictions:
35+
* Only root user is allowed to open the file in write mode.
36+
* The file can be opened in read mode by all the users.
37+
38+
In-kernel integration:
39+
* Other subsystems in the kernel can use the exported transport
40+
function hsmp_send_message().
41+
* Locking across callers is taken care by the driver.
42+
43+
44+
An example
45+
==========
46+
47+
To access hsmp device from a C program.
48+
First, you need to include the headers::
49+
50+
#include <linux/amd_hsmp.h>
51+
52+
Which defines the supported messages/message IDs.
53+
54+
Next thing, open the device file, as follows::
55+
56+
int file;
57+
58+
file = open("/dev/hsmp", O_RDWR);
59+
if (file < 0) {
60+
/* ERROR HANDLING; you can check errno to see what went wrong */
61+
exit(1);
62+
}
63+
64+
The following IOCTL is defined:
65+
66+
``ioctl(file, HSMP_IOCTL_CMD, struct hsmp_message *msg)``
67+
The argument is a pointer to a::
68+
69+
struct hsmp_message {
70+
__u32 msg_id; /* Message ID */
71+
__u16 num_args; /* Number of input argument words in message */
72+
__u16 response_sz; /* Number of expected output/response words */
73+
__u32 args[HSMP_MAX_MSG_LEN]; /* argument/response buffer */
74+
__u16 sock_ind; /* socket number */
75+
};
76+
77+
The ioctl would return a non-zero on failure; you can read errno to see
78+
what happened. The transaction returns 0 on success.
79+
80+
More details on the interface and message definitions can be found in chapter
81+
"7 Host System Management Port (HSMP)" of the respective family/model PPR
82+
eg: https://www.amd.com/system/files/TechDocs/55898_B1_pub_0.50.zip
83+
84+
User space C-APIs are made available by linking against the esmi library,
85+
which is provided by the E-SMS project https://developer.amd.com/e-sms/.
86+
See: https://github.com/amd/esmi_ib_library

Documentation/x86/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ x86-specific Documentation
2525
intel-iommu
2626
intel_txt
2727
amd-memory-encryption
28+
amd_hsmp
2829
pti
2930
mds
3031
microcode

MAINTAINERS

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,16 @@ L: [email protected]
989989
S: Maintained
990990
F: drivers/platform/x86/amd-pmc.*
991991

992+
AMD HSMP DRIVER
993+
M: Naveen Krishna Chatradhi <[email protected]>
994+
R: Carlos Bilbao <[email protected]>
995+
996+
S: Maintained
997+
F: Documentation/x86/amd_hsmp.rst
998+
F: arch/x86/include/asm/amd_hsmp.h
999+
F: arch/x86/include/uapi/asm/amd_hsmp.h
1000+
F: drivers/platform/x86/amd_hsmp.c
1001+
9921002
AMD POWERPLAY AND SWSMU
9931003
M: Evan Quan <[email protected]>
9941004
@@ -9934,6 +9944,13 @@ S: Maintained
99349944
F: arch/x86/include/asm/intel_scu_ipc.h
99359945
F: drivers/platform/x86/intel_scu_*
99369946

9947+
INTEL SDSI DRIVER
9948+
M: David E. Box <[email protected]>
9949+
S: Supported
9950+
F: drivers/platform/x86/intel/sdsi.c
9951+
F: tools/arch/x86/intel_sdsi/
9952+
F: tools/testing/selftests/drivers/sdsi/
9953+
99379954
INTEL SKYLAKE INT3472 ACPI DEVICE DRIVER
99389955
M: Daniel Scally <[email protected]>
99399956
S: Maintained
@@ -9970,7 +9987,7 @@ INTEL UNCORE FREQUENCY CONTROL
99709987
M: Srinivas Pandruvada <[email protected]>
99719988
99729989
S: Maintained
9973-
F: drivers/platform/x86/intel/uncore-frequency.c
9990+
F: drivers/platform/x86/intel/uncore-frequency/
99749991

99759992
INTEL VENDOR SPECIFIC EXTENDED CAPABILITIES DRIVER
99769993
M: David E. Box <[email protected]>

arch/x86/include/asm/amd_hsmp.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
3+
#ifndef _ASM_X86_AMD_HSMP_H_
4+
#define _ASM_X86_AMD_HSMP_H_
5+
6+
#include <uapi/asm/amd_hsmp.h>
7+
8+
#if IS_ENABLED(CONFIG_AMD_HSMP)
9+
int hsmp_send_message(struct hsmp_message *msg);
10+
#else
11+
static inline int hsmp_send_message(struct hsmp_message *msg)
12+
{
13+
return -ENODEV;
14+
}
15+
#endif
16+
#endif /*_ASM_X86_AMD_HSMP_H_*/

0 commit comments

Comments
 (0)