From patchwork Fri Mar 1 20:48:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 209083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp146400dyc; Fri, 1 Mar 2024 12:49:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWl+8msKiTxMCupgBJHCY5gNiHzaX6q3q8JjBobq+1YgxFEVJ4FJVQ4k+Sy6scdbcftJQZ6e8zvCrE9cujZV1jNL+Mn/g== X-Google-Smtp-Source: AGHT+IEpgB0sPuAXSIHP62L5DiYUA2eCGt2xuQaSfobrueSrGKIm4tY5yijMDAzfYY1oVwAcq6cT X-Received: by 2002:a05:6808:148f:b0:3c1:ae0e:9c4a with SMTP id e15-20020a056808148f00b003c1ae0e9c4amr3468139oiw.24.1709326183531; Fri, 01 Mar 2024 12:49:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709326183; cv=pass; d=google.com; s=arc-20160816; b=J3PwC5AUn8YJZaYFCiJYJ37bWoQgc9g7Hh+6p4tlupSBcKAxMP1QKBSqod/4kP/sfG y+Z0g/TPcy+fvJqSFmHiVPORwVBE6inVyK4Qs4d+CHUmxQlmUSX09o7UUK78LHxZ6B45 446nOZO0q+40ev5W4OSJXM0ffwGbzd2E/MxzSju/joMj4BSdxcEh9hxiGp/fSN6EA3tK DIXCIkStsi8FI4V7XIj7NDPk0I0znMVQ48y7dIWtXnTrCywZGasvBzfRIJ9XrfpxnST9 RFLPRSWZIC8SEdMR5yckc7dAkFpfRGIargM1Q10yQ/9Cl9Fb+4lvrz3PKiP13lXF9cqi 26Wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=AFcw22EsX0TAntmyqYDwVrlfo/EZNLuo4RfsMaRqGhQ=; fh=LWlv3U+xZ3+vQt4tlJRIlKl5VzN7iFjjE/bzRmlxKDA=; b=kXc9pkKOjXY7Er47g9eWULci5S2Yhe2UZiNuSwQQpyKcH5ZribrSSbw2mq5ehBbCFS gEp+7ifyRijxE8paCQcw4BNVUYWNi/xqDGWMu0sBZ8WYrZa6xkOOC5+fnOvwIE6BizlN sT5/oVp78/AA9eWyeW8gyRGtOP1VIpOhjxWnXqDEJHPUIFrnyM0XxnX656skFR7HJubd SkcV4TzP+xkMjkNLTlBO15365KBYcZsq7Wl1QLy0GyNNqR9XjiatNLd25TTQvKmGLbqs mURxdKL4QfpaPOOUzv42R5Q5IF5C+F7FzX8fmpM0y5RcfqAj/ik+TlTOiMk+o7Qdq7KQ T9iQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q6xlKup4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=cdjH2Xtc; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-89115-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89115-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b10-20020a056a00114a00b006e4bb525845si4203060pfm.274.2024.03.01.12.49.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 12:49:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89115-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q6xlKup4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=cdjH2Xtc; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-89115-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89115-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2D6EB28FDFF for ; Fri, 1 Mar 2024 20:49:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72E4C57307; Fri, 1 Mar 2024 20:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Q6xlKup4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cdjH2Xtc" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 2082C537F6; Fri, 1 Mar 2024 20:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709326128; cv=none; b=plHVxS5C7uxJr+moztGB8ldnxgv4YLreeI2lpTQodU6D0nMPppyTXzUSRc66QIlrD4AC5MPamb1//ITje8BBJ/CZ7J8DPiE96qT4V2JTnRNtughi0G8Bd9eUUJYYR2kymHyD5Qes01Yd4VSQjRgsFB7LgI+gZpRPPEfFhjcMQTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709326128; c=relaxed/simple; bh=lVm0fmnn1SEFePlLOkP7aHhUvllk3HXlAGwr2mbIcMA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=u7ktQYYto7e3hJrdyyYUKscYfn4DSQsRR+b/1mguqLFy+fDvg0pQ5x1JVxm/bJLc46DzLcRuSyu9b+wvJoAd9tWimOlnxei/4cTkp+5Qe7h7lot3aNyofJtP5ofk8Vg3rWy1Coym4MvRLrEAqamekuNPbWbvcAoczakWEN9aYJQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Q6xlKup4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=cdjH2Xtc; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Fri, 01 Mar 2024 20:48:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1709326121; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AFcw22EsX0TAntmyqYDwVrlfo/EZNLuo4RfsMaRqGhQ=; b=Q6xlKup4DFIbwGDvmGyeCCh4gNVhLu4pfgO2eXkWIOhkPh6ObeshARE9dwaorgjiqCm9WW SOakaIUDsK69Ueop5GlQQ3wBfDwgi+njCUF8Le6RW9Cy9LTWniY9vwCe0urFq7eqYkFPKJ EM5it7f1/bxl43mtV5o3zT8w03FNAE4OWd8RhGfhTFJL2dFSjG4OJ1eFMsmHxWKVOCKrf3 Nq43ANMvsY70lTnhMP8FHHGGhNxuRCZPEiTjxHI7aHIJcrnwyAwp2ReqeXttAQYCzzRFkL 7qdSjbb9YLqQPLLw9wNd8/z+qxioNbZVySzqsLjWyt7VGLlet/2kTNk28QRWMw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1709326121; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AFcw22EsX0TAntmyqYDwVrlfo/EZNLuo4RfsMaRqGhQ=; b=cdjH2XtcHUagk3dbEqahtez9BjFEYXaRYXDLbMReTnH3WuLsS3oYLgVOl70pkBMOEXd1Ts Kwa1NorKW3lwKLCw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/core] x86/idle: Let prefer_mwait_c1_over_halt() return bool Cc: Thomas Gleixner , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240229142248.518723854@linutronix.de> References: <20240229142248.518723854@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170932612092.398.1034470417889380142.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792243640724867300 X-GMAIL-MSGID: 1792358412233787862 The following commit has been merged into the x86/core branch of tip: Commit-ID: 71f3a783a758696b5f8084b6f1621240b8804568 Gitweb: https://git.kernel.org/tip/71f3a783a758696b5f8084b6f1621240b8804568 Author: Thomas Gleixner AuthorDate: Thu, 29 Feb 2024 15:23:41 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Fri, 01 Mar 2024 21:33:12 +01:00 x86/idle: Let prefer_mwait_c1_over_halt() return bool The return value is truly boolean. Make it so. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20240229142248.518723854@linutronix.de --- arch/x86/kernel/process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 678d5cf..2d51cbd 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -853,21 +853,21 @@ void __noreturn stop_this_cpu(void *dummy) * Do not prefer MWAIT if MONITOR instruction has a bug or idle=nomwait * is passed to kernel commandline parameter. */ -static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c) +static bool prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c) { u32 eax, ebx, ecx, edx; /* If override is enforced on the command line, fall back to HALT. */ if (boot_option_idle_override != IDLE_NO_OVERRIDE) - return 0; + return false; /* MWAIT is not supported on this platform. Fallback to HALT */ if (!cpu_has(c, X86_FEATURE_MWAIT)) - return 0; + return false; /* Monitor has a bug or APIC stops in C1E. Fallback to HALT */ if (boot_cpu_has_bug(X86_BUG_MONITOR) || boot_cpu_has_bug(X86_BUG_AMD_APIC_C1E)) - return 0; + return false; cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx); @@ -876,13 +876,13 @@ static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c) * with EAX=0, ECX=0. */ if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED)) - return 1; + return true; /* * If MWAIT extensions are available, there should be at least one * MWAIT C1 substate present. */ - return (edx & MWAIT_C1_SUBSTATE_MASK); + return !!(edx & MWAIT_C1_SUBSTATE_MASK); } /*