Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp5074946pxy; Tue, 27 Apr 2021 20:37:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFeWAk9AMhpZIsUmFl22aNQ2xfU4QnHJYz/op3kqmf+1RF+rmcNyniqWYcLK7r+Jjrox7Z X-Received: by 2002:a17:906:37c9:: with SMTP id o9mr26209432ejc.285.1619581055408; Tue, 27 Apr 2021 20:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619581055; cv=none; d=google.com; s=arc-20160816; b=RyhVCUOzWykltAGq++TnRQokWiF5jrmx6Ib4/RMwXYHG6XgB/xfl7t+YyWKef0CSZK R3NkZGcUxIATYUfO++FeQei/jiuMmeX6BjT0ilM9LKbzciMUqahsAWzKe7WbPpcKWBqJ aglb+Bu4NbmS5vhpDU8DH6EFkoDcJBkouuvQCHFS/9wKvjc4W97A+KhN5S8kxWbxuFN0 M2ldOP8ms7bMM2A4EvBNx7xgmJk9P0yqvoeBNNkuf06BLvC0mB/0MJlddMGl09ZOkzDn U3RTHbQ3h3FtqZCzo+etBJlVDlAPgvRtSNFDrc1lObb+Qi2HMbb7xGeHIFuv6pjC9joS 6F6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:message-id:date:subject:dkim-signature; bh=vtak+go3WyFH+Z4SifbQHwiLP50hFLvT92GjDh2aMwc=; b=Bo3/raUCvefO/qaNN/VoFqHgzsh3GiS63XmClXAfBDf6Eh89aTxHjygwfZuLSihEfY HOtV53n1zTRUE8Wu6IzViSkmqrRl5GtPrKFHj4AeTpTZ35kvh5sRJyDofqPkweCnMh2t DqgGsATkjnlylZafVdcriVTEGB298zbXIAeWIE5Dl+Oo2rVdnPBGOj5n617VTyjRrGFJ BTwDq+qXM8IqeaKpamxbuqOYn46MV7WSwfIzisDnIT+MQwb5w+lMLd/oSEErlOt68aNY hgxnj8lGsvQXLEBizOq7/TubE98HNltxZzVhOvB7tNzODGrr8bwaAMUpViBYDZ3aqEEO ZccA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=dsDpNy8j; 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 bx19si1643653ejb.481.2021.04.27.20.36.46; Tue, 27 Apr 2021 20:37:35 -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=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=dsDpNy8j; 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 S235501AbhD1DgE (ORCPT + 99 others); Tue, 27 Apr 2021 23:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbhD1DgE (ORCPT ); Tue, 27 Apr 2021 23:36:04 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2DB1C061574 for ; Tue, 27 Apr 2021 20:35:19 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so8366712pjv.1 for ; Tue, 27 Apr 2021 20:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=subject:date:message-id:mime-version:content-transfer-encoding:cc :from:to; bh=vtak+go3WyFH+Z4SifbQHwiLP50hFLvT92GjDh2aMwc=; b=dsDpNy8jry1Is3B4NZLRFbftN/qOKSSeld8iqW2y0DSZ1+Qag1mVZAgj0bb7W7kvVm Q43mtfUJOzXIQEDaaa6VCuR26ZZ+ZlDOkFcDd2wvVVrttEIZUCKGn6R+6b/5/cz81rU1 GS1VFc5v/MHO/Iv7fZ83H9JIPwYMEfOK+aNicNMXMZ6OOd7Kd/b7A+kEXxEN6iBJ11cq q9PlWbZI4dnoHRp4vtDlidTdbOQ5LS3m2fRur65vcd2MGGes6GI5gBE7V2XCg5dJycGf LTG+cZLtFC+1oSVVjnxS4NabKajQBLr9RIFMv5lTthDqJbkMAtM/oYMlgb1K6bvxDuw4 yGKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:mime-version :content-transfer-encoding:cc:from:to; bh=vtak+go3WyFH+Z4SifbQHwiLP50hFLvT92GjDh2aMwc=; b=nLi+z4q9QFxsIpnmCRFxbesX1kPtGtliOsW60/gFcQGmERw3DQQhSEw1p5qQdt1SQ6 LjO9+TodWw7NYZZ4dUASgoKtECVmmQmv0labYiF4vuehvyufL432mmecLag+4yjcyGc1 2fBIhueei3B436uUdfeLjkOabQ5P3sTaX7MAJcgOsqT0QVKYo/qPRKVtElssUp+YBSDB G/EIm/9oruXGGkXLJG3pa9GdwZjVE5a4cmDueKD5T5tBZKSix+4v1SXro0Pg8iWzeLY4 jUlbSeMUVFrlVyIEYfEPAvHqd+q/VGIsqZf7ISE6LZeJQ2HQQtzccOHHWBHHtDhpDtP2 jtHw== X-Gm-Message-State: AOAM533YZy1+MxHYjv6ElfrRF1+FaBX+jiGJChoSbectiqDvXz+XNhfn wALkeTIUyHxlbs++AVZob1iWhA== X-Received: by 2002:a17:90a:a613:: with SMTP id c19mr1681578pjq.117.1619580919209; Tue, 27 Apr 2021 20:35:19 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id z23sm972435pgj.56.2021.04.27.20.35.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 20:35:18 -0700 (PDT) Subject: [PATCH] RISC-V: Always define XIP_FIXUP Date: Tue, 27 Apr 2021 20:34:15 -0700 Message-Id: <20210428033415.107756-1-palmer@dabbelt.com> X-Mailer: git-send-email 2.31.1.498.g6c1eba8ee3d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, akpm@linux-foundation.org, Atish Patra , Anup Patel , wangkefeng.wang@huawei.com, rppt@kernel.org, vitaly.wool@konsulko.com, alex@ghiti.fr, greentime.hu@sifive.com, 0x7f454c46@gmail.com, chenhuang5@huawei.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Palmer Dabbelt , Guenter Roeck From: Palmer Dabbelt To: linux-riscv@lists.infradead.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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