Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752621AbcD1XKg (ORCPT ); Thu, 28 Apr 2016 19:10:36 -0400 Received: from relay1.sgi.com ([192.48.180.66]:57025 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751837AbcD1XKe (ORCPT ); Thu, 28 Apr 2016 19:10:34 -0400 Message-Id: <20160428231031.727194291@asylum.americas.sgi.com> References: <20160428231031.265120287@asylum.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Thu, 28 Apr 2016 18:10:33 -0500 From: Mike Travis To: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton , Len Brown , Dimitri Sivanich Cc: Russ Anderson , John Estabrook , Andrew Banman , Nathan Zimmer , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/21] X86_64, UV: Add UV Architecture Defines Content-Disposition: inline; filename=uv4_add_is_uvX_conditionals Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2197 Lines: 88 Add defines to control which UV architectures are supported, and modify the 'if (is_uvX_*)' functions to return constant 0 for those not supported. This will help optimize code paths when support for specific UV arches is removed. Signed-off-by: Mike Travis Reviewed-by: Dimitri Sivanich Tested-by: John Estabrook Tested-by: Gary Kroening Tested-by: Nathan Zimmer --- arch/x86/include/asm/uv/uv_hub.h | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) --- linux.orig/arch/x86/include/asm/uv/uv_hub.h +++ linux/arch/x86/include/asm/uv/uv_hub.h @@ -178,22 +178,43 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __ #define UV3_HUB_REVISION_BASE 5 #define UV4_HUB_REVISION_BASE 7 +#ifdef UV1_HUB_IS_SUPPORTED static inline int is_uv1_hub(void) { return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE; } +#else +static inline int is_uv1_hub(void) +{ + return 0; +} +#endif +#ifdef UV2_HUB_IS_SUPPORTED static inline int is_uv2_hub(void) { return ((uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) && (uv_hub_info->hub_revision < UV3_HUB_REVISION_BASE)); } +#else +static inline int is_uv2_hub(void) +{ + return 0; +} +#endif +#ifdef UV3_HUB_IS_SUPPORTED static inline int is_uv3_hub(void) { return ((uv_hub_info->hub_revision >= UV3_HUB_REVISION_BASE) && (uv_hub_info->hub_revision < UV4_HUB_REVISION_BASE)); } +#else +static inline int is_uv3_hub(void) +{ + return 0; +} +#endif #ifdef UV4_HUB_IS_SUPPORTED static inline int is_uv4_hub(void) @@ -207,15 +228,20 @@ static inline int is_uv4_hub(void) } #endif -static inline int is_uv_hub(void) +static inline int is_uvx_hub(void) { - return uv_hub_info->hub_revision; + if (uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE) + return uv_hub_info->hub_revision; + + return 0; } -/* code common to uv2/3/4 only */ -static inline int is_uvx_hub(void) +static inline int is_uv_hub(void) { - return uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE; +#ifdef UV1_HUB_IS_SUPPORTED + return uv_hub_info->hub_revision; +#endif + return is_uvx_hub(); } union uvh_apicid { --