From nobody Thu May 7 19:05:51 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88F15C433FE for ; Fri, 20 May 2022 15:45:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351084AbiETPpr (ORCPT ); Fri, 20 May 2022 11:45:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbiETPpk (ORCPT ); Fri, 20 May 2022 11:45:40 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D41EB179945 for ; Fri, 20 May 2022 08:45:24 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id r71so8090658pgr.0 for ; Fri, 20 May 2022 08:45:24 -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=avELjSEfO4YwxdS1hy2OFqCYNIZpTM4Eec2OkZMhhf8=; b=uzwPDcC0XNDiwV+Mifx3alyGqhvqonpDCfcELm9PIplNCWzW/NqPcz7dO5AZvP9aD/ 9DftJ2uI7dj8WLDMyULQL9Mzmc1Sw3yvKBYHDYFq5mmlt9/FBMk4iD2EQWZueEc2SOPY XVhWu4TTcLkAOsWufKOvZedwA75506ErlcRUoG/dg5Yzf/7w2VdM2e5A3R0RG/jQrebr WUB0GKOJ4kmaKKnMV38ouro+kV5lD5ureu3IhSzvLXkIPBO/tOcRZZnJcLQKaOJ4pIFD ivVBRmb/1LPO2IfDj8CG9AXLvr+6Wf30+Cf7gop/trMMi003rY5ezCy3QBoYTgXe1rFB h7JA== 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=avELjSEfO4YwxdS1hy2OFqCYNIZpTM4Eec2OkZMhhf8=; b=CNyG4/XZcJOUZKqqgIhZEDzDvgOeg2MYpdXyip3g7oO+tFYuauscEZtsqy5fgDuyu3 57gYzTEVuRzB8RAcaCidK4v3tCXN8KmaMzihetHIJ38nUzdmQvdYYlfdIRINiQYT1P+v CqLNicry5w0kqLGhLq0IgyYZOHJE7QaOvU1y1CTGYwbs5+XC6IAaZBBhPtHh4z72d8gY koJXNI52ZEkSAhcgGgaFKF4USPDk+WdmNNASP5apkVyCWuAqSk+Vmz15aEb+JnO9sJ7E oAzuE89itlsJQ0/plUV26qQcMG0xyMwfdQAb0lPwu0M5giALwVtIPAQAMuWiY3F9TImq gRjQ== X-Gm-Message-State: AOAM530Y7Ny3v+kacAnGIleCLTDzECFhctBqCy3uHLob6mHrWLWgI2QW yeCbiA817cZ+kxVs+F1hqdwhPQ== X-Google-Smtp-Source: ABdhPJy0cSSVWa5pAf0mHY5fITaZVq1V36HgsUtNvAxSOP+5C4C+/tqwdW6Q0EnMt1H6wgdEVX6jxQ== X-Received: by 2002:a62:1413:0:b0:518:4259:200e with SMTP id 19-20020a621413000000b005184259200emr8368526pfu.41.1653061524395; Fri, 20 May 2022 08:45:24 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id t10-20020a17090340ca00b0015e8d4eb29esm5596985pld.232.2022.05.20.08.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 08:45:24 -0700 (PDT) Subject: [PATCH v1 1/5] drivers: of: kexec ima: Support 32-bit platforms Date: Fri, 20 May 2022 08:44:27 -0700 Message-Id: <20220520154430.18593-2-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220520154430.18593-1-palmer@rivosinc.com> References: <20220520154430.18593-1-palmer@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, robh+dt@kernel.org, frowand.list@gmail.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, liaochang1@huawei.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: lizhengyu3@huawei.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Palmer Dabbelt RISC-V recently added kexec_file() support, which uses enables kexec IMA. We're the first 32-bit platform to support this, so we found a build bug. Signed-off-by: Palmer Dabbelt Acked-by: Rob Herring --- drivers/of/kexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c index b9bd1cff1793..ed3451ec2b24 100644 --- a/drivers/of/kexec.c +++ b/drivers/of/kexec.c @@ -236,8 +236,8 @@ static int setup_ima_buffer(const struct kimage *image,= void *fdt, if (ret) return -EINVAL; =20 - pr_debug("IMA buffer at 0x%llx, size =3D 0x%zx\n", - image->ima_buffer_addr, image->ima_buffer_size); + pr_debug("IMA buffer at 0x%pa, size =3D 0x%zx\n", + &image->ima_buffer_addr, image->ima_buffer_size); =20 return 0; } --=20 2.34.1 From nobody Thu May 7 19:05:51 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5184AC4332F for ; Fri, 20 May 2022 15:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351252AbiETPqR (ORCPT ); Fri, 20 May 2022 11:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351035AbiETPpk (ORCPT ); Fri, 20 May 2022 11:45:40 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14425179959 for ; Fri, 20 May 2022 08:45:26 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d22so7670109plr.9 for ; Fri, 20 May 2022 08:45:26 -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=5TWBcQL6wNB9LxLHrCP8/TqxtjURhSYJy0/t361wYQU=; b=c4yOuQVg7fx9koZWMZRlxpoboAwjwiDzPiwKBiWegfHXXsuU2piqdAdZvKOlVL3wY3 UyMVdqIEVjbV1MmgqqqPhWFWRYk+bwhWi3TkpDv7o5K0YMkwc2c02fWRsbHrFdFzgmc/ DLCeupy+iNJUpjyqYR4JeQBFPDjmxJXZ6WuV96Z/KK2rf4fz8KRM7VUPEfZqSILfpstt Q93Pbbx+e/CkwcfH5kHA9LYQWUOunWsskcKvraNycowPS7MwBNFLKoTqCaCh2XphgH0+ vJzeQDisWHO7I9qWBsQtNc8D/rVzeLhSaBVt5S0CGzQ2juEt6+b5bBLTQFftgGxZVBOb xF9g== 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=5TWBcQL6wNB9LxLHrCP8/TqxtjURhSYJy0/t361wYQU=; b=cmpQw46X9jFcAuzoaphzXcwD3fZbPIRBkqbID1VV7q3gSgvRTHYEwBsZKcfMPw3HFB lhyIGWqF6IBuYUcASXHb238QIdSg4A0ZxNU92keTsm3uW9gMtgFfEUhqvhsjquWFHoiC 1Au4rIrSUd2JioNZEH9hGQygyp4WETAurqhiYN92sbrDKLqHkrJfbGVDpkgpbjn+GCPZ H7Kp0/zfRbcPTvVzVhE2RaufDouEaFFDH2PkC7zyciCnQUdeuWyG0RUyQw5wj58uwvza /xCCoDf304vsjP/5fI9b2EJFEoAk3qB8pli0Tv0zlZtHOgEmDVpIvBibp/+zrr8nOydl cbMQ== X-Gm-Message-State: AOAM530+OeAc3vGm5Q7ASSnCW/GOPm2vRFpJ30k7R+2UWO85Bp+bVH38 Z+Jcd9LfiVguf6tzGw23EHChCA== X-Google-Smtp-Source: ABdhPJyPOaFhKw7lv1sn4i4AHPP0QtokVuzUJUfKGEWZJSnPqbVu1QCImrf5yMwt/D4DDEzAf6OhTw== X-Received: by 2002:a17:903:108c:b0:161:e5a5:e387 with SMTP id u12-20020a170903108c00b00161e5a5e387mr6866867pld.108.1653061525601; Fri, 20 May 2022 08:45:25 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id l17-20020a170902eb1100b0015e8d4eb239sm5936919plb.131.2022.05.20.08.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 08:45:25 -0700 (PDT) Subject: [PATCH v1 2/5] ima: Fix a build issue on 32-bit platforms Date: Fri, 20 May 2022 08:44:28 -0700 Message-Id: <20220520154430.18593-3-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220520154430.18593-1-palmer@rivosinc.com> References: <20220520154430.18593-1-palmer@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, robh+dt@kernel.org, frowand.list@gmail.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, liaochang1@huawei.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: lizhengyu3@huawei.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Palmer Dabbelt ima_dump_measurement_list() took an "unsigned long *", but was passed a size_t. This triggers build warnings on 32-bit RISC-V. Signed-off-by: Palmer Dabbelt --- security/integrity/ima/ima_kexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/integrity/ima/ima_kexec.c b/security/integrity/ima/im= a_kexec.c index 13753136f03f..f2a94ec3002a 100644 --- a/security/integrity/ima/ima_kexec.c +++ b/security/integrity/ima/ima_kexec.c @@ -15,7 +15,7 @@ #include "ima.h" =20 #ifdef CONFIG_IMA_KEXEC -static int ima_dump_measurement_list(unsigned long *buffer_size, void **bu= ffer, +static int ima_dump_measurement_list(size_t *buffer_size, void **buffer, unsigned long segment_size) { struct ima_queue_entry *qe; --=20 2.34.1 From nobody Thu May 7 19:05:51 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD448C43219 for ; Fri, 20 May 2022 15:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351031AbiETPpu (ORCPT ); Fri, 20 May 2022 11:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351062AbiETPpl (ORCPT ); Fri, 20 May 2022 11:45:41 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F29D179969 for ; Fri, 20 May 2022 08:45:27 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id ds11so8419167pjb.0 for ; Fri, 20 May 2022 08:45:27 -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=VE2vUXFOy2mJkujHyFNt0HPmwfcDu8WrrrqGHwab5YA=; b=tuEF1onridrYFom6GHGoVmHMvyrHQV/Jf6B0yeiPYn43PWuCZ4txpDmw1dqIEPI397 t5iPNCMjW7PoX+tc8jbAUuH+BtaBGhp84qL41HRaB+DxQsJQC5EubyjCwjzedw8vRa0M DOZewV7xP26BcxzG8nNBVz/1ZAHv+yYAEcqmwxfbbXeF+P45JlXSS2N9YAx08Gm4/53w jkQMCSJDbP6WMAnG9MJccNFyCBJ6Bz0WlkimSCCLCsYlwwcNmedJ2b3qjgTg30qXLW6B y3T1P3I694ihOLCY/fCBx+g/6qUP2n1uyx7/SrJKVy53gR9qE31qHY2VU7Q+nBgZveBu z18Q== 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=VE2vUXFOy2mJkujHyFNt0HPmwfcDu8WrrrqGHwab5YA=; b=6VONx4GornRuXdHjIV1Y7rQNuQL7qahiScilQw6GaGLS5oMHq/C+li8hj+DXDUA5sC G7kMi40WAMKjOMZvGeesymY+2wKCaurSs15OkpxO4k0n2NrLdBmi28/UtvnyXyxGdzHG crKQlgo5vuaKXwHXFUI32QbnD1njFSZ0XE6AD8C7T4SNqllitaKAEdLFw8UGt0qRnMx8 5yROpgnBbkkWLYWp63qnNSGyPDSRmCsPnpqB5SSqrHlLLWVDWohXbBynpuKGrjR+DrMP x6HKz/8h13X1rY6PQbYX9qzBpdGOEyvL28B++27tEEMpo026r7nPQnLPuTe05ENUE7Hk IZlQ== X-Gm-Message-State: AOAM53038oG8YZmlK3b/JK9iOqhwSj5gSwd1mb9kCCauWnkoSdJU4Mg3 yI2g58Qj+YjRACT+rfpQk1AEEA== X-Google-Smtp-Source: ABdhPJxutQunHuqBnSDi1AyU5l++uXDUp12EI7aTjzru4LJnptzsRLuteBJZfMF6zOk21wIEpEwfSA== X-Received: by 2002:a17:90b:4b02:b0:1df:d622:dd07 with SMTP id lx2-20020a17090b4b0200b001dfd622dd07mr10203411pjb.160.1653061526701; Fri, 20 May 2022 08:45:26 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id a12-20020a62bd0c000000b0050dc7628188sm1982140pff.98.2022.05.20.08.45.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 08:45:26 -0700 (PDT) Subject: [PATCH v1 3/5] RISC-V: kexec: Use Elf64 on 64-bit targets Date: Fri, 20 May 2022 08:44:29 -0700 Message-Id: <20220520154430.18593-4-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220520154430.18593-1-palmer@rivosinc.com> References: <20220520154430.18593-1-palmer@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, robh+dt@kernel.org, frowand.list@gmail.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, liaochang1@huawei.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: lizhengyu3@huawei.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Palmer Dabbelt Most of the Elf macros automatically select the correct Elf type, this converts the one explicit Elf64 usage to depend on XLEN. Signed-off-by: Palmer Dabbelt --- arch/riscv/kernel/elf_kexec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.c index 9cb85095fd45..4532e3cf17a5 100644 --- a/arch/riscv/kernel/elf_kexec.c +++ b/arch/riscv/kernel/elf_kexec.c @@ -342,6 +342,12 @@ static void *elf_kexec_load(struct kimage *image, char= *kernel_buf, #define CLEAN_IMM(type, x) \ ((~ENCODE_##type##_IMM((uint64_t)(-1))) & (x)) =20 +#if __riscv_xlen =3D=3D 32 +#define ELFN(T) ELF32 ## T +#else +#define ELFN(T) ELF64 ## T +#endif + int arch_kexec_apply_relocations_add(struct purgatory_info *pi, Elf_Shdr *section, const Elf_Shdr *relsec, @@ -367,7 +373,7 @@ int arch_kexec_apply_relocations_add(struct purgatory_i= nfo *pi, void *loc; /* tmp location to modify */ =20 sym =3D (void *)pi->ehdr + symtab->sh_offset; - sym +=3D ELF64_R_SYM(relas[i].r_info); + sym +=3D ELFN(_R_SYM)(relas[i].r_info); =20 if (sym->st_name) name =3D strtab + sym->st_name; --=20 2.34.1 From nobody Thu May 7 19:05:51 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1A60C433F5 for ; Fri, 20 May 2022 15:46:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351104AbiETPqB (ORCPT ); Fri, 20 May 2022 11:46:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351066AbiETPpl (ORCPT ); Fri, 20 May 2022 11:45:41 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 783D0179973 for ; Fri, 20 May 2022 08:45:28 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id i1so7684310plg.7 for ; Fri, 20 May 2022 08:45:28 -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=U/MW6rSbN5zBgusIBhKQzePh9cnp8uaNotWlLIHTUsY=; b=JQyzbPvORX1IKsTlWc0qkUHSKntueefkGU8dfB3thfUfkSYRjG91vooo6vChrw9Bf7 9Z5XY/rjVuwzsrlkQA5pcgEYx+QnJKtt5nmCn9DhLAdeLEqucw8pOG8J12o96ngdNp5g itgIArPjfmV3PmE0JpQd4a+cAR95KxK2BRwn0m7OypbO/75j+MGw0tQDgXO551FebRyN 04wS/DqNscTUoNHtWgoitV/Yu0wzpeaqdS7LdRbwE65wXveDL69cHyxRiC2N2xewmWjM UTbLdEVcVlOT/o6zIiNUwcdDEW8akpNDod5tvoD9ZEXINE7/RJScDiChs8rEREGK9MC4 rYKg== 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=U/MW6rSbN5zBgusIBhKQzePh9cnp8uaNotWlLIHTUsY=; b=fk5p4QXQIVTN/dVlSavsfl2Ch7V0ciR7csY6PDF46V/qbH2HPOqstWNmXz8oco/2jw +Q3BAiZcST14WyLgS/7+7U7i+OrmjOIuIf31tYWTVm4u1kVnWFEDElFHPr5xCJ8UQb85 7WxG+tXuUQzki4kkSio9xp1Hu1HExDcFNAX1UN/0k3UJc9VjBx2CcO6p+Y2sUvrvKaDN /x2nxveFIM/T5V4XCVC4jFeIRLrAnYAUY4bSNNTupqiIa/RBwCnRKsp+LehzYrdrLRcD xDlnR3oLx7Nvhcs9hG3i4sZWYdhLiRoggBytCJgihJRNdmbrJskaf/eBYHIEiA4hrGK/ LrTA== X-Gm-Message-State: AOAM530IWl3vObearNcDF/9XKbxNW/62Lz0SkWNbo2nrqL88tDNq4Afb IEf5Lgb5l0DlgPVmNpgSQWpY0g== X-Google-Smtp-Source: ABdhPJxcVY/NCwkycro4XerYgWAVjh079yzImy34/DKN8DSXqYHS1KYB9wqnCW7AFPycA9lFB2mEsg== X-Received: by 2002:a17:902:7788:b0:15e:ec55:2cfd with SMTP id o8-20020a170902778800b0015eec552cfdmr10405450pll.113.1653061527803; Fri, 20 May 2022 08:45:27 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id p11-20020a17090a4f0b00b001df78f27c10sm2091006pjh.42.2022.05.20.08.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 08:45:27 -0700 (PDT) Subject: [PATCH v1 4/5] RISC-V: purgatory: Use XLEN-length loads to support rv32 Date: Fri, 20 May 2022 08:44:30 -0700 Message-Id: <20220520154430.18593-5-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220520154430.18593-1-palmer@rivosinc.com> References: <20220520154430.18593-1-palmer@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, robh+dt@kernel.org, frowand.list@gmail.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, liaochang1@huawei.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: lizhengyu3@huawei.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Palmer Dabbelt This uses an explicit "ld" to load up target address, which dosn't work on rv32. Convert it to a REG_L macro, like everywhere else. Signed-off-by: Palmer Dabbelt --- arch/riscv/purgatory/entry.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/riscv/purgatory/entry.S b/arch/riscv/purgatory/entry.S index 0194f4554130..71c50fef051c 100644 --- a/arch/riscv/purgatory/entry.S +++ b/arch/riscv/purgatory/entry.S @@ -8,6 +8,8 @@ * */ =20 +#include + .macro size, sym:req .size \sym, . - \sym .endm @@ -26,7 +28,7 @@ purgatory_start: /* Start new image. */ mv a0, s0 mv a1, s1 - ld a2, riscv_kernel_entry + REG_L a2, riscv_kernel_entry jr a2 =20 size purgatory_start @@ -41,7 +43,7 @@ size purgatory_start =20 .globl riscv_kernel_entry riscv_kernel_entry: - .quad 0 + REG_ASM 0 size riscv_kernel_entry =20 .end --=20 2.34.1 From nobody Thu May 7 19:05:51 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CBF9C433EF for ; Fri, 20 May 2022 15:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351171AbiETPqH (ORCPT ); Fri, 20 May 2022 11:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351073AbiETPpl (ORCPT ); Fri, 20 May 2022 11:45:41 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95BCF17997F for ; Fri, 20 May 2022 08:45:29 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id l14so8395173pjk.2 for ; Fri, 20 May 2022 08:45:29 -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=vc6UzMZJ99rPT/oGbTC9rWGA9q53ZOjUpC79nvKqcAU=; b=xn7tGQsd1Ammyb30tKhGhYaTasZDR6D+KopoaEElpoNqc6cGf0hpG8c/xcaW+oBpAb NQDMz08xYT3+AcMmulQAk6hqyDWTp+nOeQiNtJHz9aUl3GAakkxCzJCkqmNuICNj6ku9 Vl5uzJywr8dENe3WususOJPHvvwQ2N9Zb7UXl2j98MpGfkZKlVUup3aNUYpiWXSSsMnF HepGggexSW9DzDTaB5r53P4KdrOWLX4hD7rWWZIHZzryaJzlILIHBDAqaXM69uvA+q0+ HTb8rFfgcXIiymlN8fTxxIcV4a/06ryRKb3FCuQF+PfCqhJ1VLcOJ4sJZ6Wafv1dnUgs vWtQ== 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=vc6UzMZJ99rPT/oGbTC9rWGA9q53ZOjUpC79nvKqcAU=; b=R8RFTq+HC73AvlFUeFaZm4v44QwETC2LO12xEJa94BvYgg08MUw9FtsS/DXOqSYyqb UVOez1dSh+POqZRJc3zGkpdPzl/W1hoQl0FsT93t+cvsqHU+zVCuHHniPovDpds+5tOC 7B3s84AOWQAmIOuBMshkF/XoVCiPyVaCHazGr8CNWu9CYb7nFxGMFbu4UaD0S5fB6cxd kZMKZNJAZSbFOz6v6H0j7c2MgPYjQscANrauViSvpxn5+73TTb6w5mIgzzg/hoCJxVHI aHPknOextskPPt2FAl6qvLbIRPCwc/l6prizj56XdTGZAc2s+wzuivVeb0XnPUogwDgh b9kw== X-Gm-Message-State: AOAM5331MbrrvRjbr7wCnxVeIwooHD5Kc6PnuikpqC6ogjlHjh8ZmO54 JCek2Edy+uyrBRgAucq1xBeYWQ== X-Google-Smtp-Source: ABdhPJztQKNxzDANcIjGDZLNAGCofYLcLEa+w82rs1Ze6iiV8t755M1LTaCfj73BRJaCli8PyHWtOQ== X-Received: by 2002:a17:902:8c98:b0:15f:3e78:dc43 with SMTP id t24-20020a1709028c9800b0015f3e78dc43mr10194800plo.120.1653061528884; Fri, 20 May 2022 08:45:28 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id hi4-20020a17090b30c400b001cda0b69a30sm1987977pjb.52.2022.05.20.08.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 08:45:28 -0700 (PDT) Subject: [PATCH v1 5/5] RISC-V: Allow kexec_file() on 32-bit platforms Date: Fri, 20 May 2022 08:44:31 -0700 Message-Id: <20220520154430.18593-6-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220520154430.18593-1-palmer@rivosinc.com> References: <20220520154430.18593-1-palmer@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Cc: Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, robh+dt@kernel.org, frowand.list@gmail.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, liaochang1@huawei.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux@rivosinc.com, Palmer Dabbelt From: Palmer Dabbelt To: lizhengyu3@huawei.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Palmer Dabbelt With the build issues now sorted out we can enable kexec_file() on 32-bit platforms as well. Signed-off-by: Palmer Dabbelt --- arch/riscv/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 898052ff743e..a246f2fe60c2 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -388,7 +388,6 @@ config KEXEC_FILE select KEXEC_CORE select KEXEC_ELF select HAVE_IMA_KEXEC if IMA - depends on 64BIT help This is new version of kexec system call. This system call is file based and takes file descriptors as system call argument --=20 2.34.1