Skip to contentSkip to conversation

x86/boot/compressed/head_64.S: Cleanup SEV-related comments

PATCH Applied Borislav Petkov 3 participants 4 messages Jun 20 – Jul 10 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/boot/compressed/head_64.S: Cleanup SEV-related comments

From: "Borislav Petkov (AMD)" <[email protected]>

Move the comment about setting the encryption mask above the line which does that and, especially, inside the ifdeffery, where it belongs.

Move comments ontop of the code lines they refer to and not on the side, which impairs readability.

No functional changes.

---
 arch/x86/boot/compressed/head_64.S | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
arch/x86/boot/compressed/head_64.S +11 -7
index d9dab940ff62..1aca51390f73 100644
@@ -172,19 +172,23 @@ SYM_FUNC_START(startup_32)
  /*
   * Build early 4G boot pagetable
   */
-	/*
-	 * If SEV is active then set the encryption mask in the page tables.
-	 * This will ensure that when the kernel is copied and decompressed
-	 * it will be done so encrypted.
-	 */
 	xorl	%edx, %edx
 #ifdef	CONFIG_AMD_MEM_ENCRYPT
 	call	get_sev_encryption_bit
 	xorl	%edx, %edx
 	testl	%eax, %eax
 	jz	1f
-	subl	$32, %eax	/* Encryption bit is always above bit 31 */
-	bts	%eax, %edx	/* Set encryption mask for page tables */
+
+	/* Encryption bit is always above bit 31 */
+	subl	$32, %eax
+
+	/*
+	 * If SEV is active then set the encryption mask in the page tables.
+	 * This will ensure that when the kernel is copied and decompressed it
+	 * will be done so encrypted.
+	 */
+	bts	%eax, %edx
+
 	/*
 	 * Set MSR_AMD64_SEV_ENABLED_BIT in sev_status so that
 	 * startup32_check_sev_cbit() will do a check. sev_enable() will
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Borislav Petkov

From: "Borislav Petkov (AMD)" <[email protected]>

Move the comment about setting the encryption mask above the line which does that and, especially, inside the ifdeffery, where it belongs.

Move comments ontop of the code lines they refer to and not on the side, which impairs readability.

No functional changes.

Quoted 39 lines
---
 arch/x86/boot/compressed/head_64.S | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
arch/x86/boot/compressed/head_64.S +11 -7
index d9dab940ff62..1aca51390f73 100644
@@ -172,19 +172,23 @@ SYM_FUNC_START(startup_32)
  /*
   * Build early 4G boot pagetable
   */
-	/*
-	 * If SEV is active then set the encryption mask in the page tables.
-	 * This will ensure that when the kernel is copied and decompressed
-	 * it will be done so encrypted.
-	 */
 	xorl	%edx, %edx
 #ifdef	CONFIG_AMD_MEM_ENCRYPT
 	call	get_sev_encryption_bit
 	xorl	%edx, %edx
 	testl	%eax, %eax
 	jz	1f
-	subl	$32, %eax	/* Encryption bit is always above bit 31 */
-	bts	%eax, %edx	/* Set encryption mask for page tables */
+
+	/* Encryption bit is always above bit 31 */
+	subl	$32, %eax
+
+	/*
+	 * If SEV is active then set the encryption mask in the page tables.
+	 * This will ensure that when the kernel is copied and decompressed it
+	 * will be done so encrypted.
+	 */
+	bts	%eax, %edx
+
 	/*
 	 * Set MSR_AMD64_SEV_ENABLED_BIT in sev_status so that
 	 * startup32_check_sev_cbit() will do a check. sev_enable() will
#2 lore raw
In reply to Borislav Petkov
The following commit has been merged into the x86/cleanups branch of tip:

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     cb6417b360a7ad215cde42aa2cf56a2076cac560
Gitweb:        https://git.kernel.org/tip/cb6417b360a7ad215cde42aa2cf56a2076cac560
Author:        Borislav Petkov (AMD) <[email protected]>
AuthorDate:    Fri, 19 Jun 2026 21:37:57 -07:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Thu, 09 Jul 2026 16:16:32 -07:00

x86/boot/compressed/head_64.S: Cleanup SEV-related comments

Move the comment about setting the encryption mask above the line which does that and, especially, inside the ifdeffery, where it belongs.

Move comments ontop of the code lines they refer to and not on the side, which impairs readability.

No functional changes.

---
 arch/x86/boot/compressed/head_64.S | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
arch/x86/boot/compressed/head_64.S +11 -7
index d9dab94..1aca513 100644
@@ -172,19 +172,23 @@ SYM_FUNC_START(startup_32)
  /*
   * Build early 4G boot pagetable
   */
-	/*
-	 * If SEV is active then set the encryption mask in the page tables.
-	 * This will ensure that when the kernel is copied and decompressed
-	 * it will be done so encrypted.
-	 */
 	xorl	%edx, %edx
 #ifdef	CONFIG_AMD_MEM_ENCRYPT
 	call	get_sev_encryption_bit
 	xorl	%edx, %edx
 	testl	%eax, %eax
 	jz	1f
-	subl	$32, %eax	/* Encryption bit is always above bit 31 */
-	bts	%eax, %edx	/* Set encryption mask for page tables */
+
+	/* Encryption bit is always above bit 31 */
+	subl	$32, %eax
+
+	/*
+	 * If SEV is active then set the encryption mask in the page tables.
+	 * This will ensure that when the kernel is copied and decompressed it
+	 * will be done so encrypted.
+	 */
+	bts	%eax, %edx
+
 	/*
 	 * Set MSR_AMD64_SEV_ENABLED_BIT in sev_status so that
 	 * startup32_check_sev_cbit() will do a check. sev_enable() will
#3 lore raw

[tip: x86/cleanups] x86/boot/compressed/head_64.S: Clean up SEV-related comments

In reply to Borislav Petkov
The following commit has been merged into the x86/cleanups branch of tip:

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     7bdcb5b3a9c5ea63aaea75adfc1ffd30dee969f0
Gitweb:        https://git.kernel.org/tip/7bdcb5b3a9c5ea63aaea75adfc1ffd30dee969f0
Author:        Borislav Petkov (AMD) <[email protected]>
AuthorDate:    Fri, 19 Jun 2026 21:37:57 -07:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Fri, 10 Jul 2026 11:21:51 +02:00

x86/boot/compressed/head_64.S: Clean up SEV-related comments

Move the comment about setting the encryption mask above the line which does that and, especially, inside the ifdeffery, where it belongs.

Move comments on top of the code lines they refer to and not on the side, which impairs readability.

No functional changes.

---
 arch/x86/boot/compressed/head_64.S | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
arch/x86/boot/compressed/head_64.S +11 -7
index d9dab94..1aca513 100644
@@ -172,19 +172,23 @@ SYM_FUNC_START(startup_32)
  /*
   * Build early 4G boot pagetable
   */
-	/*
-	 * If SEV is active then set the encryption mask in the page tables.
-	 * This will ensure that when the kernel is copied and decompressed
-	 * it will be done so encrypted.
-	 */
 	xorl	%edx, %edx
 #ifdef	CONFIG_AMD_MEM_ENCRYPT
 	call	get_sev_encryption_bit
 	xorl	%edx, %edx
 	testl	%eax, %eax
 	jz	1f
-	subl	$32, %eax	/* Encryption bit is always above bit 31 */
-	bts	%eax, %edx	/* Set encryption mask for page tables */
+
+	/* Encryption bit is always above bit 31 */
+	subl	$32, %eax
+
+	/*
+	 * If SEV is active then set the encryption mask in the page tables.
+	 * This will ensure that when the kernel is copied and decompressed it
+	 * will be done so encrypted.
+	 */
+	bts	%eax, %edx
+
 	/*
 	 * Set MSR_AMD64_SEV_ENABLED_BIT in sev_status so that
 	 * startup32_check_sev_cbit() will do a check. sev_enable() will