Message ID | 20240222183950.92A959F2@davehans-spike.ostc.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-77172-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp186578dyb; Thu, 22 Feb 2024 12:15:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVA56jklfh98UipMibtagDEYj5rb06Gz6bMiIjZv0KgYe2xmHnjJRI4g0+UxBhEfPBfRIu33wdLcnrlWJOxo+WebnJj7Q== X-Google-Smtp-Source: AGHT+IGJfFtEAsLPpwQ4bEX2+8lOPj6xJBGFgT2yj6X6wbfFnUWjePW+Dmqd94eQsc/r+v7WQS7A X-Received: by 2002:ac8:578d:0:b0:42e:5aca:cdd1 with SMTP id v13-20020ac8578d000000b0042e5acacdd1mr255629qta.12.1708632931156; Thu, 22 Feb 2024 12:15:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708632931; cv=pass; d=google.com; s=arc-20160816; b=gnVHgLglXdix/l8O8lVXx1IgJX3pYE1mByJ+XnbNFp1XEsOE5veBdW6qDQF4EUw5tb R+DAVt0AKl/VnJhZ3OJtokDfaEG6J/jaT0E6rLzoHL0f0iPELzhDe3sbVP/jyFgR9GcU OnkTUynkrQ8+bTtRQK+4bTpoe01qpdb9tFgPFMatiLGyoRSffkRzezzS+C43wsUIIUFd 2RDO18EO56GuyPUgflbwWohkXM0LI7ls9yhYKqMHNY1AcE/X8ryyIa72zkYbtwD6/ody SV6pwlaW/pJdd48NWJPeIF+suB3Ts86zlW2P2yvJ8sd9gk1ZkZcbHygqnwlDt5aEymx5 YLEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id :in-reply-to:references:date:from:cc:to:subject:dkim-signature; bh=4TjDH1Log44PBm3k7sIleX37H9Ks6zq6qh155EmZvec=; fh=HUgOPOMLUPcroonsK10/uEWpbBCP57e0QFUoVmMwghQ=; b=WCudXOh4juA+K4PdMKck4lMPUeenv6Opmy7N1nuolKrn1f42A8xqXNZ0eja5IVSl8z IuI7LaNpwGPe+3vfrxF8vIgfqzjSnc5ghdDk7pbFHL8anoufzckbLw/+0rrnxTPg9nJs rGjYk/+JJ8ZY0fvh/akRthU/WTWlRwkinbB6R1Ng27rCPweOSHizycLQ1AUXDjbbCPUp weGgnfAAqEJrhfBPwpHHa/BFpNaLgcvZuIK7KVG4ixITvpFAA1wevf/bmXgjaXO1uQJz jUzV2NiNThS9xda1MXNg4b4WfMdgfBIEIn0gEYzDiJWJN4V8MHru5w8QMufkOGxGtrKj JabA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YZHNMckL; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77172-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77172-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i17-20020ac84f51000000b0042e4cefabdfsi1865399qtw.4.2024.02.22.12.15.31 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 12:15:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77172-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=@intel.com header.s=Intel header.b=YZHNMckL; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-77172-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77172-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 62A181C25C54 for <ouuuleilei@gmail.com>; Thu, 22 Feb 2024 18:47:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23036140E34; Thu, 22 Feb 2024 18:39:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YZHNMckL" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 040E7137932 for <linux-kernel@vger.kernel.org>; Thu, 22 Feb 2024 18:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627192; cv=none; b=DslV5nsxNgrAz7Yzu5gKuQKI1/HbU6Mib5R6C6skahxlDSob69q1ZEpg14tcLwETT2sdvx+5OEPxP7awdXqug20pN+4D+z6wDeDxdmN4Yfv5PTvVcjckV00oS+8usRepIrTwUN3xZ1gZ4F5epmcAI8fqo1tBsWm752jcuYs3+e8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708627192; c=relaxed/simple; bh=tiABm/o18DPqMhSfzvK1w9HdGuxe4IVkXU92OGIYjng=; h=Subject:To:Cc:From:Date:References:In-Reply-To:Message-Id; b=UZOLwPqxKMatEtR2m5EWFHBH7DbBt8WPgzBcombK7wRVaZk2FCeAka8gPV7w79SbzER5ewNUjGGLvcKjNco+GKzYMdKJIlCjEwO56qEb+Rfd0ZCnE3H0KOehfs+5GJyBZDFf6WMP7XHUNbC5QOkdKvgY9qc1n5YL6iL3p0jJRMo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YZHNMckL; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708627192; x=1740163192; h=subject:to:cc:from:date:references:in-reply-to: message-id; bh=tiABm/o18DPqMhSfzvK1w9HdGuxe4IVkXU92OGIYjng=; b=YZHNMckLx4OE1Yfdx78bBnLVuhg24KVBrYgHQmss2t6vqs4Ti9CZpKKn fJA+E9ydCEasxmUcYtyoLYxx1wIMk0lmaziSRKUzpoukRn1c+nqpdPgaD fw/gtCFdUZjL4GhrEGSCn9WYncUr6G8rQAFzcg6CZLU1ZaTN6bPcDYSch sHSVGzreIjNFqSKuXT8xDyukMMG1hSB0O5QwXtTRw85p1WycT80qdqxNe pbdeyxYh5aPRd900FrFxVS83TBLchWg49t1a8jCkYt8mUtsgRLkDzDg4+ mCV7TCHqOFYGeEY2itCuqW16drs/amtK3OVj/tQarV77tcQaFk+ni7lpd g==; X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="3031824" X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="3031824" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2024 10:39:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,179,1705392000"; d="scan'208";a="5975552" Received: from davehans-spike.ostc.intel.com (HELO localhost.localdomain) ([10.165.164.11]) by orviesa008.jf.intel.com with ESMTP; 22 Feb 2024 10:39:51 -0800 Subject: [RFC][PATCH 18/34] x86/cpu/centaur: Move cache alignment override to BSP init To: linux-kernel@vger.kernel.org Cc: kirill.shutemov@linux.intel.com,pbonzini@redhat.com,tglx@linutronix.de,x86@kernel.org,bp@alien8.de,Dave Hansen <dave.hansen@linux.intel.com> From: Dave Hansen <dave.hansen@linux.intel.com> Date: Thu, 22 Feb 2024 10:39:50 -0800 References: <20240222183926.517AFCD2@davehans-spike.ostc.intel.com> In-Reply-To: <20240222183926.517AFCD2@davehans-spike.ostc.intel.com> Message-Id: <20240222183950.92A959F2@davehans-spike.ostc.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791631484438994301 X-GMAIL-MSGID: 1791631484438994301 |
Series |
x86: Rework system-wide configuration masquerading as per-cpu data
|
|
Commit Message
Dave Hansen
Feb. 22, 2024, 6:39 p.m. UTC
From: Dave Hansen <dave.hansen@linux.intel.com> The 'x86_cache_alignment' is yet another system-wide value which is stored per-cpu. Stop initializing it per-cpu on (some) Centaur CPUs and move it to a new BSP init function. Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> --- b/arch/x86/kernel/cpu/centaur.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff -puN arch/x86/kernel/cpu/centaur.c~centaur-c_early_init arch/x86/kernel/cpu/centaur.c --- a/arch/x86/kernel/cpu/centaur.c~centaur-c_early_init 2024-02-22 10:08:57.268799139 -0800 +++ b/arch/x86/kernel/cpu/centaur.c 2024-02-22 10:08:57.268799139 -0800 @@ -61,12 +61,8 @@ static void init_c3(struct cpuinfo_x86 * if (c->x86_model >= 6 && c->x86_model < 9) set_cpu_cap(c, X86_FEATURE_3DNOW); #endif - if (c->x86 == 0x6 && c->x86_model >= 0xf) { - c->x86_cache_alignment = x86_clflush_size() * 2; - set_cpu_cap(c, X86_FEATURE_REP_GOOD); - } - - if (c->x86 >= 7) + if ((c->x86 == 0x6 && c->x86_model >= 0xf) || + (c->x86 >= 7)) set_cpu_cap(c, X86_FEATURE_REP_GOOD); } @@ -217,6 +213,12 @@ static void init_centaur(struct cpuinfo_ init_ia32_feat_ctl(c); } +static void bsp_init_centaur(struct cpuinfo_x86 *c) +{ + if (c->x86 == 0x6 && c->x86_model >= 0xf) + c->x86_cache_alignment = x86_clflush_size() * 2; +} + #ifdef CONFIG_X86_32 static unsigned int centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) @@ -241,6 +243,7 @@ static const struct cpu_dev centaur_cpu_ .c_vendor = "Centaur", .c_ident = { "CentaurHauls" }, .c_early_init = early_init_centaur, + .c_bsp_init = bsp_init_centaur, .c_init = init_centaur, #ifdef CONFIG_X86_32 .legacy_cache_size = centaur_size_cache,