acrn-hypervisor/hypervisor/arch/x86/guest
Wu Zhou a9860fad05 hv: bugfix: skip invalid ffs64 return value
ffs64() returns INVALID_BIT_INDEX (0xffffU) when it tries to deal with
zero input value. This may happen In calculate_logical_dest_mask() when
the guest tries to write some illegal destination IDs to MSI config
registers of a pt-device. The ffs64() return value is used as per_cpu
array index, and it would cause a page fault.

This patch adds protection to the per_cpu array, making this function
return zero on illegal value. As in logical destination's definition, a
zero logical designation would point to no CPU.

Fixes: 1334349f8
Tracked-On: #8454
Signed-off-by: Wu Zhou <wu.zhou@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2023-07-14 17:05:17 +08:00
..
assign.c hv: bugfix: skip invalid ffs64 return value 2023-07-14 17:05:17 +08:00
ept.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
guest_memory.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
hyperv.c hv: tlfs: fix the incorrect vLAPIC freq MSR 2022-07-26 05:53:19 +08:00
instr_emul.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
lock_instr_emul.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
nested.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
optee.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
pm.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
trusty.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
ucode.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vcat.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vcpu.c hv: add param to control INIT used to kick pCPU 2022-09-26 13:28:02 +08:00
vcpuid.c hv: hide mwait from guest. 2022-11-04 18:55:52 +08:00
ve820.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vept.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
virq.c hv: improve smp call to support debugging RTVM 2022-09-26 13:28:02 +08:00
virtual_cr.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vlapic_priv.h Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vlapic.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vm_reset.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vm.c hv: hide mwait from guest. 2022-11-04 18:55:52 +08:00
vmcall.c hv: add hypercall to register asyncio 2022-09-27 10:26:42 +08:00
vmcs.c hv: hide mwait from guest. 2022-11-04 18:55:52 +08:00
vmexit.c hv: hide mwait from guest. 2022-11-04 18:55:52 +08:00
vmsr.c hv: hide mwait from guest. 2022-11-04 18:55:52 +08:00
vmtrr.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vmx_asm.S Update copyright year range in code headers 2022-07-15 11:48:35 +08:00
vmx_io.c Update copyright year range in code headers 2022-07-15 11:48:35 +08:00