acrn-hypervisor/hypervisor/include
Zide Chen 6040d8f6a2 hv: fix SOS vapic_id assignment issue
Currently vlapic_build_id() uses vcpu_id to retrieve the lapic_id
per_cpu variable:

  vlapic_id = per_cpu(lapic_id, vcpu->vcpu_id);

SOS vcpu_id may not equal to pcpu_id, and in that case it runs into
problems. For example, if any pre-launched VMs are launched on PCPUs
whose IDs are smaller than any PCPU IDs that are used by SOS.

This patch fixes the issue and simplify the code to create or get
vapic_id by:

- assign vapic_id in create_vlapic(), which now takes pcpu_id as input
  argument, and save it in the new field: vlapic->vapic_id, which will
  never be changed.
- simplify vlapic_get_apicid() by returning te saved vapid_id directly.
- remove vlapic_build_id().
- vlapic_init() is only called once, merge it into vlapic_create().

Tracked-On: #4268
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2020-04-15 14:34:15 +08:00
..
arch/x86 hv: fix SOS vapic_id assignment issue 2020-04-15 14:34:15 +08:00
common hv: Introduce Global System Interrupt (GSI) into INTx Remapping 2020-03-25 09:36:18 +08:00
debug HV: correct ept page array usage 2020-03-12 14:56:34 +08:00
dm hv: vm: refine the devices unregistration sequence of vm shutdown 2020-04-08 10:13:37 +08:00
hw hv: vpci: handle the quirk part for pass through pci device cfg access in dm 2020-03-20 10:08:43 +08:00
lib hv: list: rename list_entry to container_of 2020-03-31 10:57:47 +08:00
public hv: vpci: handle the quirk part for pass through pci device cfg access in dm 2020-03-20 10:08:43 +08:00