Re: [PATCH v8 06/15] x86: Add early SHA support for Secure Launch early measurements

2024-04-03 Thread ross . philipson
On 4/3/24 4:56 PM, Eric Biggers wrote: On Wed, Apr 03, 2024 at 09:32:02AM -0700, Andy Lutomirski wrote: On Fri, Feb 23, 2024, at 10:30 AM, Eric Biggers wrote: On Fri, Feb 23, 2024 at 06:20:27PM +, Andrew Cooper wrote: On 23/02/2024 5:54 pm, Eric Biggers wrote: On Fri, Feb 23, 2024 at

Re: [PATCH v8 04/15] x86: Secure Launch Resource Table header file

2024-04-01 Thread ross . philipson
On 3/29/24 3:38 PM, 'Kim Phillips' via trenchboot-devel wrote: Hi Ross, On 2/14/24 4:18 PM, 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 ---   include/linux/slr_table.h

Re: [PATCH v8 04/15] x86: Secure Launch Resource Table header file

2024-02-22 Thread ross . philipson
On 2/15/24 12:08 AM, Ard Biesheuvel wrote: On Wed, 14 Feb 2024 at 23:31, 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 --- include/linux/slr_table.h | 270

Re: [PATCH v8 04/15] x86: Secure Launch Resource Table header file

2024-02-21 Thread ross . philipson
On 2/21/24 6:03 PM, 'Andrew Cooper' via trenchboot-devel wrote: On 15/02/2024 8:08 am, Ard Biesheuvel wrote: On Wed, 14 Feb 2024 at 23:31, Ross Philipson wrote: +/* + * Primary SLR Table Header I know it's just a comment, but SLR ought to be written in longhand here. Will do, thanks. Ross

Re: [PATCH v8 15/15] x86: EFI stub DRTM launch support for Secure Launch

2024-02-21 Thread ross . philipson
On 2/15/24 1:01 AM, Ard Biesheuvel wrote: On Wed, 14 Feb 2024 at 23: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 v8 07/15] x86: Secure Launch kernel early boot stub

2024-02-15 Thread ross . philipson
On 2/15/24 12:29 AM, Ard Biesheuvel wrote: On Wed, 14 Feb 2024 at 23: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

Re: [PATCH v8 03/15] x86: Secure Launch Kconfig

2024-02-15 Thread ross . philipson
On 2/14/24 11:59 PM, Ard Biesheuvel wrote: On Wed, 14 Feb 2024 at 23:31, Ross Philipson wrote: 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 | 12 1

[PATCH v8 13/15] tpm: Add sysfs interface to allow setting and querying the preferred locality

2024-02-14 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 v8 12/15] tpm: Add ability to set the preferred locality the TPM chip uses

2024-02-14 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 v8 09/15] x86: Secure Launch SMP bringup support

2024-02-14 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| 58 +++- arch/x86/realmode/init.c | 3 ++ arch/x86/realmode/rm/header.S

[PATCH v8 11/15] reboot: Secure Launch SEXIT support on reboot paths

2024-02-14 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 v8 10/15] kexec: Secure Launch kexec SEXIT support

2024-02-14 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 v8 07/15] x86: Secure Launch kernel early boot stub

2024-02-14 Thread Ross Philipson
and 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 v8 02/15] Documentation/x86: Secure Launch kernel documentation

2024-02-14 Thread Ross Philipson
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/launch-integrity/index.rst

[PATCH v8 15/15] x86: EFI stub DRTM launch support for Secure Launch

2024-02-14 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 v8 14/15] x86: Secure Launch late initcall platform module

2024-02-14 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 v8 06/15] x86: Add early SHA support for Secure Launch early measurements

2024-02-14 Thread Ross Philipson
ha256 code and allow it to be pulled into the setup kernel in the same manner as sha256 is. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 + arch/x86/boot/compressed/early_sha1.c | 12 arch/x86/boot/compressed/early_sha256.c | 6 ++ i

[PATCH v8 08/15] x86: Secure Launch kernel late boot stub

2024-02-14 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 v8 04/15] x86: Secure Launch Resource Table header file

2024-02-14 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 | 270 ++ 1 file changed, 270 insertions(+) create mode 100644 include/linux

[PATCH v8 05/15] x86: Secure Launch main header file

2024-02-14 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 | 542 1 file changed, 542 insertions(+) create mode 100644 include/linux/slaunch.h diff --git

[PATCH v8 01/15] x86/boot: Place kernel_info at a fixed offset

2024-02-14 Thread Ross Philipson
structure in the ELF symbol table. Signed-off-by: Arvind Sankar Cc: Ross Philipson Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/kernel_info.S | 19 +++ arch/x86/boot/compressed/kernel_info.h | 12 arch/x86/boot/compressed/vmlinux.lds.S | 6 ++ 3 files c

[PATCH v8 00/15] x86: Trenchboot secure dynamic launch Linux kernel support

2024-02-14 Thread Ross Philipson
ith Secure Launch for Linux: https://github.com/TrenchBoot/documentation/blob/master/QUICKSTART.md Patch set based on commit: torvolds/master/54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478 Thanks Ross Philipson and Daniel P. Smith Changes in v2: - Modified 32b entry code to prevent causing r

[PATCH v8 03/15] x86: Secure Launch Kconfig

2024-02-14 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 | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 5edec175b9bf

Re: [PATCH v7 02/13] Documentation/x86: Secure Launch kernel documentation

2023-11-16 Thread ross . philipson
On 11/12/23 10:07 AM, Alyssa Ross wrote: +Load-time Integrity +--- + +It is critical to understand what load-time integrity establishes about a +system and what is assumed, i.e. what is being trusted. Load-time integrity is +when a trusted entity, i.e. an entity with an assumed

Re: [PATCH v7 10/13] kexec: Secure Launch kexec SEXIT support

2023-11-15 Thread ross . philipson
On 11/10/23 3:41 PM, Sean Christopherson wrote: On Fri, Nov 10, 2023, Ross Philipson wrote: 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

[PATCH v7 07/13] x86: Secure Launch kernel early boot stub

2023-11-12 Thread Ross Philipson
and 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 v7 02/13] Documentation/x86: Secure Launch kernel documentation

2023-11-12 Thread Ross Philipson
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/launch-integrity/index.rst

[PATCH v7 13/13] tpm: Allow locality 2 to be set when initializing the TPM for Secure Launch

2023-11-10 Thread Ross Philipson
The Secure Launch MLE environment uses PCRs that are only accessible from the DRTM locality 2. By default the TPM drivers always initialize the locality to 0. When a Secure Launch is in progress, initialize the locality to 2. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-chip.c | 9

[PATCH v7 08/13] x86: Secure Launch kernel late boot stub

2023-11-10 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 v7 05/13] x86: Secure Launch main header file

2023-11-10 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 | 542 1 file changed, 542 insertions(+) create mode 100644 include/linux/slaunch.h diff --git

[PATCH v7 00/13] x86: Trenchboot secure dynamic launch Linux kernel support

2023-11-10 Thread Ross Philipson
set based on commit: torvolds/master/6bc986ab839c844e78a2333a02e55f02c9e57935 Thanks Ross Philipson and Daniel P. Smith Changes in v2: - Modified 32b entry code to prevent causing relocations in the compressed kernel. - Dropped patches for compressed kernel TPM PCR extender. - Modified

[PATCH v7 04/13] x86: Secure Launch Resource Table header file

2023-11-10 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 | 270 ++ 1 file changed, 270 insertions(+) create mode 100644 include/linux

[PATCH v7 10/13] kexec: Secure Launch kexec SEXIT support

2023-11-10 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 v7 06/13] x86: Add early SHA support for Secure Launch early measurements

2023-11-10 Thread Ross Philipson
ha256 code and allow it to be pulled into the setup kernel in the same manner as sha256 is. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 + arch/x86/boot/compressed/early_sha1.c | 12 arch/x86/boot/compressed/early_sha256.c | 6 ++ i

[PATCH v7 09/13] x86: Secure Launch SMP bringup support

2023-11-10 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| 56 +++- arch/x86/realmode/init.c | 3 ++ arch/x86/realmode/rm/header.S

[PATCH v7 12/13] x86: Secure Launch late initcall platform module

2023-11-10 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 v7 01/13] x86/boot: Place kernel_info at a fixed offset

2023-11-10 Thread Ross Philipson
structure in the ELF symbol table. Signed-off-by: Arvind Sankar Cc: Ross Philipson Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/kernel_info.S | 19 +++ arch/x86/boot/compressed/kernel_info.h | 12 arch/x86/boot/compressed/vmlinux.lds.S | 6 ++ 3 files c

[PATCH v7 11/13] reboot: Secure Launch SEXIT support on reboot paths

2023-11-10 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 v7 03/13] x86: Secure Launch Kconfig

2023-11-10 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 | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 3762f41bb092

Re: [PATCH v6 05/14] x86: Secure Launch main header file

2023-10-31 Thread ross . philipson
On 5/12/23 9:10 AM, Ross Philipson wrote: On 5/12/23 07:00, Matthew Garrett wrote: On Thu, May 04, 2023 at 02:50:14PM +, Ross Philipson wrote: +static inline int tpm12_log_event(void *evtlog_base, u32 evtlog_size, +  u32 event_size, void *event) +{ +    struct

Re: [PATCH v6 07/14] x86: Secure Launch kernel early boot stub

2023-09-20 Thread ross . philipson
On 5/12/23 11:04 AM, Thomas Gleixner wrote: On Thu, May 04 2023 at 14:50, Ross Philipson wrote: + +/* CPUID: leaf 1, ECX, SMX feature bit */ +#define X86_FEATURE_BIT_SMX(1 << 6) + +/* Can't include apiddef.h in asm */ Why not? All it needs is a #ifndef __ASSEMBLY__ guard around

Re: [PATCH v6 02/14] Documentation/x86: Secure Launch kernel documentation

2023-06-28 Thread Ross Philipson
On 5/6/23 04:48, Bagas Sanjaya wrote: On Thu, May 04, 2023 at 02:50:11PM +, Ross Philipson wrote: += +System Launch Integrity documentation += + +.. toctree:: By convention, doc toctree have 2-level depth (only page

Re: [PATCH v6 07/14] x86: Secure Launch kernel early boot stub

2023-06-15 Thread Ross Philipson
On 5/15/23 21:45, Matthew Garrett wrote: On Mon, May 15, 2023 at 09:11:15PM -0400, Daniel P. Smith wrote: On 5/12/23 12:17, Ross Philipson wrote: This is a good point. At this point it is really something we overlooked. We will have to revisit this and figure out the best way to find the final

Re: [PATCH v6 09/14] x86: Secure Launch SMP bringup support

2023-05-15 Thread Ross Philipson
On 5/12/23 14:02, Thomas Gleixner wrote: On Thu, May 04 2023 at 14:50, Ross Philipson wrote: +#ifdef CONFIG_SECURE_LAUNCH + +static atomic_t first_ap_only = {1}; ATOMIC_INIT(1) if at all. + +/* + * Called to fix the long jump address for the waiting APs to vector to + * the correct

Re: [PATCH v6 07/14] x86: Secure Launch kernel early boot stub

2023-05-15 Thread Ross Philipson
On 5/12/23 14:04, Thomas Gleixner wrote: On Thu, May 04 2023 at 14:50, Ross Philipson wrote: + +/* CPUID: leaf 1, ECX, SMX feature bit */ +#define X86_FEATURE_BIT_SMX(1 << 6) + +/* Can't include apiddef.h in asm */ Why not? All it needs is a #ifndef __ASSEMBLY__ guard around the C

Re: [PATCH v6 08/14] x86: Secure Launch kernel late boot stub

2023-05-15 Thread Ross Philipson
On 5/12/23 11:44, Thomas Gleixner wrote: On Thu, May 04 2023 at 14:50, Ross Philipson wrote: The routine slaunch_setup is called out of the x86 specific setup_arch Can you please make functions visible in changelogs by appending (), i.e. setup_arch() ? Yes I will. See https

Re: [PATCH v6 11/14] reboot: Secure Launch SEXIT support on reboot paths

2023-05-15 Thread Ross Philipson
On 5/12/23 07:40, Matthew Garrett wrote: On Thu, May 04, 2023 at 02:50:20PM +, Ross Philipson wrote: 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

Re: [PATCH v6 13/14] tpm: Allow locality 2 to be set when initializing the TPM for Secure Launch

2023-05-12 Thread Ross Philipson
On 5/12/23 07:43, Matthew Garrett wrote: On Thu, May 04, 2023 at 02:50:22PM +, Ross Philipson wrote: The Secure Launch MLE environment uses PCRs that are only accessible from the DRTM locality 2. By default the TPM drivers always initialize the locality to 0. When a Secure Launch

Re: [PATCH v6 07/14] x86: Secure Launch kernel early boot stub

2023-05-12 Thread Ross Philipson
On 5/12/23 07:26, Matthew Garrett wrote: On Thu, May 04, 2023 at 02:50:16PM +, Ross Philipson wrote: +static void sl_find_event_log(struct slr_table *slrt) If this is called after the EFI stub then we're presumably post-ExitBootServices and we're copied the TPM event log

Re: [PATCH v6 05/14] x86: Secure Launch main header file

2023-05-12 Thread Ross Philipson
On 5/12/23 07:00, Matthew Garrett wrote: On Thu, May 04, 2023 at 02:50:14PM +, Ross Philipson wrote: +static inline int tpm12_log_event(void *evtlog_base, u32 evtlog_size, + u32 event_size, void *event) +{ + struct tpm12_event_log_header *evtlog

Re: [PATCH v6 08/14] x86: Secure Launch kernel late boot stub

2023-05-12 Thread Ross Philipson
On 5/10/23 19:02, Jarkko Sakkinen wrote: On Thu May 4, 2023 at 5:50 PM 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 platform

Re: [PATCH v6 12/14] x86: Secure Launch late initcall platform module

2023-05-12 Thread Ross Philipson
On 5/10/23 18:40, Jarkko Sakkinen wrote: On Thu May 4, 2023 at 5:50 PM EEST, Ross Philipson wrote: 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 a

Re: [PATCH v6 12/14] x86: Secure Launch late initcall platform module

2023-05-12 Thread Ross Philipson
On 5/10/23 18:39, Jarkko Sakkinen wrote: On Thu May 4, 2023 at 5:50 PM EEST, Ross Philipson wrote: 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 a

Re: [PATCH v6 09/14] x86: Secure Launch SMP bringup support

2023-05-11 Thread Ross Philipson
On 5/10/23 18:55, Jarkko Sakkinen wrote: On Thu May 4, 2023 at 5:50 PM 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

[PATCH v6 07/14] x86: Secure Launch kernel early boot stub

2023-05-10 Thread Ross Philipson
and 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 v6 02/14] Documentation/x86: Secure Launch kernel documentation

2023-05-10 Thread Ross Philipson
Introduce background, overview and configuration/ABI information for the Secure Launch kernel feature. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- Documentation/security/index.rst | 1 + Documentation/security/launch-integrity/index.rst | 10

Re: [PATCH v6 12/14] x86: Secure Launch late initcall platform module

2023-05-08 Thread Ross Philipson
On 5/5/23 15:42, Simon Horman wrote: On Thu, May 04, 2023 at 02:50:21PM +, Ross Philipson wrote: 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 a

Re: [PATCH v6 08/14] x86: Secure Launch kernel late boot stub

2023-05-05 Thread Ross Philipson
On 5/5/23 13:52, Simon Horman wrote: On Thu, May 04, 2023 at 02:50:17PM +, 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 platform

Re: [PATCH v6 09/14] x86: Secure Launch SMP bringup support

2023-05-05 Thread Ross Philipson
On 5/5/23 13:54, Simon Horman wrote: On Thu, May 04, 2023 at 02:50:18PM +, 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

Re: [PATCH v6 07/14] x86: Secure Launch kernel early boot stub

2023-05-05 Thread Ross Philipson
On 5/5/23 13:47, Simon Horman wrote: On Thu, May 04, 2023 at 02:50:16PM +, 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

Re: [PATCH v6 05/14] x86: Secure Launch main header file

2023-05-05 Thread Ross Philipson
On 5/5/23 12:25, Simon Horman wrote: On Thu, May 04, 2023 at 02:50:14PM +, 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 --- include/linux/slaunch.h | 513

Re: [PATCH v6 04/14] x86: Secure Launch Resource Table header file

2023-05-05 Thread Ross Philipson
On 5/5/23 12:22, Simon Horman wrote: On Thu, May 04, 2023 at 02:50:13PM +, 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 --- include/linux/slr_table.h | 270

Re: [PATCH v6 02/14] Documentation/x86: Secure Launch kernel documentation

2023-05-05 Thread Ross Philipson
On 5/5/23 12:19, Simon Horman wrote: On Thu, May 04, 2023 at 02:50:11PM +, Ross Philipson wrote: Introduce background, overview and configuration/ABI information for the Secure Launch kernel feature. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson Hi Ross and Daniel, some

Re: [PATCH v6 00/14] x86: Trenchboot secure dynamic launch Linux kernel support

2023-05-05 Thread Ross Philipson
On 5/5/23 04:39, Bagas Sanjaya wrote: On Thu, May 04, 2023 at 02:50:09PM +, Ross Philipson wrote: This patchset provides detailed documentation of DRTM, the approach used for adding the capbility, and relevant API/ABI documentation. In addition to the documentation the patch set introduces

[PATCH v6 08/14] x86: Secure Launch kernel late boot stub

2023-05-04 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 v6 00/14] x86: Trenchboot secure dynamic launch Linux kernel support

2023-05-04 Thread Ross Philipson
-38-dlstub Thanks Ross Philipson and Daniel P. Smith Changes in v2: - Modified 32b entry code to prevent causing relocations in the compressed kernel. - Dropped patches for compressed kernel TPM PCR extender. - Modified event log code to insert log delimiter events and not rely on TPM acces

[PATCH v6 12/14] x86: Secure Launch late initcall platform module

2023-05-04 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 v6 14/14] x86: EFI stub DRTM launch support for Secure Launch

2023-05-04 Thread Ross Philipson
This support allows the DRTM launch to be initiated after and 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. Signed-off-by: Ross Philipson --- drivers/firmware/efi/libstub/x86-stub.c | 55

[PATCH v6 13/14] tpm: Allow locality 2 to be set when initializing the TPM for Secure Launch

2023-05-04 Thread Ross Philipson
The Secure Launch MLE environment uses PCRs that are only accessible from the DRTM locality 2. By default the TPM drivers always initialize the locality to 0. When a Secure Launch is in progress, initialize the locality to 2. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-chip.c | 9

[PATCH v6 11/14] reboot: Secure Launch SEXIT support on reboot paths

2023-05-04 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 v6 10/14] kexec: Secure Launch kexec SEXIT support

2023-05-04 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 | 69

[PATCH v6 09/14] x86: Secure Launch SMP bringup support

2023-05-04 Thread Ross Philipson
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| 86 arch/x86/realmode/rm/header.S| 3 ++ arch/x86/realmode/rm

[PATCH v6 06/14] x86: Add early SHA support for Secure Launch early measurements

2023-05-04 Thread Ross Philipson
ependencies it pulls in. The result is this is a modified copy of that code that still leverages the core SHA algorithms. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 + arch/x86/boot/compressed/early_sha1.c | 97 +++

[PATCH v6 04/14] x86: Secure Launch Resource Table header file

2023-05-04 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 | 270 ++ 1 file changed, 270 insertions(+) create mode 100644 include/linux

[PATCH v6 05/14] x86: Secure Launch main header file

2023-05-04 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 | 513 1 file changed, 513 insertions(+) create mode 100644 include/linux/slaunch.h diff

[PATCH v6 01/14] x86/boot: Place kernel_info at a fixed offset

2023-05-04 Thread Ross Philipson
structure in the ELF symbol table. Signed-off-by: Arvind Sankar Cc: Ross Philipson Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/kernel_info.S | 19 +++ arch/x86/boot/compressed/kernel_info.h | 12 arch/x86/boot/compressed/vmlinux.lds.S | 6 ++ 3 files c

[PATCH v6 03/14] x86: Secure Launch Kconfig

2023-05-04 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 | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 53bab12..85ecf3f

[PATCH v5 06/12] x86: Secure Launch kernel early boot stub

2022-02-18 Thread Ross Philipson
and 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 v5 02/12] Documentation/x86: Secure Launch kernel documentation

2022-02-18 Thread Ross Philipson
Introduce background, overview and configuration/ABI information for the Secure Launch kernel feature. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- Documentation/security/index.rst | 1 + Documentation/security/launch-integrity/index.rst | 10

[PATCH v5 03/12] x86: Secure Launch Kconfig

2022-02-18 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 | 34 ++ 1 file changed, 34 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig

[PATCH v5 08/12] x86: Secure Launch SMP bringup support

2022-02-18 Thread Ross Philipson
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| 86 arch/x86/realmode/rm/header.S| 3 ++ arch/x86/realmode/rm

[PATCH v5 01/12] x86/boot: Place kernel_info at a fixed offset

2022-02-18 Thread Ross Philipson
structure in the ELF symbol table. Signed-off-by: Arvind Sankar Cc: Ross Philipson Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/kernel_info.S | 19 +++ arch/x86/boot/compressed/kernel_info.h | 12 arch/x86/boot/compressed/vmlinux.lds.S | 6 ++ 3 files c

[PATCH v5 00/12] x86: Trenchboot secure dynamic launch Linux kernel support

2022-02-18 Thread Ross Philipson
tel.com/en-us/articles/intel-sdm AMD SKINIT is documented in the System Programming manual: https://www.amd.com/system/files/TechDocs/24593.pdf GRUB2 pre-launch support patchset (WIP): https://lists.gnu.org/archive/html/grub-devel/2020-05/msg00011.html Thanks Ross Philipson and Daniel P. Smit

[PATCH v5 09/12] kexec: Secure Launch kexec SEXIT support

2022-02-18 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 | 69

[PATCH v5 12/12] tpm: Allow locality 2 to be set when initializing the TPM for Secure Launch

2022-02-18 Thread Ross Philipson
The Secure Launch MLE environment uses PCRs that are only accessible from the DRTM locality 2. By default the TPM drivers always initialize the locality to 0. When a Secure Launch is in progress, initialize the locality to 2. Signed-off-by: Ross Philipson --- drivers/char/tpm/tpm-chip.c | 9

[PATCH v5 11/12] x86: Secure Launch late initcall platform module

2022-02-18 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 v5 07/12] x86: Secure Launch kernel late boot stub

2022-02-18 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 v5 10/12] reboot: Secure Launch SEXIT support on reboot paths

2022-02-18 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 v5 04/12] x86: Secure Launch main header file

2022-02-18 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 | 532 1 file changed, 532 insertions(+) create mode 100644 include/linux/slaunch.h diff

[PATCH v5 05/12] x86: Add early SHA support for Secure Launch early measurements

2022-02-18 Thread Ross Philipson
ependencies it pulls in. The result is this is a modified copy of that code that still leverages the core SHA algorithms. Signed-off-by: Daniel P. Smith Signed-off-by: Ross Philipson --- arch/x86/boot/compressed/Makefile | 2 + arch/x86/boot/compressed/early_sha1.c | 97 +++