From nobody Thu Nov 21 16:50:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=quarantine dis=quarantine) header.from=epam.com ARC-Seal: i=1; a=rsa-sha256; t=1725552090; cv=none; d=zohomail.com; s=zohoarc; b=BTU2fJVjbJTyvoXXbRX6oYAeFDRA5QoXSABy0RmBzHlKG8U6qzmjfCSqxt6oG01osu5fDnGFqxHfHBkpM+piVevCHusMyb26JLilS5LrsWF4clLBQ2aJxX+SbCcBSwWJKOpauX+Jw8uhhQa6umck5IGQcGI3sWz0o/yTmO8AePc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725552090; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lz6Gc2DZ28SPclNdaJoAMMfIqI5n2deEAjxbtQvx/2Q=; b=aPeZWgFio7SpHsozMv24REcGUGhzSKUl920+tT/QN9Dn9yehNZ7OPtxU9gpXRy7TU6EddZL0MUG0YWuKEj5SIWJoht+CkDJbUQQhiIlYI4VIHJGVNR7sUmHVE5WC/ChrREZ9o2m8Bx6TvX2TeWa0RyqFXELYgWhwVktpaiGr2Wk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725552089896645.5452416521479; Thu, 5 Sep 2024 09:01:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.791255.1201121 (Exim 4.92) (envelope-from ) id 1smEuy-0007Ig-B7; Thu, 05 Sep 2024 16:01:08 +0000 Received: by outflank-mailman (output) from mailman id 791255.1201121; Thu, 05 Sep 2024 16:01:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1smEuy-0007IZ-8P; Thu, 05 Sep 2024 16:01:08 +0000 Received: by outflank-mailman (input) for mailman id 791255; Thu, 05 Sep 2024 16:01:07 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1smEux-0007IF-9b for xen-devel@lists.xenproject.org; Thu, 05 Sep 2024 16:01:07 +0000 Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0cb79e48-6ba0-11ef-99a1-01e77a169b0f; Thu, 05 Sep 2024 18:01:03 +0200 (CEST) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id C324D25512; Thu, 5 Sep 2024 12:01:01 -0400 (EDT) (envelope-from sakib@darkstar.site) Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id B364225511; Thu, 5 Sep 2024 12:01:01 -0400 (EDT) (envelope-from sakib@darkstar.site) Received: from localhost (unknown [176.8.169.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 5E2872550E; Thu, 5 Sep 2024 12:01:00 -0400 (EDT) (envelope-from sakib@darkstar.site) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0cb79e48-6ba0-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; s=sasl; bh=zPOXA8NaqMQ6JOGieGrJ4xhhf42V86TduaJ5Pc2JdxA=; b=MIqX I0G2RMiNIfvI2eO1HMb2kPF/s0NceP6V+wJn/abRVAYFlTK5gzyKAz2CpZm4RW9U UNX8hFOD2d/GfXVl+RNhiqZtKBbOyxV3cYNgOh0jXsvx0aVwzfSjtxCheeB65Ts9 CpxGgj6ec/KfErvlJZo3L18DdkJr5YCEu5Sm5u4= From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v1] x86/mwait-idle: add dependency on general Intel CPU support Date: Thu, 5 Sep 2024 19:00:58 +0300 Message-Id: <20240905160058.493057-1-Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Pobox-Relay-ID: 0B869A7C-6BA0-11EF-8C15-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @pobox.com) X-ZM-MESSAGEID: 1725552095302116600 Content-Type: text/plain; charset="utf-8" Currently mwait_idle driver in Xen only implements support for Intel CPUs. Thus in order to reduce dead code in non-Intel build configurations it can be made explicitly dependant on CONFIG_INTEL option. Signed-off-by: Sergiy Kibrik --- xen/arch/x86/cpu/Makefile | 2 +- xen/arch/x86/include/asm/cpuidle.h | 7 +++++++ xen/arch/x86/include/asm/mwait.h | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile index eafce5f204..7cfe28b7ec 100644 --- a/xen/arch/x86/cpu/Makefile +++ b/xen/arch/x86/cpu/Makefile @@ -8,7 +8,7 @@ obj-y +=3D common.o obj-y +=3D hygon.o obj-y +=3D intel.o obj-y +=3D intel_cacheinfo.o -obj-y +=3D mwait-idle.o +obj-$(CONFIG_INTEL) +=3D mwait-idle.o obj-y +=3D shanghai.o obj-y +=3D vpmu.o obj-$(CONFIG_AMD) +=3D vpmu_amd.o diff --git a/xen/arch/x86/include/asm/cpuidle.h b/xen/arch/x86/include/asm/= cpuidle.h index 707b3e948d..fde2fa7b08 100644 --- a/xen/arch/x86/include/asm/cpuidle.h +++ b/xen/arch/x86/include/asm/cpuidle.h @@ -15,7 +15,14 @@ extern void (*lapic_timer_on)(void); =20 extern uint64_t (*cpuidle_get_tick)(void); =20 +#ifdef CONFIG_INTEL int mwait_idle_init(struct notifier_block *nfb); +#else +static inline int mwait_idle_init(struct notifier_block *nfb) +{ + return -ENOSYS; +} +#endif int cpuidle_init_cpu(unsigned int cpu); void cf_check default_dead_idle(void); void cf_check acpi_dead_idle(void); diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mw= ait.h index 9298f987c4..000a692f6d 100644 --- a/xen/arch/x86/include/asm/mwait.h +++ b/xen/arch/x86/include/asm/mwait.h @@ -14,6 +14,13 @@ #define MWAIT_ECX_INTERRUPT_BREAK 0x1 =20 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx); +#ifdef CONFIG_INTEL bool mwait_pc10_supported(void); +#else +static inline bool mwait_pc10_supported(void) +{ + return false; +} +#endif =20 #endif /* __ASM_X86_MWAIT_H__ */ --=20 2.25.1