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


Groups > linux.kernel > #1195173 > unrolled thread

[PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check

Started byPaolo Bonzini <pbonzini@redhat.com>
First post2015-07-29 15:30 +0200
Last post2015-07-30 09:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check Paolo Bonzini <pbonzini@redhat.com> - 2015-07-29 15:30 +0200
    Re: [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel  check Steve Rutherford <srutherford@google.com> - 2015-07-30 06:40 +0200
      Re: [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel  check Paolo Bonzini <pbonzini@redhat.com> - 2015-07-30 09:30 +0200

#1195173 — [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check

FromPaolo Bonzini <pbonzini@redhat.com>
Date2015-07-29 15:30 +0200
Subject[PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check
Message-ID<pRzAK-Um-7@gated-at.bofh.it>
The PIT is only created if irqchip_in_kernel returns true, so the
check is superfluous.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/i8254.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index f90952f64e79..f588eb7bdf45 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -333,7 +333,7 @@ static void create_pit_timer(struct kvm *kvm, u32 val, int is_period)
 	struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state;
 	s64 interval;
 
-	if (!irqchip_in_kernel(kvm) || ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)
+	if (ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)
 		return;
 
 	interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ);
-- 
1.8.3.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1195711 — Re: [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check

FromSteve Rutherford <srutherford@google.com>
Date2015-07-30 06:40 +0200
SubjectRe: [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check
Message-ID<pRNNo-4sV-1@gated-at.bofh.it>
In reply to#1195173
On Wed, Jul 29, 2015 at 03:28:57PM +0200, Paolo Bonzini wrote:
> The PIT is only created if irqchip_in_kernel returns true, so the
> check is superfluous.
I poked around. Looks to me like the existence of an IOAPIC is not
checked on the creation of the in-kernel PIT. Userspace might limit itself to
that scenario (PIT implies IOAPIC in-kernel), but that isn't enforced at PIT
creation.

It's worth adding that check in.

> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  arch/x86/kvm/i8254.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
> index f90952f64e79..f588eb7bdf45 100644
> --- a/arch/x86/kvm/i8254.c
> +++ b/arch/x86/kvm/i8254.c
> @@ -333,7 +333,7 @@ static void create_pit_timer(struct kvm *kvm, u32 val, int is_period)
>  	struct kvm_kpit_state *ps = &kvm->arch.vpit->pit_state;
>  	s64 interval;
>  
> -	if (!irqchip_in_kernel(kvm) || ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)
> +	if (ps->flags & KVM_PIT_FLAGS_HPET_LEGACY)
>  		return;
>  
>  	interval = muldiv64(val, NSEC_PER_SEC, KVM_PIT_FREQ);
> -- 
> 1.8.3.1
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1195757 — Re: [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check

FromPaolo Bonzini <pbonzini@redhat.com>
Date2015-07-30 09:30 +0200
SubjectRe: [PATCH 3/4] KVM: i8254: remove unnecessary irqchip_in_kernel check
Message-ID<pRQrU-8ly-7@gated-at.bofh.it>
In reply to#1195711

On 30/07/2015 06:36, Steve Rutherford wrote:
> On Wed, Jul 29, 2015 at 03:28:57PM +0200, Paolo Bonzini wrote:
>> > The PIT is only created if irqchip_in_kernel returns true, so the
>> > check is superfluous.
> I poked around. Looks to me like the existence of an IOAPIC is not
> checked on the creation of the in-kernel PIT.

You're right, and presumably it's also legal to create the PIT before
KVM_CREATE_IRQCHIP.

> Userspace might limit itself to
> that scenario (PIT implies IOAPIC in-kernel), but that isn't enforced at PIT
> creation.

I'll play with the "PIT without IOAPIC" scenario and see if something
breaks badly with this patch.  From reading the code it seems like it
should not introduce any problems (oopses or similar), but I'll set this
patch aside for now.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web