[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b649d697-710d-91f1-1090-e32c8211c2fa@cn.fujitsu.com>
Date: Tue, 16 Jan 2018 19:02:51 +0800
From: Dou Liyang <douly.fnst@...fujitsu.com>
To: Arnd Bergmann <arnd@...db.de>
CC: Jan Kiszka <jan.kiszka@...mens.com>,
Thomas Gleixner <tglx@...utronix.de>,
the arch/x86 maintainers <x86@...nel.org>,
<jailhouse-dev@...glegroups.com>, Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Juergen Gross <jgross@...e.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/jailhouse: fix building without X86_X2APIC
Hi Arnd,
At 01/16/2018 04:50 PM, Arnd Bergmann wrote:
> On Tue, Jan 16, 2018 at 9:17 AM, Dou Liyang <douly.fnst@...fujitsu.com> 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.
Powered by blists - more mailing lists