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

2024-12-19 Thread Ross Philipson
These values are needed by Secure Launch to locate particular CPUs during AP startup and to restore the MTRR state after a TXT launch. Signed-off-by: Ross Philipson --- arch/x86/include/asm/msr-index.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/msr-index.h b

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

2024-12-19 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

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

2024-12-19 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

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

2024-12-19 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

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

2024-12-19 Thread Ross Philipson
callback (into ACPI code) or when an emergency reset is done. In these cases, just the TXT registers are finalized but SEXIT is skipped. Signed-off-by: Ross Philipson --- arch/x86/kernel/reboot.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/reboot.c b/arch/x86

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

2024-12-19 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 v12 17/19] tpm, sysfs: Show locality used by kernel

2024-12-19 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

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

2024-12-19 Thread Ross Philipson
e platform module also registers the securityfs nodes to allow access to TXT register fields on Intel along with the fetching of and writing events to the late launch TPM log. Signed-off-by: Daniel P. Smith Signed-off-by: garnetgrimm Signed-off-by: Ross Philipson --- arch/x86/kernel/Makefi

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

2024-12-19 Thread Ross Philipson
start of the setup kernel. The support in the linker file achieves this. Signed-off-by: Ross Philipson Suggested-by: Ard Biesheuvel Reviewed-by: Ard Biesheuvel --- arch/x86/boot/compressed/kernel_info.S | 50 +++--- arch/x86/boot/compressed/vmlinux.lds.S | 7 2

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

2024-12-19 Thread Ross Philipson
niel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 + arch/x86/boot/compressed/sha1.c | 6 +++ include/crypto/sha1.h | 1 + lib/crypto/sha1.c | 81 +++ 4 files changed, 90 insertions(+) create

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

2024-12-19 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 --- dr

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

2024-12-19 Thread Ross Philipson
do then jumps to the standard RM piggy protected mode entry point. Signed-off-by: Ross Philipson --- arch/x86/include/asm/realmode.h | 3 ++ arch/x86/kernel/smpboot.c| 43 ++-- arch/x86/realmode/init.c | 3 ++ arch/x86/realmode/rm/header.S

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

2024-12-19 Thread Ross Philipson
handling the APs on Intel platforms. The routine sl_main which runs after entering 64b mode is responsible for measuring configuration and module information before it is used like the boot params, the kernel command line, the TXT heap, an external initramfs, etc. Signed-off-by: Ross Philipson

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

2024-12-19 Thread Ross Philipson
annot be used. Signed-off-by: Ross Philipson --- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/setup.c| 3 + arch/x86/kernel/slaunch.c | 524 + drivers/iommu/intel/dmar.c | 4 + 4 files changed, 532 insertions(+) create mode 100644 arch/x86/k

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

2024-12-19 Thread Ross Philipson
Introduce the Secure Launch Resource Table which forms the formal interface between the pre and post launch code. Signed-off-by: Ross Philipson --- include/linux/slr_table.h | 277 ++ 1 file changed, 277 insertions(+) create mode 100644 include/linux

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

2024-12-19 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 9d7bd0ae48c4

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

2024-12-19 Thread Ross Philipson
ly we would like to thank everyone for their input and assistance. It has all been very helpful in improving the quality of our solution and in reviewing/strengthening our security posture. Thanks Ross Philipson and Daniel P. Smith Changes in v2: - Modified 32b entry code to prevent causing relo

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

2024-12-19 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 + ..

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

2024-12-19 Thread Ross Philipson
Introduce the main Secure Launch header file used in the early SL stub and the early setup code. Signed-off-by: Ross Philipson --- include/linux/slaunch.h | 547 1 file changed, 547 insertions(+) create mode 100644 include/linux/slaunch.h diff --git a

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

2024-12-19 Thread Ross Philipson
nel is not uncompressed at this point. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/boot/compressed/sha256.c | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 arch/x86/boot/compressed/sha256.c

Re: [PATCH v9 06/19] x86: Add early SHA-1 support for Secure Launch early measurements

2024-11-22 Thread ross . philipson
On 11/21/24 2:42 PM, Andy Lutomirski wrote: On Thu, Nov 21, 2024 at 12:54 PM Andy Lutomirski wrote: On Thu, Nov 21, 2024 at 12:11 PM wrote: On 11/18/24 12:02 PM, Andy Lutomirski wrote: If the vendor of an attestation-dependent thing trusts SM3 but *Linux* does not like SM3, then the vend

Re: [PATCH v9 06/19] x86: Add early SHA-1 support for Secure Launch early measurements

2024-11-21 Thread ross . philipson
On 11/18/24 12:02 PM, Andy Lutomirski wrote: On Mon, Nov 18, 2024 at 11:12 AM James Bottomley wrote: On Mon, 2024-11-18 at 10:43 -0800, Andy Lutomirski wrote: Linux should not use TPM2_PCR_Extend *at all*. Instead, Linux should exclusively use TPM2_PCR_Event. I would expect that passing, sa

[PATCH v11 02/20] x86: Secure Launch Kconfig

2024-09-13 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 007bab9f2a0e

[PATCH v11 00/20] x86: Trenchboot secure dynamic launch Linux kernel support

2024-09-13 Thread Ross Philipson
s/TechDocs/24593.pdf The TrenchBoot project provides a quick start guide to help get a system up and running with Secure Launch for Linux: https://github.com/TrenchBoot/documentation/blob/master/QUICKSTART.md Patch set based on commit: torvalds/master/77f587896757708780a7e8792efe62939f25a5ab Thanks Ro

[PATCH v11 20/20] x86/efi: EFI stub DRTM launch support for Secure Launch

2024-09-13 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

[PATCH v11 19/20] x86: Secure Launch late initcall platform module

2024-09-13 Thread Ross Philipson
e platform module also registers the securityfs nodes to allow access to TXT register fields on Intel along with the fetching of and writing events to the late launch TPM log. Signed-off-by: Daniel P. Smith Signed-off-by: garnetgrimm Signed-off-by: Ross Philipson --- arch/x86/kernel/Makefi

[PATCH v11 18/20] tpm: Add sysfs interface to allow setting and querying the default locality

2024-09-13 Thread Ross Philipson
Expose a sysfs interface to allow user mode to set and query the default locality set for the TPM chip. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-sysfs.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char

[PATCH v11 17/20] tpm: Add ability to set the default locality the TPM chip uses

2024-09-13 Thread Ross Philipson
Curently the locality is hard coded to 0 but for DRTM support, access is needed to localities 1 through 4. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-chip.c | 24 +++- include/linux/tpm.h | 4 2 files changed, 27 insertions(+), 1 deletion(-) diff

[PATCH v11 16/20] tpm: Make locality requests return consistent values

2024-09-13 Thread Ross Philipson
ned-off-by: Ross Philipson --- drivers/char/tpm/tpm_tis_core.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 22ebf679ea69..20a8b341be0d 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/driver

[PATCH v11 15/20] tpm: Ensure tpm is in known state at startup

2024-09-13 Thread Ross Philipson
From: "Daniel P. Smith" When tis_tis_core initializes, it assumes all localities are closed. There are cases when this may not be the case. This commit addresses this by ensuring all localities are closed before initializing begins. Signed-off-by: Daniel P. Smith Signed-off-by: Ross

[PATCH v11 14/20] tpm: Protect against locality counter underflow

2024-09-13 Thread Ross Philipson
ned-off-by: Daniel P. Smith Signed-off-by: Ross Philipson Reported-by: Kanth Ghatraju --- drivers/char/tpm/tpm_tis_core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index fdef214b9f6b..a6967f312837 10

[PATCH v11 13/20] x86/reboot: Secure Launch SEXIT support on reboot paths

2024-09-13 Thread Ross Philipson
callback (into ACPI code) or when an emergency reset is done. In these cases, just the TXT registers are finalized but SEXIT is skipped. Signed-off-by: Ross Philipson --- arch/x86/kernel/reboot.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/reboot.c b/arch/x86

[PATCH v11 12/20] kexec: Secure Launch kexec SEXIT support

2024-09-13 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 v11 11/20] x86: Secure Launch SMP bringup support

2024-09-13 Thread Ross Philipson
do then jumps to the standard RM piggy protected mode entry point. Signed-off-by: Ross Philipson --- arch/x86/include/asm/realmode.h | 3 ++ arch/x86/kernel/smpboot.c| 43 ++-- arch/x86/realmode/init.c | 3 ++ arch/x86/realmode/rm/header.S

[PATCH v11 10/20] x86: Secure Launch kernel late boot stub

2024-09-13 Thread Ross Philipson
annot be used. Signed-off-by: Ross Philipson --- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/setup.c| 3 + arch/x86/kernel/slaunch.c | 524 + drivers/iommu/intel/dmar.c | 4 + 4 files changed, 532 insertions(+) create mode 100644 arch/x86/k

[PATCH v11 09/20] x86: Secure Launch kernel early boot stub

2024-09-13 Thread Ross Philipson
handling the APs on Intel platforms. The routine sl_main which runs after entering 64b mode is responsible for measuring configuration and module information before it is used like the boot params, the kernel command line, the TXT heap, an external initramfs, etc. Signed-off-by: Ross Philipson

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

2024-09-13 Thread Ross Philipson
start of the setup kernel. The support in the linker file achieves this. Signed-off-by: Ross Philipson Suggested-by: Ard Biesheuvel Reviewed-by: Ard Biesheuvel --- arch/x86/boot/compressed/kernel_info.S | 50 +++--- arch/x86/boot/compressed/vmlinux.lds.S | 7 2

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

2024-09-13 Thread Ross Philipson
These values are needed by Secure Launch to locate particular CPUs during AP startup and to restore the MTRR state after a TXT launch. Signed-off-by: Ross Philipson --- arch/x86/include/asm/msr-index.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/msr-index.h b

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

2024-09-13 Thread Ross Philipson
nel is not uncompressed at this point. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/boot/compressed/sha256.c | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 arch/x86/boot/compressed/sha256.c

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

2024-09-13 Thread Ross Philipson
niel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 + arch/x86/boot/compressed/sha1.c | 6 +++ include/crypto/sha1.h | 1 + lib/crypto/sha1.c | 81 +++ 4 files changed, 90 insertions(+) create

[PATCH v11 04/20] x86: Secure Launch main header file

2024-09-13 Thread Ross Philipson
Introduce the main Secure Launch header file used in the early SL stub and the early setup code. Signed-off-by: Ross Philipson --- include/linux/slaunch.h | 548 1 file changed, 548 insertions(+) create mode 100644 include/linux/slaunch.h diff --git a

[PATCH v11 01/20] Documentation/x86: Secure Launch kernel documentation

2024-09-13 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 + ..

[PATCH v11 03/20] x86: Secure Launch Resource Table header file

2024-09-13 Thread Ross Philipson
Introduce the Secure Launch Resource Table which forms the formal interface between the pre and post launch code. Signed-off-by: Ross Philipson --- include/linux/slr_table.h | 276 ++ 1 file changed, 276 insertions(+) create mode 100644 include/linux

Re: [PATCH v10 20/20] x86/efi: EFI stub DRTM launch support for Secure Launch

2024-08-29 Thread ross . philipson
N9M2RV99hQ!KhkZK77BXRIR4F24tKkUeIlIrdqXtUW2vcnDV74c_5BmrQBQaQ4FqcDKKv9LB3HQUocTGkrmIxuz-LAC$ ] url: https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commits/Ross-Philipson/Documentation-x86-Secure-Launch-kernel-documentation/20240827-065225__;!!ACWV5

Re: [PATCH v10 20/20] x86/efi: EFI stub DRTM launch support for Secure Launch

2024-08-28 Thread ross . philipson
d in https://urldefense.com/v3/__https://git-scm.com/docs/git-format-patch*_base_tree_information__;Iw!!ACWV5N9M2RV99hQ!KhkZK77BXRIR4F24tKkUeIlIrdqXtUW2vcnDV74c_5BmrQBQaQ4FqcDKKv9LB3HQUocTGkrmIxuz-LAC$ ] url: https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commits/Ross-Philipson/Doc

Re: [PATCH v9 06/19] x86: Add early SHA-1 support for Secure Launch early measurements

2024-08-28 Thread ross . philipson
On 8/27/24 11:14 AM, 'Eric Biggers' via trenchboot-devel wrote: On Thu, May 30, 2024 at 07:16:56PM -0700, Eric Biggers wrote: On Thu, May 30, 2024 at 06:03:18PM -0700, Ross Philipson wrote: From: "Daniel P. Smith" For better or worse, Secure Launch needs SHA-1 and SH

Re: [PATCH v10 20/20] x86/efi: EFI stub DRTM launch support for Secure Launch

2024-08-27 Thread ross . philipson
On 8/27/24 3:28 AM, Ard Biesheuvel wrote: On Tue, 27 Aug 2024 at 00:44, Ross Philipson wrote: 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

[PATCH v10 04/20] x86: Secure Launch main header file

2024-08-26 Thread Ross Philipson
Introduce the main Secure Launch header file used in the early SL stub and the early setup code. Signed-off-by: Ross Philipson --- include/linux/slaunch.h | 548 1 file changed, 548 insertions(+) create mode 100644 include/linux/slaunch.h diff --git a

[PATCH v10 00/20] x86: Trenchboot secure dynamic launch Linux kernel support

2024-08-26 Thread Ross Philipson
s/TechDocs/24593.pdf The TrenchBoot project provides a quick start guide to help get a system up and running with Secure Launch for Linux: https://github.com/TrenchBoot/documentation/blob/master/QUICKSTART.md Patch set based on commit: torvalds/master/b311c1b497e51a628aa89e7cb954481e5f9dced2 Thanks Ro

[PATCH v10 20/20] x86/efi: EFI stub DRTM launch support for Secure Launch

2024-08-26 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

[PATCH v10 19/20] x86: Secure Launch late initcall platform module

2024-08-26 Thread Ross Philipson
e platform module also registers the securityfs nodes to allow access to TXT register fields on Intel along with the fetching of and writing events to the late launch TPM log. Signed-off-by: Daniel P. Smith Signed-off-by: garnetgrimm Signed-off-by: Ross Philipson --- arch/x86/kernel/Makefi

[PATCH v10 18/20] tpm: Add sysfs interface to allow setting and querying the default locality

2024-08-26 Thread Ross Philipson
Expose a sysfs interface to allow user mode to set and query the default locality set for the TPM chip. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-sysfs.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char

[PATCH v10 17/20] tpm: Add ability to set the default locality the TPM chip uses

2024-08-26 Thread Ross Philipson
Curently the locality is hard coded to 0 but for DRTM support, access is needed to localities 1 through 4. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-chip.c | 24 +++- include/linux/tpm.h | 4 2 files changed, 27 insertions(+), 1 deletion(-) diff

[PATCH v10 16/20] tpm: Make locality requests return consistent values

2024-08-26 Thread Ross Philipson
ned-off-by: Ross Philipson --- drivers/char/tpm/tpm_tis_core.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 22ebf679ea69..20a8b341be0d 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/driver

[PATCH v10 15/20] tpm: Ensure tpm is in known state at startup

2024-08-26 Thread Ross Philipson
From: "Daniel P. Smith" When tis_tis_core initializes, it assumes all localities are closed. There are cases when this may not be the case. This commit addresses this by ensuring all localities are closed before initializing begins. Signed-off-by: Daniel P. Smith Signed-off-by: Ross

[PATCH v10 14/20] tpm: Protect against locality counter underflow

2024-08-26 Thread Ross Philipson
ned-off-by: Daniel P. Smith Signed-off-by: Ross Philipson Reported-by: Kanth Ghatraju --- drivers/char/tpm/tpm_tis_core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index fdef214b9f6b..a6967f312837 10

[PATCH v10 13/20] x86/reboot: Secure Launch SEXIT support on reboot paths

2024-08-26 Thread Ross Philipson
callback (into ACPI code) or when an emergency reset is done. In these cases, just the TXT registers are finalized but SEXIT is skipped. Signed-off-by: Ross Philipson --- arch/x86/kernel/reboot.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/reboot.c b/arch/x86

[PATCH v10 12/20] kexec: Secure Launch kexec SEXIT support

2024-08-26 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 v10 09/20] x86: Secure Launch kernel early boot stub

2024-08-26 Thread Ross Philipson
handling the APs on Intel platforms. The routine sl_main which runs after entering 64b mode is responsible for measuring configuration and module information before it is used like the boot params, the kernel command line, the TXT heap, an external initramfs, etc. Signed-off-by: Ross Philipson

[PATCH v10 11/20] x86: Secure Launch SMP bringup support

2024-08-26 Thread Ross Philipson
do then jumps to the standard RM piggy protected mode entry point. Signed-off-by: Ross Philipson --- arch/x86/include/asm/realmode.h | 3 ++ arch/x86/kernel/smpboot.c| 43 ++-- arch/x86/realmode/init.c | 3 ++ arch/x86/realmode/rm/header.S

[PATCH v10 10/20] x86: Secure Launch kernel late boot stub

2024-08-26 Thread Ross Philipson
annot be used. Signed-off-by: Ross Philipson --- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/setup.c| 3 + arch/x86/kernel/slaunch.c | 524 + drivers/iommu/intel/dmar.c | 4 + 4 files changed, 532 insertions(+) create mode 100644 arch/x86/k

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

2024-08-26 Thread Ross Philipson
start of the setup kernel. The support in the linker file achieves this. Signed-off-by: Ross Philipson Suggested-by: Ard Biesheuvel --- arch/x86/boot/compressed/kernel_info.S | 50 +++--- arch/x86/boot/compressed/vmlinux.lds.S | 7 2 files changed, 53 insertions(

[PATCH v10 01/20] Documentation/x86: Secure Launch kernel documentation

2024-08-26 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 + ..

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

2024-08-26 Thread Ross Philipson
These values are needed by Secure Launch to locate particular CPUs during AP startup and to restore the MTRR state after a TXT launch. Signed-off-by: Ross Philipson --- arch/x86/include/asm/msr-index.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/msr-index.h b

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

2024-08-26 Thread Ross Philipson
nel is not uncompressed at this point. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/boot/compressed/sha256.c | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 arch/x86/boot/compressed/sha256.c

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

2024-08-26 Thread Ross Philipson
niel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 + arch/x86/boot/compressed/sha1.c | 6 +++ include/crypto/sha1.h | 1 + lib/crypto/sha1.c | 82 +++ 4 files changed, 91 insertions(+) create

[PATCH v10 03/20] x86: Secure Launch Resource Table header file

2024-08-26 Thread Ross Philipson
Introduce the Secure Launch Resource Table which forms the formal interface between the pre and post launch code. Signed-off-by: Ross Philipson --- include/linux/slr_table.h | 276 ++ 1 file changed, 276 insertions(+) create mode 100644 include/linux

[PATCH v10 02/20] x86: Secure Launch Kconfig

2024-08-26 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 007bab9f2a0e

Re: [PATCH v9 09/19] x86: Secure Launch kernel late boot stub

2024-08-12 Thread ross . philipson
On 6/4/24 3:59 PM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: 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

Re: [PATCH v9 04/19] x86: Secure Launch Resource Table header file

2024-06-20 Thread ross . philipson
On 6/19/24 5:18 PM, Jarkko Sakkinen wrote: On Thu Jun 6, 2024 at 7:49 PM EEST, wrote: For any architectures dig a similar fact: 1. Is not dead. 2. Will be there also in future. Make any architecture existentially relevant for and not too much coloring in the text that is easy to check. It is

Re: [PATCH v9 04/19] x86: Secure Launch Resource Table header file

2024-06-06 Thread ross . philipson
On 6/5/24 11:02 PM, Jarkko Sakkinen wrote: On Wed Jun 5, 2024 at 10:03 PM EEST, wrote: So I did not mean to imply that DRTM support on various platforms/architectures has a short expiration date. In fact we are actively working on DRTM support through the TrenchBoot project on several platforms

Re: [PATCH v9 04/19] x86: Secure Launch Resource Table header file

2024-06-05 Thread ross . philipson
Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: Introduce the Secure Launch Resource Table which forms the formal interface between the pre and post launch code. Signed-off-by: Ross Philipson If a uarch specific, I'd appreciate Intel SDM reference here so that I can

Re: [PATCH v9 04/19] x86: Secure Launch Resource Table header file

2024-06-04 Thread ross . philipson
On 6/4/24 5:22 PM, Jarkko Sakkinen wrote: On Wed Jun 5, 2024 at 2:00 AM EEST, wrote: On 6/4/24 3:36 PM, Jarkko Sakkinen wrote: On Tue Jun 4, 2024 at 11:31 PM EEST, wrote: On 6/4/24 11:21 AM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: Introduce the

Re: [PATCH v9 16/19] tpm: Add ability to set the preferred locality the TPM chip uses

2024-06-04 Thread ross . philipson
On 6/4/24 3:50 PM, Jarkko Sakkinen wrote: On Wed Jun 5, 2024 at 1:14 AM EEST, wrote: On 6/4/24 1:27 PM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: Curently the locality is hard coded to 0 but for DRTM support, access is needed to localities 1 through 4

Re: [PATCH v9 04/19] x86: Secure Launch Resource Table header file

2024-06-04 Thread ross . philipson
On 6/4/24 3:36 PM, Jarkko Sakkinen wrote: On Tue Jun 4, 2024 at 11:31 PM EEST, wrote: On 6/4/24 11:21 AM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: Introduce the Secure Launch Resource Table which forms the formal interface between the pre and post

Re: [PATCH v9 16/19] tpm: Add ability to set the preferred locality the TPM chip uses

2024-06-04 Thread ross . philipson
On 6/4/24 1:27 PM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: Curently the locality is hard coded to 0 but for DRTM support, access is needed to localities 1 through 4. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-chip.c | 24

Re: [PATCH v9 10/19] x86: Secure Launch SMP bringup support

2024-06-04 Thread ross . philipson
On 6/4/24 1:05 PM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: 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

Re: [PATCH v9 09/19] x86: Secure Launch kernel late boot stub

2024-06-04 Thread ross . philipson
On 6/4/24 12:59 PM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: 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

Re: [PATCH v9 09/19] x86: Secure Launch kernel late boot stub

2024-06-04 Thread ross . philipson
On 6/4/24 12:58 PM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: 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

Re: [PATCH v9 08/19] x86: Secure Launch kernel early boot stub

2024-06-04 Thread ross . philipson
03:32, Ross Philipson wrote: The Secure Launch (SL) stub provides the entry point for Intel TXT (and later AMD SKINIT) to vector to during the late launch. The symbol sl_stub_entry is that entry point and its offset into the kernel is conveyed to the launching code using the MLE (Measured Launch

Re: [PATCH v9 08/19] x86: Secure Launch kernel early boot stub

2024-06-04 Thread ross . philipson
On 6/4/24 12:56 PM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: The Secure Launch (SL) stub provides the entry point for Intel TXT (and later AMD SKINIT) to vector to during the late launch. The symbol sl_stub_entry is that entry point and its offset into

Re: [PATCH v9 06/19] x86: Add early SHA-1 support for Secure Launch early measurements

2024-06-04 Thread ross . philipson
On 6/4/24 11:52 AM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: From: "Daniel P. Smith" For better or worse, Secure Launch needs SHA-1 and SHA-256. The choice of hashes used lie with the platform firmware, not with software, and is often outs

Re: [PATCH v9 05/19] x86: Secure Launch main header file

2024-06-04 Thread ross . philipson
On 6/4/24 11:24 AM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: Introduce the main Secure Launch header file used in the early SL stub and the early setup code. Signed-off-by: Ross Philipson Right and anything AMD specific should also have legit

Re: [PATCH v9 04/19] x86: Secure Launch Resource Table header file

2024-06-04 Thread ross . philipson
On 6/4/24 11:21 AM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: Introduce the Secure Launch Resource Table which forms the formal interface between the pre and post launch code. Signed-off-by: Ross Philipson If a uarch specific, I'd appreciate Inte

Re: [PATCH v9 01/19] x86/boot: Place kernel_info at a fixed offset

2024-06-04 Thread ross . philipson
On 6/4/24 11:18 AM, Jarkko Sakkinen wrote: On Fri May 31, 2024 at 4:03 AM EEST, Ross Philipson wrote: From: Arvind Sankar There are use cases for storing the offset of a symbol in kernel_info. For example, the trenchboot series [0] needs to store the offset of the Measured Launch Environment

Re: [PATCH v9 08/19] x86: Secure Launch kernel early boot stub

2024-06-04 Thread ross . philipson
On 6/4/24 10:27 AM, Ard Biesheuvel wrote: On Tue, 4 Jun 2024 at 19:24, wrote: On 5/31/24 6:33 AM, Ard Biesheuvel wrote: On Fri, 31 May 2024 at 13:00, Ard Biesheuvel wrote: Hello Ross, On Fri, 31 May 2024 at 03:32, Ross Philipson wrote: The Secure Launch (SL) stub provides the entry

Re: [PATCH v9 08/19] x86: Secure Launch kernel early boot stub

2024-06-04 Thread ross . philipson
On 5/31/24 7:04 AM, Ard Biesheuvel wrote: On Fri, 31 May 2024 at 15:33, Ard Biesheuvel wrote: On Fri, 31 May 2024 at 13:00, Ard Biesheuvel wrote: Hello Ross, On Fri, 31 May 2024 at 03:32, Ross Philipson wrote: The Secure Launch (SL) stub provides the entry point for Intel TXT (and

Re: [PATCH v9 08/19] x86: Secure Launch kernel early boot stub

2024-06-04 Thread ross . philipson
On 5/31/24 6:33 AM, Ard Biesheuvel wrote: On Fri, 31 May 2024 at 13:00, Ard Biesheuvel wrote: Hello Ross, On Fri, 31 May 2024 at 03:32, Ross Philipson wrote: The Secure Launch (SL) stub provides the entry point for Intel TXT (and later AMD SKINIT) to vector to during the late launch. The

Re: [PATCH v9 19/19] x86: EFI stub DRTM launch support for Secure Launch

2024-06-04 Thread ross . philipson
On 5/31/24 4:09 AM, Ard Biesheuvel wrote: On Fri, 31 May 2024 at 03:32, Ross Philipson wrote: 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

Re: [PATCH v9 08/19] x86: Secure Launch kernel early boot stub

2024-06-04 Thread ross . philipson
On 5/31/24 4:00 AM, Ard Biesheuvel wrote: Hello Ross, Hi Ard, On Fri, 31 May 2024 at 03:32, Ross Philipson wrote: The Secure Launch (SL) stub provides the entry point for Intel TXT (and later AMD SKINIT) to vector to during the late launch. The symbol sl_stub_entry is that entry point

Re: [PATCH v9 06/19] x86: Add early SHA-1 support for Secure Launch early measurements

2024-05-31 Thread ross . philipson
On 5/30/24 7:16 PM, Eric Biggers wrote: On Thu, May 30, 2024 at 06:03:18PM -0700, Ross Philipson wrote: From: "Daniel P. Smith" For better or worse, Secure Launch needs SHA-1 and SHA-256. The choice of hashes used lie with the platform firmware, not with software, and is often outs

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

2024-05-30 Thread Ross Philipson
e platform module also registers the securityfs nodes to allow access to TXT register fields on Intel along with the fetching of and writing events to the late launch TPM log. Signed-off-by: Daniel P. Smith Signed-off-by: garnetgrimm Signed-off-by: Ross Philipson --- arch/x86/kernel/Makefi

[PATCH v9 16/19] tpm: Add ability to set the preferred locality the TPM chip uses

2024-05-30 Thread Ross Philipson
Curently the locality is hard coded to 0 but for DRTM support, access is needed to localities 1 through 4. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-chip.c | 24 +++- drivers/char/tpm/tpm-interface.c | 15 +++ drivers/char/tpm/tpm.h

[PATCH v9 15/19] tpm: Make locality requests return consistent values

2024-05-30 Thread Ross Philipson
ned-off-by: Ross Philipson --- drivers/char/tpm/tpm_tis_core.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 9fb53bb3e73f..685bdeadec51 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/driver

[PATCH v9 14/19] tpm: Ensure tpm is in known state at startup

2024-05-30 Thread Ross Philipson
From: "Daniel P. Smith" When tis core initializes, it assumes all localities are closed. There are cases when this may not be the case. This commit addresses this by ensuring all localities are closed before initializing begins. Signed-off-by: Daniel P. Smith Signed-off-by: Ross

[PATCH v9 11/19] kexec: Secure Launch kexec SEXIT support

2024-05-30 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 | 73

[PATCH v9 13/19] tpm: Protect against locality counter underflow

2024-05-30 Thread Ross Philipson
ned-off-by: Daniel P. Smith Signed-off-by: Ross Philipson Reported-by: Kanth Ghatraju Fixes: 933bfc5ad213 ("tpm, tpm: Implement usage counter for locality") --- drivers/char/tpm/tpm_tis_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_

[PATCH v9 09/19] x86: Secure Launch kernel late boot stub

2024-05-30 Thread Ross Philipson
protections are in place. For TXT, this code also reserves the original compressed kernel setup area where the APs were left looping so that this memory cannot be used. Signed-off-by: Ross Philipson --- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/setup.c| 3 + arch/x86/kernel/slaunch.c

[PATCH v9 17/19] tpm: Add sysfs interface to allow setting and querying the preferred locality

2024-05-30 Thread Ross Philipson
Expose a sysfs interface to allow user mode to set and query the preferred locality for the TPM chip. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-sysfs.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char

[PATCH v9 12/19] reboot: Secure Launch SEXIT support on reboot paths

2024-05-30 Thread Ross Philipson
callback (into ACPI code) or when an emergency reset is done. In these cases, just the TXT registers are finalized but SEXIT is skipped. Signed-off-by: Ross Philipson --- arch/x86/kernel/reboot.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/reboot.c b/arch/x86

  1   2   3   >