Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4629218pxb; Tue, 25 Jan 2022 14:58:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlhUuxEap27o6zii1RAWO0ybry/i9U9Frw7L+NsVVESCjuZx3GdKOyBlxi+UwM39V5cDwU X-Received: by 2002:a17:907:2ce6:: with SMTP id hz6mr15066406ejc.103.1643151531505; Tue, 25 Jan 2022 14:58:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643151531; cv=none; d=google.com; s=arc-20160816; b=W7+4l2ZMP/o+h6Ii1j582afPfWOGLQJuaDz7D1P0Pf+AX/tDkU7W2uQmJ28p5Rp2YD h+KVgRlmbokNGn5OZZNr5z1Yu2XkpNzs/hf6rc+6xkPRtBS5j1DrKdbM+fEWyPsGU8WP d9KU7dFunpZdlza+WyEXdm3rtd09Vw9HGFiaz14YpaXxt2MVnu3ihvM8eRF56+EeRvAc PF+vOtSzHgNWcEJoShhmP++w9aYw6yjRwbcVrazzLuCrnmuYh8JGEllzfw2WqvWUPZ2M T1f0bOU2XUFgrIWaQkaw5vX+bANXMhY6JcZ8rKC5HIQALo5U2tSdprk3wEaBWRczba0k 1RDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=v3aVlIe1/anVwuYlYEDfwSot2IXQ3CcbqZhE6v2Bu9s=; b=k8m21mIUpUaziNxB0Cm1RjxfGkkV+zH7UlOockXuCMgg4XNSPUQpPKKn4CsQHfSCxQ OHYfPZEQlSOmeh1ILS7r8f5ToOrxPivtCZYy4OYhZVlBu5ojBM4st02UouWWe4Pjo3jW psdhJ2+oaUIVTPA5TpwSNHI089AjX4s/OgnPl6jxuHpNw6Pag1T/ZQ0r6DR8Q4pJglyo PC/Esez1Vt7T2M8Q55kii1JeBvG8p19uvAbxyo4tmaw5Wj4mA6IW6KVv0hr7778FMOii P8G93FosYYSNN71qU2L8D8a3P1+vqmUeFTWNdlAikSsOUdqwDncpxeDQlryKrAgRNUUs 1w4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hYM1D5+u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si10925207edj.100.2022.01.25.14.58.27; Tue, 25 Jan 2022 14:58:51 -0800 (PST) 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=k20201202 header.b=hYM1D5+u; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378475AbiAYQE2 (ORCPT + 99 others); Tue, 25 Jan 2022 11:04:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344537AbiAYQD0 (ORCPT ); Tue, 25 Jan 2022 11:03:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB21AC06173D for ; Tue, 25 Jan 2022 08:03:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 96281B818D8 for ; Tue, 25 Jan 2022 16:03:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75246C340E0; Tue, 25 Jan 2022 16:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643126598; bh=KHKViS+ZOMcXA32XNvw1CZnIuutNB5Xs6JKM3HBXQfI=; h=From:To:Cc:Subject:Date:From; b=hYM1D5+uPzvDjlfDRdH4f3pp48z93xP+lQQiLcp5LxIr24/ysoaQzRTJ6Buw8OdjZ Dof/Z0dUBMVgcCOQebSZE1MmT1z0Z6Ta9EyDfH32tRo4/m8AC1KnpjwQkzQr5toEro UnLN2SQ/uKQTEOgD2z3IEwUXyfDZyQCUHAjpw8Ax6dvkQTFDI5UF0E7HOp10RrqsbY 5WqYEURdPCuJT34B3A+fKODtI2Ng1vr6gfKSdkUctMOuvKtnQxHdl1Gps6lkUNeJMz WWJnPCBFe3jzG5vRMiPKKeYjitGF9pE9zmekMDbdNo83H6LyNbonlwnTK43eeANvoK bBccW2HwkjjvA== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Ghiti Subject: [PATCH] riscv: mm: remove the BUG_ON check of mapping the last 4K bytes of memory Date: Tue, 25 Jan 2022 23:55:42 +0800 Message-Id: <20220125155542.3753-1-jszhang@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org remove the BUG_ON check of mapping the last 4K bytes of the addressable memory since "this is true for every kernel actually" as pointed out by Alexandre. Signed-off-by: Jisheng Zhang Reviewed-by: Alexandre Ghiti --- arch/riscv/mm/init.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index cf4d018b7d66..8347d0fda8cd 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -811,14 +811,6 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa) BUG_ON((PAGE_OFFSET % PGDIR_SIZE) != 0); BUG_ON((kernel_map.phys_addr % PMD_SIZE) != 0); -#ifdef CONFIG_64BIT - /* - * The last 4K bytes of the addressable memory can not be mapped because - * of IS_ERR_VALUE macro. - */ - BUG_ON((kernel_map.virt_addr + kernel_map.size) > ADDRESS_SPACE_END - SZ_4K); -#endif - pt_ops_set_early(); /* Setup early PGD for fixmap */ -- 2.34.1