From nobody Wed Dec 4 08:41:30 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=1726651177; cv=none; d=zohomail.com; s=zohoarc; b=AzYFJ0pkRGgQeEY4IEr0Xz7kwX4F90heioy5lJIEDfKbeMQhv+ewpdogh8q5I7/8SwLsUvjtQB8cBp3gtlFHOrnuI9C7cs48KXdNCUr/ePJE9yWlrBGHo7ddS8rmMHXYRyQ1WCt1XynOELXbjAfqaCAe0UAtJoM7grXqukZKVcY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726651177; 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=eDdj+DXC0s/jFFVi2BvRHuUnA3irlY6gD7NvejKsFXM=; b=IoiAWnXWD+0psdHursIGTExii9peytrt2XvuSfQ9wnQ/QGULGzDUqHiaOTg3503BGgsTxoqjIcCCa+EKEvpPe32G/NJqMC0UC/tk8wOsU5CTdumozgy4vf1MBr2AXbhhm46qyUHn5SAzxpSowU0kgCO/w4Z0fVGf9SHUZk7BTWU= 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 1726651177778823.1578832395699; Wed, 18 Sep 2024 02:19:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.800204.1210101 (Exim 4.92) (envelope-from ) id 1sqqqE-0008Ry-8k; Wed, 18 Sep 2024 09:19:18 +0000 Received: by outflank-mailman (output) from mailman id 800204.1210101; Wed, 18 Sep 2024 09:19:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sqqqE-0008Rr-62; Wed, 18 Sep 2024 09:19:18 +0000 Received: by outflank-mailman (input) for mailman id 800204; Wed, 18 Sep 2024 09:19:17 +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 1sqqqC-0008Rj-U4 for xen-devel@lists.xenproject.org; Wed, 18 Sep 2024 09:19:17 +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 122c7e04-759f-11ef-99a2-01e77a169b0f; Wed, 18 Sep 2024 11:19:14 +0200 (CEST) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 4CED72AB66; Wed, 18 Sep 2024 05:19:13 -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 450452AB65; Wed, 18 Sep 2024 05:19:13 -0400 (EDT) (envelope-from sakib@darkstar.site) Received: from localhost (unknown [185.130.54.100]) (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 6BBC02AB64; Wed, 18 Sep 2024 05:19:11 -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: 122c7e04-759f-11ef-99a2-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=53smXasWd1kdsCxJozw3baFujpwna0GJ4sddX+8FhMw=; b=kRWi rD0wnWY36abD8De65J12QiJsQSjOKBH/9pnRnIKD68qz+5HLmA5ImBYLr3DVaVMI vO8ekBng6YLLGgXg+9nPQTcwKYxRMYugbPusJilL6id8Gtt40jKSR6D0Gh28wl01 ttNmVWerSEz6gJ1PBeaGHEK2kDBaZyvM8mrokR4= From: Sergiy Kibrik To: xen-devel@lists.xenproject.org Cc: Sergiy Kibrik , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , Jan Beulich Subject: [XEN PATCH v2] x86/mwait-idle: add dependency on general Intel CPU support Date: Wed, 18 Sep 2024 12:19:09 +0300 Message-Id: <20240918091909.1201170-1-Sergiy_Kibrik@epam.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Pobox-Relay-ID: 10D7833E-759F-11EF-BE9A-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @pobox.com) X-ZM-MESSAGEID: 1726651178220116600 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 CC: Jan Beulich Acked-by: Jan Beulich --- v1 patch here: https://lore.kernel.org/xen-devel/20240905160058.493057-1-Sergiy_Kibrik@epa= m.com/ changes in v2: - stub returns -ENODEV --- 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..3a6b73142b 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 -ENODEV; +} +#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