From nobody Wed Dec 17 12:48:32 2025 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AEC12451F5 for ; Tue, 10 Dec 2024 22:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733868353; cv=none; b=dQIHVVW+L03Vkjcg13p7a64xa4JEdNBb6j4b4/dxI1BhiC6Yf9oul+4aevj4lWj+7UbbStrTy6E8DzFiFmCNyHuu8oX090B8LWkvrp+9BAauPMQwxXNbsqtSLTdbpDUiOefU9/moRywMdTVOqEGHbHFNsnO+FwYf9uUFF1h95EU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733868353; c=relaxed/simple; bh=Fh3n7PO+dBFbjqXgXF7FsyhtwUGk4+k4X3Y2eq0ifU0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aaxoV94YQ35bICZ7un7d/FxowYbE0Jx4f1NmXvC/XiXCeq/pBfpLOohwbPo8ZSc6MdbA1bynOqRTxYLR+WJyuHs1ZsgfQ+rHNUcxfwN/gZIcC45qQq0LZIeOV2iW/vAZEErdZN5nAWd+IvhzwXR2lvjmBNpEG9hPsNF8T3ibjLc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=ZPlmdnOn; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="ZPlmdnOn" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-6d89a727a19so905776d6.0 for ; Tue, 10 Dec 2024 14:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1733868350; x=1734473150; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EAbRT3t6URREoSf/WrSmqWIQoci4Yw7h23phPh/fk7k=; b=ZPlmdnOnmen35vIY7iDVA41Snl46w80ILte2Oo6TSP8IcyhfgV9KXL+g0Q99zSJHvv IdvxlJGNpjUDwA3QkCzGtS85/0JVzsdP0XCH+5a7nRwyfYk6wDNhRN8iNoXa3o7VtDVe Mhf0aG9cPCqf7UixaK+oPiL5B17fozdxwp/alWSeaIRnS6FUfxUCGtOU6S5L0UqqaXC1 +I1Wy796XCKMrUM0oVQ4MeRGpl/6McUrbSpk+kNxt+ulj//oR+L18o1ca107zSBj/XJm yfg3r04gh6EWackkjmxtWhdfj7Qx0+X7kScSAfmZukVbWc0+C1vu0g1uMzZiwVPsXYlm o0WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733868350; x=1734473150; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EAbRT3t6URREoSf/WrSmqWIQoci4Yw7h23phPh/fk7k=; b=v85Dxjdl+UVopW6MLYJcRYOM6iMhaZq2DFWKTeoK85bjO20AMu5DsfBreGQHbYVVcJ VFVBfMemo6eF+zYvJcJJoNWIlFi8JSM6yjDDb9bKBFbzgW554d+kWM6yJpLN5FSXM+IU xFvfHiKq1LFPRxqFEtxF89s72699sP8Ib5KR+gAGjvRq3PO9S3UBKjzjL01LZNyv1HIe MXovMLJ6yAs5YnycR/9/CD6ElpyLiLqltucEi5RTeO2bIda4VKUnzdXKhvhQtQA5HUx8 Iv9l9i5Df4/7O5wkY9Jod6kTIvXWeZSLWsQJlYmBAfSwHspNLM9sp4ks5tp+6ayQcUct aM0Q== X-Forwarded-Encrypted: i=1; AJvYcCUG08598r6DwXpXKXtocszU3f3E7CJiguNOHmhxupQig1LxN0Yr3ltr8lX2sCkMeiscsAXYGUNetDyorQY=@vger.kernel.org X-Gm-Message-State: AOJu0Yz9dQxiae2YHrSMSriuiicplPjqMlJ5VlWsRoK4wahsc62VrKVc JipLSVJ15OHJswER2I8E5gMSx+sX7nE9yQNAwaDlmop0VkkwGUfVbcgetmh+lvo= X-Gm-Gg: ASbGncuh9iniC58ngUaRsgjfLg3MqY6XEsDUjrykQGvRoC60J3pmOL6qahXshvDBm6J vHCgo8R2eB4FUV5EreqDZm57hjbfi3wtChpPuGfgF15Xph7aZl7zaDMNYAN/trMGOeKrivFcCjz bxmUFzyGkpLzlwory0sWbwzze/5qYgvyNpE2pkLKbO/jYypkHzb8Mk2nyL3dM0ifYzP0hB8nzMw 7jERp73o8AzpOoBMVq/dNXubOBoPUDh2KY6gsKpY9g4nOkXhmOg+o44YEUgEzRWho/AS2GJt+hK WKyu9rvMG1aNvytPKtuH4ae09JPFhFlFJxAXTFc= X-Google-Smtp-Source: AGHT+IFa401/2CB5gCylFx+OUusnw00jP99YqBV6GuTzUiOFDtq2M92ekuKX3e9+dJid45ADWSbIGg== X-Received: by 2002:a05:6214:260f:b0:6d8:98a0:23b6 with SMTP id 6a1803df08f44-6d9351fb640mr8120916d6.4.1733868350323; Tue, 10 Dec 2024 14:05:50 -0800 (PST) Received: from PC2K9PVX.TheFacebook.com (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d8eeb132e1sm49707756d6.35.2024.12.10.14.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 14:05:50 -0800 (PST) From: Gregory Price To: x86@kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org Cc: linux-cxl@vger.kernel.org, kernel-team@meta.com, dan.j.williams@intel.com, ira.weiny@intel.com, gourry@gourry.net, dave.hansen@linux.intel.com, david@redhat.com, rppt@kernel.org, akpm@linux-foundation.org, luto@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, rafael@kernel.org, lenb@kernel.org, osalvador@suse.de, Fan Ni Subject: [PATCH v7 3/3] acpi,srat: give memory block size advice based on CFMWS alignment Date: Tue, 10 Dec 2024 17:05:17 -0500 Message-ID: <20241210220517.3744-4-gourry@gourry.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210220517.3744-1-gourry@gourry.net> References: <20241210220517.3744-1-gourry@gourry.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Capacity is stranded when CFMWS regions are not aligned to block size. On x86, block size increases with capacity (2G blocks @ 64G capacity). Use CFMWS base/size to report memory block size alignment advice. Suggested-by: Dan Williams Signed-off-by: Gregory Price Acked-by: Mike Rapoport (Microsoft) Acked-by: David Hildenbrand Acked-by: Dan Williams Tested-by: Fan Ni --- drivers/acpi/numa/srat.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index bec0dcd1f9c3..af7d51222933 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -339,13 +340,22 @@ static int __init acpi_parse_cfmws(union acpi_subtabl= e_headers *header, { struct acpi_cedt_cfmws *cfmws; int *fake_pxm =3D arg; - u64 start, end; + u64 start, end, align; int node; =20 cfmws =3D (struct acpi_cedt_cfmws *)header; start =3D cfmws->base_hpa; end =3D cfmws->base_hpa + cfmws->window_size; =20 + /* Align memblock size to CFMW regions if possible */ + align =3D 1UL << __ffs(start | end); + if (align >=3D SZ_256M) { + if (memory_block_advise_max_size(align) < 0) + pr_warn("CFMWS: memblock size advise failed\n"); + } else { + pr_err("CFMWS: [BIOS BUG] base/size alignment violates spec\n"); + } + /* * The SRAT may have already described NUMA details for all, * or a portion of, this CFMWS HPA range. Extend the memblks --=20 2.43.0