From mboxrd@z Thu Jan 1 00:00:00 1970 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 B73AFC004C0 for ; Mon, 23 Oct 2023 10:08:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjJWKId (ORCPT ); Mon, 23 Oct 2023 06:08:33 -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-Google-Smtp-Source: AGHT+IF0AGitdQJUS/4bR8okkah9gJ8ur6YNsJ9+3rz+vlExwWE6UKBsdxQZQMbHsSgKlRITPAhqDQ== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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