historical-speck.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: speck@linutronix.de
Subject: Re: [PATCH 3/4] V7 more sampling fun 3
Date: Tue, 14 Apr 2020 18:23:38 +0200	[thread overview]
Message-ID: <87h7xmniid.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20200414034843.GA5995@mtg-dev.jf.intel.com>

Mark,

speck for mark gross <speck@linutronix.de> writes:
> On Thu, Jan 16, 2020 at 02:16:07PM -0800, speck for mark gross wrote:
>> +	/*
>> +	 * Check to see if this is one of the MDS_NO systems supporting
>> +	 * TSX that are only exposed to SRBDS when TSX is enabled.
>> +	 */
>> +	ia32_cap = x86_read_arch_cap_msr();
>> +	if ((ia32_cap & ARCH_CAP_MDS_NO) && !boot_cpu_has(X86_FEATURE_RTM)) {
>> +		srbds_mitigation = SRBDS_MITIGATION_NOT_AFFECTED_TSX_OFF;
>> +		goto out;
>> +	}
>> +
>> +	if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
>> +		srbds_mitigation = SRBDS_MITIGATION_HYPERVISOR;
>> +		goto out;
>> +	}
>> +
>> +	if (!boot_cpu_has(X86_FEATURE_SRBDS_CTRL)) {
>> +		srbds_mitigation = SRBDS_MITIGATION_UCODE_NEEDED;
>> +		goto out;
>> +	}
>> +
>> +	if (cpu_mitigations_off() || srbds_off) {
>> +		if (srbds_mitigation != SRBDS_MITIGATION_NOT_AFFECTED_TSX_OFF)
>> +			srbds_mitigation = SRBDS_MITIGATION_OFF;
>> +	}
>> +out:
> The test for cpu_mitigations_off or srbds off needs to be after out:
> Otherwise when TSX is off and srbds=off will report the wrong answer.

If the CPU has SRBDS_IF_TSX and TSX is disabled then the correct
answer is: Not affected (TSX off)

That's what we do with other issues as well. If the CPU is not affected
then we print this even with mitigation disabled (all or particular).

Thanks,

        tglx

  reply	other threads:[~2020-04-14 16:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 18:10 [MODERATED] [PATCH 0/4] V7 more sampling fun 0 mark gross
2020-01-16 22:16 ` [MODERATED] [PATCH 3/4] V7 more sampling fun 3 mark gross
2020-01-30 19:12 ` [MODERATED] [PATCH 4/4] V7 more sampling fun 4 mark gross
2020-03-17  0:56 ` [MODERATED] [PATCH 2/4] V7 more sampling fun 2 mark gross
2020-03-17  0:56 ` [MODERATED] [PATCH 1/4] V7 more sampling fun 1 mark gross
2020-04-14  3:48 ` [MODERATED] Re: [PATCH 3/4] V7 more sampling fun 3 mark gross
2020-04-14 16:23   ` Thomas Gleixner [this message]
2020-04-14 20:03     ` mark gross
2020-04-14 10:58 ` Thomas Gleixner
2020-04-14 16:43   ` [MODERATED] " mark gross
2020-04-14 20:02 ` Josh Poimboeuf
2020-04-14 21:03   ` mark gross
2020-04-14 21:23     ` Josh Poimboeuf
2020-04-14 21:53       ` mark gross
2020-04-14 20:05 ` Josh Poimboeuf
2020-04-14 21:59   ` mark gross
2020-04-14 22:46     ` Josh Poimboeuf
2020-04-15 20:59       ` mark gross
2020-04-15 12:58     ` Thomas Gleixner
2020-04-15 22:21       ` [MODERATED] " mark gross
2020-04-15 17:51 ` [MODERATED] Re: [PATCH 1/4] V7 more sampling fun 1 Borislav Petkov
2020-04-15 23:58   ` mark gross

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=87h7xmniid.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=speck@linutronix.de \
    --subject='Re: [PATCH 3/4] V7 more sampling fun 3' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).