linux_dsm_epyc7002/arch
Sean Christopherson bac38bd7c4 KVM: nVMX: Ensure 64-bit shift when checking VMFUNC bitmap
[ Upstream commit 0e75225dfa4c5d5d51291f54a3d2d5895bad38da ]

Use BIT_ULL() instead of an open-coded shift to check whether or not a
function is enabled in L1's VMFUNC bitmap.  This is a benign bug as KVM
supports only bit 0, and will fail VM-Enter if any other bits are set,
i.e. bits 63:32 are guaranteed to be zero.

Note, "function" is bounded by hardware as VMFUNC will #UD before taking
a VM-Exit if the function is greater than 63.

Before:
  if ((vmcs12->vm_function_control & (1 << function)) == 0)
   0x000000000001a916 <+118>:	mov    $0x1,%eax
   0x000000000001a91b <+123>:	shl    %cl,%eax
   0x000000000001a91d <+125>:	cltq
   0x000000000001a91f <+127>:	and    0x128(%rbx),%rax

After:
  if (!(vmcs12->vm_function_control & BIT_ULL(function & 63)))
   0x000000000001a955 <+117>:	mov    0x128(%rbx),%rdx
   0x000000000001a95c <+124>:	bt     %rax,%rdx

Fixes: 27c42a1bb8 ("KVM: nVMX: Enable VMFUNC for the L1 hypervisor")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210609234235.1244004-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:08 +02:00
..
alpha sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
arc sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
arm sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
arm64 arm64/mm: Fix ttbr0 values stored in struct thread_info for software-pan 2021-07-14 16:56:07 +02:00
c6x arch-cleanup-2020-10-22 2020-10-23 10:06:38 -07:00
csky sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 11:02:28 +01:00
hexagon Hexagon: change jumps to must-extend in futex_atomic_* 2021-07-11 12:53:31 +02:00
ia64 ia64: mca_drv: fix incorrect array size calculation 2021-07-14 16:56:02 +02:00
m68k m68k: atari: Fix ATARI_KBD_CORE kconfig unmet dependency warning 2021-07-14 16:56:05 +02:00
microblaze local64.h: make <asm/local64.h> mandatory 2021-01-12 20:18:16 +01:00
mips sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
nds32 nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff 2021-04-14 08:41:58 +02:00
nios2 nios2: fixed broken sys_clone syscall 2021-03-04 11:38:16 +01:00
openrisc sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
parisc sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
powerpc KVM: PPC: Book3S HV: Fix TLB management on SMT8 POWER9 and POWER10 processors 2021-07-14 16:55:55 +02:00
riscv sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
s390 KVM: s390: get rid of register asm usage 2021-07-14 16:55:56 +02:00
sh sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
sparc sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
um um: Disable CONFIG_GCOV with MODULES 2021-05-22 11:40:53 +02:00
x86 KVM: nVMX: Ensure 64-bit shift when checking VMFUNC bitmap 2021-07-14 16:56:08 +02:00
xtensa sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
.gitignore
Kconfig fanotify: Fix sys_fanotify_mark() on native x86-32 2021-01-17 14:16:59 +01:00