Re: [PATCH 10/16] ARM: KVM: vgic: move the "unlikely" statement for vgic init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Thursday, December 6, 2012, Marc Zyngier wrote:
Move the "unlikely" statement to indicate that it is the
"not initialized" state of the vgic that is unlikely.

Not that it does anything on ARM...

Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx>
---
 arch/arm/kvm/arm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index fea8fbb..b307d27 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -661,9 +661,12 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
        if (unlikely(vcpu->arch.target < 0))
                return -ENOEXEC;

-       /* Initalize the VGIC before running a vcpu the first time on this VM */
-       if (unlikely(irqchip_in_kernel(vcpu->kvm) &&
-                    !vgic_initialized(vcpu->kvm))) {
+       /*
+        * Initialize the VGIC before running a vcpu the first time on
+        * this VM

super nit: this is a sentence that could be followed by a dot '.'  :)
 
+        */
+       if (irqchip_in_kernel(vcpu->kvm) &&
+           unlikely(!vgic_initialized(vcpu->kvm))) {
                ret = kvm_vgic_init(vcpu->kvm);
                if (ret)
                        return ret;

hmm, could we move this check to kvm_arch_vcpu_load to reduce the number of branches we have at each vmexit?
 
--
1.8.0.1



_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm

[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux