hv: simplify get_primary_vcpu and vcpu_from_vid

This patch simplifies `get_primary_vcpu` and `vcpu_from_vid`.
The target_vcpu could be get from the index directly.

Tracked-On: #1842
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shiqing Gao
2019-03-04 09:26:36 +08:00
committed by wenlingz
parent 3d0d8609cc
commit da14c96135
4 changed files with 7 additions and 27 deletions

View File

@@ -25,7 +25,8 @@ static void efi_spurious_handler(int32_t vector)
static int32_t uefi_sw_loader(struct acrn_vm *vm)
{
int32_t ret = 0;
struct acrn_vcpu *vcpu = get_primary_vcpu(vm);
/* get primary vcpu */
struct acrn_vcpu *vcpu = vcpu_from_vid(vm, BOOT_CPU_ID);
struct acrn_vcpu_regs *vcpu_regs = &boot_context;
const struct efi_context *efi_ctx = get_efi_ctx();
const struct lapic_regs *uefi_lapic_regs = get_efi_lapic_regs();