Re: [PATCH 2/5] KVM: arm64: arch_timer: Remove VGIC initialization check

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

 



Hi Alexandru,

On 12/1/20 4:01 PM, Alexandru Elisei wrote:
> kvm_timer_enable() is called in kvm_vcpu_first_run_init() after
> kvm_vgic_map_resources() if the VGIC wasn't ready. kvm_vgic_map_resources()
> is the only place where kvm->arch.vgic.ready is set to true.
> 
> For a v2 VGIC, kvm_vgic_map_resources() will attempt to initialize the VGIC
> and set the initialized flag.
> 
> For a v3 VGIC, kvm_vgic_map_resources() will return an error code if the
> VGIC isn't already initialized.
> 
> The end result is that if we've reached kvm_timer_enable(), the VGIC is
> initialzed and ready and vgic_initialized() will always be true, so remove
> this check.
> 
> Signed-off-by: Alexandru Elisei <alexandru.elisei@xxxxxxx>
> ---
>  arch/arm64/kvm/arch_timer.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c
> index 32ba6fbc3814..2e0ca8bcc6ff 100644
> --- a/arch/arm64/kvm/arch_timer.c
> +++ b/arch/arm64/kvm/arch_timer.c
> @@ -1129,9 +1129,6 @@ int kvm_timer_enable(struct kvm_vcpu *vcpu)
>  	if (!irqchip_in_kernel(vcpu->kvm))
>  		goto no_vgic;
>  
> -	if (!vgic_initialized(vcpu->kvm))
> -		return -ENODEV;
> -
>  	if (!timer_irqs_are_valid(vcpu)) {
>  		kvm_debug("incorrectly configured timer irqs\n");
>  		return -EINVAL;
>
The only concern I have is if some future contributor forgets the
constraint. Maybe add a comment (as bug on is frown upon by scripts).

Reviewed-by: Eric Auger <eric.auger@xxxxxxxxxx>

Thanks

Eric


_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/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