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

@@ -192,7 +192,7 @@ static int32_t vcpu_do_pending_extint(const struct acrn_vcpu *vcpu)
/* check if there is valid interrupt from vPIC, if yes just inject it */
/* PIC only connect with primary CPU */
primary = get_primary_vcpu(vm);
primary = vcpu_from_vid(vm, BOOT_CPU_ID);
if (vcpu == primary) {
vpic_pending_intr(vcpu->vm, &vector);