Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2657920pxa; Mon, 17 Aug 2020 15:44:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5yKps3ORXhi431Hw6sMaGh5JoLC6hmGLNtrdCDGgDstWPUEzWsw1XmtLyWE/cV80EAdSR X-Received: by 2002:a05:6402:1bc1:: with SMTP id ch1mr17290565edb.142.1597704266300; Mon, 17 Aug 2020 15:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704266; cv=none; d=google.com; s=arc-20160816; b=zZ85icYs/Jr6aV4s66Zd0feP/O305jbzH5lzoZz9i899ifgMqpwQwJM7NMq3tVn4ek Q+8EkN6Iyp4roaxd/hAIS5fWfrl4NRM0IxR8s/hExLK2i9plqu++OSa1FblclAsKfjh0 DORahtRzduQAId61kUmErPxY2z0HklQ09YrZqrDMjSNq44ZBQQ/jSpadiruYh7axzVyi Eqp5CElxzaJZ3CzW2ydldtWLcMKyPrCojtcDZPRaiF21Ec9ST9+kUERe5ds/xuk2qSTp W3czybkCforywORIj34dQIEygoQgWEL525KjQ+E9mTHbJKWlvYGpqa6POrYRJuc19ThX Wp2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UuXrliiHffyHEU4gNgPpdyXmU38ltuyXPPIiBiIy6Ok=; b=VqUcDysQxtKHOn8VmoYfXOGNboiLlAiL8mACCfq5bNNesdh21+kDeWvbCBn+BDBUcN F3kjWEEvWqZkLweSqxBg3nFZg+vwyEF5TVUdokbg4Dkv0V5kYOlhHDq3tMtUEzQntLDT H9sQRg77FkhpfXRTTQmV3PJNpxS2QE+/nVGHdBLVYYAmX/OMaYp+25IVYGlaC9ymxox6 kLlsZ6uv2LRmvgkiYkQ93HH5eYGom7Pp4e/sKn91Enfyj/73oAWM+s8EUeYcOkK7OVd7 WjIbOnvFSKBfLwTxuG61IPbHSWF4WxGonXmedlyUy2XaXL9xOcZuGzZ9qt7T7qV2RyvC RdSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OLY+0Qpu; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si13207443edn.359.2020.08.17.15.44.03; Mon, 17 Aug 2020 15:44:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=OLY+0Qpu; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391630AbgHQTBy (ORCPT + 99 others); Mon, 17 Aug 2020 15:01:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:59632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730824AbgHQPrf (ORCPT ); Mon, 17 Aug 2020 11:47:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 549D72065D; Mon, 17 Aug 2020 15:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679254; bh=TMQK9uOZoj6tbB77XQ2uVp/0+/Y91TXINTGPzdp7Gp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OLY+0QpuX9s2Vh4NBiFh4rkc1EiAerv1cxS3DYaiFsMsToJK75SF9ODIxf7gVG4+U gV7VLcKVZxd7zt1CsAy0rh+VSJXZzG45Npa8fCt95++sW9/7UmO9BC+GJYxcqDDYr5 CMPJAPS5bHd43rKfjENHHW7W8eBn57owgUiJM3Zw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 5.7 148/393] powerpc/fixmap: Fix FIX_EARLY_DEBUG_BASE when page size is 256k Date: Mon, 17 Aug 2020 17:13:18 +0200 Message-Id: <20200817143826.792021886@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy [ Upstream commit 03fd42d458fb9cb69e712600bd69ff77ff3a45a8 ] 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. Fixes: b8e8efaa8639 ("powerpc: reserve fixmap entries for early debug") Reported-by: kernel test robot Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ca8c9f8249f523b1fab873e67b81b11989d46553.1592207216.git.christophe.leroy@csgroup.eu Signed-off-by: Sasha Levin --- 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 2ef155a3c8214..77ab25a199740 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.1