From patchwork Mon Jan 22 19:07:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 190353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2782962dyb; Mon, 22 Jan 2024 11:16:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2rg1glERZyIn+efBanfW8ymMFoAvqqJsAVP/M2lrVfaqT5L0tnFyoO5qVDssLvTxEl19c X-Received: by 2002:aca:2302:0:b0:3bd:74ee:db14 with SMTP id e2-20020aca2302000000b003bd74eedb14mr4066912oie.86.1705951019645; Mon, 22 Jan 2024 11:16:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705951019; cv=pass; d=google.com; s=arc-20160816; b=Wux4G2IkA2KhgInu5NJURepPuC2TiW+4Ys/MvAyQm/+kdlgDVvR9sw1o2yQkxa+IGg SsetFVxNfSfc50b+pNWz1/6AnIHwgtaFV+vWta8TMqgtqvt8Qbt6a8okW11NMuPCC8V5 6GLw6MjJSABolA9nHFMdofcEyOdyOKbprHSbAoUWleYfbvEYUb5NaKJ0W24+Y0PjJMw7 AgjXTwDZsJdEaImuqXVccx8Waowje3wPsNcOcsfgr7i0W2vVRlLQHcaSdvr0zBWZ/dis sxla4GpoHEgwzGBNmCvxkUrxyh/4Ax5iBlm+AXdvWWyNkKLxx3e9+Ujx4HGxy3AGgk3s qkuQ== 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=1LEUs35sDeIr6Y5L91RFWmBlsM22sW9iX8+nznOQvIw=; fh=cm/R/gah6XbQW9rCQxjNiXMSKJsRtR5Duof/MLmnSVY=; b=Guw4c9cX5SvJXkdMd8roVQkV5Y9YuvQrD7sgNMJ9RKROOaT1PmD5l3JlLvPWhy1bWd RyET+n+2gB8xjL+ltP14q5iYNjWsbt+GOjJli2PHo+sl5Wh5/WWVE5Xpt2a6fDmuCOnL QpyBNt2fpsXYe7OVd1ihnIec1ZvVdIkGPOHo8xvxFHKQ7CGmTyYK2ejLJ6V/fsAqS4oX haMqNeDOHCs1CRv2Z3pmTTHfK++j5Q+odtMYXZRHMnd62x3NYvu4M8SGfbBZ8a9rz7yw gB+XvYtYe45SPdxex2vaovcrfDpRJbI+haUmQnwsTlj63bbGKX9mwPq/9NFVPk53jyua AKbg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sNyIdv99; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-34038-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34038-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u12-20020a05622a198c00b0042a34c52488si5058340qtc.493.2024.01.22.11.16.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 11:16:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34038-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sNyIdv99; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-34038-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34038-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6CA401C2A5B5 for ; Mon, 22 Jan 2024 19:16:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B0B14BA8D; Mon, 22 Jan 2024 19:07:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sNyIdv99"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VBufSsvk" 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 0540D4B5BA; Mon, 22 Jan 2024 19:07:09 +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=1705950431; cv=none; b=cee6HRWtossOLyWEZ96cVIRMODH4WT+vRNYlxZcm4NLVG0JXYdTQk1MQ82ZE9bYFTscrqsNihREmZdKbfg+wRJnsfXKSoQxkGJ7pvhz5jBESA+OZZVlPKdM1Vu/BDmQECcXX5HVFv/jVxCLy1yKvPCfJbCl6+5R+L/gUudA6/uI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705950431; c=relaxed/simple; bh=PRh9dwBF31NtpVfZmzoRaCu2sQRo38CzZ3BHMdCkcTs=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=pwJIr145tKASPzgwxgZIkTp8w3IVwdgqwv7XHDTDI9loW8XAIYP9W5KyHDaa3+JmPCfayqa/f4tzs/mI0hU9o7+d6n2mqz18jKCRetVIRkMt20IZeCTosFdDPzXIWE2yc8n3os0jI0uLQ0/LA4Yptc06hhF64qZJzYcuJo62zxk= 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=sNyIdv99; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=VBufSsvk; 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: Mon, 22 Jan 2024 19:07:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1705950422; 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=1LEUs35sDeIr6Y5L91RFWmBlsM22sW9iX8+nznOQvIw=; b=sNyIdv99QBAM7nTNMJhn/yG/FUUIuT/Gg+jcnW6kxekn7ne0hm2SmQDQkb1BrlkC269jEF jaLDv9DEDXiREu0L2cyxDiELPSmNu18TVbFFDLZ1gbEiynlvBWIhL9L4f2teEnr9+Xj/p8 DT2erHOIc2i3Pb9/zDaw5e4ZlAscLZEHnruIwGiTLcumapgsp2Ax5sRTYSXpLmBZkhO9Xk eYRTmDnATELQ7KYGWHsP0JPObJ2XZGZkUfMzG3bL6df51TgjM+SyxBSFKYKM5IexSscJ6N CNj7Z6BHzIaXlVar5t4zIuIRjq35o986fG6O/UuppH9KV4YSBXRyXNP2FWDgbQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1705950422; 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=1LEUs35sDeIr6Y5L91RFWmBlsM22sW9iX8+nznOQvIw=; b=VBufSsvko8u43KhyCj+lYOT6yC0ib2ciYwMzjnHBdpoxUhThJqS5V3UD2ArYTEZSkIf8SI bcKurI7rS9AzSwAg== From: "tip-bot2 for Tony Luck" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cache] x86/resctrl: Fix unused variable warning in cache_alloc_hsw_probe() Cc: Tony Luck , "Borislav Petkov (AMD)" , Babu Moger , Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170595042118.398.14799564036429215323.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: 1788819296324062520 X-GMAIL-MSGID: 1788819296324062520 The following commit has been merged into the x86/cache branch of tip: Commit-ID: 1b908debf53ff3cf0e43e0fa51e7319a23518e6c Gitweb: https://git.kernel.org/tip/1b908debf53ff3cf0e43e0fa51e7319a23518e6c Author: Tony Luck AuthorDate: Wed, 01 Nov 2023 14:26:15 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 22 Jan 2024 19:54:54 +01:00 x86/resctrl: Fix unused variable warning in cache_alloc_hsw_probe() In a "W=1" build gcc throws a warning: arch/x86/kernel/cpu/resctrl/core.c: In function ‘cache_alloc_hsw_probe’: arch/x86/kernel/cpu/resctrl/core.c:139:16: warning: variable ‘h’ set but not used Switch from wrmsr_safe() to wrmsrl_safe(), and from rdmsr() to rdmsrl() using a single u64 argument for the MSR value instead of the pair of u32 for the high and low halves. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Babu Moger Acked-by: Reinette Chatre Link: https://lore.kernel.org/r/ZULCd/TGJL9Dmncf@agluck-desk3 --- arch/x86/kernel/cpu/resctrl/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index 19e0681..d29ebe3 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -136,15 +136,15 @@ static inline void cache_alloc_hsw_probe(void) { struct rdt_hw_resource *hw_res = &rdt_resources_all[RDT_RESOURCE_L3]; struct rdt_resource *r = &hw_res->r_resctrl; - u32 l, h, max_cbm = BIT_MASK(20) - 1; + u64 max_cbm = BIT_ULL_MASK(20) - 1, l3_cbm_0; - if (wrmsr_safe(MSR_IA32_L3_CBM_BASE, max_cbm, 0)) + if (wrmsrl_safe(MSR_IA32_L3_CBM_BASE, max_cbm)) return; - rdmsr(MSR_IA32_L3_CBM_BASE, l, h); + rdmsrl(MSR_IA32_L3_CBM_BASE, l3_cbm_0); /* If all the bits were set in MSR, return success */ - if (l != max_cbm) + if (l3_cbm_0 != max_cbm) return; hw_res->num_closid = 4;