Re: [REGRESSION] Kernel booted via kexec fails to resume from hibernation

2025-03-28 Thread Baoquan He
On 03/29/25 at 01:14am, Roberto Ricci wrote: > On 2025-01-27 10:42 +0800, Dave Young wrote: > > On Mon, 27 Jan 2025 at 10:39, Dave Young wrote: > > > On 01/13/25 at 10:28pm, Roberto Ricci wrote: > > > > After rebooting the system via kexec, hibernating and rebooting the > > > > machine, this oops

[PATCH v13 14/19] tpm, tpm_tis: Close all localities

2025-03-28 Thread Ross Philipson
From: "Daniel P. Smith" There are environments, for example, those that comply with the TCG D-RTM specification that requires the TPM to be left in locality 2. Prepare kernel for such environments by closing all the localities. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson Signe

Re: [REGRESSION] Kernel booted via kexec fails to resume from hibernation

2025-03-28 Thread Roberto Ricci
[0.00] Linux version 6.14.0 (ricci@desktop0a) (gcc (GCC) 13.2.0, GNU ld (GNU Binutils) 2.41) #1 SMP PREEMPT_DYNAMIC @0 [0.00] Command line: root=UUID=71b5e20d-efaa-4c09-b189-73cd6255e8ce ro loglevel=4 oops=panic panic=30 crashkernel=512M [0.00] BIOS-provided physical RAM m

Re: [REGRESSION] Kernel booted via kexec fails to resume from hibernation

2025-03-28 Thread Roberto Ricci
On 2025-01-27 10:42 +0800, Dave Young wrote: > On Mon, 27 Jan 2025 at 10:39, Dave Young wrote: > > On 01/13/25 at 10:28pm, Roberto Ricci wrote: > > > After rebooting the system via kexec, hibernating and rebooting the > > > machine, this oops occurs: > > > > > [snip] > > > > > > I will send the k

[PATCH v13 01/19] Documentation/x86: Secure Launch kernel documentation

2025-03-28 Thread Ross Philipson
From: "Daniel P. Smith" Introduce background, overview and configuration/ABI information for the Secure Launch kernel feature. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson Reviewed-by: Bagas Sanjaya --- Documentation/security/index.rst | 1 + .../security/launc

[PATCH v13 13/19] x86/reboot: Secure Launch SEXIT support on reboot paths

2025-03-28 Thread Ross Philipson
If the MLE kernel is being powered off, rebooted or halted, then SEXIT must be called. Note that the SEXIT GETSEC leaf can only be called after a machine_shutdown() has been done on these paths. The machine_shutdown() is not called on a few paths like when poweroff action does not have a poweroff c

[PATCH v13 16/19] tpm, tpm_tis: Allow locality to be set to a different value

2025-03-28 Thread Ross Philipson
DRTM needs to be able to set the locality used by kernel. Provide a one-shot function tpm_chip_set_locality() for the purpose. Signed-off-by: Ross Philipson Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-chip.c | 33 - drivers/char/tpm/tpm_tis_core.c

[PATCH v13 02/19] x86: Secure Launch Kconfig

2025-03-28 Thread Ross Philipson
Initial bits to bring in Secure Launch functionality. Add Kconfig options for compiling in/out the Secure Launch code. Signed-off-by: Ross Philipson --- arch/x86/Kconfig | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 9427b5292ca2..a9278

[PATCH v13 09/19] x86: Secure Launch kernel early boot stub

2025-03-28 Thread Ross Philipson
The Secure Launch (SL) stub provides the entry point for Intel TXT to jump to during the dynamic launch. The symbol sl_stub_entry is that entry point and its offset into the kernel is conveyed to the launching code using the Measured Launch Environment (MLE) header in the structure named mle_header

[PATCH v13 00/19] x86: Trenchboot secure dynamic launch Linux kernel support

2025-03-28 Thread Ross Philipson
The larger focus of the TrenchBoot project (https://github.com/TrenchBoot) is to enhance the boot security and integrity in a unified manner. The first area of focus has been on the Trusted Computing Group's Dynamic Launch for establishing a hardware Root of Trust for Measurement, also know as DRTM

[PATCH v13 07/19] x86/msr: Add variable MTRR base/mask and x2apic ID registers

2025-03-28 Thread Ross Philipson
Add the MSR values required by Secure Launch to locate particular CPU cores during application processor (AP) startup, and restore the MTRR state after an Intel TXT launch. Signed-off-by: Ross Philipson --- arch/x86/include/asm/msr-index.h | 5 + 1 file changed, 5 insertions(+) diff --git a

[PATCH v13 18/19] x86: Secure Launch late initcall platform module

2025-03-28 Thread Ross Philipson
From: "Daniel P. Smith" The Secure Launch platform module is a late init module. During the init call, the TPM event log is read and measurements taken in the early boot stub code are located. These measurements are extended into the TPM PCRs using the mainline TPM kernel driver. The platform mo

[PATCH v13 17/19] tpm, sysfs: Show locality used by kernel

2025-03-28 Thread Ross Philipson
Expose the locality used by the kernel to sysfs. Signed-off-by: Ross Philipson Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-sysfs.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c index 94231f052ea7..2da5857e

[PATCH v13 11/19] x86: Secure Launch SMP bringup support

2025-03-28 Thread Ross Philipson
On Intel, the APs are left in a well documented state after TXT performs the late launch. Specifically they cannot have #INIT asserted on them so a standard startup via INIT/SIPI/SIPI cannot be performed. Instead the early SL stub code uses MONITOR and MWAIT to park the APs. The realmode/init.c cod

[PATCH v13 19/19] x86/efi: EFI stub DRTM launch support for Secure Launch

2025-03-28 Thread Ross Philipson
This support allows the DRTM launch to be initiated after an EFI stub launch of the Linux kernel is done. This is accomplished by providing a handler to jump to when a Secure Launch is in progress. This has to be called after the EFI stub does Exit Boot Services. Signed-off-by: Ross Philipson Rev

[PATCH v13 08/19] x86/boot: Place TXT MLE header in the kernel_info section

2025-03-28 Thread Ross Philipson
The Measured Launch Environment (MLE) header must be locatable by the boot loader and Intel TXT must be setup to do a launch with this header's location. While the offset to the kernel_info structure does not need to be at a fixed offset, the offsets in the header must be relative offsets from the

[PATCH v13 15/19] tpm, tpm_tis: Address positive localities in tpm_tis_request_locality()

2025-03-28 Thread Ross Philipson
From: "Daniel P. Smith" Validate that the input locality is within the correct range, as specified by TCG standards, and increase the locality count also for the positive localities. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson Signed-off-by: Jarkko Sakkinen --- drivers/char/

[PATCH v13 05/19] x86: Add early SHA-1 support for Secure Launch early measurements

2025-03-28 Thread Ross Philipson
From: "Daniel P. Smith" Secure Launch is written to be compliant with the Intel TXT Measured Launch Developer's Guide. The MLE Guide dictates that the system can be configured to use both the SHA-1 and SHA-2 hashing algorithms. Regardless of the preference towards SHA-2, if the firmware elected

[PATCH v13 12/19] kexec: Secure Launch kexec SEXIT support

2025-03-28 Thread Ross Philipson
Prior to running the next kernel via kexec, the Secure Launch code closes down private SMX resources and does an SEXIT. This allows the next kernel to start normally without any issues starting the APs etc. Signed-off-by: Ross Philipson --- arch/x86/kernel/slaunch.c | 72

[PATCH v13 10/19] x86: Secure Launch kernel late boot stub

2025-03-28 Thread Ross Philipson
The routine slaunch_setup() is called out of the x86 specific setup_arch() routine during early kernel boot. After determining what platform is present, various operations specific to that platform occur. This includes finalizing setting for the platform late launch and verifying that memory protec

[PATCH v13 06/19] x86: Add early SHA-256 support for Secure Launch early measurements

2025-03-28 Thread Ross Philipson
From: "Daniel P. Smith" The SHA-256 algorithm is necessary to measure configuration information into the TPM as early as possible before using the values. This implementation uses the established approach of #including the SHA-256 libraries directly in the code since the compressed kernel is not

[PATCH v13 04/19] x86: Secure Launch main header file

2025-03-28 Thread Ross Philipson
Introduce the main Secure Launch header file used in the early SL stub and the early setup code. This header file contains the following categories: - Secure Launch implementation specific structures and definitions. - Intel TXT architecture specific DRTM structures, definitions and functions us

[PATCH v13 03/19] x86: Secure Launch Resource Table header file

2025-03-28 Thread Ross Philipson
The Secure Launch Specification is an architectural agnostic, software neutral API/ABI maintainted by the TrenchBoot project. It's function is to allow any compliant boot loader to communicate the pre-launch configuration to any compliant post-launch kernel. This API/ABI is referred to as the Secur

[PATCH] MAINTAINERS: Add Andrew and myself as kexec maintainer

2025-03-28 Thread Baoquan He
Add Andrew as kexec/kdump maintainer because he has been helping review and merge ready kexec/kdump patches. And I would like to nominate myself as kexec maintainer because I always try to review generic kexec codes. Signed-off-by: Baoquan He --- MAINTAINERS | 3 +++ 1 file changed, 3 insertion