X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=virt%2Fkvm%2Farm%2Fhyp%2Fvgic-v3-sr.c;fp=virt%2Fkvm%2Farm%2Fhyp%2Fvgic-v3-sr.c;h=0351f0a0a49d2e9795ce98ef3bef43a8e3541800;hb=f1acc5bd248cff4d79995cfe695d9e6d48f2f9f8;hp=86824e99ecb8d4aeae4af4107096fd6591e64900;hpb=8b760f8176386ce249b13a472046e4182623e6aa;p=mirror_ubuntu-zesty-kernel.git diff --git a/virt/kvm/arm/hyp/vgic-v3-sr.c b/virt/kvm/arm/hyp/vgic-v3-sr.c index 86824e99ecb8..0351f0a0a49d 100644 --- a/virt/kvm/arm/hyp/vgic-v3-sr.c +++ b/virt/kvm/arm/hyp/vgic-v3-sr.c @@ -701,6 +701,30 @@ static void __hyp_text __vgic_v3_bump_eoicount(void) write_gicreg(hcr, ICH_HCR_EL2); } +static void __hyp_text __vgic_v3_write_dir(struct kvm_vcpu *vcpu, + u32 vmcr, int rt) +{ + u32 vid = vcpu_get_reg(vcpu, rt); + u64 lr_val; + int lr; + + /* EOImode == 0, nothing to be done here */ + if (!(vmcr & ICH_VMCR_EOIM_MASK)) + return; + + /* No deactivate to be performed on an LPI */ + if (vid >= VGIC_MIN_LPI) + return; + + lr = __vgic_v3_find_active_lr(vcpu, vid, &lr_val); + if (lr == -1) { + __vgic_v3_bump_eoicount(); + return; + } + + __vgic_v3_clear_active_lr(lr, lr_val); +} + static void __hyp_text __vgic_v3_write_eoir(struct kvm_vcpu *vcpu, u32 vmcr, int rt) { u32 vid = vcpu_get_reg(vcpu, rt); @@ -995,6 +1019,9 @@ int __hyp_text __vgic_v3_perform_cpuif_access(struct kvm_vcpu *vcpu) else fn = __vgic_v3_write_bpr0; break; + case ICC_DIR_EL1: + fn = __vgic_v3_write_dir; + break; default: return 0; }