The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	pbonzini@redhat.com, seanjc@google.com, vannapurve@google.com
Cc: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, H Peter Anvin <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	rick.p.edgecombe@intel.com, kirill.shutemov@linux.intel.com,
	kai.huang@intel.com, reinette.chatre@intel.com,
	xiaoyao.li@intel.com, tony.lindgren@linux.intel.com,
	binbin.wu@linux.intel.com, isaku.yamahata@intel.com,
	yan.y.zhao@intel.com, chao.gao@intel.com
Subject: Re: [PATCH 2/2] x86/tdx: Skip clearing reclaimed pages unless X86_BUG_TDX_PW_MCE is present
Date: Thu, 3 Jul 2025 07:25:25 -0700	[thread overview]
Message-ID: <4bce6d90-c0d4-4f0d-bcb7-4a58fa9643e3@intel.com> (raw)
In-Reply-To: <20250703114038.99270-3-adrian.hunter@intel.com>

On 7/3/25 04:40, Adrian Hunter wrote:
> @@ -642,6 +642,15 @@ static void reset_tdx_pages(unsigned long base, unsigned long size)
>  	const void *zero_page = (const void *)page_address(ZERO_PAGE(0));
>  	unsigned long phys, end;

If the only possible use for reset_tdx_pages() is for the erratum, then
it needs to be in the function name.

> +	/*
> +	 * Linux uses only KeyID 0 which can read or write pages
> +	 * that were formerly TDX private pages, without poisoning
> +	 * memory. However on platforms with the partial-write errata,
> +	 * poisoning still happens for partial writes.
> +	 */
> +	if (!boot_cpu_has_bug(X86_BUG_TDX_PW_MCE))
> +		return;

Would this be more clear?

	/*
	 * Typically, any write to the page will convert it from TDX
	 * private back to normal kernel memory. Systems with the
	 * erratum need to do the conversion explicitly.
	 */

      reply	other threads:[~2025-07-03 14:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 11:40 [PATCH 0/2] x86/tdx: Skip clearing reclaimed pages unless X86_BUG_TDX_PW_MCE is present Adrian Hunter
2025-07-03 11:40 ` [PATCH 1/2] x86/tdx: Eliminate duplicate code in tdx_clear_page() Adrian Hunter
2025-07-03 14:14   ` Dave Hansen
2025-07-03 14:39     ` Adrian Hunter
2025-07-03 14:53       ` Dave Hansen
2025-07-03 11:40 ` [PATCH 2/2] x86/tdx: Skip clearing reclaimed pages unless X86_BUG_TDX_PW_MCE is present Adrian Hunter
2025-07-03 14:25   ` Dave Hansen [this message]

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=4bce6d90-c0d4-4f0d-bcb7-4a58fa9643e3@intel.com \
    --to=dave.hansen@intel.com \
    --cc=adrian.hunter@intel.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kai.huang@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=tony.lindgren@linux.intel.com \
    --cc=tony.luck@intel.com \
    --cc=vannapurve@google.com \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    --cc=yan.y.zhao@intel.com \
    /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