Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp43851lqh; Fri, 3 May 2024 12:47:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXUb9gLZZD+dxzN+53P3dZtsfLwsowd4JITLXjrGoYH+USl1jMsTWUYpJpTZfPSTlU1t1FfqR50+Pp2b7kyVo/p7mOZPAtUxFtGEeCKwg== X-Google-Smtp-Source: AGHT+IGXQGS1FHGigBqVHhwDgAXX2FeWf9ACASDdssZl0UZ3kjV3pZmgI1o4hKeLvHXmd73AzPuL X-Received: by 2002:a05:620a:215b:b0:790:e856:81e0 with SMTP id m27-20020a05620a215b00b00790e85681e0mr3038722qkm.43.1714765673512; Fri, 03 May 2024 12:47:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714765673; cv=pass; d=google.com; s=arc-20160816; b=KUe6DqI9DSx4SkXrGMP8lgySCXKfoM2Uu1TsUy9XPVAxZUEE70yOiAesGhtzZNjemH 8Glwou1+HbBW1qHZVOsebrUtasFBaZQp8cW9P3r1WVH3uhPH1g5GY3llQR7DUCNIYZpY ox0+lrsear0FW/T2S0DNQ7XJhaGvTDuTamA63XNHDp6F6GURTn/PRG5UxbRzNPlfihu6 89+RnNkIU7cU5itsPd1P8oGKlEE6tvYB5gtfvZde5m0wCgmFNJX9M2NQfGRaPYWiYXqh 9KX+eTnjdDYdBHQESp0hCUIQWaZkK+CEmhLY6byNU8She9X7FJ8yB/DGjR4VU3Gxa2IY EdZQ== 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=yzvLC6+/q4ZSI1AV7yc/hUTsRe1cV21NxgKZRSc1g10=; fh=7oAlPOAc+16huQWHLF0ye8sY3A9MiEZQ7PsFw2lJJCY=; b=fEx8pYMPN4ctA72kUc699UDgY0tmc3W0u5IH9kiftaw6ieaDpSeOOpmFIuHX2w+Dhe XweHRjqHs/LwwfMkOhBoWXtcCm/dUNMYjpZSM7b91Sl2d33oqGSix5H5JanPk65y+Muh JlgLlTpQ2UYRG4O4Y6srvVB53d67bh/nfHerWTUXifM+Dncm0mvZQ914kkdlgOSkEm3p iSqrBHdwXk4Mxn26NvyCv2UJSOK6CkdExpJ5DxfJRHDA5Lp3WdTok/K1b8dx4mRkW4gF zTqTSm7tA16HapBce66BNVFhm4TIyNnndvjshyHSq/ZYuu4ESLWwwQI+XxhDCMCIb0Vi 9GQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=GHrbTJnX; 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-168152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pc1-20020a05620a840100b0078f0ceb7eddsi3711866qkn.327.2024.05.03.12.47.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 12:47:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=GHrbTJnX; 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-168152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168152-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F388D1C22C66 for ; Fri, 3 May 2024 19:47:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97A6C158D69; Fri, 3 May 2024 19:47:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="GHrbTJnX" 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 7AD5A41C72; Fri, 3 May 2024 19:47:02 +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=1714765626; cv=none; b=PCZA74cX46TvEu8v+I78PcXFXKMDiwfCmoeeF1gi3/h83f7yaz+/f8ftgKjgkmnr0sB6yXpFjm10XX3kYjzLO5dfeGv3RYO2fXcecS9wxrq2O/XLESa7JfJng8VDSxquzDptohDWWXLg0SV5+2xQoxyXehHRLjMgx8wAWiUAG0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714765626; c=relaxed/simple; bh=38Oe0TTS1d5mmNZHF8apJST8m7sFv9qPew/sat94rso=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bq/AxCQnbqJj/T0ejdDkXRCwsjeQNkdfgbzIdNt0zWbIzQLNPD0nib7lssLHfUT5T3Dro4PuxewiBU7cw7w/eQpFG0nE3qfIBeTL6iyAoI4MARV8Lm9wOXIAFsNoYdr2u+6x9yBpwUATSNAXS+RKj8dwan9QTG3TlGNH2K4zhtY= 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=GHrbTJnX; 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 8E13A40E0192; Fri, 3 May 2024 19:47:00 +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 oFqlqvI6Q3DU; Fri, 3 May 2024 19:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1714765616; bh=yzvLC6+/q4ZSI1AV7yc/hUTsRe1cV21NxgKZRSc1g10=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GHrbTJnX3zJTL4ZmrSH8GDrXwkuBC6ZYQPfHWVgyFNuf5eqOWgIRxr+yj9GschRp4 ncZf+eUpkGqnkoo053bn3YPf38iDjfeJm8Fr1ufBdd93/wtwYNVdi6Dz6nkPLMxHA2 kD3Dw6Cjhj68Rfs2miNW9ZMKYC4kP3ktbdr1+whcdQJI/nnJtibB5vMR7Te7MeVlHD udaP+ymEFbHn9RTpb5H6QmuBgBM4WMFFRcNcO3FaILHTOhQlzv9Pcf+PjnjHb5y69f kHiwnxmKoDCYZarFpUnz3Yahr4I2sxWWIw1RTMCVTgdFVn/QY2LDZibXJ9xRM2fZf6 Iq8MBsNbWbvNPtBoyPGGSc1JmkQdRulvtDDcPShqPl1udcHGD4kfMt68Qct6XdzDdE /rfjwqsTac5wl/QjCW2ggPPd3SKWIUTQUsOievCxys12LGfigH3apKV+T0xHs5bOHg 4w7Ji1taQYI7Y+Rql4q85tzAOh2uYuz4C6g1eWvPk6Oc5CXpT0fMsjkSHIh4FSKVPZ mwA7J6axFog0Zv6a8ujrsEaKD8AQzD4cRda0Xw622hMf5/XPoDPxIvJuMax9hYafcn Bg5n9OMLYQCHeVc1O2VM4l5yAK3g+ZjIkgRX0UZSF++NsDanLs5iVaBA0cXkifVXOJ gFy/lbRCmlUw7cZdFH3Vga9Q= Received: from zn.tnic (pd953020b.dip0.t-ipconnect.de [217.83.2.11]) (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 0322D40E01F6; Fri, 3 May 2024 19:46:38 +0000 (UTC) Date: Fri, 3 May 2024 21:46:32 +0200 From: Borislav Petkov To: Robert Richter Cc: "Rafael J. Wysocki" , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, Andy Lutomirski , Peter Zijlstra , Alison Schofield , Dan Williams , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, Derick Marks , Jonathan Cameron , "H. Peter Anvin" , Len Brown Subject: Re: [PATCH v7 1/4] x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() Message-ID: <20240503194632.GBZjU_GOFUNDD-3zkK@fat_crate.local> References: <20240502131012.2385725-1-rrichter@amd.com> <20240502131012.2385725-2-rrichter@amd.com> 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: <20240502131012.2385725-2-rrichter@amd.com> On Thu, May 02, 2024 at 03:10:09PM +0200, Robert Richter wrote: > For configurations that have the kconfig option NUMA_KEEP_MEMINFO > disabled, numa_fill_memblks() only returns with NUMA_NO_MEMBLK (-1). > SRAT lookup fails then because an existing SRAT memory range cannot be > found for a CFMWS address range. This causes the addition of a > duplicate numa_memblk with a different node id and a subsequent page > fault and kernel crash during boot. > > Fix this by making numa_fill_memblks() always available regardless of > NUMA_KEEP_MEMINFO. > > As Dan suggested, the fix is implemented to remove numa_fill_memblks() > from sparsemem.h and alos using __weak for the function. > > Note that the issue was initially introduced with [1]. But since > phys_to_target_node() was originally used that returned the valid node > 0, an additional numa_memblk was not added. Though, the node id was > wrong too, a message is seen then in the logs: > > kernel/numa.c: pr_info_once("Unknown target node for memory at 0x%llx, assuming node 0\n", > > [1] commit fd49f99c1809 ("ACPI: NUMA: Add a node and memblk for each > CFMWS not in SRAT") > > Suggested-by: Dan Williams > Link: https://lore.kernel.org/all/66271b0072317_69102944c@dwillia2-xfh.jf.intel.com.notmuch/ > Fixes: 8f1004679987 ("ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window") > Cc: Derick Marks > Cc: Dan Williams > Cc: Alison Schofield > Reviewed-by: Jonathan Cameron > Reviewed-by: Alison Schofield > Reviewed-by: Dan Williams > Signed-off-by: Robert Richter > --- > arch/x86/include/asm/sparsemem.h | 2 -- > arch/x86/mm/numa.c | 4 ++-- > drivers/acpi/numa/srat.c | 5 +++++ > include/linux/numa.h | 7 +------ > 4 files changed, 8 insertions(+), 10 deletions(-) This needs to go through the ACPI tree but because Robert asked and FWIW: Acked-by: Borislav Petkov (AMD) Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette