Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp5077358pxy; Tue, 27 Apr 2021 20:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+XaUU9mSbi7DZbXaMMtQf3O3U20miQXc08g1vlSH1AwOFjZqLiCz37bdK/ZED0QrGs4CJ X-Received: by 2002:a05:6402:12cf:: with SMTP id k15mr8226368edx.130.1619581345715; Tue, 27 Apr 2021 20:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619581345; cv=none; d=google.com; s=arc-20160816; b=UFktkNt9ePerM2zOPNKAiFxvUz83SJ5Dsj4HXIie3XeJuJa/oJwoi0gnKruvMsDITI 07llv2tJTTj4Z5zQEY+ZtzftWwbQa18+ykksM/GewrJQ5/BqoKiYiF+DoJtot1hXS2T0 NYVwbQ+pcJwRnkldBXibzeNoztqLDbux+qF4UdgqDZilFQnsg1YUW1h8KfDr7P6zOiCY uCYHOcwnR5go0K6YVrn8UJntVfgWTkogw43J0pY7d4xi7c1ZQYsVHUJ+VcL8NyOYy7el uV4EW6scn2l071QKxGvCyUNI8xGb5WPjCurSGjnZ5lHudPJbBH8MquVbd0vibrADjrOs +7RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=unJ/nW7IwIPU8FuEPxu2WTBi2sq/u62GKZm9+1iXWxg=; b=0jd2bZUQKGLUYd1rGT4Qc1Lch2KfLpblS+A+sNZcvTM5GpblZZtY+eiStLcRvfUz3C 55MgW+ZN8102UY+A5nmQV8BD9ZgKra9t7RbkCHSNBAPRpxODJU5aVzRGjnEC33scVD0/ czeykxZk8DW1U4zeUUQfb9JmYFQ4R1pDlPbVe12erBD9kiv4DJ+WUSPPJsjF07dO717J wbJ7vl0ths4g3W0U1hPQBJCMlykvoyW2zt+XGGWW3hQuQUvEOdUwP5Cb6ZGXX3E0TqsJ Y/tq/oUEAlsRPO+I/xdIjqvc6HaDBjVHbOPY6RfAcRXx6h4AXGd4DbJd+DixcHHBtz9E XX4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=QZH1yvad; 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 u26si1760049ejj.30.2021.04.27.20.42.01; Tue, 27 Apr 2021 20:42:25 -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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=QZH1yvad; 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 S230490AbhD1Dls (ORCPT + 99 others); Tue, 27 Apr 2021 23:41:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbhD1Dlr (ORCPT ); Tue, 27 Apr 2021 23:41:47 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E7BFC061574 for ; Tue, 27 Apr 2021 20:41:03 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id n4-20020a05600c4f84b029013151278decso7883422wmq.4 for ; Tue, 27 Apr 2021 20:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=unJ/nW7IwIPU8FuEPxu2WTBi2sq/u62GKZm9+1iXWxg=; b=QZH1yvadssNTkCLMPr/YyOHxUqvnHGZdJCeQ0QG07wZ0c8v0Tq0mdqoauuoTNo8c5t 52FJF+EF5/YcdSBwaM+q6wczSHVyrqMzy7KO8c6WMEyJ5VU2ugjm8CcPR2jttv1T/2O6 OQX7EngW1Kd701aUoIHwM9CM6zKwoGh0O7QqHeOzcDnsSBDAxguVsEwXzdNPa965DUQx uNdKG3sM+V3YHeIQciUPGRNi+aEFtzAjLBmOvqJwb43mMmKtUGURK7e1fhZdAufBrwdf 9VRI74ZT2q5ZsWsHB9vphithqi77n7VEtA8rNG3EUPgub2WbkFATcl1aDrnfbtmPUPpO g+gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=unJ/nW7IwIPU8FuEPxu2WTBi2sq/u62GKZm9+1iXWxg=; b=PcLjwTPovO5VQ9mqy6PDrnzKmeroUnCfX2sNHZk7QZiE6OYLqGDnuGSrYJ2ZbW8Rv4 21FEcOQQlQGNDCHNqgfDMhi5nLbGhBhSwqreV6iiRnrOKNfgKk0j7LmW13sYjpDFVtcS S96I9kDn0oI9etAfSpqe5ma2sfCYGKGRu0ul5STniQzkZdiV9UnPxeU6m8D0+YDLuyUt 2ohzqSElI50HN5IAg4PQ1s2s+/Krst2anL0ETqym5H4pSoBQOsRHvtaynGeqneyn2psu lSmcij2vdq34K2QkM2qMS0O0lMPIAIgwX6uqtEITXB0IMyGOMiVzDVtVnn/rSWWAnsc6 H/2w== X-Gm-Message-State: AOAM5300Up4jyg2GC3iTNI4Qc3Es0GIwCd6oUbb0H4FiXd7hk+1TbljC xDhqA+GL4sUqzpqBYNmm0FAGZ3yRPb7uriRy1VLrEQ== X-Received: by 2002:a7b:c348:: with SMTP id l8mr1765461wmj.152.1619581262305; Tue, 27 Apr 2021 20:41:02 -0700 (PDT) MIME-Version: 1.0 References: <20210428033415.107756-1-palmer@dabbelt.com> In-Reply-To: <20210428033415.107756-1-palmer@dabbelt.com> From: Anup Patel Date: Wed, 28 Apr 2021 09:10:51 +0530 Message-ID: Subject: Re: [PATCH] RISC-V: Always define XIP_FIXUP To: Palmer Dabbelt Cc: linux-riscv , Paul Walmsley , Albert Ou , Andrew Morton , Atish Patra , Anup Patel , Kefeng Wang , Mike Rapoport , Vitaly Wool , Alexandre Ghiti , Greentime Hu , 0x7f454c46@gmail.com, chenhuang5@huawei.com, "linux-kernel@vger.kernel.org List" , kernel-team@android.com, Palmer Dabbelt , Guenter Roeck Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 28, 2021 at 9:05 AM Palmer Dabbelt wrote: > > From: Palmer Dabbelt > > XIP depends on MMU, but XIP_FIXUP is defined throughout the kernel in > order to avoid excessive ifdefs. This just makes sure to always define > XIP_FIXIP, which will fix MMU=n builds. > > Fixes: 44c922572952 ("RISC-V: enable XIP") > Reported-by: Guenter Roeck > Signed-off-by: Palmer Dabbelt Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- > arch/riscv/include/asm/pgtable.h | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h > index 2f1384e14e31..fd749351f432 100644 > --- a/arch/riscv/include/asm/pgtable.h > +++ b/arch/riscv/include/asm/pgtable.h > @@ -73,18 +73,6 @@ > #endif > #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) > > -#ifdef CONFIG_XIP_KERNEL > -#define XIP_OFFSET SZ_8M > -#define XIP_FIXUP(addr) ({ \ > - uintptr_t __a = (uintptr_t)(addr); \ > - (__a >= CONFIG_XIP_PHYS_ADDR && __a < CONFIG_XIP_PHYS_ADDR + SZ_16M) ? \ > - __a - CONFIG_XIP_PHYS_ADDR + CONFIG_PHYS_RAM_BASE - XIP_OFFSET :\ > - __a; \ > - }) > -#else > -#define XIP_FIXUP(addr) (addr) > -#endif /* CONFIG_XIP_KERNEL */ > - > #endif > > #ifndef __ASSEMBLY__ > @@ -101,6 +89,18 @@ > #include > #endif /* CONFIG_64BIT */ > > +#ifdef CONFIG_XIP_KERNEL > +#define XIP_OFFSET SZ_8M > +#define XIP_FIXUP(addr) ({ \ > + uintptr_t __a = (uintptr_t)(addr); \ > + (__a >= CONFIG_XIP_PHYS_ADDR && __a < CONFIG_XIP_PHYS_ADDR + SZ_16M) ? \ > + __a - CONFIG_XIP_PHYS_ADDR + CONFIG_PHYS_RAM_BASE - XIP_OFFSET :\ > + __a; \ > + }) > +#else > +#define XIP_FIXUP(addr) (addr) > +#endif /* CONFIG_XIP_KERNEL */ > + > #ifdef CONFIG_MMU > /* Number of entries in the page global directory */ > #define PTRS_PER_PGD (PAGE_SIZE / sizeof(pgd_t)) > -- > 2.31.1.498.g6c1eba8ee3d-goog >