From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932484AbbCELNl (ORCPT ); Thu, 5 Mar 2015 06:13:41 -0500 Received: from mga11.intel.com ([192.55.52.93]:24000 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932318AbbCELNj (ORCPT ); Thu, 5 Mar 2015 06:13:39 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,346,1422950400"; d="scan'208";a="687294734" Message-ID: <54F83A61.3090906@linux.intel.com> Date: Thu, 05 Mar 2015 19:13:37 +0800 From: "Li, Aubrey" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ingo Molnar , Arjan van de Ven CC: Borislav Petkov , "alan@linux.intel.com" , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , "Rafael J. Wysocki" , Len.Brown@intel.com, x86@kernel.org, LKML Subject: Re: [PATCH] x86: Bypass legacy PIC and PIT on ACPI hardware reduced platform References: <54F67ACC.3010500@linux.intel.com> <20150304050858.GB5158@gmail.com> <54F69774.2050400@linux.intel.com> <20150304053106.GA3701@gmail.com> <54F6A08B.2010105@linux.intel.com> <20150304073717.GA11736@gmail.com> <54F6C59C.706@linux.intel.com> <20150304095011.GH3233@pd.tnic> <54F71888.4040608@linux.intel.com> <20150304201102.GA6530@gmail.com> In-Reply-To: <20150304201102.GA6530@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/3/5 4:11, Ingo Molnar wrote: > > * Arjan van de Ven wrote: > >> On 3/4/2015 1:50 AM, Borislav Petkov wrote: >>> On Wed, Mar 04, 2015 at 12:43:08AM -0800, Arjan van de Ven wrote: >>>>> >>>>> Using 'acpi_gbl_reduced_hardware' flag outside the ACPI code >>>>> is a mistake. >>>> >>>> ideally, the presence of that flag in the firmware table will clear/set more global settings, >>>> for example, having that flag should cause the 8042 input code to not probe for the 8042. >>>> >>>> for interrupts, there really ought to be a "apic first/only" mode, which is then used on >>>> all modern systems (not just hw reduced). >>> >>> Do we need some sort of platform-specific querying interfaces now too, >>> similar to cpu_has()? I.e., platform_has()... >>> >>> if (platform_has(X86_PLATFORM_REDUCED_HW)) >>> do stuff.. >> >> more like >> >> platform_has(X86_PLATFORM_PIT) >> >> etc, one for each legacy io item > > Precisely. The main problem is the generic, 'lumps everything > together' nature of the acpi_gbl_reduced_hardware flag. > > (Like the big kernel lock lumped together all sorts of locking rules > and semantics.) > > Properly split out, feature-ish or driver-ish interfaces for PIT and > other legacy details are the proper approach to 'turn them off'. > > - x86_platform is a function pointer driven, driver-ish interface. > > - platform_has(X86_PLATFORM_IT) is a flag driven, feature-flag-ish > interface. > > Both are fine - for something as separate as the PIT (or the PIC) it > might make more sense to go towards a 'driver' interface though, as > modern drivers are (and will be) much different from the legacy PIT. > > Whichever method is used, low level platforms can just switch them > on/off in their enumeration/detection routines, while the generic code > will have them enabled by default. Whichever method is used, we will face a problem how to determine PIT exists or not. When we enabled Bay Trail-T platform at the beginning, we were trying to make the code as generic as possible, and it works properly up to now. So we don't have a SUBARCH like X86_SUBARCH_INTEL_MID to use the platform specific functions. And for now I'm not quite sure it's a good idea to create one. If we make it as a flag driven, I don't know there is a flag in firmware better than ACPI HW reduced flag(Of course it's not good enough to cover all the cases). Or if we want to use platform info to turn on/off this flag, we'll have to maintain a platform list, which may be longer and more complicated than worth doing that. Thanks, -Aubrey > >> so we can clear it on hw reduced, but also in other cases. hw >> reduced is one way, but I'd be surprised if there weren't other ways >> (like quirks) where we'd want to do the same things > > Exactly. The key step is the proper, clean separation out of hardware > interfaces. > > Thanks, > > Ingo > >