Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752057AbeAPLDC (ORCPT + 1 other); Tue, 16 Jan 2018 06:03:02 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:14883 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751395AbeAPLDA (ORCPT ); Tue, 16 Jan 2018 06:03:00 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="35362856" Subject: Re: [PATCH] x86/jailhouse: fix building without X86_X2APIC To: Arnd Bergmann CC: Jan Kiszka , Thomas Gleixner , the arch/x86 maintainers , , Ingo Molnar , "H. Peter Anvin" , Juergen Gross , Linux Kernel Mailing List References: <20180115202335.1645883-1-arnd@arndb.de> <4284ee79-a87c-a47d-7e96-682bdd8754e1@cn.fujitsu.com> <86917190-5499-3fb8-7b5c-736dc2daeca5@cn.fujitsu.com> From: Dou Liyang Message-ID: Date: Tue, 16 Jan 2018 19:02:51 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 085FE48AEA0D.AEB2D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Arnd, At 01/16/2018 04:50 PM, Arnd Bergmann wrote: > On Tue, Jan 16, 2018 at 9:17 AM, Dou Liyang wrote: >> Hi Arnd, >> >> [...] >>>> >>>> The reason I don't want to expose the x2apic_mode and x2apic_phys is >>>> that they may be misused in X2APIC=n case. So I create an interface to >>>> wrap it. do you think so? ;-) >>> >>> >>> I'm not sure I follow what the intention of that is. If you want to hide >> >> >> My purpose of that is hiding the variables in X2APIC=n case. > > But why? I'd say either hide them all the time, or don't hide them at all. > In this case, I prefer to hide them all the time. >>> I see nothing wrong it with this, but also don't see anything it does >>> that improves the interface. >>> >> >> Another way we can choice is wrap the code with "CONFIG_X86_X2APIC". >> > > But why? That just makes perfectly reasonably code uglier. Generally > speaking, compiler conditionals are better than preprocessor conditionals > for this, as they are easier to read and provide better compile-time coverage > when things go wrong, such as the missing declaration. > Yes, Indeed. Thank you for telling me that. Thanks, dou.