From patchwork Tue Oct 24 13:26:54 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: 13434518 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A94CC25B6C for ; Tue, 24 Oct 2023 13:28:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ia+kAZJZAm07Xi5ea8aXUOUwekHQu8pfydeEsjDpLw0=; b=B5YYOx572eboUv 3vOnAZWX/bpQgRcmm+tmFW8Ux1kk/jGj5J3kkWzxrBwU1vsmBh3ia0yzJ7R4ofZAgo62jH+n5gUzu WkO2g+xgN30cGx0FpjDT1stDwJEJDQTg9Fu1DzF9OtJ1l2mhk0PDt18360r84XPk5nY6nTPe2Iy2C RSawFqpB3y1jjvU2Nf7YDIfB8Yer6Eep/y3uOXt7voSdbbf4Jd/Fy/U3Z+S/42PdIrX9liu+IyuIf wtU13C+GMYEuwcijDZRprzIAxy/rPGF4iIM/4wsXLnY+L0e/06rEZHBTwOPhzaNPp0Q4qoMDBJWSu 7LzeWHjTeP0ZTOTlDgnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvHRz-009wqi-0T; Tue, 24 Oct 2023 13:28:03 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvHRs-009wlT-2z for linux-riscv@lists.infradead.org; Tue, 24 Oct 2023 13:27:58 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-407acb21f27so4911465e9.0 for ; Tue, 24 Oct 2023 06:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698154075; x=1698758875; darn=lists.infradead.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=AX7Kg3pLTr22HxmtrSzH05kFw/tkq3Ew+3ARfiqVrfA=; b=qWoaVCVJe04pOTJqbYEOs3k7adZE23kGX0MOgaE2j7LOtHTMUn+y7nqw16Sc/TKkXI 0aMGx5JQetq4cYFpwJiqzAh4PYUmw14d8CmHPaaq5QnwKnbUlcodTEgRtigVyGiC6M7T nQQw5CW8N7p0j2uGEh6+IT58jd9bzsmsxNb9gumUy94+PSbbPXpnOHPZNdn3irImAYUE gLclfVMPF2a4V/bdGdhCvWUqlen2nPntWhTCNpMQDlQeyL8hkkay/8tfAvD+Uhms0e0I hnHY91Z5xtvJX7tCQ7kOMecPMlM9cip4BuNZxJatETTd1Ss9ojJb64/clmDSkZk9INLN XiuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698154075; x=1698758875; 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=AX7Kg3pLTr22HxmtrSzH05kFw/tkq3Ew+3ARfiqVrfA=; b=hzQymFY4Y6Yze4siAZCby4X0xCmVWFotpCMsAIEVQ+Ipe9B38AHI7/amW6EzAeNLwI pQkpyYiFwMbbeFOM8TssXFFiSM0DyS4zshWYQSekJBF/ev5FA7PnyAJynnKMBcxXg54e hEUdUYV6Lfn7ruTwTZOSQW9KeJ/XyV/yKBim8toTDOhX4Pnh51zZtpBh9e83qQdD401q 4UCrXi+MpMiVkmEOQtqHKdI/rYL669H2MciZZEnqYI0R1mepEnVwP2NZxPOuUnOxA0u4 fq+LxmKwgzHw/96EWt93MhGO1GrFwJpISNR55F63AqbWRoKSUcSDyYbIrqxHszsLMH77 HpWA== X-Gm-Message-State: AOJu0YyUmh3HZG+Sp4wLC5Nw9hirhn1cVpB+VqpZsX7EE7FcS79wI1Ie vAGpC+n+6lmRL3e6P48gJhCQVw== X-Google-Smtp-Source: AGHT+IHA25WZkPnpG7hkj0epNRPJqd27SODY+lc7O8SDNKvya8GFTiFglhkKPL8RIhS/CoJQXkOmIg== X-Received: by 2002:a05:600c:35cc:b0:401:7d3b:cc84 with SMTP id r12-20020a05600c35cc00b004017d3bcc84mr9290453wmq.0.1698154075695; Tue, 24 Oct 2023 06:27:55 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:597d:e2c5:6741:bac9]) by smtp.gmail.com with ESMTPSA id c17-20020a5d4151000000b0032d87b13240sm10034964wrq.73.2023.10.24.06.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:27:54 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra , Andrew Jones 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 v2 4/5] riscv: kvm: Use SYM_*() assembly macros instead of deprecated ones Date: Tue, 24 Oct 2023 15:26:54 +0200 Message-ID: <20231024132655.730417-5-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231024132655.730417-1-cleger@rivosinc.com> References: <20231024132655.730417-1-cleger@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231024_062757_015761_2BD1E541 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Acked-by: Palmer Dabbelt --- 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