Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp748345pxb; Fri, 3 Sep 2021 12:31:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx90HjD6gvXiKtxeXN0WQbgmA6eNkmGf91YtF37qe1oFrUt/XbLW/2PL6XfZubz7QcaZNdo X-Received: by 2002:a05:6e02:214b:: with SMTP id d11mr370184ilv.239.1630697487667; Fri, 03 Sep 2021 12:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630697487; cv=none; d=google.com; s=arc-20160816; b=mVtYRLyzTgQgFlFH7CtEn3ZLOlrD+axqXLzCbPL8jyClqDdSFxQ6y9DAtDm9GUe2ZG qAhXOEtb/+xQtOw220AP37mfcRAAXOBWoVik6dAjFnURN5VuWIh1tCZGAk/HVmDznWwD GgvnDLqZKCxbYDtgUblBQvBEixooaUoVFQbxWEVe3sEDRV11CcUT4whVCa2lKEL71tYI LziPAxVrWPS8sJwOPwF35gKcytbED4oTqShnKrRLnifYuPDRGRf5cmSsohU9HNZ2AsD3 ToDRjLMwNDzlMUpsQRk6QfC9M4Wbp5XxYzuWpFI9hkZkRu871mq3VTOqpYWWu9hNdVBh Xn8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hs5R959SOHm+FY2nHSnYB8p0QSZDrkCRkJApp51mQfY=; b=YJz/H5n/OptJyQPK9nsyqUDURwmmK2p5ltrytWEB8yhP+yH8sBb9AwG5J+FcQZDFcH M0hwLR/1pyuxtaWZDWqUMriUa9ahpkNN2o1tCzhq3mppcH63Zp4cPeVJnzTaFyciX4Bl maZijj7qPQGtxa2lSOzEpbEwpoWLllAszV5JWNg0ML666qngroiPje7lsM2lo365klGW hoWE//sLI9ERqTk+iyug1C909HYTLrXTVCNJsxJRTUMoL2YcoucrSiwi/JRyr6S5v2Mb Qe40ywVxD65aPi7xj5Fsgue5YtuvJAu2q2lylvQbFhhAOL7Jdj2ZgPXe7tCIF4GdayWL oiZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=sVl7qEq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si243619ilu.80.2021.09.03.12.31.16; Fri, 03 Sep 2021 12:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=sVl7qEq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232516AbhICSWf (ORCPT + 99 others); Fri, 3 Sep 2021 14:22:35 -0400 Received: from mail.skyhub.de ([5.9.137.197]:45188 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbhICSWf (ORCPT ); Fri, 3 Sep 2021 14:22:35 -0400 Received: from zn.tnic (p200300ec2f0d58000d44f02d043b904a.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:5800:d44:f02d:43b:904a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B24201EC0287; Fri, 3 Sep 2021 20:21:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1630693293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=hs5R959SOHm+FY2nHSnYB8p0QSZDrkCRkJApp51mQfY=; b=sVl7qEq4MBIoEdWUGYfhXOReT71JBg8eR4VGKyDJsHFqzpuL0PqAtzkBeVh9sqgsQhYwsd U/avLGOMLZlAjiUGGDSaTA1dsJYeg+/aV02O0Sir1Qd7JzHQ+jaVIM8m4HmhcJGgjE+ai1 ZwHWaC0SHGAci2vIEwkQz9cyo7zMeq8= Date: Fri, 3 Sep 2021 20:22:08 +0200 From: Borislav Petkov To: Kuppuswamy Sathyanarayanan 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 Subject: Re: [PATCH v6 01/11] x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT Message-ID: References: <20210903172812.1097643-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210903172812.1097643-2-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210903172812.1097643-2-sathyanarayanan.kuppuswamy@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ Note the empty space after the '#' of the inner ifdef to show that it is an inner one. Also, this header has clearly too many #if*def __ASSEMBLY__ things sprinkled around. Lemme see if I can get rid of them so that it is at least a bit readable. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette