From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E6D822A81D; Tue, 29 Apr 2025 17:06:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745946406; cv=none; b=Mfls0jhoI4rfGAx2l0xja/G0JLhELPJpJrLMQBadTpX6zkA7AP9LppXtFfacQZyPi/ncQ8T79do6uubn1b8ydHqkZG2dVDInwbIMBCngbhtL+dtUhLdm4L8FiIKTTCYdyGgBNXzBKrXYScekPXIvjinNF88r6uvearAfBwK1TM4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745946406; c=relaxed/simple; bh=v3y9TtIhB/Jr7Fa5FtiluUroeQ99iH85SOzgIDI2pI0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ny1P0moG6xd3Q1QwCtEq91SGulbpwC9cwJmcF4Bz1uPK8X8mjrGiQjyNwvjN8EhwOE9Hfzmj74rtO1WQtJSidlEUoM3ZupAnKkMXrg24pAVQ6UXl9/tBI7cbDlZISNLY91NKLOarBTEhUiFy2kCY04a41iz64cpmfOeQPjTb7pY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=a7GGEYsF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="a7GGEYsF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2021FC4CEE3; Tue, 29 Apr 2025 17:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745946406; bh=v3y9TtIhB/Jr7Fa5FtiluUroeQ99iH85SOzgIDI2pI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a7GGEYsFeuCsacEskehD+HZnN5VQpRVOT9fn7FR3/emfv/xfqh76GxrgbHQb6IR6M rFZx0cp0cGIa0CORrR9oYCy31T+tTAQzIN9Qifqjt7emBG4O+MULR1fynbeb5KyI84 AUetDT20KuuxJhP4e2f4qlFT8IHhtUYsRiZRFomg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jason Andryuk , Juergen Gross , Sasha Levin Subject: [PATCH 6.14 257/311] x86/xen: disable CPU idle and frequency drivers for PVH dom0 Date: Tue, 29 Apr 2025 18:41:34 +0200 Message-ID: <20250429161131.548400691@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429161121.011111832@linuxfoundation.org> References: <20250429161121.011111832@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Roger Pau Monne [ Upstream commit 64a66e2c3b3113dc78a6124e14825d68ddc2e188 ] When running as a PVH dom0 the ACPI tables exposed to Linux are (mostly) the native ones, thus exposing the C and P states, that can lead to attachment of CPU idle and frequency drivers. However the entity in control of the CPU C and P states is Xen, as dom0 doesn't have a full view of the system load, neither has all CPUs assigned and identity pinned. Like it's done for classic PV guests, prevent Linux from using idle or frequency state drivers when running as a PVH dom0. On an AMD EPYC 7543P system without this fix a Linux PVH dom0 will keep the host CPUs spinning at 100% even when dom0 is completely idle, as it's attempting to use the acpi_idle driver. Signed-off-by: Roger Pau Monné Reviewed-by: Jason Andryuk Signed-off-by: Juergen Gross Message-ID: <20250407101842.67228-1-roger.pau@citrix.com> Signed-off-by: Sasha Levin --- arch/x86/xen/enlighten_pvh.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c index 0e3d930bcb89e..9d25d9373945c 100644 --- a/arch/x86/xen/enlighten_pvh.c +++ b/arch/x86/xen/enlighten_pvh.c @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include +#include #include #include @@ -123,8 +125,23 @@ static void __init pvh_arch_setup(void) { pvh_reserve_extra_memory(); - if (xen_initial_domain()) + if (xen_initial_domain()) { xen_add_preferred_consoles(); + + /* + * Disable usage of CPU idle and frequency drivers: when + * running as hardware domain the exposed native ACPI tables + * causes idle and/or frequency drivers to attach and + * malfunction. It's Xen the entity that controls the idle and + * frequency states. + * + * For unprivileged domains the exposed ACPI tables are + * fabricated and don't contain such data. + */ + disable_cpuidle(); + disable_cpufreq(); + WARN_ON(xen_set_default_idle()); + } } void __init xen_pvh_init(struct boot_params *boot_params) -- 2.39.5