From patchwork Wed Oct 4 14:30:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 148326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp178404vqb; Wed, 4 Oct 2023 07:35:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNoocPkvw/0oIaOn6rljhcKRT6lctfEfVe+6jUkD3SuxkuyMklxdYK1783aJYwIrSF+N1x X-Received: by 2002:a17:902:ee8b:b0:1c5:f663:1722 with SMTP id a11-20020a170902ee8b00b001c5f6631722mr2472049pld.6.1696430107569; Wed, 04 Oct 2023 07:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696430107; cv=none; d=google.com; s=arc-20160816; b=L8nGf99AjbQ2dE5nh3rNd/lnhoFsFrlEf/bPh5Di5u/w75fj4CxmFz5ma4e045/Sdg xZNgNx9j8JUdeHlI5X5DusjHdgPLYtEU0hMKb01vxc7nSXZ0Jr7mvCFkirkr5ABnW3LD G/KHxuwZJwqcFBJiSkxmDE6iBlfgyMlrzMfWV0OJNalxQh2DCN/unm1g0HQ2xPVr+ErW 8C0DPBGLiFs8lDzsJuQXcA2xfvZS2wTQKgpeQu8G1rdUbrTg6NoC87si17Bs5mgP8CRN 6Bkv8h9r9v4s8gYcKePbb7FjTDyYpjVr8cRRifHZtoRT7r6Qie4+r/52zPnl+APSyVwE lWCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=D3YF5WNle5WpS70J/C6Gc27a4yBxFn8dy6pHVVBXBUQ=; fh=LGqxV//S2dNc9ZXry/APvah5P8y0u5J065Xrxe/jE+g=; b=hB3yOSe3n0Vlc05KmHk1G30gyr2YtUciJRM9sWBLF5KlK55TSfB9laZsKpJe2GjsZu w8QkXVeRabJVZOLAvYWBfRynxCxrdB4dZw0lOiQw5YCP4Ak9CpF8ONkb7TxTz3I8y0vV p8S3aOOdRTF/wDTJwdJt5mYyTdM0S8Z4fBKTOS6kIAA6w5T4RYivEXHgDgXCU2+Mb9Eh cqMpiPBoa/jbkLrxG37RNISVADYkpGIB1yhvOTE2c1rnFecKtZiWHBC0e3Ej7HHAAZ16 FQk+4ruyTgpR5O7AFDXTc8LDrCh1BRspJeJ0AK147/iNIcbDboFJxnIb6zvDkN3yUMKa HmVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=nRHBWLD2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s8-20020a170902ea0800b001c7615a8e09si4235499plg.593.2023.10.04.07.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:35:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=nRHBWLD2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id DC4528220769; Wed, 4 Oct 2023 07:35:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242870AbjJDOfC (ORCPT + 18 others); Wed, 4 Oct 2023 10:35:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242867AbjJDOez (ORCPT ); Wed, 4 Oct 2023 10:34:55 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22906C6 for ; Wed, 4 Oct 2023 07:34:50 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4053e6e8ca7so5615325e9.1 for ; Wed, 04 Oct 2023 07:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1696430088; x=1697034888; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D3YF5WNle5WpS70J/C6Gc27a4yBxFn8dy6pHVVBXBUQ=; b=nRHBWLD2BeVsjKK5IK+4w2nw3Xcmd5InkpiYdvBHxWAvTdSR0H7mLrad7F2boeNqfv 3F6cScUSKN6Au2l3K8rl+zW9Ygtl99QOUNxb59C49ofNNpNS0xRtRZlD92HOOFATEjfm fF1cGaMBGrIJAvup1b25GhNrumCwBfWP8ix1AjjrO0cWGD68yKgowlBYUISkxkT066Am sMDaGsX//zKl3HZDzdoPK0z6AcQSb3G2ysLXDMGfJfqcswaqeTIx57Lz9BO5MQ0JilsW G0EnSHKfBJrvQKi6dsdF61STbyE2/wfxeJgxp4N2taU9OlXXpClcOHmQCX2KeVoVFneC Infw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696430088; x=1697034888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D3YF5WNle5WpS70J/C6Gc27a4yBxFn8dy6pHVVBXBUQ=; b=bECxuwMA6C/hrnm1kDQEzZKS8q2qyqeyBvgUqr+jd8IM5nrmyr+d4laB97ejf4Kpf2 x9U33gVd5ocDr7KX2n1Ouul5zyXrlSKscUUQuySQE2K1yyiriyKIYe0W2bRL75I2QrjL AthKNdpfX4pZc/+2rV52QuIblV6BxPFh8RJ9a4SrXnPY6yQQ0mXphqyR0MHhE+epQxGO HUqZ5f6IoHjYsTk6ZvMrsVvTy0Riw3zmmi1TQh4nCyhH6s1zyudHqvcHZhtmTJo2GdOG NruNfiwXl0U0Sql+vlCuwEqLWa/YsI73TA4vq0WlMBZDZwGf4X61NLAL5fSQ4LWgGlHU KDXA== X-Gm-Message-State: AOJu0Yw1J5iow2QyA5Tn5eD/NxIsmVDXzwJ4deFYWNFduSNID/Kx7kqE SclpPww7D4VIXPRnE+ilua5Anw== X-Received: by 2002:a05:600c:511d:b0:401:b53e:6c3e with SMTP id o29-20020a05600c511d00b00401b53e6c3emr2517778wms.1.1696430088453; Wed, 04 Oct 2023 07:34:48 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:9474:8d75:5115:42cb]) by smtp.gmail.com with ESMTPSA id t20-20020a1c7714000000b00401e32b25adsm1686205wmi.4.2023.10.04.07.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:34:48 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Subject: [PATCH 4/5] riscv: kvm: Use SYM_*() assembly macros instead of deprecated ones Date: Wed, 4 Oct 2023 16:30:53 +0200 Message-ID: <20231004143054.482091-5-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231004143054.482091-1-cleger@rivosinc.com> References: <20231004143054.482091-1-cleger@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 07:35:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778835896492476688 X-GMAIL-MSGID: 1778835896492476688 ENTRY()/END()/WEAK() macros are deprecated and we should make use of the new SYM_*() macros [1] for better annotation of symbols. Replace the deprecated ones with the new ones and fix wrong usage of END()/ENDPROC() to correctly describe the symbols. [1] https://docs.kernel.org/core-api/asm-annotations.html Signed-off-by: Clément Léger Reviewed-by: Andrew Jones --- arch/riscv/kvm/vcpu_switch.S | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/arch/riscv/kvm/vcpu_switch.S b/arch/riscv/kvm/vcpu_switch.S index d74df8eb4d71..8b18473780ac 100644 --- a/arch/riscv/kvm/vcpu_switch.S +++ b/arch/riscv/kvm/vcpu_switch.S @@ -15,7 +15,7 @@ .altmacro .option norelax -ENTRY(__kvm_riscv_switch_to) +SYM_FUNC_START(__kvm_riscv_switch_to) /* Save Host GPRs (except A0 and T0-T6) */ REG_S ra, (KVM_ARCH_HOST_RA)(a0) REG_S sp, (KVM_ARCH_HOST_SP)(a0) @@ -208,9 +208,9 @@ __kvm_switch_return: /* Return to C code */ ret -ENDPROC(__kvm_riscv_switch_to) +SYM_FUNC_END(__kvm_riscv_switch_to) -ENTRY(__kvm_riscv_unpriv_trap) +SYM_CODE_START(__kvm_riscv_unpriv_trap) /* * We assume that faulting unpriv load/store instruction is * 4-byte long and blindly increment SEPC by 4. @@ -231,12 +231,10 @@ ENTRY(__kvm_riscv_unpriv_trap) csrr a1, CSR_HTINST REG_S a1, (KVM_ARCH_TRAP_HTINST)(a0) sret -ENDPROC(__kvm_riscv_unpriv_trap) +SYM_CODE_END(__kvm_riscv_unpriv_trap) #ifdef CONFIG_FPU - .align 3 - .global __kvm_riscv_fp_f_save -__kvm_riscv_fp_f_save: +SYM_FUNC_START(__kvm_riscv_fp_f_save) csrr t2, CSR_SSTATUS li t1, SR_FS csrs CSR_SSTATUS, t1 @@ -276,10 +274,9 @@ __kvm_riscv_fp_f_save: sw t0, KVM_ARCH_FP_F_FCSR(a0) csrw CSR_SSTATUS, t2 ret +SYM_FUNC_END(__kvm_riscv_fp_f_save) - .align 3 - .global __kvm_riscv_fp_d_save -__kvm_riscv_fp_d_save: +SYM_FUNC_START(__kvm_riscv_fp_d_save) csrr t2, CSR_SSTATUS li t1, SR_FS csrs CSR_SSTATUS, t1 @@ -319,10 +316,9 @@ __kvm_riscv_fp_d_save: sw t0, KVM_ARCH_FP_D_FCSR(a0) csrw CSR_SSTATUS, t2 ret +SYM_FUNC_END(__kvm_riscv_fp_d_save) - .align 3 - .global __kvm_riscv_fp_f_restore -__kvm_riscv_fp_f_restore: +SYM_FUNC_START(__kvm_riscv_fp_f_restore) csrr t2, CSR_SSTATUS li t1, SR_FS lw t0, KVM_ARCH_FP_F_FCSR(a0) @@ -362,10 +358,9 @@ __kvm_riscv_fp_f_restore: fscsr t0 csrw CSR_SSTATUS, t2 ret +SYM_FUNC_END(__kvm_riscv_fp_f_restore) - .align 3 - .global __kvm_riscv_fp_d_restore -__kvm_riscv_fp_d_restore: +SYM_FUNC_START(__kvm_riscv_fp_d_restore) csrr t2, CSR_SSTATUS li t1, SR_FS lw t0, KVM_ARCH_FP_D_FCSR(a0) @@ -405,4 +400,5 @@ __kvm_riscv_fp_d_restore: fscsr t0 csrw CSR_SSTATUS, t2 ret +SYM_FUNC_END(__kvm_riscv_fp_d_restore) #endif