mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-04 11:43:54 +08:00
KVM: x86: Break kvm_for_each_vcpu loop after finding the VP_INDEX
No need to scan the entire VCPU array. Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9cac38dd5d
commit
684851a157
@ -2328,9 +2328,12 @@ static int get_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
|
||||
case HV_X64_MSR_VP_INDEX: {
|
||||
int r;
|
||||
struct kvm_vcpu *v;
|
||||
kvm_for_each_vcpu(r, v, vcpu->kvm)
|
||||
if (v == vcpu)
|
||||
kvm_for_each_vcpu(r, v, vcpu->kvm) {
|
||||
if (v == vcpu) {
|
||||
data = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HV_X64_MSR_EOI:
|
||||
|
Loading…
Reference in New Issue
Block a user