From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48FE4C433F5 for ; Fri, 3 Sep 2021 19:04:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2438F60E93 for ; Fri, 3 Sep 2021 19:04:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350608AbhICTFB (ORCPT ); Fri, 3 Sep 2021 15:05:01 -0400 Received: from mga06.intel.com ([134.134.136.31]:60244 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbhICTE7 (ORCPT ); Fri, 3 Sep 2021 15:04:59 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10096"; a="280506307" X-IronPort-AV: E=Sophos;i="5.85,266,1624345200"; d="scan'208";a="280506307" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 12:03:59 -0700 X-IronPort-AV: E=Sophos;i="5.85,266,1624345200"; d="scan'208";a="462502843" Received: from nadeshpa-mobl1.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.213.188.116]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 12:03:58 -0700 Subject: Re: [PATCH v6 01/11] x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , x86@kernel.org, Paolo Bonzini , Juergen Gross , Deep Shah , VMware Inc , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org References: <20210903172812.1097643-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210903172812.1097643-2-sathyanarayanan.kuppuswamy@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <256d0f5b-3a6d-0912-2edc-44b4a0889c73@linux.intel.com> Date: Fri, 3 Sep 2021 12:03:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/3/21 11:22 AM, Borislav Petkov wrote: > On Fri, Sep 03, 2021 at 10:28:02AM -0700, Kuppuswamy Sathyanarayanan wrote: >> diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h >> index c5ce9845c999..ddc77c95adc6 100644 >> --- a/arch/x86/include/asm/irqflags.h >> +++ b/arch/x86/include/asm/irqflags.h >> @@ -59,27 +59,8 @@ static inline __cpuidle void native_halt(void) >> >> #endif >> >> -#ifdef CONFIG_PARAVIRT_XXL >> -#include >> -#else >> +#ifndef CONFIG_PARAVIRT >> #ifndef __ASSEMBLY__ >> -#include >> - >> -static __always_inline unsigned long arch_local_save_flags(void) >> -{ >> - return native_save_fl(); >> -} >> - >> -static __always_inline void arch_local_irq_disable(void) >> -{ >> - native_irq_disable(); >> -} >> - >> -static __always_inline void arch_local_irq_enable(void) >> -{ >> - native_irq_enable(); >> -} >> - >> /* >> * Used in the idle loop; sti takes one instruction cycle >> * to complete: >> @@ -97,6 +78,33 @@ static inline __cpuidle void halt(void) >> { >> native_halt(); >> } >> +#endif /* __ASSEMBLY__ */ >> +#endif /* CONFIG_PARAVIRT */ >> + >> +#ifdef CONFIG_PARAVIRT >> +#ifndef __ASSEMBLY__ >> +#include >> +#endif /* __ASSEMBLY__ */ >> +#endif /* CONFIG_PARAVIRT */ > > I think the way we write those is like this: > > #ifdef CONFIG_PARAVIRT > > # ifndef __ASSEMBLY__ > # include > # endif > > #else /* ! CONFIG_PARAVIRT */ > > # ifndef __ASSEMBLY__ > /* > * Used in the idle loop; sti takes one instruction cycle > * to complete: > */ > static inline __cpuidle void arch_safe_halt(void) > { > native_safe_halt(); > } > > /* > * Used when interrupts are already enabled or to > * shutdown the processor: > */ > static inline __cpuidle void halt(void) > { > native_halt(); > } > # endif /* __ASSEMBLY__ */ > > #endif /* CONFIG_PARAVIRT */ Yes, I can combine the #ifdef as you have mentioned. I can fix this in next version. > > Note the empty space after the '#' of the inner ifdef to show that it is > an inner one. Is this new convention? #ifdefs used in this file does not follow this format. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer