Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp949431lqb; Fri, 15 Mar 2024 10:40:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5oOQOd+LrGU2n4tfCnKxzrDzfOypG8EtXc/1WgzJW0OIDEZ7a5aTxGjWnIXPx0O6v/wpp6Ni9ldJJGOYFlM1zBnIUPDIBTiohZVjkmw== X-Google-Smtp-Source: AGHT+IEkSbE+jq3px+juWgXkn8ib8f14GV7c4HKCjSHcvdD0Sob4kavsPRXLswSg15f7zG8qPGJB X-Received: by 2002:a05:651c:b20:b0:2d4:9201:d4ff with SMTP id b32-20020a05651c0b2000b002d49201d4ffmr543160ljr.5.1710524454051; Fri, 15 Mar 2024 10:40:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710524454; cv=pass; d=google.com; s=arc-20160816; b=gqHyiYM6fXX0bxRJ/1/twpcvVrVy8VI/yA/jbYqiOhcK1yJdn4L9/ijzCXJcyI/D9v ufFclfIuRTdgOG1spDn8vJZHB6Udeb9+e1bE9qfA1kqunLJaYx6ZdkM80gkODsS/Y/bC 0AztinXyAdcI+XdmJOuTwiJznn4oKDIKB0nPkCHXTh+LfxfT+A8EjbiGxwUIdia7+zYe 9e8phIOS/XbCkBbyuogaKn10fLZDYRZlkharshrYTNPGJr9CAcZaGiWiHCqbTsd/tq15 hDZ1iB1UMUaZO6xmJ3hxsaa5gNtVZ9mXBr0Wu2OqaUbv72KiVx5yU4+CfArQfrOsI2IN NOqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=1wKAoieX4GWiPiXZklKeg/Psrl4l9AmnBkO9+pwsixM=; fh=u8tKDPTAmozbTgsIBlo5k2Guko7aWab/Dg0Y+4+O2so=; b=akiPychhvRoiji/WwA5vvWbY68seheQbL37cixFoIp2kUoUsPou9xMD+yzq/yhzbtS YTEoKpDFXI4LQt3Cxc2qhfS3f+kvFmVUP0sOjEUCkgSUSVqapg9FOyo3KJi5wWLxjFEH +wgdbhc5a5ZNW81oirqghjJ92qFdl1CVifNYkfnzENHkZE2KDs015Xu34woiB5k7FMfX NKWhO4pV5YLBeUMX+39Q2380GU6ogTKA7Ey0+G7+jbseegCxUQK2kOUCJJvvF9CA8JUi s4ugwDurf2FzoF/9AsTVZEIIl6VrdZLklD010FMAW6n6dMDEHbi1CdyIGLKROGwotszy DivA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=io5Jwlx2; 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-104738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104738-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id eb11-20020a0564020d0b00b005664895cd8fsi1969438edb.53.2024.03.15.10.40.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 10:40:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=io5Jwlx2; 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-104738-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104738-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id B77921F22A03 for ; Fri, 15 Mar 2024 17:40:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BF614C637; Fri, 15 Mar 2024 17:40:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="io5Jwlx2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rzl3uy7Q" 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 CA2F54AEC6; Fri, 15 Mar 2024 17:40:44 +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=1710524446; cv=none; b=Ep/eeNf+89OHieUmz7LOgHnp2PEvuE2KY8Q5bKgPnHXdeb0dyWK1SbPyZV1L9zRyVDVqt5STIN8anfLeS85mHmhwOar0d/nW3PmZQjmJXmpbjjQDWYUohT4iJGt6asbAjcc2hkDYpXmqfTdkgWwMgUT42D4WZIfUzWuZoDWE5C8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710524446; c=relaxed/simple; bh=+P6cYE986o0G9h5M0KvP9uEpUTHZAkf7yj89OpBYdmU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=HyfP6kvkDi6FmxO2v1tv8SPt4eRTCMSRDHyHenjJxxg43HwhKHWBtABNylhZumy4/17hC6S/17u5FMLib99lGOKoafrY4h+k88lEZfkOIHbNAQIoyTCyIygLlDjyJwvJdXNOfPlOm8ig/seLKOZdctDcy4t9C826hE8Xqe3kWkY= 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=io5Jwlx2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rzl3uy7Q; 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 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1710524443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1wKAoieX4GWiPiXZklKeg/Psrl4l9AmnBkO9+pwsixM=; b=io5Jwlx20Rn73Kus+artMPOdGRv/nsSZUaxjK+F1FyQTO70i03B4GnU3VriOIgqmBpm1i4 3dxE99wDhfIwJClUFBVaQzbujAjl+qdfdORmswqzOeKq7QU50/Cw4lPz8FbGMK6etl0NHv nipNwSJ0BXYqR/7odjONCNF+K6k0HQTtdZE4Kf+JqaXtO57Plu4RKROxMz/MESxdnZQCOA d6MX2hWcABk2Oj91PWx8+fXKB5LuUZYkIdeWGzgrJfsg0hioGKle2ASJo8SfbjrrZTnrUJ l5L94yPyf3l5Jvuz8pl4UGLdLCdxtnAoqcY8b+dThcpYH4sqdZrNlm6u1gGlWA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1710524443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1wKAoieX4GWiPiXZklKeg/Psrl4l9AmnBkO9+pwsixM=; b=rzl3uy7Q5ii/hnmpFveouaIiGlaqvgUPZU3r5T0nIPbtAXrYn6EoNtu9r7Sg/w30WOXKy0 oDYBm6oVEtUmtqCw== To: Linus Torvalds , Guenter Roeck Cc: LKML , x86@kernel.org, Uros Bizjak , linux-sparse@vger.kernel.org, lkp@intel.com, oe-kbuild-all@lists.linux.dev Subject: Re: [patch 5/9] x86: Cure per CPU madness on UP In-Reply-To: References: <20240303235029.555787150@linutronix.de> <20240304005104.622511517@linutronix.de> Date: Fri, 15 Mar 2024 18:40:42 +0100 Message-ID: <87y1ajjsv9.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 On Fri, Mar 15 2024 at 09:42, Linus Torvalds wrote: > On Fri, 15 Mar 2024 at 09:17, Guenter Roeck wrote: > Without line numbers (if you have debug info for that kernel, it's > good to run "scripts/decode_stacktrace.sh" on stack traces) it's hard > to really know what's up, but I strongly suspect that it's this: > > rapl_pmus->pmus[topology_logical_die_id(cpu)] = pmu; > > because we have > > topology_logical_die_id(cpu) -> > (cpu_data(cpu).topo.logical_die_id) > > and we have > > c->topo.logical_die_id = topology_get_logical_id(apicid, TOPO_DIE_DOMAIN); > > and topology_get_logical_id() does this: > > if (lvlid >= MAX_LOCAL_APIC) > return -ERANGE; > if (!test_bit(lvlid, apic_maps[at_level].map)) > return -ENODEV; > > so that -ENODEV is not entirely unlikely for a UP run. > > This also explains why it *used* to work - that whole thing is new to > the current merge window and came in through commit ca7e91776912 > ("Merge tag 'x86-apic-2024-03-10' of ..."). > > Thomas, over to you. I wonder if maybe all those topology macros > should just return 0 on an UP build, but that > topology_get_logical_id() thing looks a bit wrong regardless. > > It really shouldn't depend on local apic data for configs that may not > *have* a local apic. Right. Let me look.