From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C5BD29AAF7 for ; Wed, 7 Jan 2026 08:33:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767774826; cv=none; b=RHPes3grUJpUD8QaMHKv7RWL0gum+By3RerdJo1VmUrPz8S3HsOMpx0mYorDNBT/am1pKQNoD4zahQ8DAhdAEkIZA3priW4HxlYhgP29nOy7G+wVuHW25EWx0/klcpk3YKin8C+tKSp9G0/VBCu+T8+Nj+ZfpF9uzWYd0eyk/e0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767774826; c=relaxed/simple; bh=pZsEn4FYdw670Ewy11pQRvxkezasdcbckmVkUxtVLBA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pvhT2W8iF7Y/qdD6PgkJr0Orsk0V8tIU6xGX5G0gOj7HaYUdNXIwfpBfhk6QCD9P1bUgoGN35NSM+UjCWWd9UbmTn+fPIOPs0/KEAGz9q3uNYhPpA16zNH701L8WYeEDWf2n8wY8RgvFZZqWXrPLifjlcazgKKrXQGo/1YmsRKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 306A4497; Wed, 7 Jan 2026 00:33:36 -0800 (PST) Received: from [10.57.95.107] (unknown [10.57.95.107]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D5EEC3F6A8; Wed, 7 Jan 2026 00:33:41 -0800 (PST) Message-ID: Date: Wed, 7 Jan 2026 08:33:39 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm64/mm: Assert NR_BM_PUD_TABLES for bm_pud[] Content-Language: en-GB To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org Cc: mark.rutland@arm.com, Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org References: <20260107061606.3160088-1-anshuman.khandual@arm.com> From: Ryan Roberts In-Reply-To: <20260107061606.3160088-1-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 07/01/2026 06:16, Anshuman Khandual wrote: > There is an implicit assumption about bm_pud[] being single entry PUD table > just like bp_pmd[] which is a single entry PMD table. Though only the later > gets asserted via NR_BM_PMD_TABLES. Hence let's add a similar check for PUD > table as well. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > arch/arm64/mm/fixmap.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/mm/fixmap.c b/arch/arm64/mm/fixmap.c > index c5c5425791da..e02594be8b8e 100644 > --- a/arch/arm64/mm/fixmap.c > +++ b/arch/arm64/mm/fixmap.c > @@ -23,8 +23,11 @@ static_assert(FIXADDR_TOT_START > PCI_IO_END); > SPAN_NR_ENTRIES(FIXADDR_TOT_START, FIXADDR_TOP, PMD_SHIFT) > #define NR_BM_PMD_TABLES \ > SPAN_NR_ENTRIES(FIXADDR_TOT_START, FIXADDR_TOP, PUD_SHIFT) > +#define NR_BM_PUD_TABLES \ > + SPAN_NR_ENTRIES(FIXADDR_TOT_START, FIXADDR_TOP, P4D_SHIFT) > > static_assert(NR_BM_PMD_TABLES == 1); > +static_assert(NR_BM_PUD_TABLES == 1); But if there is only one PMD table, there must only be one PUD table (and one P4D table, and one PGD table) by definition. So I don't think this is checking anything that the existing PMD table check is not. Thanks, Ryan > > #define __BM_TABLE_IDX(addr, shift) \ > (((addr) >> (shift)) - (FIXADDR_TOT_START >> (shift)))