mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: <linux-kernel@vger.kernel.org>, <x86@kernel.org>,
	<dave.hansen@intel.com>, <kirill.shutemov@linux.intel.com>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <hpa@zytor.com>,
	<luto@kernel.org>, <peterz@infradead.org>,
	<rick.p.edgecombe@intel.com>, <thomas.lendacky@amd.com>,
	<ashish.kalra@amd.com>, <chao.gao@intel.com>, <bhe@redhat.com>,
	<nik.borisov@suse.com>, <pbonzini@redhat.com>,
	<seanjc@google.com>
Subject: Re: [PATCH v2 2/5] x86/kexec: do unconditional WBINVD in relocate_kernel()
Date: Wed, 20 Mar 2024 10:08:09 +1300	[thread overview]
Message-ID: <f4487d93-8207-4d37-b94a-7cb00894a198@intel.com> (raw)
In-Reply-To: <20240319154111.GEZfmyF7IuQ5THG0qO@fat_crate.local>



On 20/03/2024 4:41 am, Borislav Petkov wrote:
> On Tue, Mar 19, 2024 at 01:48:45AM +0000, Kai Huang wrote:
>> Both SME and TDX can leave caches in incoherent state due to memory
>> encryption.  During kexec, the caches must be flushed before jumping to
>> the second kernel to avoid silent memory corruption to the second kernel.
>>
>> During kexec, the WBINVD in stop_this_cpu() flushes caches for all
>> remote cpus when they are being stopped.  For SME, the WBINVD in
>> relocate_kernel() flushes the cache for the last running cpu (which is
>> executing the kexec).
>>
>> Similarly, for TDX after stopping all remote cpus with cache flushed, to
>> support kexec, the kernel needs to flush cache for the last running cpu.
>>
>> Make the WBINVD in the relocate_kernel() unconditional to cover both SME
>> and TDX.
>>
>> Signed-off-by: Kai Huang <kai.huang@intel.com>
>> Suggested-by: Borislav Petkov <bp@alien8.de>
> 
> Well, I suggested what you have in patch 1 but not this.
> 
> You can't just slap tags willy nilly to patches.
> 

Apologize.  Will remove.

  reply	other threads:[~2024-03-19 21:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19  1:48 [PATCH v2 0/5] TDX host: kexec() support Kai Huang
2024-03-19  1:48 ` [PATCH v2 1/5] x86/kexec: do unconditional WBINVD in stop_this_cpu() Kai Huang
2024-03-19  1:48 ` [PATCH v2 2/5] x86/kexec: do unconditional WBINVD in relocate_kernel() Kai Huang
2024-03-19 11:13   ` Kirill A. Shutemov
2024-03-19 14:38     ` Tom Lendacky
2024-03-19 21:20       ` Huang, Kai
2024-03-20  0:19         ` Kirill A. Shutemov
2024-03-20  0:45           ` Huang, Kai
2024-03-20 12:51             ` Kirill A. Shutemov
2024-03-20 13:49         ` Tom Lendacky
2024-03-20 20:48           ` Huang, Kai
2024-03-20 21:06             ` Tom Lendacky
2024-03-20 21:58               ` Huang, Kai
2024-03-20 23:10             ` Kirill A. Shutemov
2024-03-21 21:02               ` Tom Lendacky
2024-03-22 10:40                 ` Kirill A. Shutemov
2024-03-22 14:50                   ` Tom Lendacky
2024-03-25 13:04                     ` Huang, Kai
2024-03-28 16:10                       ` kirill.shutemov
2024-04-01  9:13                         ` Huang, Kai
2024-03-19 15:41   ` Borislav Petkov
2024-03-19 21:08     ` Huang, Kai [this message]
2024-03-19  1:48 ` [PATCH v2 3/5] x86/kexec: Reset TDX private memory on platforms with TDX erratum Kai Huang
2024-03-19  1:48 ` [PATCH v2 4/5] x86/virt/tdx: Remove the !KEXEC_CORE dependency Kai Huang
2024-03-19  1:48 ` [PATCH v2 5/5] x86/virt/tdx: Add TDX memory reset notifier to reset other private pages 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=f4487d93-8207-4d37-b94a-7cb00894a198@intel.com \
    --to=kai.huang@intel.com \
    --cc=ashish.kalra@amd.com \
    --cc=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@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=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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®