Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp525672rdb; Thu, 22 Feb 2024 10:47:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVmqHJfaOZOdvfduVm3DnjxL6P3QWesc9SLmR1rq406kiPVV0/hRnBOzOFidsLvPRsdy61MDaY4xggR1yVtfc0RPsS60Eh/LqsNfjSvwg== X-Google-Smtp-Source: AGHT+IG5dzG2eK8TtZ0s0YDJWGa8NIDx2auR5mjCsBFeN8b4H2gngdEO29pkZIXm/MqyD50pT1q3 X-Received: by 2002:a05:6214:1d22:b0:68f:4d6b:d125 with SMTP id f2-20020a0562141d2200b0068f4d6bd125mr16791qvd.3.1708627629959; Thu, 22 Feb 2024 10:47:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708627629; cv=pass; d=google.com; s=arc-20160816; b=MoV8r4NdrnZ12mBfEmAeJVDZuOT9MI4xD0k+nHf7uWcgYnjf+eh5UhdZCOXt4WAhXW gIkBtN+KztXbIMiA6YHPh4m0mXGiZVijmLVaRZb7YEDG83FUJqOHO/WV67LSQ1GtuW0N qxVjcbnof4PwbXjxtDPa99N0yIQzj/tiCGVD5YbKYHtBcWVHaOOcxfeFB/3drQuFxhBK gCAhnXPuJ6F0Pa+rn/LL9npX9D9hqL3E1g14Jdquz3hggdLQ3HynGD7dFXxnKoNgrySE vvvVmfKAsM6rMyyHSjSNB5/0TfjOawXH7Mw49cS7tYD9Zf70dlvTTNj+JKJAwSqMnQd8 SFkA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77172-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iu8-20020ad45cc8000000b0068f0803c9d8si4593911qvb.565.2024.02.22.10.47.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:47:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77172-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77172-linux.lists.archive=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 A26B41C25B7A for ; Thu, 22 Feb 2024 18:47:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B238140E2E; Thu, 22 Feb 2024 18:39:53 +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 ; 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 From: Dave Hansen 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: List-Subscribe: List-Unsubscribe: From: Dave Hansen 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 --- 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, _