mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "Kaplan, David" <David.Kaplan@amd.com>,
	"Hansen, Dave" <dave.hansen@intel.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"seanjc@google.com" <seanjc@google.com>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"Yamahata, Isaku" <isaku.yamahata@intel.com>,
	"Kalra, Ashish" <Ashish.Kalra@amd.com>,
	"bhe@redhat.com" <bhe@redhat.com>,
	"nik.borisov@suse.com" <nik.borisov@suse.com>,
	"sagis@google.com" <sagis@google.com>,
	Dave Young <dyoung@redhat.com>
Subject: Re: [PATCH v6 2/5] x86/kexec: do unconditional WBINVD for bare-metal in relocate_kernel()
Date: Tue, 10 Sep 2024 14:42:20 +1200	[thread overview]
Message-ID: <3f419ba5-7b95-45f0-adb3-d7397949c14e@intel.com> (raw)
In-Reply-To: <LV3PR12MB9265B4512DE5F2D580DE3CF794992@LV3PR12MB9265.namprd12.prod.outlook.com>


>> --- a/arch/x86/kernel/machine_kexec_64.c
>> +++ b/arch/x86/kernel/machine_kexec_64.c
>> @@ -322,16 +322,9 @@ void machine_kexec_cleanup(struct kimage *image)
>> void machine_kexec(struct kimage *image)  {
>>          unsigned long page_list[PAGES_NR];
>> -       unsigned int host_mem_enc_active;
>>          int save_ftrace_enabled;
>>          void *control_page;
>>
>> -       /*
>> -        * This must be done before load_segments() since if call depth tracking
>> -        * is used then GS must be valid to make any function calls.
>> -        */
>> -       host_mem_enc_active =
>> cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT);
>> -
> 
> Functionally the patch looks fine.  I would suggest keeping some form of this comment though, because the limitation about not being able to make function calls after load_segments() is arguably non-obvious and this comment served as a warning for future modifications in this area.

Yeah this makes sense.  Thanks.

I think we can add some text to the existing comment of load_segments() 
to call out this.  Allow me to dig into more about call depth tracking 
to understand it better -- relocate_kernel() after load_segments() seems 
to be a real function call and I want to know how does it interact with 
call depth tracking.

  reply	other threads:[~2024-09-10  2:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09  8:06 [PATCH v6 0/5] TDX host: kexec() support Kai Huang
2024-09-09  8:06 ` [PATCH v6 1/5] x86/kexec: do unconditional WBINVD for bare-metal in stop_this_cpu() Kai Huang
2024-09-09  8:06 ` [PATCH v6 2/5] x86/kexec: do unconditional WBINVD for bare-metal in relocate_kernel() Kai Huang
2024-09-09 13:56   ` Kaplan, David
2024-09-10  2:42     ` Huang, Kai [this message]
2024-09-10  2:46       ` Kaplan, David
2024-09-10  9:52         ` Huang, Kai
2024-09-12  2:21           ` Kaplan, David
2024-09-12 10:38             ` Huang, Kai
2024-09-09  8:06 ` [PATCH v6 3/5] x86/virt/tdx: Make module initializatiton state immutable in reboot notifier Kai Huang
2024-09-09  8:06 ` [PATCH v6 4/5] x86/kexec: Reset TDX private memory on platforms with TDX erratum Kai Huang
2024-09-09  8:06 ` [PATCH v6 5/5] x86/virt/tdx: Remove the !KEXEC_CORE dependency Kai Huang

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=3f419ba5-7b95-45f0-adb3-d7397949c14e@intel.com \
    --to=kai.huang@intel.com \
    --cc=Ashish.Kalra@amd.com \
    --cc=David.Kaplan@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nik.borisov@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=sagis@google.com \
    --cc=seanjc@google.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®