[Android-virt] [PATCH 07/15] ARM: KVM: VGIC initialisation code

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

 



On 22/06/12 21:36, Christoffer Dall wrote:
> On Mon, May 14, 2012 at 9:05 AM, Marc Zyngier <marc.zyngier at arm.com> wrote:
>> +
>> +void kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu)
>> +{
>> +       struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
>> +       struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
>> +
>> +       int i;
>> +
>> +       if (!irqchip_in_kernel(vcpu->kvm))
>> +               return;
>> +
>> +       spin_lock_init(&vgic_cpu->lock);
>> +       for (i = 0; i < VGIC_NR_IRQS; i++) {
>> +               if (i < 16)
>> +                       vgic_bitmap_set_irq_val(&dist->irq_enabled,
>> +                                               vcpu->vcpu_id, i, 1);
>> +               vgic_cpu->vgic_irq_lr_map[i] = 0xff;
>> +       }
>> +
>> +       BUG_ON(!vcpu->kvm->arch.vgic.vctrl_base);
>> +       vgic_cpu->nr_lr = (readl_relaxed(vcpu->kvm->arch.vgic.vctrl_base + GICH_VTR) & 0x1f) + 1;
>> +       for (i = 0; i < vgic_cpu->nr_lr; i++)
>> +               vgic_cpu->vgic_lr_irq_map[i] = VGIC_NR_IRQS;
>> +
>> +       vgic_cpu->vgic_mcr = readl_relaxed(vcpu->kvm->arch.vgic.vctrl_base + GICH_VMCR);
>> +       vgic_cpu->vgic_mcr |= 0xf << 28; /* Priority */
> 
> uh, why is this 0xf << 28? shouldn't it be 0x1f << 27 ?

Well, it doesn't really matter, as we inject all interrupts with a 0
priority. But yes, 0x1f << 27 is probably the right thing.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...




[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