Thomas Gleixner
fa1202ef22
x86/speculation: Add command line control for indirect branch speculation
...
Add command line control for user space indirect branch speculation
mitigations. The new option is: spectre_v2_user=
The initial options are:
- on: Unconditionally enabled
- off: Unconditionally disabled
-auto: Kernel selects mitigation (default off for now)
When the spectre_v2= command line argument is either 'on' or 'off' this
implies that the application to application control follows that state even
if a contradicting spectre_v2_user= argument is supplied.
Originally-by: Tim Chen <tim.c.chen@linux.intel.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185005.082720373@linutronix.de
2018-11-28 11:57:10 +01:00
Thomas Gleixner
495d470e98
x86/speculation: Unify conditional spectre v2 print functions
...
There is no point in having two functions and a conditional at the call
site.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Tim Chen <tim.c.chen@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185004.986890749@linutronix.de
2018-11-28 11:57:09 +01:00
Thomas Gleixner
30ba72a990
x86/speculataion: Mark command line parser data __initdata
...
No point to keep that around.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Tim Chen <tim.c.chen@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185004.893886356@linutronix.de
2018-11-28 11:57:09 +01:00
Thomas Gleixner
8770709f41
x86/speculation: Mark string arrays const correctly
...
checkpatch.pl muttered when reshuffling the code:
WARNING: static const char * array should probably be static const char * const
Fix up all the string arrays.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Tim Chen <tim.c.chen@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185004.800018931@linutronix.de
2018-11-28 11:57:09 +01:00
Thomas Gleixner
15d6b7aab0
x86/speculation: Reorder the spec_v2 code
...
Reorder the code so it is better grouped. No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Tim Chen <tim.c.chen@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185004.707122879@linutronix.de
2018-11-28 11:57:08 +01:00
Thomas Gleixner
130d6f946f
x86/l1tf: Show actual SMT state
...
Use the now exposed real SMT state, not the SMT sysfs control knob
state. This reflects the state of the system when the mitigation status is
queried.
This does not change the warning in the VMX launch code. There the
dependency on the control knob makes sense because siblings could be
brought online anytime after launching the VM.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Tim Chen <tim.c.chen@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185004.613357354@linutronix.de
2018-11-28 11:57:08 +01:00
Thomas Gleixner
a74cfffb03
x86/speculation: Rework SMT state change
...
arch_smt_update() is only called when the sysfs SMT control knob is
changed. This means that when SMT is enabled in the sysfs control knob the
system is considered to have SMT active even if all siblings are offline.
To allow finegrained control of the speculation mitigations, the actual SMT
state is more interesting than the fact that siblings could be enabled.
Rework the code, so arch_smt_update() is invoked from each individual CPU
hotplug function, and simplify the update function while at it.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Tim Chen <tim.c.chen@linux.intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185004.521974984@linutronix.de
2018-11-28 11:57:07 +01:00
Thomas Gleixner
26c4d75b23
x86/speculation: Rename SSBD update functions
...
During context switch, the SSBD bit in SPEC_CTRL MSR is updated according
to changes of the TIF_SSBD flag in the current and next running task.
Currently, only the bit controlling speculative store bypass disable in
SPEC_CTRL MSR is updated and the related update functions all have
"speculative_store" or "ssb" in their names.
For enhanced mitigation control other bits in SPEC_CTRL MSR need to be
updated as well, which makes the SSB names inadequate.
Rename the "speculative_store*" functions to a more generic name. No
functional change.
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185004.058866968@linutronix.de
2018-11-28 11:57:06 +01:00
Tim Chen
34bce7c969
x86/speculation: Disable STIBP when enhanced IBRS is in use
...
If enhanced IBRS is active, STIBP is redundant for mitigating Spectre v2
user space exploits from hyperthread sibling.
Disable STIBP when enhanced IBRS is used.
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185003.966801480@linutronix.de
2018-11-28 11:57:05 +01:00
Tim Chen
a8f76ae41c
x86/speculation: Move STIPB/IBPB string conditionals out of cpu_show_common()
...
The Spectre V2 printout in cpu_show_common() handles conditionals for the
various mitigation methods directly in the sprintf() argument list. That's
hard to read and will become unreadable if more complex decisions need to
be made for a particular method.
Move the conditionals for STIBP and IBPB string selection into helper
functions, so they can be extended later on.
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185003.874479208@linutronix.de
2018-11-28 11:57:05 +01:00
Tim Chen
b86bda0426
x86/speculation: Remove unnecessary ret variable in cpu_show_common()
...
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185003.783903657@linutronix.de
2018-11-28 11:57:05 +01:00
Tim Chen
24848509aa
x86/speculation: Clean up spectre_v2_parse_cmdline()
...
Remove the unnecessary 'else' statement in spectre_v2_parse_cmdline()
to save an indentation level.
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Reviewed-by: Ingo Molnar <mingo@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Jiri Kosina <jkosina@suse.cz >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Dave Hansen <dave.hansen@intel.com >
Cc: Casey Schaufler <casey.schaufler@intel.com >
Cc: Asit Mallick <asit.k.mallick@intel.com >
Cc: Arjan van de Ven <arjan@linux.intel.com >
Cc: Jon Masters <jcm@redhat.com >
Cc: Waiman Long <longman9394@gmail.com >
Cc: Greg KH <gregkh@linuxfoundation.org >
Cc: Dave Stewart <david.c.stewart@intel.com >
Cc: Kees Cook <keescook@chromium.org >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181125185003.688010903@linutronix.de
2018-11-28 11:57:04 +01:00
Zhenzhong Duan
ef014aae8f
x86/retpoline: Remove minimal retpoline support
...
Now that CONFIG_RETPOLINE hard depends on compiler support, there is no
reason to keep the minimal retpoline support around which only provided
basic protection in the assembly files.
Suggested-by: Peter Zijlstra <peterz@infradead.org >
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Borislav Petkov <bp@suse.de >
Cc: H. Peter Anvin <hpa@zytor.com >
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com >
Cc: <srinivas.eeda@oracle.com >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/f06f0a89-5587-45db-8ed2-0a9d6638d5c0@default
2018-11-28 11:57:03 +01:00
Zhenzhong Duan
4cd24de3a0
x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support
...
Since retpoline capable compilers are widely available, make
CONFIG_RETPOLINE hard depend on the compiler capability.
Break the build when CONFIG_RETPOLINE is enabled and the compiler does not
support it. Emit an error message in that case:
"arch/x86/Makefile:226: *** You are building kernel with non-retpoline
compiler, please update your compiler.. Stop."
[dwmw: Fail the build with non-retpoline compiler]
Suggested-by: Peter Zijlstra <peterz@infradead.org >
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: David Woodhouse <dwmw@amazon.co.uk >
Cc: Borislav Petkov <bp@suse.de >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: H. Peter Anvin <hpa@zytor.com >
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Masahiro Yamada <yamada.masahiro@socionext.com >
Cc: Michal Marek <michal.lkml@markovi.net >
Cc: <srinivas.eeda@oracle.com >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/cca0cb20-f9e2-4094-840b-fb0f8810cd34@default
2018-11-28 11:57:03 +01:00
Borislav Petkov
60c8144afc
x86/MCE/AMD: Fix the thresholding machinery initialization order
...
Currently, the code sets up the thresholding interrupt vector and only
then goes about initializing the thresholding banks. Which is wrong,
because an early thresholding interrupt would cause a NULL pointer
dereference when accessing those banks and prevent the machine from
booting.
Therefore, set the thresholding interrupt vector only *after* having
initialized the banks successfully.
Fixes: 18807ddb7f
("x86/mce/AMD: Reset Threshold Limit after logging error")
Reported-by: Rafał Miłecki <rafal@milecki.pl >
Reported-by: John Clemens <clemej@gmail.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Tested-by: Rafał Miłecki <rafal@milecki.pl >
Tested-by: John Clemens <john@deater.net >
Cc: Aravind Gopalakrishnan <aravindksg.lkml@gmail.com >
Cc: linux-edac@vger.kernel.org
Cc: stable@vger.kernel.org
Cc: Tony Luck <tony.luck@intel.com >
Cc: x86@kernel.org
Cc: Yazen Ghannam <Yazen.Ghannam@amd.com >
Link: https://lkml.kernel.org/r/20181127101700.2964-1-zajec5@gmail.com
Link: https://bugzilla.kernel.org/show_bug.cgi?id=201291
2018-11-28 10:10:36 +01:00
Reinette Chatre
456824896d
x86/resctrl: Use rdt_last_cmd_puts() where possible
...
The last_cmd_status sequence buffer contains user-visible messages
(accessed via /sys/fs/resctrl/info/last_cmd_status) that detail any
errors encountered while interacting with the resctrl filesystem.
rdt_last_cmd_printf() and rdt_last_cmd_puts() are the two calls
available to respectively print a string with format specifiers or a
simple one (which contains no format specifiers) to the last_cmd_status
buffer.
A few occurrences exist where rdt_last_cmd_printf() is used to print
a simple string. Doing so does not result in incorrect result or
incorrect behavior, but rdt_last_cmd_puts() is the function intended to
be used in these cases, as it is faster and it doesn't need to do the
vsnprintf() formatting.
Fix these occurrences to use rdt_last_cmd_puts() instead. While doing
so, fix two typos that were recently introduced into two of these simple
strings.
[ bp: massage commit message and correct typos. ]
Fixes: 723f1a0dd8
("x86/resctrl: Fixup the user-visible strings")
Fixes: e0bdfe8e36
("x86/intel_rdt: Support creation/removal of pseudo-locked region")
Fixes: 9ab9aa15c3
("x86/intel_rdt: Ensure requested schemata respects mode")
Fixes: d48d7a57f7
("x86/intel_rdt: Introduce resource group's mode resctrl file")
Fixes: dfe9674b04
("x86/intel_rdt: Enable entering of pseudo-locksetup mode")
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Tony Luck <tony.luck@intel.com >
Cc: babu.moger@amd.com
Cc: jithu.joseph@intel.com
Cc: x86-ml <x86@kernel.org >
Link: https://lkml.kernel.org/r/f48e46a016d6a5c79f13de8faeca382052189e2e.1543346009.git.reinette.chatre@intel.com
2018-11-27 20:39:02 +01:00
Babu Moger
4d05bf71f1
x86/resctrl: Introduce AMD QOS feature
...
Enable QOS feature on AMD.
Following QoS sub-features are supported on AMD if the underlying
hardware supports it:
- L3 Cache allocation enforcement
- L3 Cache occupancy monitoring
- L3 Code-Data Prioritization support
- Memory Bandwidth Enforcement (Allocation)
The specification is available at:
https://developer.amd.com/wp-content/resources/56375.pdf
There are differences in the way some of the features are implemented.
Separate those functions and add those as vendor specific functions.
The major difference is in MBA feature:
- AMD uses CPUID leaf 0x80000020 to initialize the MBA features.
- AMD uses direct bandwidth value instead of delay based on bandwidth values.
- MSR register base addresses are different for MBA.
- AMD allows non-contiguous L3 cache bit masks.
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-12-babu.moger@amd.com
2018-11-22 20:16:20 +01:00
Babu Moger
723f1a0dd8
x86/resctrl: Fixup the user-visible strings
...
Fix the messages in rdt_last_cmd_printf() and rdt_last_cmd_puts() to
make them more meaningful and consistent.
[ bp: s/cpu/CPU/; s/mem\W/memory ]
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-11-babu.moger@amd.com
2018-11-22 20:16:20 +01:00
Sherry Hurwitz
9f72f855a6
x86/resctrl: Add AMD's X86_FEATURE_MBA to the scattered CPUID features
...
The feature bit X86_FEATURE_MBA is detected via CPUID leaf 0x80000008
EBX Bit 06. This bit indicates the support of AMD's MBA feature.
This feature is supported by both Intel and AMD. But they are detected
in different CPUID leaves.
[ bp: s/cpuid/CPUID/g ]
Signed-off-by: Sherry Hurwitz <sherry.hurwitz@amd.com >
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Reviewed-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-10-babu.moger@amd.com
2018-11-22 20:16:19 +01:00
Babu Moger
6fe07ce35e
x86/resctrl: Rename the config option INTEL_RDT to RESCTRL
...
The resource control feature is supported by both Intel and AMD. So,
rename CONFIG_INTEL_RDT to the vendor-neutral CONFIG_RESCTRL.
Now CONFIG_RESCTRL will be used for both Intel and AMD to enable
Resource Control support. Update the texts in config and condition
accordingly.
[ bp: Simplify Kconfig text. ]
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-9-babu.moger@amd.com
2018-11-22 20:16:19 +01:00
Babu Moger
580ebb66cb
x86/resctrl: Add vendor check for the MBA software controller
...
MBA software controller support is available only on Intel.
Suggested-by: Fenghua Yu <fenghua.yu@intel.com >
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-8-babu.moger@amd.com
2018-11-22 20:16:19 +01:00
Babu Moger
a36c5ff560
x86/resctrl: Bring cbm_validate() into the resource structure
...
Bring all the functions that are different between the vendors into the
resource structure and initialize them dynamically. Add _intel suffix to
the Intel-specific functions.
cbm_validate() which does cache bitmask validation, differs between the
vendors as AMD allows non-contiguous masks. So, use separate functions
for Intel and AMD.
[ bp: Massage commit message and fixup rdt_resource members' vertical
alignment. ]
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-7-babu.moger@amd.com
2018-11-22 20:16:19 +01:00
Babu Moger
1ad4fa41d9
x86/resctrl: Initialize the vendor-specific resource functions
...
Initialize the resource functions that are different between the
vendors. Some features are initialized differently between the vendors.
Add _intel suffix to Intel-specific functions.
For example, the MBA feature varies significantly between Intel and AMD.
Separate the initialization of these resource functions. That way we can
easily add AMD's functions later.
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-6-babu.moger@amd.com
2018-11-22 20:16:19 +01:00
Babu Moger
aa50453a44
x86/resctrl: Move all the macros to resctrl/internal.h
...
Move all the macros to resctrl/internal.h and rename the registers with
MSR_ prefix for consistency.
[bp: align MSR definitions vertically ]
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-5-babu.moger@amd.com
2018-11-22 20:16:19 +01:00
Babu Moger
0f00717ecc
x86/resctrl: Re-arrange the RDT init code
...
Separate the call sequence for rdt_quirks and MBA feature. This is in
preparation to handle vendor differences in these call sequences. Rename
the functions to make the flow a bit more meaningful.
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Cc: x86-ml <x86@kernel.org >
Link: https://lkml.kernel.org/r/20181121202811.4492-4-babu.moger@amd.com
2018-11-22 20:16:19 +01:00
Babu Moger
352940ecec
x86/resctrl: Rename the RDT functions and definitions
...
As AMD is starting to support RESCTRL features, rename the RDT functions
and definitions to more generic names.
Replace "intel_rdt" with "resctrl" where applicable.
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Reviewed-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-3-babu.moger@amd.com
2018-11-22 20:16:18 +01:00
Babu Moger
fa7d949337
x86/resctrl: Rename and move rdt files to a separate directory
...
New generation of AMD processors add support for RDT (or QOS) features.
Together, these features will be called RESCTRL. With more than one
vendors supporting these features, it seems more appropriate to rename
these files.
Create a new directory with the name 'resctrl' and move all the
intel_rdt files to the new directory. This way all the resctrl related
code resides inside one directory.
[ bp: Add SPDX identifier to the Makefile ]
Suggested-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Babu Moger <babu.moger@amd.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Andrew Morton <akpm@linux-foundation.org >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Brijesh Singh <brijesh.singh@amd.com >
Cc: "Chang S. Bae" <chang.seok.bae@intel.com >
Cc: David Miller <davem@davemloft.net >
Cc: David Woodhouse <dwmw2@infradead.org >
Cc: Dmitry Safonov <dima@arista.com >
Cc: Fenghua Yu <fenghua.yu@intel.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jann Horn <jannh@google.com >
Cc: Joerg Roedel <jroedel@suse.de >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Kate Stewart <kstewart@linuxfoundation.org >
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com >
Cc: <linux-doc@vger.kernel.org >
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Philippe Ombredanne <pombredanne@nexb.com >
Cc: Pu Wen <puwen@hygon.cn >
Cc: <qianyue.zj@alibaba-inc.com >
Cc: "Rafael J. Wysocki" <rafael@kernel.org >
Cc: Reinette Chatre <reinette.chatre@intel.com >
Cc: Rian Hunter <rian@alum.mit.edu >
Cc: Sherry Hurwitz <sherry.hurwitz@amd.com >
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vitaly Kuznetsov <vkuznets@redhat.com >
Cc: <xiaochen.shen@intel.com >
Link: https://lkml.kernel.org/r/20181121202811.4492-2-babu.moger@amd.com
2018-11-22 20:16:18 +01:00
Borislav Petkov
2ffcbce39e
x86/microcode/AMD: Update copyright
...
Adjust copyright.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-17-bp@alien8.de
2018-11-19 10:55:12 +01:00
Maciej S. Szmigiero
413c89154c
x86/microcode/AMD: Check the equivalence table size when scanning it
...
Currently, the code scanning the CPU equivalence table read from a
microcode container file assumes that it actually contains a terminating
zero entry.
Check also the size of this table to make sure that no reads past its
end happen, in case there's no terminating zero entry at the end of the
table.
[ bp: Adjust to new changes. ]
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-16-bp@alien8.de
2018-11-19 10:55:12 +01:00
Maciej S. Szmigiero
39cd7c17f9
x86/microcode/AMD: Convert CPU equivalence table variable into a struct
...
Convert the CPU equivalence table into a proper struct in preparation
for tracking also the size of this table.
[ bp: Have functions deal with struct equiv_cpu_table pointers only. Rediff. ]
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-15-bp@alien8.de
2018-11-19 10:55:12 +01:00
Maciej S. Szmigiero
38673f623d
x86/microcode/AMD: Check microcode container data in the late loader
...
Convert the late loading path to use the newly introduced microcode
container data checking functions as it was previously done for the
early loader.
[ bp: Keep header length addition in install_equiv_cpu_table() and rediff. ]
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-14-bp@alien8.de
2018-11-19 10:55:11 +01:00
Borislav Petkov
72dc571a3a
x86/microcode/AMD: Fix container size's type
...
Make it size_t everywhere as this is what we get from cpio.
[ bp: Fix a smatch warning. ]
Originally-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name >
Reported-by: kbuild test robot <lkp@intel.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
Link: https://lkml.kernel.org/r/20181107170218.7596-13-bp@alien8.de
2018-11-19 10:55:06 +01:00
Borislav Petkov
c45e80358c
x86/microcode/AMD: Convert early parser to the new verification routines
...
Now that they have the required functionality, use them to verify the
equivalence table and each patch, thus making parse_container() more
readable.
Originally-by: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-12-bp@alien8.de
2018-11-19 10:51:06 +01:00
Borislav Petkov
d430a305b7
x86/microcode/AMD: Change verify_patch()'s return value
...
Have it return 0 on success, positive value when the current patch
should be skipped and negative on error.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-11-bp@alien8.de
2018-11-19 10:51:06 +01:00
Borislav Petkov
c79570205b
x86/microcode/AMD: Move chipset-specific check into verify_patch()
...
... where it belongs.
No functional changes.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
https://lkml.kernel.org/r/20181107170218.7596-10-bp@alien8.de
2018-11-19 10:51:06 +01:00
Borislav Petkov
51776fb805
x86/microcode/AMD: Move patch family check to verify_patch()
...
... where all the microcode patch verification is being concentrated.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-9-bp@alien8.de
2018-11-19 10:51:05 +01:00
Borislav Petkov
6cdce951f7
x86/microcode/AMD: Simplify patch family detection
...
Instead of traversing the equivalence table, compute the family a patch
is for, from the processor revision ID in the microcode header.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-8-bp@alien8.de
2018-11-19 10:51:05 +01:00
Borislav Petkov
2b8d34b1ec
x86/microcode/AMD: Concentrate patch verification
...
Add a verify_patch() function which tries to sanity-check many aspects
of a microcode patch supplied by an outside container before attempting
a load.
Prepend all sub-functions' names which verify an aspect of a microcode
patch with "__".
Call it in verify_and_add_patch() *before* looking at the microcode
header.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-7-bp@alien8.de
2018-11-19 10:51:05 +01:00
Borislav Petkov
70887cb23e
x86/microcode/AMD: Cleanup verify_patch_size() more
...
Rename the variable which contains the patch size read out from the
section header to sh_psize for better differentiation of all the "sizes"
in that function.
Also, improve the comment above it.
No functional changes.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-6-bp@alien8.de
2018-11-19 10:51:05 +01:00
Borislav Petkov
cfffbfeb42
x86/microcode/AMD: Clean up per-family patch size checks
...
Starting with family 0x15, the patch size verification is not needed
anymore. Thus get rid of the need to update this checking function with
each new family.
Keep the check for older families.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Tom Lendacky <thomas.lendacky@amd.com >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-5-bp@alien8.de
2018-11-19 10:51:00 +01:00
Borislav Petkov
3974b68114
x86/microcode/AMD: Move verify_patch_size() up in the file
...
... to enable later improvements.
No functional changes.
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-4-bp@alien8.de
2018-11-19 10:45:08 +01:00
Maciej S. Szmigiero
f4ff25916c
x86/microcode/AMD: Add microcode container verification
...
Add container and patch verification functions to the AMD microcode
update driver.
These functions check whether a passed buffer contains the relevant
structure, whether it isn't truncated and (for actual microcode patches)
whether the size of a patch is not too large for a particular CPU family.
By adding these checks as separate functions the actual microcode loading
code won't get interspersed with a lot of checks and so will be more
readable.
[ bp: Make all pr_err() calls into pr_debug() and drop the
verify_patch() bits. ]
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86-ml <x86@kernel.org >
Link: http://lkml.kernel.org/r/3014e96c82cd90761b4601bd2cfe59c4119e46a7.1529424596.git.mail@maciej.szmigiero.name
2018-11-19 10:45:03 +01:00
Maciej S. Szmigiero
479229d160
x86/microcode/AMD: Subtract SECTION_HDR_SIZE from file leftover length
...
verify_patch_size() verifies whether the remaining size of the microcode
container file is large enough to contain a patch of the indicated size.
However, the section header length is not included in this indicated
size but it is present in the leftover file length so it should be
subtracted from the leftover file length before passing this value to
verify_patch_size().
[ bp: Split comment. ]
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: x86-ml <x86@kernel.org >
Link: http://lkml.kernel.org/r/6df43f4f6a28186a13a66e8d7e61143c5e1a2324.1529424596.git.mail@maciej.szmigiero.name
2018-11-19 10:44:59 +01:00
Borislav Petkov
68b5e4326e
x86/mce: Fix -Wmissing-prototypes warnings
...
Add the proper includes and make smca_get_name() static.
Fix an actual bug too which the warning triggered:
arch/x86/kernel/cpu/mcheck/therm_throt.c:395:39: error: conflicting \
types for ‘smp_thermal_interrupt’
asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *r)
^~~~~~~~~~~~~~~~~~~~~
In file included from arch/x86/kernel/cpu/mcheck/therm_throt.c:29:
./arch/x86/include/asm/traps.h:107:17: note: previous declaration of \
‘smp_thermal_interrupt’ was here
asmlinkage void smp_thermal_interrupt(void);
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: Yi Wang <wang.yi59@zte.com.cn >
Cc: Michael Matz <matz@suse.de >
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1811081633160.1549@nanos.tec.linutronix.de
2018-11-14 13:46:26 +01:00
Steven Rostedt (VMware)
1503538843
x86/cpu/vmware: Do not trace vmware_sched_clock()
...
When running function tracing on a Linux guest running on VMware
Workstation, the guest would crash. This is due to tracing of the
sched_clock internal call of the VMware vmware_sched_clock(), which
causes an infinite recursion within the tracing code (clock calls must
not be traced).
Make vmware_sched_clock() not traced by ftrace.
Fixes: 80e9a4f21f
("x86/vmware: Add paravirt sched clock")
Reported-by: GwanYeong Kim <gy741.kim@gmail.com >
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org >
Signed-off-by: Borislav Petkov <bp@suse.de >
CC: Alok Kataria <akataria@vmware.com >
CC: GwanYeong Kim <gy741.kim@gmail.com >
CC: "H. Peter Anvin" <hpa@zytor.com >
CC: Ingo Molnar <mingo@kernel.org >
Cc: stable@vger.kernel.org
CC: Thomas Gleixner <tglx@linutronix.de >
CC: virtualization@lists.linux-foundation.org
CC: x86-ml <x86@kernel.org >
Link: http://lkml.kernel.org/r/20181109152207.4d3e7d70@gandalf.local.home
2018-11-09 21:39:14 +01:00
Vishal Verma
e8a308e5f4
acpi/nfit, x86/mce: Validate a MCE's address before using it
...
The NFIT machine check handler uses the physical address from the mce
structure, and compares it against information in the ACPI NFIT table
to determine whether that location lies on an NVDIMM. The mce->addr
field however may not always be valid, and this is indicated by the
MCI_STATUS_ADDRV bit in the status field.
Export mce_usable_address() which already performs validation for the
address, and use it in the NFIT handler.
Fixes: 6839a6d96f
("nfit: do an ARS scrub on hitting a latent media error")
Reported-by: Robert Elliott <elliott@hpe.com >
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
CC: Arnd Bergmann <arnd@arndb.de >
Cc: Dan Williams <dan.j.williams@intel.com >
CC: Dave Jiang <dave.jiang@intel.com >
CC: elliott@hpe.com
CC: "H. Peter Anvin" <hpa@zytor.com >
CC: Ingo Molnar <mingo@redhat.com >
CC: Len Brown <lenb@kernel.org >
CC: linux-acpi@vger.kernel.org
CC: linux-edac <linux-edac@vger.kernel.org >
CC: linux-nvdimm@lists.01.org
CC: Qiuxu Zhuo <qiuxu.zhuo@intel.com >
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net >
CC: Ross Zwisler <zwisler@kernel.org >
CC: stable <stable@vger.kernel.org >
CC: Thomas Gleixner <tglx@linutronix.de >
CC: Tony Luck <tony.luck@intel.com >
CC: x86-ml <x86@kernel.org >
CC: Yazen Ghannam <yazen.ghannam@amd.com >
Link: http://lkml.kernel.org/r/20181026003729.8420-2-vishal.l.verma@intel.com
2018-11-06 19:13:26 +01:00
Vishal Verma
5d96c9342c
acpi/nfit, x86/mce: Handle only uncorrectable machine checks
...
The MCE handler for nfit devices is called for memory errors on a
Non-Volatile DIMM and adds the error location to a 'badblocks' list.
This list is used by the various NVDIMM drivers to avoid consuming known
poison locations during IO.
The MCE handler gets called for both corrected and uncorrectable errors.
Until now, both kinds of errors have been added to the badblocks list.
However, corrected memory errors indicate that the problem has already
been fixed by hardware, and the resulting interrupt is merely a
notification to Linux.
As far as future accesses to that location are concerned, it is
perfectly fine to use, and thus doesn't need to be included in the above
badblocks list.
Add a check in the nfit MCE handler to filter out corrected mce events,
and only process uncorrectable errors.
Fixes: 6839a6d96f
("nfit: do an ARS scrub on hitting a latent media error")
Reported-by: Omar Avelar <omar.avelar@intel.com >
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
CC: Arnd Bergmann <arnd@arndb.de >
CC: Dan Williams <dan.j.williams@intel.com >
CC: Dave Jiang <dave.jiang@intel.com >
CC: elliott@hpe.com
CC: "H. Peter Anvin" <hpa@zytor.com >
CC: Ingo Molnar <mingo@redhat.com >
CC: Len Brown <lenb@kernel.org >
CC: linux-acpi@vger.kernel.org
CC: linux-edac <linux-edac@vger.kernel.org >
CC: linux-nvdimm@lists.01.org
CC: Qiuxu Zhuo <qiuxu.zhuo@intel.com >
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net >
CC: Ross Zwisler <zwisler@kernel.org >
CC: stable <stable@vger.kernel.org >
CC: Thomas Gleixner <tglx@linutronix.de >
CC: Tony Luck <tony.luck@intel.com >
CC: x86-ml <x86@kernel.org >
CC: Yazen Ghannam <yazen.ghannam@amd.com >
Link: http://lkml.kernel.org/r/20181026003729.8420-1-vishal.l.verma@intel.com
2018-11-06 19:13:10 +01:00
Sean Christopherson
43500e6f29
x86/cpufeatures: Remove get_scattered_cpuid_leaf()
...
get_scattered_cpuid_leaf() was added[1] to help KVM rebuild hardware-
defined leafs that are rearranged by Linux to avoid bloating the
x86_capability array. Eventually, the last consumer of the function was
removed[2], but the function itself was kept, perhaps even intentionally
as a form of documentation.
Remove get_scattered_cpuid_leaf() as it is currently not used by KVM.
Furthermore, simply rebuilding the "real" leaf does not resolve all of
KVM's woes when it comes to exposing a scattered CPUID feature, i.e.
keeping the function as documentation may be counter-productive in some
scenarios, e.g. when KVM needs to do more than simply expose the leaf.
[1] 47bdf3378d
("x86/cpuid: Provide get_scattered_cpuid_leaf()")
[2] b7b27aa011
("KVM/x86: Update the reverse_cpuid list to include CPUID_7_EDX")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com >
Signed-off-by: Borislav Petkov <bp@suse.de >
CC: "H. Peter Anvin" <hpa@zytor.com >
CC: Ingo Molnar <mingo@redhat.com >
Cc: Paolo Bonzini <pbonzini@redhat.com >
Cc: Radim Krčmář <rkrcmar@redhat.com >
CC: Thomas Gleixner <tglx@linutronix.de >
CC: x86-ml <x86@kernel.org >
Link: http://lkml.kernel.org/r/20181105185725.18679-1-sean.j.christopherson@intel.com
2018-11-05 20:54:20 +01:00
Michael Kelley
1de72c7064
x86/hyper-v: Enable PIT shutdown quirk
...
Hyper-V emulation of the PIT has a quirk such that the normal PIT shutdown
path doesn't work, because clearing the counter register restarts the
timer.
Disable the counter clearing on PIT shutdown.
Signed-off-by: Michael Kelley <mikelley@microsoft.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: "gregkh@linuxfoundation.org " <gregkh@linuxfoundation.org >
Cc: "devel@linuxdriverproject.org " <devel@linuxdriverproject.org >
Cc: "daniel.lezcano@linaro.org " <daniel.lezcano@linaro.org >
Cc: "virtualization@lists.linux-foundation.org " <virtualization@lists.linux-foundation.org >
Cc: "jgross@suse.com " <jgross@suse.com >
Cc: "akataria@vmware.com " <akataria@vmware.com >
Cc: "olaf@aepfle.de " <olaf@aepfle.de >
Cc: "apw@canonical.com " <apw@canonical.com >
Cc: vkuznets <vkuznets@redhat.com >
Cc: "jasowang@redhat.com " <jasowang@redhat.com >
Cc: "marcelo.cerri@canonical.com " <marcelo.cerri@canonical.com >
Cc: KY Srinivasan <kys@microsoft.com >
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1541303219-11142-3-git-send-email-mikelley@microsoft.com
2018-11-04 11:04:46 +01:00
Ingo Molnar
23a12ddee1
Merge branch 'core/urgent' into x86/urgent, to pick up objtool fix
...
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2018-11-03 23:42:16 +01:00