Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1033318lqs; Wed, 6 Mar 2024 04:35:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV0m3uSOp5FQr2m4n3piM8fzEtuvSMd2gVQuF41W/l16rJvjZxJyRap7f2MP/u6qik2Ycqu9jKY2KRKabehHPKJUkwjpDxvtfkkA6S0yg== X-Google-Smtp-Source: AGHT+IECzJ4uxc2Kh43v6MVklwEZaJwDZzlIKZQRgh21MnGR+7kIsg8pWUSjWfTqijL5KUDdFh5z X-Received: by 2002:a17:90a:d718:b0:29a:b988:ab64 with SMTP id y24-20020a17090ad71800b0029ab988ab64mr11244075pju.7.1709728536491; Wed, 06 Mar 2024 04:35:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709728536; cv=pass; d=google.com; s=arc-20160816; b=muMXqnNfakxfpPJGm0UAHrL7m3yDb8gADI9Vp3kbli+5vQcto/hXBrTNmkuud0xKi+ IYOkuS9kj7Oe1R5cWXaEar3h97FwrKU9Ck7rnOC4JajJCBxqbh/JgJaOYpSlMjnkhTLn 5UWkv7Sgjv5tbvVBdeDt6Ejely3di21RokLsd8XDbxgJgU12BA4FUh4lFcvB4X9/Wwjd EQBfJcydT+f0Pl6QuklMFCZOL1bCnsu7zkCs5mHnl/fY2lNncHL5nxGZ9SKyXusCXlKE UDJKCTw0Z+brmc1bj+BAQ8yUq7Tskx0DFkQlNBwaGixVCNqKvBYbzrEHEq/8EYMdR9a5 4+2A== 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=PAp1bf6qrMiX4CQWZNcoZnKRC6rV4wKaDkhIHyk1xsA=; fh=MkDsgvFd9YNJdzOKUQcPnPHOQe3MpIMBuYxRMnFJmts=; b=k+QtT7ZHmE17zei/gRXXVBIA5p40KiTDqoOya9GVfDE6AWtIzPL6j+PgJ0rFkxeD+s osdI3mChbFSOf1lI7Gss4V6dH6A8ivmOR/jTVtHEorgP75Gtap4tkmmtNXH/J6fPpExo OgvlAxjjVOM/kEHSxSOXAAStq0dP0Z0lUbtETM+LcbBKkUcY8w4QWjXSoEGgrSB6nqDo u7xoKQoWljZhxcxl3trkN2UaT0sbIlcqjk9M4zadLGr91gbMLO+Ppzy4U5wLVP39ve+l OqXzWLTz1TOVuVe9yakHxLD96E5W3DIDh9lbPJJpq+rJh/latH537yupxdrWA+ufw2ed o1ZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=HItIfRhZ; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-93899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93899-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id im22-20020a170902bb1600b001dcdf1cb573si10837935plb.451.2024.03.06.04.35.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 04:35:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93899-linux.lists.archive=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=@alien8.de header.s=alien8 header.b=HItIfRhZ; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-93899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93899-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.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 3CA54289736 for ; Wed, 6 Mar 2024 12:33:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3594130ACE; Wed, 6 Mar 2024 12:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="HItIfRhZ" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (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 E58B812FF67 for ; Wed, 6 Mar 2024 12:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709728373; cv=none; b=Z+j2O3BmEYSatHoFFOTqYSh8u+vod0rTJaKCnVX/OfK0QpAdojMKG3Pu1iUKApS+1PHCvl6t0BFuPiQx4cJ4To6LW0UIb51sPXWA2uuq1u/0yDNEJi5NzZ/VOImcLNYnhxRLIYkM16eK1WDy8hq1Zymf9lAnpdcF88dludzBSWM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709728373; c=relaxed/simple; bh=0Tc0hQYDtt48jZhh0NYn8h+kJpBxzpBz3yqZS60Ykn0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Qwo7UO8QCQKT+Yr742kRPic77tIYilQvV+Mr7JT1nr8Ra+j5YJBR8KIz3RT9Zy3eHkR2JfkW/XIIV5ZoKS5KH7cG7UdM9PfWQXJt/rjDrRm/MXMk7SBlP0t8OAftN6MFoh+qkh4HyuDrtTXuWC3y5QkReBvfAOIbsq698LamQRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=HItIfRhZ; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 369DB40E01A8; Wed, 6 Mar 2024 12:32:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Vl3CpBHFptTT; Wed, 6 Mar 2024 12:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1709728365; bh=PAp1bf6qrMiX4CQWZNcoZnKRC6rV4wKaDkhIHyk1xsA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HItIfRhZ6cmgWXlbyxVTiOHumC88/3sDgSLBtHKgyUFgjAE84Rsu2wYWymQQ5Scsx gxiRW4FytlI4qiEp0RIsxvHRV5R8HMU9vOnvRY7xCDpDu+edKrKtdmwCzI9kOWq7jZ E1aQ2zCtrRe4Dg8g4+V+JatJ4bLyXJgVJNEPPg9aphRdOF6g9JbQV1w0GAE4OKsCij ws0CpIZTPqOluyt3L7PYKsajN53koEtEOdJ3bEq7m85jAm08fm048WIl1JFVHOJUsg pXvf9tGqCpNcsM86Sal7uM3g3Em2Oc5UWbZMQNKnPzegiUq5MZTR1Tmvsn1rx18qDS ykI8B1zfQsPV7TaLgp69P0sfOt/dJroPDLyzaqmamUq9/kRP7bA3cfxB3TAt7MxIQL ohN3kmjdMmNfNGOd8ctUkqqoEWMajnb8z4Mwcau+k/ucMmQ8Yoi5q/SdbeYPMMxkab fYE5ukc3eIn8mhGxJfCVNTz09jbjsArowojq6NDF3TmL9OqA08fVoRCD+M5kgbhQn7 Sn/Fihhz35zHcvAI7uRzO6boVPcRjx9R7nRguXenPw+RiOMJ3nLW3GLnvlGr3VuhCm m71Ys7HxdXJw1lRX6ji+Km6XzZxzPCG4qUCLKBjh28SmiNalJ0bvlqqcSpyAVmO6Xn lpfzutfmuXg5buYpiHkJdpNQ= Received: from zn.tnic (pd953021b.dip0.t-ipconnect.de [217.83.2.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 65CD340E0185; Wed, 6 Mar 2024 12:32:37 +0000 (UTC) Date: Wed, 6 Mar 2024 13:32:30 +0100 From: Borislav Petkov To: Thomas Gleixner Cc: "Liang, Kan" , x86-ml , Alexander Shishkin , Adrian Hunter , Alexander Antonov , lkml , "Rafael J. Wysocki" Subject: Re: unchecked MSR access error: WRMSR to 0xd84 (tried to write 0x0000000000010003) at rIP: 0xffffffffa025a1b8 (snbep_uncore_msr_init_box+0x38/0x60 [intel_uncore]) Message-ID: <20240306123230.GCZehiXhHIZwi2zU1_@fat_crate.local> References: <20240304201233.GDZeYrMc9exmV21PFB@fat_crate.local> <87sf15ugsz.ffs@tglx> <20240305121014.GCZecLppQTzWmpI_yR@fat_crate.local> <87a5nbvccx.ffs@tglx> 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=utf-8 Content-Disposition: inline In-Reply-To: <87a5nbvccx.ffs@tglx> On Wed, Mar 06, 2024 at 12:17:02PM +0100, Thomas Gleixner wrote: > On Tue, Mar 05 2024 at 13:10, Borislav Petkov wrote: > > I guess ship it but we'll pay attention to what else ends up > > complaining. > > Here is an updated version which handles it in the topology core code so > that MPPARSE is covered as well. > > Thanks, > > tglx > --- > Subject: x86/topology: Ignore non-present APIC IDs in a present package > From: Thomas Gleixner > Date: Tue, 05 Mar 2024 10:57:26 +0100 > > Borislav reported that one of his systems has a broken MADT table which > advertises eight present APICs and 24 non-present APICs in the same > package. > > The non-present ones are considered hot-pluggable by the topology > evaluation code, which is obviously bogus as there is no way to hot-plug > within the same package. > > As the topology evaluation code accounts for hot-pluggable CPUs in a > package, the maximum number of cores per package is computed wrong, which > in turn causes the uncore performance counter driver to access non-existing > MSRs. It will probably confuse other entities which rely on the maximum > number of cores and threads per package too. > > Cure this by ignoring hot-pluggable APIC IDs within a present package. > > In theory it would be reasonable to just do this unconditionally, but then > there is this thing called reality^Wvirtualization which ruins > everything. Virtualization is the only existing user of "physical" hotplug > and the virtualization tools allow the above scenario. Whether that is > actually in use or not is unknown. > > As it can be argued that the virtualization case is not affected by the > issues which exposed the reported problem, allow the bogosity if the kernel > determined that it is running in a VM for now. > > Reported-by: Borislav Petkov (AMD) > Fixes: 89b0f15f408f ("x86/cpu/topology: Get rid of cpuinfo::x86_max_cores") > Signed-off-by: Thomas Gleixner > --- > arch/x86/kernel/cpu/topology.c | 38 +++++++++++++++++++++++++++++--------- > 1 file changed, 29 insertions(+), 9 deletions(-) > > --- a/arch/x86/kernel/cpu/topology.c > +++ b/arch/x86/kernel/cpu/topology.c #include at the top here. With that, relevant new lines from dmesg: +CPU topo: Ignoring hot-pluggable APIC ID 8 in present package. and @@ -129,9 +130,10 @@ CPU topo: Max. logical packages: 1 CPU topo: Max. logical dies: 1 CPU topo: Max. dies per package: 1 CPU topo: Max. threads per core: 2 -CPU topo: Num. cores per package: 16 -CPU topo: Num. threads per package: 32 -CPU topo: Allowing 8 present CPUs plus 24 hotplug CPUs +CPU topo: Num. cores per package: 4 +CPU topo: Num. threads per package: 8 +CPU topo: Allowing 8 present CPUs plus 0 hotplug CPUs +CPU topo: Rejected CPUs 24 AFAIC, ship it. Tested-by: Borislav Petkov (AMD) Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette