Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1111746rda; Mon, 23 Oct 2023 03:00:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHT+WDQ4oTIdtWKt1CUMn/ZvKwpnK/0odmNOQucfTs7h6IKWMdSHkPj5JReJSztqasl+pvR X-Received: by 2002:a05:6a00:134b:b0:690:422f:4f17 with SMTP id k11-20020a056a00134b00b00690422f4f17mr7470657pfu.4.1698055231431; Mon, 23 Oct 2023 03:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698055231; cv=none; d=google.com; s=arc-20160816; b=Xi6YeEjJF/BVsZeQrd45oKA7o1si/JzRMnKbmlUsjbYcwZb5daqlxncOVvYbvgNjpJ tYUMQ4mLoODf/LHp07XsofruY3FXxznTfU/P6MmvTVLcd7KIeudP4o6wCndz6xSQL31/ t2cC8ewhyVXagb3F0fgc12On6ZXND9PVZ9QXfWBUMBS9hzKOmPlHp0Wft9fGLN+ymV88 lJz/m7Vsu5l6By8ut1vXdrG6We3mx36b/7id7UXpMyul2cWdD7ocuI08aLOo1yC8NNFL F3mMXkp8js1OW8intZEGJ3oKIytzJB4ealSo4qX0V/p7lzjru71yl2Faj1MBmCfbz5wO PtlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2OmZDh8zFkt2im5G0Ax6bYEcMQDHeA27n8h3Y3jQvbM=; fh=2M58xexEgYMOkKj9+FLh7crHdCkIeKqoS96089cM1y8=; b=0OFRzoa7spp6YDm7Qcod+0gH+YQxIu7kqKOKl4kwvnFk7yW3Xi0/w/bUqkrtJBbfCg t2jBtF7bCPK0CMQLgRIu+/vH/UJLoA5wYip788+6NC5ANoJqgw9flhRwqXfHeVaY/U3e K2luwVHrrj4O68uLvgcV3Hkou2O2tHARBcFhiYhpitKJnha9YQrL6VwUCPmgZy4T5n2m HI1CcFcVjvh8ynEtPCEXZZVCOK61R8mjqnjejuyf3guB/bWBVl5d95tRSWqW8ZME7ZHx Xfbpd+12XDHSj0Wz/Z5HGD9MG7/UM0dILKeHxDvN8OOHEW/lHjazoL2BburPaGdAAQQC oMzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="hjpzCF/f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b11-20020aa7950b000000b006b356972c78si5959031pfp.405.2023.10.23.03.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 03:00:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="hjpzCF/f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3AA3C80AA25F; Mon, 23 Oct 2023 03:00:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233453AbjJWJ7n (ORCPT + 99 others); Mon, 23 Oct 2023 05:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233459AbjJWJ70 (ORCPT ); Mon, 23 Oct 2023 05:59:26 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E0351726 for ; Mon, 23 Oct 2023 02:59:10 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53dfc28a2afso4490184a12.1 for ; Mon, 23 Oct 2023 02:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698055148; x=1698659948; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=2OmZDh8zFkt2im5G0Ax6bYEcMQDHeA27n8h3Y3jQvbM=; b=hjpzCF/fgnhnePd3lDSypoSov04oIGQOoD5kN0+b90weY6uL9toeQ8AlbGRjodLmtR WYbcZ+UHdcmb+0TQlL9/FCfi7exL/W+LkZ0T/Zs9JEZCbZDyJ2ng/tUtUBCMGX5QkzaS Jl5mV8tYnJQCkaKmUDnHwUKIdSet5hkqPLOUT6PNE1BHovCPQYEfph5uKmyvCucN3Amb EMgEqa1ZOlld+wgok/DH7N10qg915QCWRc9SUXf3MkwzUapBq/T+dru6KDoAULWN/hGb v9BY8rQA9DoKyPAV4JDqBDY9lCVSyBpluTZGj1EJooDA5ZwT0MIoW3h+Ao0jVp37sh7b Ztmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698055148; x=1698659948; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2OmZDh8zFkt2im5G0Ax6bYEcMQDHeA27n8h3Y3jQvbM=; b=PRnZuA0QWca9tS87YZngRTeUg9NpPB8DivNJR6asQlJhkkZECoMDjHMIE9Uda/MMgI NtDqVYmi4YNKi37cm5J6ox0nfsys5OpZYjPUZ7JUPa5AqL8aC+e+TQTLuVskaHu0rFOo ivf/jQbpHrnzBcFz5E4lfCFVLiC/AOxhKEoftqLDVEXP/eZjej/AVItOK1H8at5+5MeG wIHgcCi+5jKXjqL1IS4knzRz8cTQJS3isM1CNG+T24XMnhTvZ8jKC9Cp4uuCQNC1yEFs xBDnpekBjDr6GRdD9oRLVUL4Nwkwz4T8Lhms5d+L3oludIPvYVG/ZmSsC6WR82uerN1E Hn4Q== X-Gm-Message-State: AOJu0Yx7uEaf+hGQ+DJzu2tU1HzN8arJmhlDMdr7FaR+kgTk7wuW5e3p Z9i85uUoTkDZR+OasQQLJf4OE/BbUNrZLx6n1c4= X-Received: by 2002:a17:906:6a19:b0:9bd:a165:7822 with SMTP id qw25-20020a1709066a1900b009bda1657822mr7556299ejc.47.1698055148535; Mon, 23 Oct 2023 02:59:08 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id m10-20020a170906234a00b009b29668fce7sm6355325eja.113.2023.10.23.02.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 02:59:08 -0700 (PDT) Date: Mon, 23 Oct 2023 11:59:07 +0200 From: Andrew Jones To: =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Subject: Re: [PATCH 2/5] riscv: Use SYM_*() assembly macros instead of deprecated ones Message-ID: <20231023-136cad6e15a2c5c27b6176af@orel> References: <20231004143054.482091-1-cleger@rivosinc.com> <20231004143054.482091-3-cleger@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231004143054.482091-3-cleger@rivosinc.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 03:00:03 -0700 (PDT) On Wed, Oct 04, 2023 at 04:30:51PM +0200, Cl?ment L?ger wrote: ... > diff --git a/arch/riscv/lib/memmove.S b/arch/riscv/lib/memmove.S > index 1930b388c3a0..5130033e3e02 100644 > --- a/arch/riscv/lib/memmove.S > +++ b/arch/riscv/lib/memmove.S > @@ -7,7 +7,6 @@ > #include > > SYM_FUNC_START(__memmove) > -SYM_FUNC_START_WEAK(memmove) > /* > * Returns > * a0 - dest > @@ -314,5 +313,6 @@ SYM_FUNC_START_WEAK(memmove) > > SYM_FUNC_END(memmove) Should this one above be removed? > SYM_FUNC_END(__memmove) > +SYM_FUNC_ALIAS_WEAK(memmove, __memmove) > SYM_FUNC_ALIAS(__pi_memmove, __memmove) > SYM_FUNC_ALIAS(__pi___memmove, __memmove) > diff --git a/arch/riscv/lib/memset.S b/arch/riscv/lib/memset.S > index 34c5360c6705..35f358e70bdb 100644 > --- a/arch/riscv/lib/memset.S > +++ b/arch/riscv/lib/memset.S > @@ -8,8 +8,7 @@ > #include > > /* void *memset(void *, int, size_t) */ > -ENTRY(__memset) > -WEAK(memset) > +SYM_FUNC_START(__memset) > move t0, a0 /* Preserve return value */ > > /* Defer to byte-oriented fill for small sizes */ > @@ -110,4 +109,5 @@ WEAK(memset) > bltu t0, a3, 5b > 6: > ret > -END(__memset) > +SYM_FUNC_END(__memset) > +SYM_FUNC_ALIAS_WEAK(memset, __memset) > diff --git a/arch/riscv/lib/uaccess.S b/arch/riscv/lib/uaccess.S > index 09b47ebacf2e..3ab438f30d13 100644 > --- a/arch/riscv/lib/uaccess.S > +++ b/arch/riscv/lib/uaccess.S > @@ -10,8 +10,7 @@ > _asm_extable 100b, \lbl > .endm > > -ENTRY(__asm_copy_to_user) > -ENTRY(__asm_copy_from_user) > +SYM_FUNC_START(__asm_copy_to_user) > > /* Enable access to user memory */ > li t6, SR_SUM > @@ -181,13 +180,13 @@ ENTRY(__asm_copy_from_user) > csrc CSR_STATUS, t6 > sub a0, t5, a0 > ret > -ENDPROC(__asm_copy_to_user) > -ENDPROC(__asm_copy_from_user) > +SYM_FUNC_END(__asm_copy_to_user) > EXPORT_SYMBOL(__asm_copy_to_user) > +SYM_FUNC_ALIAS(__asm_copy_from_user, __asm_copy_to_user) IIUC, we'll only have debug information for __asm_copy_to_user. I'm not sure what that means for debugging. Is it possible to generate something confusing? > EXPORT_SYMBOL(__asm_copy_from_user) > > > -ENTRY(__clear_user) > +SYM_FUNC_START(__clear_user) > > /* Enable access to user memory */ > li t6, SR_SUM > @@ -233,5 +232,5 @@ ENTRY(__clear_user) > csrc CSR_STATUS, t6 > sub a0, a3, a0 > ret > -ENDPROC(__clear_user) > +SYM_FUNC_END(__clear_user) > EXPORT_SYMBOL(__clear_user) > diff --git a/arch/riscv/purgatory/entry.S b/arch/riscv/purgatory/entry.S > index 0194f4554130..7befa276fb01 100644 > --- a/arch/riscv/purgatory/entry.S > +++ b/arch/riscv/purgatory/entry.S > @@ -7,15 +7,11 @@ > * Author: Li Zhengyu (lizhengyu3@huawei.com) > * > */ > - > -.macro size, sym:req > - .size \sym, . - \sym > -.endm > +#include > > .text > > -.globl purgatory_start > -purgatory_start: > +SYM_CODE_START(purgatory_start) > > lla sp, .Lstack > mv s0, a0 /* The hartid of the current hart */ > @@ -28,8 +24,7 @@ purgatory_start: > mv a1, s1 > ld a2, riscv_kernel_entry > jr a2 > - > -size purgatory_start > +SYM_CODE_END(purgatory_start) > > .align 4 > .rept 256 > @@ -39,9 +34,8 @@ size purgatory_start > > .data > > -.globl riscv_kernel_entry > -riscv_kernel_entry: > +SYM_DATA_START(riscv_kernel_entry) > .quad 0 > -size riscv_kernel_entry > +SYM_DATA_END(riscv_kernel_entry) I think we could also use the shorthand version for this one-liner. SYM_DATA(riscv_kernel_entry, quad 0) Thanks, drew