Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1492693ybt; Mon, 15 Jun 2020 01:28:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh13sEULVGe/eKBXJvijoaMx8XHpqSC4MgMj4wRS4NLs7tx9+GV2uVMkdyOo9W4YtWUpJm X-Received: by 2002:a50:d7d1:: with SMTP id m17mr23528477edj.126.1592209729772; Mon, 15 Jun 2020 01:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592209729; cv=none; d=google.com; s=arc-20160816; b=utaktSj+3Z0+QsGheHzIVT6DjbFJJiz3e4TlqQFiA3j/JzCA3+KVVxch2OjDS7nT6i 6iZYHgoFJc8dpRLg+xW53Q17rozS31B3wpfrUFDw6V4cu0L5A1s29Q8kqbPt2vcGeomN t3iiz/+nw9LNAmfqLEwl2qRJgcjwV3r5DG4RU+McG2JQ0Nq1i4fdvFoUXyttkZXG+ilq HHx30alBER6iB0bBr61tJeiBt00J7D/zV/B2dzbHylu7k70h1/Nq/LPV4g9RH8RP6pTl 5aDlZqcAMeE4CRqQRZ4h5+YVhxbQ7ZeeymCliLIh+SDM/i38VnHXQBQYC6KwXwRNeySm sNEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id; bh=m2kJQqjmI8N/WkfqWa7deVOYWwy6tp/POwWFR+kFvi8=; b=UnUvgavmzsrLNMXwjMuGg7/XRBqWn4m2Fi82+0q1TPVg89+wLoMM0cCV26bcpklLKb 96t4wFxi7jPgeSOPs20vuI7KyK+00/tfgxP3UhHoXiVl62l/Jf4Tzz83S++eA5Ja94h7 /TMIh4RJlh9guevr2LhKiPSVI8LyyuKZDMh5XezVchtzX7tjyV5aT+56BPXq1tLxz2Xb u6nE6v7rIAmjBg9QNcKjRx2ugOB2bFkY/Z6yrxCn/bjbssNXh0CBJO1APOHzXEzrAD64 mpMfd0I5tAiSN2uix+2c0FvUlsdGAOJVgIOEjYnfZijFLyFuxT8hkxq2+llBeD/PzfRp 9Flg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp1si13030805ejc.505.2020.06.15.01.28.26; Mon, 15 Jun 2020 01:28:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728782AbgFOI03 (ORCPT + 99 others); Mon, 15 Jun 2020 04:26:29 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:19322 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728162AbgFOI02 (ORCPT ); Mon, 15 Jun 2020 04:26:28 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 49lkv53h6Nz9v03C; Mon, 15 Jun 2020 10:26:25 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id b_rTsqgA_kcz; Mon, 15 Jun 2020 10:26:25 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 49lkv23ynTz9v1fZ; Mon, 15 Jun 2020 10:26:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 81B3D8B786; Mon, 15 Jun 2020 09:48:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id lsX-bHFjEBuH; Mon, 15 Jun 2020 09:48:25 +0200 (CEST) Received: from pc16570vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.104]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 44F098B791; Mon, 15 Jun 2020 09:48:25 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 1B25265B0A; Mon, 15 Jun 2020 07:48:25 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] powerpc/fixmap: Fix FIX_EARLY_DEBUG_BASE when page size is 256k To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Albert Herranz Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 15 Jun 2020 07:48:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org FIX_EARLY_DEBUG_BASE reserves a 128k area for debuging. When page size is 256k, the calculation results in a 0 number of pages, leading to the following failure: CC arch/powerpc/kernel/asm-offsets.s In file included from ./arch/powerpc/include/asm/nohash/32/pgtable.h:77:0, from ./arch/powerpc/include/asm/nohash/pgtable.h:8, from ./arch/powerpc/include/asm/pgtable.h:20, from ./include/linux/pgtable.h:6, from ./arch/powerpc/include/asm/kup.h:42, from ./arch/powerpc/include/asm/uaccess.h:9, from ./include/linux/uaccess.h:11, from ./include/linux/crypto.h:21, from ./include/crypto/hash.h:11, from ./include/linux/uio.h:10, from ./include/linux/socket.h:8, from ./include/linux/compat.h:15, from arch/powerpc/kernel/asm-offsets.c:14: ./arch/powerpc/include/asm/fixmap.h:75:2: error: overflow in enumeration values __end_of_permanent_fixed_addresses, ^ make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1 Ensure the debug area is at least one page. Reported-by: kernel test robot Fixes: b8e8efaa8639 ("powerpc: reserve fixmap entries for early debug") Cc: stable@vger.kernel.org Cc: Albert Herranz Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/fixmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/fixmap.h b/arch/powerpc/include/asm/fixmap.h index 29188810ba30..925cf89cbf4b 100644 --- a/arch/powerpc/include/asm/fixmap.h +++ b/arch/powerpc/include/asm/fixmap.h @@ -52,7 +52,7 @@ enum fixed_addresses { FIX_HOLE, /* reserve the top 128K for early debugging purposes */ FIX_EARLY_DEBUG_TOP = FIX_HOLE, - FIX_EARLY_DEBUG_BASE = FIX_EARLY_DEBUG_TOP+((128*1024)/PAGE_SIZE)-1, + FIX_EARLY_DEBUG_BASE = FIX_EARLY_DEBUG_TOP+(ALIGN(SZ_128, PAGE_SIZE)/PAGE_SIZE)-1, #ifdef CONFIG_HIGHMEM FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, -- 2.25.0