All of lore.kernel.org
 help / color / mirror / Atom feed
* [stable 4.4 00/29] some stable-4.4 backport
@ 2018-02-23 10:41 Jack Wang
  2018-02-23 10:41 ` [stable 4.4 01/29] KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously Jack Wang
                   ` (30 more replies)
  0 siblings, 31 replies; 68+ messages in thread
From: Jack Wang @ 2018-02-23 10:41 UTC (permalink / raw)
  To: gregkh, stable; +Cc: Jack Wang

From: Jack Wang <jinpu.wang@profitbricks.com>

Hi Greg,

I notice there are some stable bugfix missing on stable-4.4, so I did
backport from 4.9, most of them are simple cherry-pick, some need to
adjust context a bit, I did some regression tests/ltp/kvm-unit-tests,
looks fine, there are still some patches to port, not sure if worth the
effort.

Note: patches base on 4.4.117

Thanks,
Jack Wang

Andi Kleen (1):
  module/retpoline: Warn about missing retpoline in module

Borislav Petkov (2):
  x86/nospec: Fix header guards names
  x86/bugs: Drop one "mitigation" from dmesg

Colin Ian King (1):
  x86/spectre: Fix spelling mistake: "vunerable"-> "vulnerable"

Dan Williams (9):
  array_index_nospec: Sanitize speculative array de-references
  x86: Implement array_index_mask_nospec
  x86: Introduce barrier_nospec
  x86/get_user: Use pointer masking to limit speculation
  x86/syscall: Sanitize syscall table de-references under speculation
  vfs, fdtable: Prevent bounds-check bypass via speculative execution
  nl80211: Sanitize array index in parse_txq_params
  x86/spectre: Report get_user mitigation for spectre_v1
  x86/kvm: Update spectre-v1 mitigation

Darren Kenny (1):
  x86/speculation: Fix typo IBRS_ATT, which should be IBRS_ALL

David Hildenbrand (2):
  KVM: nVMX: kmap() can't fail
  KVM: nVMX: vmx_complete_nested_posted_interrupt() can't fail

David Woodhouse (1):
  x86/retpoline: Avoid retpolines for built-in __init functions

Dou Liyang (1):
  x86/spectre: Check CONFIG_RETPOLINE in command line parser

Jan Dakinevich (2):
  KVM: VMX: clean up declaration of VPID/EPT invalidation types
  KVM: nVMX: invvpid handling improvements

Jim Mattson (1):
  kvm: nVMX: Fix kernel panics induced by illegal INVEPT/INVVPID types

Josh Poimboeuf (1):
  x86/paravirt: Remove 'noreplace-paravirt' cmdline option

KarimAllah Ahmed (1):
  x86/spectre: Simplify spectre_v2 command line parsing

Mark Rutland (1):
  Documentation: Document array_index_nospec

Peter Zijlstra (2):
  KVM: x86: Make indirect calls in emulator speculation safe
  KVM: VMX: Make indirect call speculation safe

Thomas Gleixner (1):
  x86/cpu/bugs: Make retpoline module warning conditional

Waiman Long (1):
  x86/retpoline: Remove the esp/rsp thunk

Wanpeng Li (1):
  KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page
    Ready" exceptions simultaneously

 Documentation/kernel-parameters.txt   |   2 -
 Documentation/speculation.txt         |  90 +++++++++++++++++++++++++
 arch/x86/entry/common.c               |   2 +
 arch/x86/include/asm/asm-prototypes.h |   1 -
 arch/x86/include/asm/barrier.h        |  28 ++++++++
 arch/x86/include/asm/msr.h            |   3 +-
 arch/x86/include/asm/nospec-branch.h  |   8 +--
 arch/x86/include/asm/vmx.h            |   5 +-
 arch/x86/kernel/alternative.c         |  14 ----
 arch/x86/kernel/cpu/bugs.c            | 122 ++++++++++++++++++++++++----------
 arch/x86/kvm/emulate.c                |   9 +--
 arch/x86/kvm/vmx.c                    |  83 +++++++++++------------
 arch/x86/kvm/x86.c                    |  34 +++++++---
 arch/x86/lib/getuser.S                |  10 +++
 arch/x86/lib/retpoline.S              |   1 -
 include/linux/fdtable.h               |   5 +-
 include/linux/init.h                  |   9 ++-
 include/linux/module.h                |   9 +++
 include/linux/nospec.h                |  72 ++++++++++++++++++++
 kernel/module.c                       |  11 +++
 net/wireless/nl80211.c                |   9 ++-
 scripts/mod/modpost.c                 |   9 +++
 22 files changed, 417 insertions(+), 119 deletions(-)
 create mode 100644 Documentation/speculation.txt
 create mode 100644 include/linux/nospec.h

-- 
2.7.4

^ permalink raw reply	[flat|nested] 68+ messages in thread
* Patch "KVM: nVMX: invvpid handling improvements" has been added to the 4.9-stable tree
@ 2017-03-30  8:12 gregkh
  0 siblings, 0 replies; 68+ messages in thread
From: gregkh @ 2017-03-30  8:12 UTC (permalink / raw)
  To: jan.dakinevich, gregkh, lprosek, rkrcmar; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    KVM: nVMX: invvpid handling improvements

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-nvmx-invvpid-handling-improvements.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From bcdde302b8268ef7dbc4ddbdaffb5b44eafe9a1e Mon Sep 17 00:00:00 2001
From: Jan Dakinevich <jan.dakinevich@gmail.com>
Date: Fri, 28 Oct 2016 07:00:30 +0300
Subject: KVM: nVMX: invvpid handling improvements
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Jan Dakinevich <jan.dakinevich@gmail.com>

commit bcdde302b8268ef7dbc4ddbdaffb5b44eafe9a1e upstream.

 - Expose all invalidation types to the L1

 - Reject invvpid instruction, if L1 passed zero vpid value to single
   context invalidations

Signed-off-by: Jan Dakinevich <jan.dakinevich@gmail.com>
Tested-by: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/kvm/vmx.c |   36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -132,6 +132,12 @@ module_param_named(preemption_timer, ena
 
 #define VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE 5
 
+#define VMX_VPID_EXTENT_SUPPORTED_MASK		\
+	(VMX_VPID_EXTENT_INDIVIDUAL_ADDR_BIT |	\
+	VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT |	\
+	VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT |	\
+	VMX_VPID_EXTENT_SINGLE_NON_GLOBAL_BIT)
+
 /*
  * These 2 parameters are used to config the controls for Pause-Loop Exiting:
  * ple_gap:    upper bound on the amount of time between two successive
@@ -2811,8 +2817,7 @@ static void nested_vmx_setup_ctls_msrs(s
 	 */
 	if (enable_vpid)
 		vmx->nested.nested_vmx_vpid_caps = VMX_VPID_INVVPID_BIT |
-				VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT |
-				VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT;
+			VMX_VPID_EXTENT_SUPPORTED_MASK;
 	else
 		vmx->nested.nested_vmx_vpid_caps = 0;
 
@@ -7698,7 +7703,8 @@ static int handle_invvpid(struct kvm_vcp
 	vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO);
 	type = kvm_register_readl(vcpu, (vmx_instruction_info >> 28) & 0xf);
 
-	types = (vmx->nested.nested_vmx_vpid_caps >> 8) & 0x7;
+	types = (vmx->nested.nested_vmx_vpid_caps &
+			VMX_VPID_EXTENT_SUPPORTED_MASK) >> 8;
 
 	if (type >= 32 || !(types & (1 << type))) {
 		nested_vmx_failValid(vcpu,
@@ -7720,21 +7726,27 @@ static int handle_invvpid(struct kvm_vcp
 	}
 
 	switch (type) {
+	case VMX_VPID_EXTENT_INDIVIDUAL_ADDR:
 	case VMX_VPID_EXTENT_SINGLE_CONTEXT:
-		/*
-		 * Old versions of KVM use the single-context version so we
-		 * have to support it; just treat it the same as all-context.
-		 */
+	case VMX_VPID_EXTENT_SINGLE_NON_GLOBAL:
+		if (!vpid) {
+			nested_vmx_failValid(vcpu,
+				VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID);
+			skip_emulated_instruction(vcpu);
+			return 1;
+		}
+		break;
 	case VMX_VPID_EXTENT_ALL_CONTEXT:
-		__vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02);
-		nested_vmx_succeed(vcpu);
 		break;
 	default:
-		/* Trap individual address invalidation invvpid calls */
-		BUG_ON(1);
-		break;
+		WARN_ON_ONCE(1);
+		skip_emulated_instruction(vcpu);
+		return 1;
 	}
 
+	__vmx_flush_tlb(vcpu, vmx->nested.vpid02);
+	nested_vmx_succeed(vcpu);
+
 	skip_emulated_instruction(vcpu);
 	return 1;
 }


Patches currently in stable-queue which might be from jan.dakinevich@gmail.com are

queue-4.9/kvm-nvmx-invvpid-handling-improvements.patch

^ permalink raw reply	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2018-02-26  8:29 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-23 10:41 [stable 4.4 00/29] some stable-4.4 backport Jack Wang
2018-02-23 10:41 ` [stable 4.4 01/29] KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously Jack Wang
2018-02-23 10:41 ` [stable 4.4 02/29] x86/retpoline: Remove the esp/rsp thunk Jack Wang
2018-02-23 16:39   ` Patch "x86/retpoline: Remove the esp/rsp thunk" has been added to the 4.4-stable tree gregkh
2018-02-23 10:41 ` [stable 4.4 03/29] KVM: x86: Make indirect calls in emulator speculation safe Jack Wang
2018-02-23 16:37   ` Patch "KVM: x86: Make indirect calls in emulator speculation safe" has been added to the 4.4-stable tree gregkh
2018-02-23 10:41 ` [stable 4.4 04/29] KVM: VMX: Make indirect call speculation safe Jack Wang
2018-02-23 16:37   ` Patch "KVM: VMX: Make indirect call speculation safe" has been added to the 4.4-stable tree gregkh
2018-02-23 10:41 ` [stable 4.4 05/29] module/retpoline: Warn about missing retpoline in module Jack Wang
2018-02-23 16:37   ` Patch "module/retpoline: Warn about missing retpoline in module" has been added to the 4.4-stable tree gregkh
2018-02-23 10:41 ` [stable 4.4 06/29] x86/nospec: Fix header guards names Jack Wang
2018-02-23 16:39   ` Patch "x86/nospec: Fix header guards names" has been added to the 4.4-stable tree gregkh
2018-02-23 10:41 ` [stable 4.4 07/29] x86/bugs: Drop one "mitigation" from dmesg Jack Wang
2018-02-23 16:39   ` Patch "x86/bugs: Drop one "mitigation" from dmesg" has been added to the 4.4-stable tree gregkh
2018-02-23 10:41 ` [stable 4.4 08/29] x86/cpu/bugs: Make retpoline module warning conditional Jack Wang
2018-02-23 16:39   ` Patch "x86/cpu/bugs: Make retpoline module warning conditional" has been added to the 4.4-stable tree gregkh
2018-02-23 10:41 ` [stable 4.4 09/29] x86/spectre: Check CONFIG_RETPOLINE in command line parser Jack Wang
2018-02-23 16:39   ` Patch "x86/spectre: Check CONFIG_RETPOLINE in command line parser" has been added to the 4.4-stable tree gregkh
2018-02-23 10:41 ` [stable 4.4 10/29] Documentation: Document array_index_nospec Jack Wang
2018-02-23 16:36   ` Patch "Documentation: Document array_index_nospec" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 11/29] array_index_nospec: Sanitize speculative array de-references Jack Wang
2018-02-23 16:36   ` Patch "array_index_nospec: Sanitize speculative array de-references" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 12/29] x86: Implement array_index_mask_nospec Jack Wang
2018-02-23 16:39   ` Patch "x86: Implement array_index_mask_nospec" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 13/29] x86: Introduce barrier_nospec Jack Wang
2018-02-23 16:39   ` Patch "x86: Introduce barrier_nospec" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 14/29] x86/get_user: Use pointer masking to limit speculation Jack Wang
2018-02-23 16:39   ` Patch "x86/get_user: Use pointer masking to limit speculation" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 15/29] x86/syscall: Sanitize syscall table de-references under speculation Jack Wang
2018-02-23 16:39   ` Patch "x86/syscall: Sanitize syscall table de-references under speculation" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 16/29] vfs, fdtable: Prevent bounds-check bypass via speculative execution Jack Wang
2018-02-23 16:38   ` Patch "vfs, fdtable: Prevent bounds-check bypass via speculative execution" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 17/29] nl80211: Sanitize array index in parse_txq_params Jack Wang
2018-02-23 16:38   ` Patch "nl80211: Sanitize array index in parse_txq_params" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 18/29] x86/spectre: Report get_user mitigation for spectre_v1 Jack Wang
2018-02-23 16:39   ` Patch "x86/spectre: Report get_user mitigation for spectre_v1" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 19/29] x86/spectre: Fix spelling mistake: "vunerable"-> "vulnerable" Jack Wang
2018-02-23 10:42   ` Jack Wang
2018-02-23 16:39   ` Patch "x86/spectre: Fix spelling mistake: "vunerable"-> "vulnerable"" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 20/29] x86/paravirt: Remove 'noreplace-paravirt' cmdline option Jack Wang
2018-02-23 16:39   ` Patch "x86/paravirt: Remove 'noreplace-paravirt' cmdline option" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 21/29] x86/kvm: Update spectre-v1 mitigation Jack Wang
2018-02-23 16:39   ` Patch "x86/kvm: Update spectre-v1 mitigation" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 22/29] x86/retpoline: Avoid retpolines for built-in __init functions Jack Wang
2018-02-23 16:39   ` Patch "x86/retpoline: Avoid retpolines for built-in __init functions" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 23/29] x86/spectre: Simplify spectre_v2 command line parsing Jack Wang
2018-02-23 16:39   ` Patch "x86/spectre: Simplify spectre_v2 command line parsing" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 24/29] x86/speculation: Fix typo IBRS_ATT, which should be IBRS_ALL Jack Wang
2018-02-23 16:39   ` Patch "x86/speculation: Fix typo IBRS_ATT, which should be IBRS_ALL" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 25/29] KVM: nVMX: kmap() can't fail Jack Wang
2018-02-23 16:37   ` Patch "KVM: nVMX: kmap() can't fail" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 26/29] KVM: nVMX: vmx_complete_nested_posted_interrupt() can't fail Jack Wang
2018-02-23 16:37   ` Patch "KVM: nVMX: vmx_complete_nested_posted_interrupt() can't fail" has been added to the 4.4-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 27/29] kvm: nVMX: Fix kernel panics induced by illegal INVEPT/INVVPID types Jack Wang
2018-02-23 10:42 ` [stable 4.4 28/29] KVM: VMX: clean up declaration of VPID/EPT invalidation types Jack Wang
2018-02-23 10:54   ` Greg KH
2018-02-23 11:03     ` Jinpu Wang
2018-02-23 16:37   ` Patch "KVM: VMX: clean up declaration of VPID/EPT invalidation types" has been added to the 4.4-stable tree gregkh
2018-02-23 16:39   ` Patch "KVM: VMX: clean up declaration of VPID/EPT invalidation types" has been added to the 4.9-stable tree gregkh
2018-02-23 10:42 ` [stable 4.4 29/29] KVM: nVMX: invvpid handling improvements Jack Wang
2018-02-23 16:37   ` Patch "KVM: nVMX: invvpid handling improvements" has been added to the 4.4-stable tree gregkh
2018-02-23 16:39   ` Patch "KVM: nVMX: invvpid handling improvements" has been added to the 4.9-stable tree gregkh
2018-02-23 10:53 ` [stable 4.4 00/29] some stable-4.4 backport Greg KH
2018-02-23 11:07   ` Jinpu Wang
2018-02-23 16:19     ` Greg KH
2018-02-23 16:36 ` Greg KH
2018-02-26  8:29   ` Jinpu Wang
  -- strict thread matches above, loose matches on Subject: below --
2017-03-30  8:12 Patch "KVM: nVMX: invvpid handling improvements" has been added to the 4.9-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.