public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Kuppuswamy Sathyanarayanan 
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org
Cc: "H . Peter Anvin" <hpa@zytor.com>,
	Tony Luck <tony.luck@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Kirill Shutemov <kirill.shutemov@linux.intel.com>,
	Kuppuswamy Sathyanarayanan <knsathya@kernel.org>,
	Kuppuswamy Sathyanarayanan 
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/tdx: Don't write CSTAR MSR on Intel
Date: Thu, 25 Nov 2021 00:40:49 +0100	[thread overview]
Message-ID: <87sfvljf5q.ffs@tglx> (raw)
In-Reply-To: <20211119035803.4012145-1-sathyanarayanan.kuppuswamy@linux.intel.com>

Kuppuswamy,

On Thu, Nov 18 2021 at 19:58, Kuppuswamy Sathyanarayanan wrote:

almost. The subject line is bogus:

        x86/tdx: Don't write CSTAR MSR on Intel

This has nothing to do with TDX in the first place as the actual check
is for CPU vendor == Intel. It's absolutely no requirement to remove
this for TDX. TDX could just handle the #VE and ignore the write.

It's an obvious optimization without TDX because the write is pointless
independent of TDX. There is no value to slap TDX on everything just
because.

Also 'write on Intel' should be 'write on Intel CPUs' to make sense.
  
> +/* Don't write CSTAR MSR on Intel platforms */

How is this comment useful? The proper explanation is below.

> +static void wrmsrl_cstar(unsigned long val)
> +{
> +	/*
> +	 * Intel CPUs do not support 32-bit SYSCALL. Writing to MSR_CSTAR
> +	 * is normally ignored by the CPU, but raises a #VE trap in a TDX
> +	 * guest.
> +	 */
> +	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
> +		wrmsrl(MSR_CSTAR, val);
> +}

I fixed it up for you because of Thanksgiving.

Thanks,

        tglx

  reply	other threads:[~2021-11-24 23:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16  0:51 [PATCH v1 1/1] x86/tdx: Don't write CSTAR MSR on Intel Kuppuswamy Sathyanarayanan
2021-11-18 21:02 ` Thomas Gleixner
2021-11-18 21:03   ` Sathyanarayanan Kuppuswamy
2021-11-19  3:58   ` [PATCH v2] " Kuppuswamy Sathyanarayanan
2021-11-24 23:40     ` Thomas Gleixner [this message]
2021-11-25  0:03       ` Sathyanarayanan Kuppuswamy
2021-11-24 23:45     ` [tip: x86/cpu] x86/cpu: Don't write CSTAR MSR on Intel CPUs tip-bot2 for Andi Kleen

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=87sfvljf5q.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=knsathya@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=tony.luck@intel.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