Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1528792

Re: [PATCH] KVM: x86: check for pic and ioapic presence before use

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] KVM: x86: check for pic and ioapic presence before use
Date 2016-11-23 23:00 +0100
Message-ID <sGNK9-1Sn-7@gated-at.bofh.it> (permalink)
References <sGMl4-1a7-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 23/11/2016 21:25, Radim Krčmář wrote:
> diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c
> index 25810b144b58..ddd63b8b176e 100644
> --- a/arch/x86/kvm/irq_comm.c
> +++ b/arch/x86/kvm/irq_comm.c
> @@ -41,6 +41,15 @@ static int kvm_set_pic_irq(struct kvm_kernel_irq_routing_entry *e,
>  			   bool line_status)
>  {
>  	struct kvm_pic *pic = pic_irqchip(kvm);
> +
> +	/*
> +	 * XXX: rejecting pic routes when pic isn't in use would be better,
> +	 * but the default routing table is installed while kvm->arch.vpic is
> +	 * NULL and KVM_CREATE_IRQCHIP can race with KVM_SET_GSI_ROUTING.
> +	 */
> +	if (!pic)
> +		return -1;
> +
>  	return kvm_pic_set_irq(pic, e->irqchip.pin, irq_source_id, level);
>  }
>  

Can you explain the race with the default routing table better?  It
seems to me that it can only make the routing table go from invalid to
valid (there is no KVM_DESTROY_IRQCHIP) so it's benign.

Paolo

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] KVM: x86: check for pic and ioapic presence before use Radim Krčmář <rkrcmar@redhat.com> - 2016-11-23 21:30 +0100
  Re: [PATCH] KVM: x86: check for pic and ioapic presence before use Paolo Bonzini <pbonzini@redhat.com> - 2016-11-23 23:00 +0100
    Re: [PATCH] KVM: x86: check for pic and ioapic presence before use Radim Krčmář <rkrcmar@redhat.com> - 2016-11-24 13:50 +0100
      Re: [PATCH] KVM: x86: check for pic and ioapic presence before use Paolo Bonzini <pbonzini@redhat.com> - 2016-11-24 17:40 +0100

csiph-web