Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3171872pxj; Sun, 23 May 2021 23:53:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbUZLQlBbv6CzGRas59jwV1axXQVL721ZWW65HDQXrlkoss+V7qMgFVfpT2P+/wsKaxjiN X-Received: by 2002:a17:906:6981:: with SMTP id i1mr21722595ejr.289.1621839219603; Sun, 23 May 2021 23:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621839219; cv=none; d=google.com; s=arc-20160816; b=FbnoLAJFyLOi4sbPVckDqOqo84OUbNZexaEYbYO2bwUtUdlAlunNvIlBGUosAHNjUZ 2Jl6e8MdgOJTySuOfOVoxjP46EJtEhaSihLxikJ7s8t1ACbsYMvYVIFX1WIBTnGnda7b emc8W6vzO7v2E11BLQQCvrH14IzpTx5+F3pbVmTT34YDrLdwjnQEyR5SWoQ49OtwqYdd pIT/elyasrP1tB1+h9epqVZCK1gHqvQoIwGx/A2T9SHGhGhUHpd5xkwps6dIMmOdI6Gm PlkKjZcKtFhiIO0vm9q/kQYltw//JplOy+hiu1qdpkomOZnnrbeRnOHq5bMAk6Ndhte4 EFhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=zwc07YT+WED/csUI9zGBfaW339bC5lvZdGSECWjDzyM=; b=cbymd9n5g35ezom6eyQFu0GVJa8GmlyBF/omEkjZc69xB7DqcLCyo+ktiF8otUyVMa vCucYANihHkcE6Cfe1unjd66cPlttwrznof2ry1twgIhgD/SWIg7N6l14vC5C37plF1F eak9W9udrG5iCnfXBiRcTqh3THA+hVoitbPClZxrmsZilvUylhsyyYhoepli+8tBM+J6 SwXSwEc7N8C9zr6JYGAgtqNtMqjW3c9+UdFhkCLregU/7UG2NMlQ/vHcmJ/3O3J6qbz3 TFzHut5hEixIBLje3DPSsEhYOLeXhoogm2fZv+bNXKZx17mWDvU/A046WoC5TditybjV wQww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=udf5cfge; 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 p3si9290535edu.599.2021.05.23.23.53.17; Sun, 23 May 2021 23:53:39 -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=k20201202 header.b=udf5cfge; 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 S232349AbhEXGxe (ORCPT + 99 others); Mon, 24 May 2021 02:53:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:60608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232358AbhEXGx3 (ORCPT ); Mon, 24 May 2021 02:53:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF7D16105A; Mon, 24 May 2021 06:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621839121; bh=KUxxMIboqKng0IyfhiaidfhsDw8pJK1odbLPMKgDjI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udf5cfged3xJcKnJN0XoXqeYbQ0f5K1ItIBM4/rX3qVl3zq0o66OSs+jvQI8iGKPi k3TNWFD0Wy++YLJR6elWv1awp2Hc+F8SlD4xUyJURVV790FfznntEmso4uz/Hp7IQ+ h7GILcX79KxX4twcBc3GHarBu8vgWHfQGRXMH59acXvLCfA2IJlu8mTNH5+QGDQInw 5lO+UsL4yaX/UsydRvf/0l2qGbksND2U/lJGO8t4lLjCxMRfzJVk3t/VXBKPRvlzkN HodTttLhOO8Ti2TSX8dLoDT/UDIkfVx/psRGBdRVL/+zQZkUWpHbYPUoWTVQf4qfcg oyQlhK6dUtqgQ== From: guoren@kernel.org To: guoren@kernel.org, anup.patel@wdc.com, palmerdabbelt@google.com, arnd@arndb.de Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-sunxi@lists.linux.dev, Guo Ren Subject: [PATCH 2/3] riscv: Fixup PAGE_UP in asm/page.h Date: Mon, 24 May 2021 06:51:07 +0000 Message-Id: <1621839068-31738-2-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1621839068-31738-1-git-send-email-guoren@kernel.org> References: <1621839068-31738-1-git-send-email-guoren@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren Current PAGE_UP implementation is wrong. PAGE_UP(0) should be 0x1000, but current implementation will give out 0. Although the current PAGE_UP isn't used, it will soon be used in tlb_flush optimization. Signed-off-by: Guo Ren Cc: Anup Patel Cc: Palmer Dabbelt --- arch/riscv/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h index 6a7761c..c611b20 100644 --- a/arch/riscv/include/asm/page.h +++ b/arch/riscv/include/asm/page.h @@ -37,7 +37,7 @@ #ifndef __ASSEMBLY__ -#define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) +#define PAGE_UP(addr) (((addr)+(PAGE_SIZE))&(~((PAGE_SIZE)-1))) #define PAGE_DOWN(addr) ((addr)&(~((PAGE_SIZE)-1))) /* align addr on a size boundary - adjust address up/down if needed */ -- 2.7.4