Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1731980rdb; Thu, 25 Jan 2024 04:43:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEf5XD3cgwTCO4C+pG0u4q7uSjAAdWMLoqEVanpSTS2O0eDvQIKaMn/E9A6ZURIjNCMnjk4 X-Received: by 2002:a05:6e02:e51:b0:361:b63c:7110 with SMTP id l17-20020a056e020e5100b00361b63c7110mr1081257ilk.29.1706186592066; Thu, 25 Jan 2024 04:43:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706186592; cv=pass; d=google.com; s=arc-20160816; b=lVsdvkS4n7peccc4N8tCwjpuDUuzpTHaiTQVz41MwcCTCm9MvdDTicfoGoL+vCmE54 t5V7RRhLSGQJoOthqHgtXh9sGmUl2SNGXKTD4aK6C16hBTX0YIni4P2xePlzzglaOIhq 6wcVUoq7FANMi3HqtA619os2U6I8dJb7ZcVXJAIxTJA2Hkoo0FXZTk245CUFiO7QlpZJ xeBklvTvSVqit6gQoDq8r5cWVYUKeV1GYl4+CK2Knrp6ZnbZZgOQF+KdkrwXhFsaU7qN f6V5hRIB3DFGw3fntSJzi9InubukrkVl3ufHOLDyGqvU6KkSK+n0XtzrveqXEpgOAfUN Hm8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Uf5KlML8Ko2n3jIcLxa+D63dm1+bjwM9i8N+m6fNGgo=; fh=qFg1RQPyR3J6fe0QangeYvLBTyfjWzRB6+N6h+FA5aA=; b=SEQTQQ+XuMRS5b95QTMkCSX1MTdDFpAcevxzJ+c1iYpbn6zsNwI1+PBE4RY6AdfhKY MroNa1Mj8apHRrm3+gg+Ruytm9ay3E+Ju5TE6K8FHFmm2qy5tZ3fhtK4SGfKwAtcOEkW 1VqI36S3+FxArFXFCN8p182Hvtku5KGvPnq2E5cHC88wsrZrtBSZvzr2psrjjsvZWC2q 9Hk2ZuxMY4wusyrOeAfcyq483hvYbQBml+SxTPKtmtwgYCTeAI/Jnq4MMqwdTeNK6bMb NKZZ8LwEOu7DGYwetij7A1BY1jfsSPgwi3mZqy05KP5EmRITHsjYYq7qfmjjyxes3Jik SJcw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JC97NJBj; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-38344-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38344-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d22-20020a631d56000000b005cdaa0544cfsi13167611pgm.670.2024.01.25.04.43.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 04:43:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38344-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JC97NJBj; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-38344-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38344-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A1E45296047 for ; Thu, 25 Jan 2024 09:56:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C45471CAA8; Thu, 25 Jan 2024 09:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="JC97NJBj" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 6D6571C6A1 for ; Thu, 25 Jan 2024 09:56:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706176572; cv=none; b=uX726LkWYJWf1V2z199Xki5WK2u7Ef4tfzmvauhPX0Vt/NuOSUBqeduBU10JlMFSWRfvLpcxnk8Mf2fVSKR3AyVx/eP7Bv0e5myx2Nk3NgdtXvpMR/9IIEm8AES7kNeqBxUjXWrIRHugMmG93ocMzEqlHjRFCdftmhmCRHgfZzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706176572; c=relaxed/simple; bh=0FglvjcoV5T/4Go2FaGM3w5PY2/YxleqKSSdfl2SFkk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lh49AXZEotDRbXXXD1xe0XiOGzAWh+/siAOxX0NwGNNVX1yGWSPaLt/3C70h6lgyg5dMRF/dHy68VMjMJN29CAiJC+KM+wUPERwGrUdikFTqp1ecp7Foy+q5Z+KObccPOO9C5P+A5Zndlg8pYwHLwo6W9HiCPUkvXz6WSjBaXZ0= 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=JC97NJBj; arc=none smtp.client-ip=198.175.65.15 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=1706176571; x=1737712571; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=0FglvjcoV5T/4Go2FaGM3w5PY2/YxleqKSSdfl2SFkk=; b=JC97NJBjVLhiHPRCLa5OEt+Sh9ZTmUZAHXFvlDnnItl9JqM3DNYvWtGQ bhfhoWhete0xSPGmp3QKj5Syt6fblUbcbao7jS95dSVIERCddGaOfl2lh ZEKVG75PWrBVR49rZOVWv0o1Gc0MTFG97UZ5T2vata45yXxa2T4LB8Knd UuQloHrqbkgTh5+HmyLrmnBMIfnnFEjpmwkTveVa/K6ABcoO5U94ZPrQN 9Uwk6WxRucJYIUbVoVNu+si5dPbVOOnMziRiwiYvoXo4QKgJqvm03qeEN HFOq6Oxa2tNSGURndMUsX32qs0xTnzuYfHiPBbgcQMhZEPlEUD+SFb2Qj g==; X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="1991541" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="1991541" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 01:56:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10962"; a="857016534" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="857016534" Received: from araj-dh-work.jf.intel.com ([10.165.157.158]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 01:56:08 -0800 Date: Thu, 25 Jan 2024 01:53:14 -0800 From: Ashok Raj To: Thomas Gleixner Cc: LKML , x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Sohil Mehta , K Prateek Nayak , Kan Liang , Zhang Rui , "Paul E. McKenney" , Feng Tang , Andy Shevchenko , Michael Kelley , "Peter Zijlstra (Intel)" , Andy Shevchenko , Wei Liu , Ashok Raj Subject: Re: [patch V2 01/22] x86/cpu/topology: Make the APIC mismatch warnings complete Message-ID: References: <20240117124704.044462658@linutronix.de> <20240117124902.403342409@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240117124902.403342409@linutronix.de> On Tue, Jan 23, 2024 at 02:10:04PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > Detect all possible combinations of mismatch right in the CPUID evaluation > code. > > Signed-off-by: Thomas Gleixner > > --- > arch/x86/include/asm/apic.h | 5 ++--- > arch/x86/kernel/cpu/common.c | 15 ++------------- > arch/x86/kernel/cpu/topology_common.c | 12 ++++++++++++ > 3 files changed, 16 insertions(+), 16 deletions(-) [snip] > --- a/arch/x86/kernel/cpu/topology_common.c > +++ b/arch/x86/kernel/cpu/topology_common.c > @@ -177,6 +177,18 @@ void cpu_parse_topology(struct cpuinfo_x > > parse_topology(&tscan, false); > > + if (IS_ENABLED(CONFIG_X86_LOCAL_APIC)) { > + if (c->topo.initial_apicid != c->topo.apicid) { > + pr_err(FW_BUG "CPU%4u: APIC ID mismatch. CPUID: 0x%04x APIC: 0x%04x\n", > + cpu, c->topo.initial_apicid, c->topo.apicid); > + } > + > + if (c->topo.apicid != cpuid_to_apicid[cpu]) { > + pr_err(FW_BUG "CPU%4u: APIC ID mismatch. Firmware: 0x%04x APIC: 0x%04x\n", > + cpu, cpuid_to_apicid[cpu], c->topo.apicid); > + } Should we consider tainting the kernel when there is any mismatch?