Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1116372rda; Mon, 23 Oct 2023 03:09:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxvrV5CyWJvi4B/nMdQeBlZHuocn/43VjMLK6elLtajdwBVStkdiNbENw8iWONfVtn+3sv X-Received: by 2002:a05:6a20:8e08:b0:15e:9923:3e35 with SMTP id y8-20020a056a208e0800b0015e99233e35mr16906879pzj.19.1698055745476; Mon, 23 Oct 2023 03:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698055745; cv=none; d=google.com; s=arc-20160816; b=ZbliOK5NhIwiezjMa56OyDYVI1wCXViHqGb7IUvyr/3BFQIrn+nvFBMq6Wykb/XCN4 ku2255039Bp7YPar06HPoNPYKJ0rsZcxkQUp35tjNTphtPjeM5wHD/qdpTwqf1JNEzJ3 dL9rx5DgVJ4KanmNufV/0JuD3oudLR7FD3KSmTKkCLvjFZ8fT/sM/l+4xKaEs4SH1LHb EKDpsk/NBZqyYTSLslh0daYQBEUO3K8ev3uMPkdMkQ0rgnG/avHGJs68edxrE8MWy3fZ z19EDgi7F2ETPRI376NsBQcW13CcNvL7I6GucK2qsBCUTbspzSK17+Mdbq1ZYofamjOu 8FiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1aEOfuIyiwkOnqlQnKYH2Ng5EBPcZk7vfkvoKG6EFyM=; fh=yFkSnf0Y2vgreyaYe6bb4s+K6avHvP9c0WRBx1DhHVU=; b=LfCXMXyOQoVSVxp1Aw4GFw0vol/nLRa8KQqCFUc2XWBeslE329hmT4qZ7muLyHbz8d oCEoc7Ip0WAyGKe6M3wZR2LhEBaB7UkAXe2QLybJPgNUqTIx9ZPB7Ld1SgIkpTt4/H5V sLf2qOr33CoDc49PQSwL1TWFnVMMYDYAJ7tL8i+A2IPQ1zcesGbA7scqJiycMFXg4C1K h3EhblB3jF5hdfMf/21R1GAt3peOKcR200jDm8KyNPpxbnDlWVWsH4nHruo599HzTXq+ NZcmfxoOEPMUh47Ssj5sII1lKUv3Ngwndb30AKDkrdFMeYJv8a5RUz1YNNMYGyZr2Po8 pGAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=tthll7qr; 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 h184-20020a6383c1000000b005b7d9aace9dsi6069570pge.46.2023.10.23.03.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 03:09:05 -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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=tthll7qr; 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 7FB9F80ABB0C; Mon, 23 Oct 2023 03:09:00 -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 S229747AbjJWKIc (ORCPT + 99 others); Mon, 23 Oct 2023 06:08:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbjJWKIb (ORCPT ); Mon, 23 Oct 2023 06:08:31 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21766F7 for ; Mon, 23 Oct 2023 03:08:29 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9c40c3814a8so93770366b.0 for ; Mon, 23 Oct 2023 03:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698055707; x=1698660507; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1aEOfuIyiwkOnqlQnKYH2Ng5EBPcZk7vfkvoKG6EFyM=; b=tthll7qrPLWYb5bp/TNK3iB1mja4LCgJTBjBgfF6PXf8JkoVIovDMpL0tjv2Hezvsa 28AIKGn9YfDrpJTl102HX+LF2CzQq6xkqoGdwPoA6d5blR6r9bYjJrdFWmnILYpEJl1/ Vp91LzOD01OPQp+rp5sNNwSX7+YLddGWuUT8SUzyX/9J0N9SHCy2M4S8XBLh4Ky5rzCg hS0lQhGa0jnGnkmOPB/HJc5xx+qdlW+Qpn6O5wdekf+FIotGmm76sbnpY34nZGgixLfs aoI4SNadY2peAP7linbc7aoh4tIW2uJ5f1v9syTmC7TkkE/iB0s6dk//Ih3AF3y1qC/d Yixg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698055707; x=1698660507; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1aEOfuIyiwkOnqlQnKYH2Ng5EBPcZk7vfkvoKG6EFyM=; b=vhO1VRuyaI9Sl/pQ8gehwsbOSlKasG3iy8SfuGfJjd9CuGmD29yx4AzgiOw1ccnAWe GHzyCEw854axRE8yCfb8AQMfqY9IO4fHE2wTOE46zJGfz61Z0T1tAvKnwk9P6T7gTD/T miyKbYXrJdIQl4zcMajh4JRscF5kxYn2QrfVTA5PJ59lM+vt2nTb6nzsowcKVCowVdZX tzjnmsfssxndLL95O0N9Qd0Y0jXInfwN6sPG6AkEZ441yXSFCvWHiyIs8Bnp0mLgGb2L oW32QFFFWTdjM2lRwx6u6XiIujSpvhNckl8JuZZLJ4qaXAz+yM3crnuPHxccpWQXc7E0 oNAQ== X-Gm-Message-State: AOJu0YyiNdm5WoezuUP2n7kq837i5Z6szXgBMR00lKjse+/snbfHlCbC 8VwCgI6EFwbPYenUUQi8f6+U/bwkV/knl2flsgmpDg== X-Received: by 2002:adf:a30e:0:b0:32d:c312:49af with SMTP id c14-20020adfa30e000000b0032dc31249afmr5895229wrb.6.1698055686818; Mon, 23 Oct 2023 03:08:06 -0700 (PDT) Received: from ?IPV6:2a01:e0a:999:a3a0:17bb:4fd9:531:a7cc? ([2a01:e0a:999:a3a0:17bb:4fd9:531:a7cc]) by smtp.gmail.com with ESMTPSA id k13-20020a5d628d000000b0032daf848f68sm7437719wru.59.2023.10.23.03.08.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Oct 2023 03:08:06 -0700 (PDT) Message-ID: <435519d9-e569-4714-b50b-f46ac281478e@rivosinc.com> Date: Mon, 23 Oct 2023 12:08:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/5] riscv: Use SYM_*() assembly macros instead of deprecated ones Content-Language: en-US To: Andrew Jones 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 References: <20231004143054.482091-1-cleger@rivosinc.com> <20231004143054.482091-3-cleger@rivosinc.com> <20231023-136cad6e15a2c5c27b6176af@orel> From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= In-Reply-To: <20231023-136cad6e15a2c5c27b6176af@orel> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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:09:00 -0700 (PDT) On 23/10/2023 11:59, Andrew Jones wrote: > 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? Hugh :/ yeah, thanks for catching this. > >> 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? I'll check that with GDB to be sure we don't have anything fancy here. > >> 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) Oh yes, nice catch. Thanks, Clément > > Thanks, > drew