From patchwork Wed Apr 20 18:40:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 12820696 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C165CC433F5 for ; Wed, 20 Apr 2022 18:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iMnHv4niGKu8WZYxB6uHMiredYst7x1JhNRh/aRPAY0=; b=WREZ9oePe+rnZd oOmdU+pQ7pa476ViCYEaIIf0Rc7HKPicvNDehW3faFQCVXBza3J0FzaIDp+LPxGSZvMRZayahASlC /IgEtC6A8j47AUoX8gj2DLix2TYTU6pZ37VpaFhkFBqxun9Y6rMU0RzaoBIkAbTkIJV3xRriwy7fL 9OqjFKssShZdK0vWjVS6q++rv8O4XO1J0SFLl/AIvsOilbXdcUilkEAXRtPauruX+rsdatg26Bc7E 82rhN3SYHB03GPf+laVWHLikVqzmMNFgmGWKRgg94awZ7G1iOwMOZDgnCb6Qxyqaj5Jhmt5lybLPk bsvTJVox/f5UD2i3k+Hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFND-00A6Cv-Ex; Wed, 20 Apr 2022 18:48:19 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFN7-00A686-QE for linux-riscv@lists.infradead.org; Wed, 20 Apr 2022 18:48:15 +0000 Received: by mail-pl1-x62f.google.com with SMTP id j8so2592496pll.11 for ; Wed, 20 Apr 2022 11:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=dGeAOCT6r5MCsaaONz+vK0DLEKteGUlMarNKYZRrUPE=; b=3DPUa2Vpp9GY71EMMBzT6vukuP1h7Mh1qSwctxVlOMqU2UrCl9zuFahzP1szIXX6JP +oGAyKYhhah/seZxnMyfudLk7ktQMOGReYKJAwqGSiWJomCJ6tV1k3jMPmrpTlPOtdQW kJRC/sx8oC23TRYHOJxOV0QJoQrwmZ0nlCC7vOzpxq3sjENQOgDOxC9U8MlJRYCijp3X XkACjOJY/fWnJpMHcU5hiv/g6rX4WMuwoudIiCd7VVJOnrLNQvI3lOfJlQ7+mItlv0ou VvWCbxS3lmCJH69vxwECf49ur9p2gkktQCU/g3ezMq4gFJAtIgzB5/OFWA4IP12tcw8N Apsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=dGeAOCT6r5MCsaaONz+vK0DLEKteGUlMarNKYZRrUPE=; b=2/hb0E4DHdnnhuKjfYRsJfQtUtfEKZ4wnqqo359x5SkQSwnMVLTSZQcD4hYXlDDMIe l0qS7A2mGqEWQjzbzDxXw5jCFfZ6H5b6q829/eBzdrHAPs03SYfk35tUZvn6hNqP66+T IF0C99WuarLWDdi3O5QtGReAsAqR67JZrjA/se9b3aYYd6wdOQ3ISav0mR8/z8yyvPbm xDFprXyZ88R3SBALNHLfoUdx6x9VkgIoUHIyac4HDMfpjnHigxMgVbl6ets+r7UqTdrC 2GGgdMz0h8TZcDhGtOGwG08OxYCQPHxwdV18Zvw7KPm2gzTbdHv7ISp/LhYsIfe4e9/1 It7w== X-Gm-Message-State: AOAM532yPe15t8LIuXfdXrgxJbvRM+fi0u+w6bVGBZrH8vAAS05gPzYT ZSKpFsfDsz6sd8wK2zBIwxiTxQ== X-Google-Smtp-Source: ABdhPJy51U92hAStdVI18w60yzTLPW9PlcbYe4Ark6awPA/Y9+hbDDPc6f0OMhgjrOvin5aqSs7Y0A== X-Received: by 2002:a17:90b:4f82:b0:1d1:b8fd:7e36 with SMTP id qe2-20020a17090b4f8200b001d1b8fd7e36mr6060236pjb.194.1650480492240; Wed, 20 Apr 2022 11:48:12 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id bc11-20020a656d8b000000b0039cc4dbb295sm19485492pgb.60.2022.04.20.11.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 11:48:11 -0700 (PDT) Subject: [PATCH v2 1/4] RISC-V: Avoid empty create_*_mapping definitions Date: Wed, 20 Apr 2022 11:40:53 -0700 Message-Id: <20220420184056.7886-2-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220420184056.7886-1-palmer@rivosinc.com> References: <20220420184056.7886-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, anup@brainfault.org, vincent.chen@sifive.com, guoren@kernel.org, Atish Patra , alexandre.ghiti@canonical.com, jszhang@kernel.org, vitaly.wool@konsulko.com, gatecat@ds0.me, wangkefeng.wang@huawei.com, mick@ics.forth.gr, panqinglin2020@iscas.ac.cn, rppt@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt , kernel test robot From: Palmer Dabbelt To: linux-riscv@lists.infradead.org, rdunlap@infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_114813_927683_84079F1C X-CRM114-Status: GOOD ( 10.54 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Palmer Dabbelt At least one use of these, that in create_fdt_early_page_table(), triggers warnings and should cause a real error (create_pmd_mpping() ends up skipped on XIP_KERNEL). Reported-by: kernel test robot Fixes: 677b9eb8810e ("riscv: mm: Prepare pt_ops helper functions for sv57") Signed-off-by: Palmer Dabbelt --- arch/riscv/mm/init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 9535bea8688c..7bc9a21e29fb 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -567,9 +567,9 @@ static void __init create_p4d_mapping(p4d_t *p4dp, create_pte_mapping(__nextp, __va, __pa, __sz, __prot) #define fixmap_pgd_next ((uintptr_t)fixmap_pte) #define early_dtb_pgd_next ((uintptr_t)early_dtb_pmd) -#define create_p4d_mapping(__pmdp, __va, __pa, __sz, __prot) -#define create_pud_mapping(__pmdp, __va, __pa, __sz, __prot) -#define create_pmd_mapping(__pmdp, __va, __pa, __sz, __prot) +#define create_p4d_mapping(__pmdp, __va, __pa, __sz, __prot) do {} while(0) +#define create_pud_mapping(__pmdp, __va, __pa, __sz, __prot) do {} while(0) +#define create_pmd_mapping(__pmdp, __va, __pa, __sz, __prot) do {} while(0) #endif /* __PAGETABLE_PMD_FOLDED */ void __init create_pgd_mapping(pgd_t *pgdp, From patchwork Wed Apr 20 18:40:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 12820697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37DFAC433EF for ; Wed, 20 Apr 2022 18:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NsQeglm7wAecDEf5HgQVrui8rrD9uB2Lg38OoGc4rM4=; b=BVWCElxX9eCJli GE2sDwZOcnygfS4kkQkF/hJgBI7ULKOV9mZSSJ575O1KoxaK5sdLeF9MKcsNTx7FRaZiCMr+HBdVW dQ9FR7tz3iUkhBNv0gS4iVhW7Evk8E3iqw3Bl2ghs4Z5UJs+Scdzj3s6aw5dGBT6UN+6ZVld3M4QY 71VzeXlZtA67Y6vRIHZXa69yYrT+zJva4BaddZ7EYNlmEPcFltXzuen2dG9E1qmKfO2MCONGR4/QF XwKMnRHlJp2T0R4+etn0KjYsSeoC80GNolAKIf6uf2zVlmIkhuzV1STE7LrTC6lpBMNOGKY3hyDhu NNIXinCw1W4IopYguA9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFNE-00A6DW-Uk; Wed, 20 Apr 2022 18:48:20 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFN8-00A68c-U7 for linux-riscv@lists.infradead.org; Wed, 20 Apr 2022 18:48:16 +0000 Received: by mail-pj1-x1033.google.com with SMTP id md20-20020a17090b23d400b001cb70ef790dso5699200pjb.5 for ; Wed, 20 Apr 2022 11:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=SoH+rXIkHfn2tDchhhZbSJ+crMNxbZGozRfYvpl+XoE=; b=juiLZLej55jZaTBjD9xwVIR/YAR4i7cO0bpHr89TY+dz1ORy2ejFFIdrCOQXcP2D8H cIxDjtw4zoR/+O/+Cz7gJVkbmHNOFMtnczcO1N4hDW2YNoDdFy7kJvt4NocRNaWc0rrK rDxA4wJWcdvspC6ywEgV5rv2Z03Jb9GhkEjoFsHw1t6EhYernuYtCEVUod4KD52lB5iP s/aDAOti+/mtT0ZCn/3oAcvuMjjaJ6zzBso+eeSET7y8Nwo2WVkVUSMAt3YlM6JRpRZD BvFtCMyG1ZheaQ4dagFcdUGWYCLZ3BHz7skwKmfSnGeYNrdPtlsudMgmLO3FdKIT+CFZ SurQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=SoH+rXIkHfn2tDchhhZbSJ+crMNxbZGozRfYvpl+XoE=; b=Gm3hUQScz+48aOshoAr0b5u+0UxtPALQT063z5tpaHko5zH11x9eG/S2eWZSgEHCfQ kX2JPaKG4EJ3mrUobTlIpVWNAi2OxYIU6eHnyT4RLdz0VZZ7iwUUsP0l9YngMtFhLrz9 ykmZ6Ysnhhpcd8Yt7J6uLuCTFeLWpCbh/OwQxFxGXgYXlCqCo4EN3lvGSTdaWHiwlE5r +o9wJeByL6L38jwFZlgNu2fJi1yDUAUIzOPm7YAKgGuvSRFeqjveLXqVqf3fjobfxhHp Vb50kndAsKLCWBSXktTCxecIxzzP0bZ+MBG/nRIH+Hox508zv3oWKkbIpZr4aaCvFDgE zObQ== X-Gm-Message-State: AOAM531jKQvxr/Q8mM6QK59lHp0so2WRmaqXGayESYX8OJUUpe6MNiin fFzob95O1v0FzhR98hoCSglTSQ== X-Google-Smtp-Source: ABdhPJxdrixrp+jfH8hvzdp/Eg4oHxPBPiHlreQAn5N+O4widmijdWQO8V5yAwiXQNEjtkHlm2bdxQ== X-Received: by 2002:a17:90b:4acb:b0:1d1:efc:39bd with SMTP id mh11-20020a17090b4acb00b001d10efc39bdmr6085138pjb.49.1650480493464; Wed, 20 Apr 2022 11:48:13 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id i11-20020a654d0b000000b0039d82c3e68csm20741715pgt.55.2022.04.20.11.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 11:48:13 -0700 (PDT) Subject: [PATCH v2 2/4] RISC-V: ignore xipImage Date: Wed, 20 Apr 2022 11:40:54 -0700 Message-Id: <20220420184056.7886-3-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220420184056.7886-1-palmer@rivosinc.com> References: <20220420184056.7886-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, anup@brainfault.org, vincent.chen@sifive.com, guoren@kernel.org, Atish Patra , alexandre.ghiti@canonical.com, jszhang@kernel.org, vitaly.wool@konsulko.com, gatecat@ds0.me, wangkefeng.wang@huawei.com, mick@ics.forth.gr, panqinglin2020@iscas.ac.cn, rppt@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: linux-riscv@lists.infradead.org, rdunlap@infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_114815_008962_D6F96EA8 X-CRM114-Status: UNSURE ( 7.78 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Palmer Dabbelt This built file shows up in "git status" without an explicit ignore. Signed-off-by: Palmer Dabbelt Reviewed-by: Guo Ren --- arch/riscv/boot/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/boot/.gitignore b/arch/riscv/boot/.gitignore index 90e66adb7de5..0cea9f7fa9d5 100644 --- a/arch/riscv/boot/.gitignore +++ b/arch/riscv/boot/.gitignore @@ -4,3 +4,4 @@ Image.* loader loader.lds loader.bin +xipImage From patchwork Wed Apr 20 18:40:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 12820698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A82C3C433FE for ; Wed, 20 Apr 2022 18:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ayEjH6eqVX2YeQwEEerRnMQ7N8bGICuZXnr0h/KIQRQ=; b=krnWEFXQapomBg GlmjSzA1kZqBWd2H+ypml8l0n7JoPjLAf3V9RY6HEHr85kR4opdCdn7pz/EbzxyP2Jfy3guseCKEj LTxfK58WwLkbZnUl+K0xFfRnh3CG6WaO/WfQT4kTE3z3gyGAwdurlrgPgkWmdzYiYxoWSiL92nIO8 y7jPnpSo+lsAXno14evtaxX88hPiNAaUP9j7crO/TUwMdMikqND5raifzKMlNCaXxnUzJw7sv0dKA 4PPvKh5TcKpK+nU9uDjZBrtyxvBjIT2vgK/2/VOxqpd0AENNSW+NIYKm9rqtAfHjhqwmrgiujKaSA OrGsGRi5Qrwo8SfYzxRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFNG-00A6Ek-LO; Wed, 20 Apr 2022 18:48:22 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFNA-00A69c-4q for linux-riscv@lists.infradead.org; Wed, 20 Apr 2022 18:48:17 +0000 Received: by mail-pg1-x533.google.com with SMTP id s137so2438272pgs.5 for ; Wed, 20 Apr 2022 11:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=UGpQa9Z2U55MjYUDsvGvuFzYMVtZARYuOzPYtbUizPg=; b=6rfdm/phCRlmO8Ct/g6arSMLvjyQ+UArCdCgU2d60t/F49+e8zW9hVbe0Hw+/6auz8 0smG66pG/9D7UcRw9gX9si6y6NvYkgsIezoJskMu1TuSK+aiSONGS9esu5svctCYwycs zy/DbrDagPCD6MWiRgjfG/1SHvaO15wkNDoUpyA8uxDBpOIZNjhiiQIbshZmfbNLbAZ6 K0wOBieQ++3HSV2zjACVh9DwCHCYxumykHQ+9uX1l+MYsJ/d3koVe32FE4ThTDttjd4t +cG0lApXd9/8MkrFy5CCYjjb/EMIcrfBtlvGGtw4/ZxtWBEMpGYveainQmNzAiPJLESC ZT8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=UGpQa9Z2U55MjYUDsvGvuFzYMVtZARYuOzPYtbUizPg=; b=fTuGu39UyA/KkgnOfvP1Xynv4lLDQ5l0oZvaqvhS+iu3cuMtndq8ynxZJyDdxts1P2 IxvDDlCiZBeLjJSf9Hk/GTV6K+3myZvzl67pdgMzRtCdPMpiTughFicRkb5S9JXL0LsJ YC10cNPl3ivfhQGSZgCwNfuhB7y27UL6eF+2hMrbQAxrGpHkUAztFHWr2uaV+QdqFPo6 CnyrWT/7iFoaBocZCpA+03Rc2J+4cDDKWrQjqcR4yZ1n6briWfwYwP8Ee8jgcfXeflEt 1xM8G5OcgeBjKoBWDerhHcKe+ax8fTOJejrhOI5Vtw7CmIxUuZ0A/b7y397XjApR9Jcg e3qQ== X-Gm-Message-State: AOAM532BkE1zxJ84Y/wQGO7ADN8NwQcq5YBNBd0FhCABo9myaWXHsK0S 9GDSsE+euDhZBHh5TGiEq3kDfg== X-Google-Smtp-Source: ABdhPJyQtvhwqEgVVnVRRdlklc0eCKG6jyhiAA/OuM6Vae1V/BWG9miXV/9kwjPjjDrjfrYbblnoIw== X-Received: by 2002:a63:e452:0:b0:3a9:fd43:fd10 with SMTP id i18-20020a63e452000000b003a9fd43fd10mr14420896pgk.541.1650480494575; Wed, 20 Apr 2022 11:48:14 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id n20-20020a634d54000000b0039d18bf7864sm20229604pgl.20.2022.04.20.11.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 11:48:14 -0700 (PDT) Subject: [PATCH v2 3/4] RISC-V: Split out the XIP fixups into their own file Date: Wed, 20 Apr 2022 11:40:55 -0700 Message-Id: <20220420184056.7886-4-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220420184056.7886-1-palmer@rivosinc.com> References: <20220420184056.7886-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, anup@brainfault.org, vincent.chen@sifive.com, guoren@kernel.org, Atish Patra , alexandre.ghiti@canonical.com, jszhang@kernel.org, vitaly.wool@konsulko.com, gatecat@ds0.me, wangkefeng.wang@huawei.com, mick@ics.forth.gr, panqinglin2020@iscas.ac.cn, rppt@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: linux-riscv@lists.infradead.org, rdunlap@infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_114816_228876_F1C3103D X-CRM114-Status: GOOD ( 14.56 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Palmer Dabbelt This was broken by the original refactoring (as the XIP definitions depend on ) and then more broken by the merge (as I accidentally took the old version). This fixes both breakages, while also pulling this out of to avoid polluting most assembly files with the XIP fixups. Fixes: bee7fbc38579 ("RISC-V CPU Idle Support") Fixes: 63b13e64a829 ("RISC-V: Add arch functions for non-retentive suspend entry/exit") Signed-off-by: Palmer Dabbelt Reviewed-by: Guo Ren --- arch/riscv/include/asm/asm.h | 26 ------------------------ arch/riscv/include/asm/xip_fixup.h | 32 ++++++++++++++++++++++++++++++ arch/riscv/kernel/head.S | 1 + arch/riscv/kernel/suspend_entry.S | 1 + 4 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 arch/riscv/include/asm/xip_fixup.h diff --git a/arch/riscv/include/asm/asm.h b/arch/riscv/include/asm/asm.h index 8c2549b16ac0..618d7c5af1a2 100644 --- a/arch/riscv/include/asm/asm.h +++ b/arch/riscv/include/asm/asm.h @@ -67,30 +67,4 @@ #error "Unexpected __SIZEOF_SHORT__" #endif -#ifdef __ASSEMBLY__ - -/* Common assembly source macros */ - -#ifdef CONFIG_XIP_KERNEL -.macro XIP_FIXUP_OFFSET reg - REG_L t0, _xip_fixup - add \reg, \reg, t0 -.endm -.macro XIP_FIXUP_FLASH_OFFSET reg - la t1, __data_loc - REG_L t1, _xip_phys_offset - sub \reg, \reg, t1 - add \reg, \reg, t0 -.endm -_xip_fixup: .dword CONFIG_PHYS_RAM_BASE - CONFIG_XIP_PHYS_ADDR - XIP_OFFSET -_xip_phys_offset: .dword CONFIG_XIP_PHYS_ADDR + XIP_OFFSET -#else -.macro XIP_FIXUP_OFFSET reg -.endm -.macro XIP_FIXUP_FLASH_OFFSET reg -.endm -#endif /* CONFIG_XIP_KERNEL */ - -#endif /* __ASSEMBLY__ */ - #endif /* _ASM_RISCV_ASM_H */ diff --git a/arch/riscv/include/asm/xip_fixup.h b/arch/riscv/include/asm/xip_fixup.h new file mode 100644 index 000000000000..0d0754305324 --- /dev/null +++ b/arch/riscv/include/asm/xip_fixup.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * XIP fixup macros, only useful in assembly. + */ +#ifndef _ASM_RISCV_XIP_FIXUP_H +#define _ASM_RISCV_XIP_FIXUP_H + +#include + +#ifdef CONFIG_XIP_KERNEL +.macro XIP_FIXUP_OFFSET reg + REG_L t0, _xip_fixup + add \reg, \reg, t0 +.endm +.macro XIP_FIXUP_FLASH_OFFSET reg + la t1, __data_loc + li t0, XIP_OFFSET_MASK + and t1, t1, t0 + li t1, XIP_OFFSET + sub t0, t0, t1 + sub \reg, \reg, t0 +.endm + +_xip_fixup: .dword CONFIG_PHYS_RAM_BASE - CONFIG_XIP_PHYS_ADDR - XIP_OFFSET +#else +.macro XIP_FIXUP_OFFSET reg +.endm +.macro XIP_FIXUP_FLASH_OFFSET reg +.endm +#endif /* CONFIG_XIP_KERNEL */ + +#endif diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S index 893b8bb69391..822c33aa7f45 100644 --- a/arch/riscv/kernel/head.S +++ b/arch/riscv/kernel/head.S @@ -14,6 +14,7 @@ #include #include +#include #include "efi-header.S" __HEAD diff --git a/arch/riscv/kernel/suspend_entry.S b/arch/riscv/kernel/suspend_entry.S index 4b07b809a2b8..aafcca58c19d 100644 --- a/arch/riscv/kernel/suspend_entry.S +++ b/arch/riscv/kernel/suspend_entry.S @@ -8,6 +8,7 @@ #include #include #include +#include .text .altmacro From patchwork Wed Apr 20 18:40:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 12820699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D39F1C4332F for ; Wed, 20 Apr 2022 18:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ghcdxjlUI5A6y2cyZSWuDtvmXoyfK+VY2l9oAGciovY=; b=u82w6nTBJQBgX8 S53vO4cuGqV5XaucLKE8a3CT8UwGwhREWZ/8JG/6AAA2J+kGwyfi6/WRjk3TIP2TFOvg+FJIEQA/1 xl4kWPF+L+kMzz4ldkFBqsmv3UG+jDDBFu23I7ECXjpVxMJ1uNp7EE8v3yLMFx5wjxyXCuI9ynCYX E5nCvT+Z4vSaITFvK1gEB3yuZWOexDjhWt8wCoD4a8ezXe1VcO7+wlWjLOTmxSD0X9nUO5GoyfnG2 ltPjxdtcWTIBj2toIHXbpV+uDDc5+PaDRzFGmaSwIq3wS/mzB4dGR+uKVIhAbEdMNE8EGh+4roRMC hPlm5dVYebCVKwcPp47Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFNI-00A6Fm-EN; Wed, 20 Apr 2022 18:48:24 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFNB-00A6AJ-Az for linux-riscv@lists.infradead.org; Wed, 20 Apr 2022 18:48:18 +0000 Received: by mail-pl1-x634.google.com with SMTP id q3so2621540plg.3 for ; Wed, 20 Apr 2022 11:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=LErP8U/PzejnwsS9KxvOA1A5d+doq+yW06k2+06H9yw=; b=SrUq1R9xL5OZEC4Ze67UAVTlCaR8u01nNPPk8oP1eppqz7PD0gBzsRZXnuhDevMwsl JKPcgMqhBle7UJ1lQpjq81l3IaPYq1YfYIuc22hlfQe+sJEpAGeTpitbhg0M9FoMS6Eb JWh7O5Qk/dz8TgOSvZTVv8rfk+D9uarBySHEo1zK+XMILDSzBxe93kfQ/D3iNRSmWyHv MrUz5aeweAEgbOxEYUVYklujxkRgWZAP2UNLy2aImjJR3QZW2LwyKanqf0piJX1tCQxW p6gg7IVLhUVllO4RYluFhedDiovafl5YmzL0213rDk5ywouSLj4h86NRtxyqUbjVmbcm hyGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=LErP8U/PzejnwsS9KxvOA1A5d+doq+yW06k2+06H9yw=; b=0MD5+FC4HnKPCJg9/RAFi8udgx8a3E6xivHNvkNI9gw3qqs07cOakj5kV1tTslHMW1 TiUm54qRKVSUu26MyLp0RLH2RJCwEhoVKtSS3s3fHTnHclFMHphp+aw2/VT0cR9WK/PP 4O4vgleFY3Aagsp/YiMhYjBgzvA7v1HIE6VeoSQdMSUFYmrfbhiXNS57AQZXu0YCE9Jn fTQkghpLdQf32HWH70M7gw6X5g88T9kkVgyg1mmex9ou/D68x5XSPoFbHE+TTclU+rCa 7+snKlA1T7tz5WBDJHi+UvCzY+RWygDiO4hTjBdkjIHSqll+4KxG02LLRinhU79aWMPa lfeg== X-Gm-Message-State: AOAM533vfLQ8xeVcadye0ii1xm4jHnRAn0mR+pyrhxC5wqE7w9jt9ST0 ZXY3MfuHYHqr5XJzEwtzDBHUPg== X-Google-Smtp-Source: ABdhPJwMcgsPdT/Mfw3ofmgGrcnyzn6fQu1hFzXbYaHfj+5RimVQrPpgk9LKR0TuPR+a5veVzb58Yg== X-Received: by 2002:a17:902:b590:b0:153:a243:3331 with SMTP id a16-20020a170902b59000b00153a2433331mr22836465pls.129.1650480495784; Wed, 20 Apr 2022 11:48:15 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id g14-20020a63200e000000b0039d9816238fsm20335794pgg.81.2022.04.20.11.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 11:48:15 -0700 (PDT) Subject: [PATCH v2 4/4] RISC-V: Fix the XIP build Date: Wed, 20 Apr 2022 11:40:56 -0700 Message-Id: <20220420184056.7886-5-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220420184056.7886-1-palmer@rivosinc.com> References: <20220420184056.7886-1-palmer@rivosinc.com> MIME-Version: 1.0 Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, anup@brainfault.org, vincent.chen@sifive.com, guoren@kernel.org, Atish Patra , alexandre.ghiti@canonical.com, jszhang@kernel.org, vitaly.wool@konsulko.com, gatecat@ds0.me, wangkefeng.wang@huawei.com, mick@ics.forth.gr, panqinglin2020@iscas.ac.cn, rppt@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: linux-riscv@lists.infradead.org, rdunlap@infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_114817_440891_5B66B4B6 X-CRM114-Status: GOOD ( 11.13 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Palmer Dabbelt A handful of functions unused functions were enabled during XIP builds, which themselves didn't build correctly. This just disables the functions entirely. Fixes: e8a62cc26ddf ("riscv: Implement sv48 support") Signed-off-by: Palmer Dabbelt Reviewed-by: Guo Ren --- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 7bc9a21e29fb..d2054a6cd791 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -660,7 +660,7 @@ static __init pgprot_t pgprot_from_va(uintptr_t va) } #endif /* CONFIG_STRICT_KERNEL_RWX */ -#ifdef CONFIG_64BIT +#if defined(CONFIG_64BIT) && !defined(CONFIG_XIP_KERNEL) static void __init disable_pgtable_l5(void) { pgtable_l5_enabled = false;