mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "tglx@linutronix.de" <tglx@linutronix.de>,
	"x86@kernel.org" <x86@kernel.org>,
	"khaliidcaliy@gmail.com" <khaliidcaliy@gmail.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>
Cc: "hpa@zytor.com" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] x86/boot: Don't return encryption mask from __startup_64()
Date: Wed, 25 Jun 2025 10:55:17 +0000	[thread overview]
Message-ID: <487c2747bb4c02d643324292489243fdc82e1c6a.camel@intel.com> (raw)
In-Reply-To: <20250619073652.719-1-khaliidcaliy@gmail.com>

On Thu, 2025-06-19 at 07:36 +0000, Khalid Ali wrote:
> --- a/arch/x86/kernel/head_64.S
> +++ b/arch/x86/kernel/head_64.S
> @@ -106,18 +106,16 @@ SYM_CODE_START_NOALIGN(startup_64)
>  
>  	/*
>  	 * Perform pagetable fixups. Additionally, if SME is active, encrypt
> -	 * the kernel and retrieve the modifier (SME encryption mask if SME
> -	 * is active) to be added to the initial pgdir entry that will be
> -	 * programmed into CR3.
> -	 */
> +	 * the kernel.
> +	 /

Sigh... this comment is broken, since there's no '*' before the last '/'.

>  	movq	%r15, %rsi
>  	call	__startup_64

Here's how I find it:

So I went to see why this patch caused early boot failure, since the code
change doesn't seem wrong to me.

After staring at the code for half hour and yet unable to see any issue, I
went to disassemble the kernel image, then I found the above two lines of
code wasn't there at all.

Then looking at this again, it's obvious that the reason is the change to
the comment is broken, leading the above two lines of code being commented
out.

With this fixed, I can boot the kernel in a normal VM (both w/ and w/o
CONFIG_AMD_MEM_ENCRYPT).

And this patch has other style issues too like the broken indent of function
parameters after changing returning value from 'unsigned int' to 'void', and
...
	
>  
>  	/* Form the CR3 value being sure to include the CR3 modifier */
> -	leaq	early_top_pgt(%rip), %rcx
> -	addq	%rcx, %rax
> -
> +	leaq	early_top_pgt(%rip), %rax
> +	
... a tailing whitespace here.

So, please, before posting patches, test them, and run
./scripts/checkpatch.pl against them.

And I would suggest AMD guys to avoid looking into this until those issues
are fixed.

  parent reply	other threads:[~2025-06-25 10:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19  7:36 Khalid Ali
2025-06-23 11:26 ` Huang, Kai
2025-06-25  6:40 ` kernel test robot
2025-06-25 10:55 ` Huang, Kai [this message]
2025-06-25 12:34   ` Khalid Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=487c2747bb4c02d643324292489243fdc82e1c6a.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=khaliidcaliy@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®