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

Re: [Xen-devel] [PATCH 31/57] ARM: new VGIC: Add IRQ sync/flush framework



Hi,

On 07/03/18 11:47, Julien Grall wrote:
> Hi Andre,
> 
> On 03/05/2018 04:03 PM, Andre Przywara wrote:
>> Implement the framework for syncing IRQs between our emulation and the
>> list registers, which represent the guest's view of IRQs.
>> This is done in kvm_vgic_flush_hwstate and kvm_vgic_sync_hwstate, which
> 
> You probably want to update the names here.
> 
>> gets called on guest entry and exit.
>> The code talking to the actual GICv2/v3 hardware is added in the
>> following patches.
>>
>> This is based on Linux commit 0919e84c0fc1, written by Marc Zyngier.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@xxxxxxxxxx>
> 
> [...]
> 
>> +/**
>> + * vgic_sync_from_lrs() - Update VGIC state from hardware after a
>> guest's run.
>> + * @vcpu: the VCPU for which to transfer from the LRs to the IRQ list.
>> + *
>> + * Sync back the hardware VGIC state after the guest has run, into our
>> + * VGIC emulation structures, It reads the LRs and updates the
>> respective
>> + * struct vgic_irq, taking level/edge into account.
>> + * This is the high level function which takes care of the conditions,
>> + * also bails out early if there were no interrupts queued.
>> + * Was: kvm_vgic_sync_hwstate()
>> + */
>> +void vgic_sync_from_lrs(struct vcpu *vcpu)
>> +{
>> +    /* An empty ap_list_head implies used_lrs == 0 */
>> +    if ( list_empty(&vcpu->arch.vgic.ap_list_head) )
>> +        return;
>> +
>> +    vgic_fold_lr_state(vcpu);
> 
> OOI, why did you drop the "if (vgic_cpu->used_lrs)" here? It looks like
> to me you want to avoid calling that function when no LRs are been used.

This is now done in the function itself. I found it cleaner this way. I
believe we will see the actual implementation of vgic_fold_lr_state()
move into this very file here, so it shouldn't make a difference.

Cheers,
Andre.

>> +
>> +    vgic_prune_ap_list(vcpu);
>> +}
> 
> Cheers,
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.