historical-speck.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
To: speck@linutronix.de
Subject: [MODERATED] [PATCH 1/9] TAA 1
Date: Wed, 23 Oct 2019 10:45:50 +0200	[thread overview]
Message-ID: <845fbeac941c6a5f9f9bf588394497faaa694909.1571905227.git.bp@suse.de> (raw)
In-Reply-To: <cover.1571905227.git.bp@suse.de>

From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Subject: [PATCH 1/9] x86/msr: Add the IA32_TSX_CTRL MSR

Transactional Synchronization Extensions (TSX) may be used on certain
processors as part of a speculative side channel attack.  A microcode
update for existing processors that are vulnerable to this attack will
add a new MSR - IA32_TSX_CTRL to allow the system administrator the
option to disable TSX as one of the possible mitigations.

  [ Note that future processors that are not vulnerable will also
    support the IA32_TSX_CTRL MSR. ]

Add defines for the new IA32_TSX_CTRL MSR and its bits.

TSX has two sub-features:

1. Restricted Transactional Memory (RTM) is an explicitly-used feature
   where new instructions begin and end TSX transactions.
2. Hardware Lock Elision (HLE) is implicitly used when certain kinds of
   "old" style locks are used by software.

Bit 7 of the IA32_ARCH_CAPABILITIES indicates the presence of the
IA32_TSX_CTRL MSR.

There are two control bits in IA32_TSX_CTRL MSR:

  Bit 0: When set, it disables the Restricted Transactional Memory (RTM)
         sub-feature of TSX (will force all transactions to abort on the
	 XBEGIN instruction).

  Bit 1: When set, it disables the enumeration of the RTM and HLE feature
         (i.e. it will make CPUID(EAX=7).EBX{bit4} and
	  CPUID(EAX=7).EBX{bit11} read as 0).

The other TSX sub-feature, Hardware Lock Elision (HLE), is
unconditionally disabled but still enumerated as present by
CPUID(EAX=7).EBX{bit4}.

Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Mark Gross <mgross@linux.intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Tested-by: Neelima Krishnan <neelima.krishnan@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
---
 arch/x86/include/asm/msr-index.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 20ce682a2540..da4caf6da739 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -93,6 +93,7 @@
 						  * Microarchitectural Data
 						  * Sampling (MDS) vulnerabilities.
 						  */
+#define ARCH_CAP_TSX_CTRL_MSR		BIT(7)	/* MSR for TSX control is available. */
 
 #define MSR_IA32_FLUSH_CMD		0x0000010b
 #define L1D_FLUSH			BIT(0)	/*
@@ -103,6 +104,10 @@
 #define MSR_IA32_BBL_CR_CTL		0x00000119
 #define MSR_IA32_BBL_CR_CTL3		0x0000011e
 
+#define MSR_IA32_TSX_CTRL		0x00000122
+#define TSX_CTRL_RTM_DISABLE		BIT(0)	/* Disable RTM feature */
+#define TSX_CTRL_CPUID_CLEAR		BIT(1)	/* Disable TSX enumeration */
+
 #define MSR_IA32_SYSENTER_CS		0x00000174
 #define MSR_IA32_SYSENTER_ESP		0x00000175
 #define MSR_IA32_SYSENTER_EIP		0x00000176
-- 
2.21.0

  reply	other threads:[~2019-10-24 13:31 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24  8:20 [MODERATED] [PATCH 0/9] TAA 0 Borislav Petkov
2019-10-23  8:45 ` Pawan Gupta [this message]
2019-10-24 15:22   ` [MODERATED] Re: [PATCH 1/9] TAA 1 Josh Poimboeuf
2019-10-24 16:23     ` Borislav Petkov
2019-10-24 16:42       ` Josh Poimboeuf
2019-10-23  8:52 ` [MODERATED] [PATCH 2/9] TAA 2 Pawan Gupta
2019-10-23  9:01 ` [MODERATED] [PATCH 3/9] TAA 3 Pawan Gupta
2019-10-24 15:30   ` [MODERATED] " Josh Poimboeuf
2019-10-24 16:33     ` Borislav Petkov
2019-10-24 16:43       ` Josh Poimboeuf
2019-10-24 17:39   ` Andrew Cooper
2019-10-24 19:45     ` Borislav Petkov
2019-10-24 19:59       ` Josh Poimboeuf
2019-10-24 20:05         ` Borislav Petkov
2019-10-24 20:14           ` Josh Poimboeuf
2019-10-24 20:36             ` Borislav Petkov
2019-10-24 20:43               ` Andrew Cooper
2019-10-24 20:55                 ` Borislav Petkov
2019-10-24 20:44               ` Josh Poimboeuf
2019-10-24 20:07       ` Andrew Cooper
2019-10-24 20:17         ` Borislav Petkov
2019-10-24 22:38           ` Andrew Cooper
2019-10-25  6:03             ` Pawan Gupta
2019-10-25  7:25               ` Borislav Petkov
2019-10-25  7:17             ` Borislav Petkov
2019-10-25  9:08               ` Andrew Cooper
2019-10-27  7:48                 ` Borislav Petkov
2019-10-27  7:49                   ` [MODERATED] [AUTOREPLY] [MODERATED] [AUTOREPLY] Automatic reply: " James, Hengameh M
2019-10-24 19:47     ` [MODERATED] " Pawan Gupta
2019-10-30 13:28   ` Greg KH
2019-10-30 14:48     ` [MODERATED] Re: ***UNCHECKED*** " Michal Hocko
2019-10-30 17:24     ` [MODERATED] " Pawan Gupta
2019-10-30 19:27       ` Greg KH
2019-10-30 19:44         ` [MODERATED] Re: ***UNCHECKED*** " Michal Hocko
2019-11-01  9:35           ` Greg KH
2019-11-01 13:15             ` [MODERATED] " Borislav Petkov
2019-11-01 14:33               ` Greg KH
2019-11-01 18:42             ` [MODERATED] Re: ***UNCHECKED*** " Michal Hocko
2019-10-23  9:30 ` [MODERATED] [PATCH 4/9] TAA 4 Pawan Gupta
2019-10-24 15:32   ` [MODERATED] " Josh Poimboeuf
2019-10-24 16:43     ` Borislav Petkov
2019-10-24 17:15       ` Josh Poimboeuf
2019-10-24 17:23         ` Pawan Gupta
2019-10-24 17:27           ` Pawan Gupta
2019-10-24 17:34           ` Josh Poimboeuf
2019-10-24 18:23       ` Andrew Cooper
2019-10-24 18:56         ` Josh Poimboeuf
2019-10-24 18:59           ` Josh Poimboeuf
2019-10-24 19:13           ` Andrew Cooper
2019-10-24 19:49             ` Josh Poimboeuf
2019-10-24 20:48               ` Andrew Cooper
2019-10-25  9:12                 ` Andrew Cooper
2019-10-25  0:49   ` Pawan Gupta
2019-10-25  7:36     ` Borislav Petkov
2019-10-23 10:19 ` [MODERATED] [PATCH 5/9] TAA 5 Pawan Gupta
2019-10-24 18:30   ` [MODERATED] " Greg KH
2019-10-23 10:23 ` [MODERATED] [PATCH 6/9] TAA 6 Pawan Gupta
2019-10-23 10:28 ` [MODERATED] [PATCH 7/9] TAA 7 Pawan Gupta
2019-10-24 15:35   ` [MODERATED] " Josh Poimboeuf
2019-10-24 16:42     ` Borislav Petkov
2019-10-24 18:20       ` Jiri Kosina
2019-10-24 19:53         ` Borislav Petkov
2019-10-24 20:02           ` Josh Poimboeuf
2019-10-24 20:08             ` Borislav Petkov
2019-10-23 10:32 ` [MODERATED] [PATCH 8/9] TAA 8 Pawan Gupta
2019-10-24 16:03   ` [MODERATED] " Josh Poimboeuf
2019-10-24 17:35     ` Borislav Petkov
2019-10-24 18:11       ` Josh Poimboeuf
2019-10-24 18:55         ` Pawan Gupta
2019-10-25  8:04         ` Borislav Petkov
2019-10-23 10:35 ` [MODERATED] [PATCH 9/9] TAA 9 Michal Hocko
2019-10-24 16:10   ` [MODERATED] " Josh Poimboeuf
2019-10-24 16:58     ` Borislav Petkov
2019-10-25 10:47       ` [MODERATED] Re: ***UNCHECKED*** " Michal Hocko
2019-10-25 13:05       ` [MODERATED] " Josh Poimboeuf

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=845fbeac941c6a5f9f9bf588394497faaa694909.1571905227.git.bp@suse.de \
    --to=pawan.kumar.gupta@linux.intel.com \
    --cc=speck@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).