From patchwork Sat Dec 23 00:10:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Schofield X-Patchwork-Id: 758475 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 D71C77EE; Sat, 23 Dec 2023 00:10:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WQhcVHaR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703290249; x=1734826249; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=afU5wIxdwWlNn3gp/rwS4T6JsOud7wKWimp37CFAj40=; b=WQhcVHaRD7VwUO+YFCJTm+dK2fORDmmy1sU9ISXjeeIJabSLMrq5x/Ya pGMqqG5JV9Jo/No7ucw8DyGYBmRrG9Y2Zy5x+jz7LlZ7/F79k2LizTIxX mql8wbg1O9l5WYKjyiUmMs18OAEWVTBVVnkJh8ELttVRL1yM2qo2i4AVu igfhJYH6fESnUWxPBO75h0HBMVR905bwvFn/kYo1WsO/6F/u3yacbzXa1 qUzSeMCx4bxBFxk4rTCd8dslZM0wv1IRjKAMri6k9IwkEXZOrLJAyjYQa lL6yU7Ul7hvEGzBxt0I4eIcwum6h1OJom+XUCr9XHt7bFscGqV5gsybaR g==; X-IronPort-AV: E=McAfee;i="6600,9927,10932"; a="14850201" X-IronPort-AV: E=Sophos;i="6.04,297,1695711600"; d="scan'208";a="14850201" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2023 16:10:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10932"; a="900641890" X-IronPort-AV: E=Sophos;i="6.04,297,1695711600"; d="scan'208";a="900641890" Received: from aschofie-mobl2.amr.corp.intel.com (HELO localhost) ([10.212.160.53]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2023 16:10:47 -0800 From: alison.schofield@intel.com To: "Rafael J. Wysocki" , Len Brown , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams Cc: linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org, "Huang, Ying" Subject: [PATCH v2] ACPI: NUMA: Fix overlap when extending memblks to fill CFMWS Date: Fri, 22 Dec 2023 16:10:44 -0800 Message-Id: <20231223001044.1401226-1-alison.schofield@intel.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Alison Schofield When the BIOS only partially describes a CFMWS Window in the SRAT the acpi driver uses numa_fill_memblks() to extend existing memblk(s) to fill the entire CFMWS Window, thereby applying the proximity domain to the entire CFMWS. The calculation of the memblks to fill has an off-by-one error, that causes numa_init to fail when it sees the overlap: [] ACPI: SRAT: Node 0 PXM 0 [mem 0x00000000-0x7fffffff] [] ACPI: SRAT: Node 0 PXM 0 [mem 0x100000000-0xffffffffff] [] ACPI: SRAT: Node 1 PXM 1 [mem 0x10000000000-0x1ffffffffff] [] node 0 [mem 0x100000000-0xffffffffff] overlaps with node 1 [mem 0x100000000-0x1ffffffffff] Fix by making the 'end' parameter to numa_fill_memblks() exclusive. Fixes: 8f1004679987 ("ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window") Reported-by: "Huang, Ying" Suggested-by: Dan Williams Signed-off-by: Alison Schofield --- Changes in v2: - Send to ACPI maintainer, reviewer, and mailing list. drivers/acpi/numa/srat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 12f330b0eac0..b99062f7c412 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -308,7 +308,7 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, cfmws = (struct acpi_cedt_cfmws *)header; start = cfmws->base_hpa; - end = cfmws->base_hpa + cfmws->window_size; + end = cfmws->base_hpa + cfmws->window_size - 1; /* * The SRAT may have already described NUMA details for all,