From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49FD91F938 for ; Sat, 20 Jun 2026 04:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781930280; cv=none; b=tp3noyOXcE52VeIEvF10GffJUFT6ntSGG5HcT9cCWTXo/mbFIGt+f3+lE2QhJE1ej8P7n1TtJqV/v+D1IGEVVfiiWcr7sRZ2BS3UOThDXcyAQ3FA9cN8aTFB82R4o2p8DfOt8tU7Vj7q2yDn1j2f1pUQFOY1emIMiqk/40xtvRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781930280; c=relaxed/simple; bh=WjxmUqsBKwDE3VOsQSHegEKGPlSL8+Y7vbS2ozoZ0PU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MdbljcGuN25VTGd1Uv6UNCDLJ+F9JAxEgWz9Db/Re/BkXSbIjVP2F00gbya8B3TEd77Tf6mkdmwcghwezg3OIJToc+M1cy7It9txViltJBX7S8ve6/BjT07f9RUFc5XBGVx5BUDZm2cE68lSGD8GRzfKCXsyWXqkXK1oAwqH+Bg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Wz6mkcPM; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wz6mkcPM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C44C71F000E9; Sat, 20 Jun 2026 04:37:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781930279; bh=708UWNV4vDmATS4uS1mtEy9JKR7+u3BKBnCyECA1zcU=; h=From:To:Cc:Subject:Date; b=Wz6mkcPMIBuAxXqIapOXnjtbLSf9/hiON6elCDu4Cbt7sOtiAFQKRtgNnI6l08mRW Y8HfEwY156owWbGSpX4Tskta1geFnG2NOWxBO5wQm9zZHNqyLx8cIOQ6bM4ClG9FyD VI8fh1JzGz6xNf3uSN0Hrjw1ERIE76DpPas9QtRaHwo/cBRmeT5LbhzTXQNwNwDQRl 4RvRep2RHRzzmg/dInPftVvmUYLb7DHmyFDGm6sMTwwAYG/BcCNLmpc4Lm9hyMD/Cn gah2P8VTBae3zC67DED7+My3NIpkW6nzCXgDLTXyW7wzjP3tGVVin+uy9KOlMReiRM f4nMWacuUs0Yw== From: Borislav Petkov To: Tom Lendacky Cc: X86 ML , LKML , "Borislav Petkov (AMD)" Subject: [PATCH] x86/boot/compressed/head_64.S: Cleanup SEV-related comments Date: Fri, 19 Jun 2026 21:37:57 -0700 Message-ID: <20260620043757.347076-1-bp@kernel.org> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Borislav Petkov (AMD)" 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. Signed-off-by: Borislav Petkov (AMD) --- arch/x86/boot/compressed/head_64.S | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index d9dab940ff62..1aca51390f73 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -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.53.0