From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253AbdAJFN6 (ORCPT ); Tue, 10 Jan 2017 00:13:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60564 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752112AbdAJFKE (ORCPT ); Tue, 10 Jan 2017 00:10:04 -0500 Date: Tue, 10 Jan 2017 13:09:58 +0800 From: Peter Xu To: David Hildenbrand Cc: Radim =?utf-8?B?S3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH v2 2/6] KVM: x86: decouple irqchip_in_kernel() and pic_irqchip() Message-ID: <20170110050958.GI4135@pxdev.xzpeter.org> References: <20161216151006.11776-1-rkrcmar@redhat.com> <20161216151006.11776-3-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 10 Jan 2017 05:10:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 03, 2017 at 01:56:23PM +0100, David Hildenbrand wrote: > Am 16.12.2016 um 16:10 schrieb Radim Krčmář: > >irqchip_in_kernel() tried to save a bit by reusing pic_irqchip(), but it > >just complicated the code. > >Add a separate state for the irqchip mode. > > > >Signed-off-by: Radim Krčmář > >--- > > v2: change two bools into one enum and rename everything [Paolo] > >--- > > arch/x86/include/asm/kvm_host.h | 8 +++++++- > > arch/x86/kvm/irq.h | 15 ++++++++------- > > arch/x86/kvm/x86.c | 5 +++-- > > 3 files changed, 18 insertions(+), 10 deletions(-) > > > >diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > >index 7892530cbacf..d3acd295446d 100644 > >--- a/arch/x86/include/asm/kvm_host.h > >+++ b/arch/x86/include/asm/kvm_host.h > >@@ -715,6 +715,12 @@ struct kvm_hv { > > HV_REFERENCE_TSC_PAGE tsc_ref; > > }; > > > >+enum kvm_irqchip_mode { > >+ KVM_IRQCHIP_NONE, > >+ KVM_IRQCHIP_KERNEL, /* created with KVM_CREATE_IRQCHIP */ > >+ KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */ > > Was wondering if FULL/SPLIT would be a better naming. However I also > find irqchip_kernel() vs irqchip_in_kernel() slightly confusing. Me too. Since we have kvm_irqchip_mode enum above, how about renaming irqchip_{kernel|split}() into irqchip_mode_{kernel|split}()? Sorry for such a late comment... -- peterx