Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1891841rda; Tue, 24 Oct 2023 06:35:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpEslCSAhay2lwO0lxc3mi+9yqDJphSOYMXUjitpfH49gVYa75yI/Adpm3OI84Oc95VkfN X-Received: by 2002:a17:902:d483:b0:1ca:9666:9616 with SMTP id c3-20020a170902d48300b001ca96669616mr12318253plg.57.1698154556843; Tue, 24 Oct 2023 06:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698154556; cv=none; d=google.com; s=arc-20160816; b=y/nFr9d/WZrRAvLz0F6uZ9oijxNQpqfnPhzFTYaedE7DIKjdJPV6AHr2QD18thHjNj O6cjHsqtkBThK1EvpBVtS8NJZTwnzk8rkLE04aRaYdJXHKOc318R4o4LGSU4uvfGFTY3 7kzrvuYISyPZWCteCReXy5oLmDgbAj0C0OPnAkOhOluhYZoysp9J3V9tSWRbrMpszexL ohvdSkZR3SpNNoXz5ddy9qFFUQx4RMarsPMPLolC1F0ZZF0rWnKc9yDoxbl2i3PjGWtI kmW3nnzrGHKoFUGZEsz60+DgTDQ5wF934hwSpUHDA1nEqAeGuBiWmnMb/28/ecgMlort Gp8w== 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=AX7Kg3pLTr22HxmtrSzH05kFw/tkq3Ew+3ARfiqVrfA=; fh=Rc5BA83UGq8xI+benUSDUMXSpsH6SOD8MT9gG1locMQ=; b=BYgxOn/dd6/dOAKbk9qpunyZv1WacG/99Enl6/6XjT3w6++eph4ho4FCMZLd6J+gy2 PHYQBdCNkrH26O3Q8SbrFpxRudYLAlOxnjle5k+Yq4N/Mk70vIuJx/WByEp5wFBcPJ0U 6vDLAFE4agbsy92ERNIR0g4LngTe+ky7c+gSywYS26JR0JzWK2jVSSRG/ccFEg0QDa9T AsuVEYugahMq4SQ0AI2i8KDttruI5lGobMHkwx2A9jOZZGaH0pOw9INW9/bsdQBBrF6G PLjWq7OsUqbrNr3fW1yce+Elnyh1HZQt8GDDSG+U0b0we94+55oF8csBFpnmzq/iE01f zPLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=OyVBZos6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l18-20020a170903245200b001bdafae4b7dsi8528741pls.43.2023.10.24.06.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=OyVBZos6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id C7AA9806A960; Tue, 24 Oct 2023 06:35:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343492AbjJXNfp (ORCPT + 99 others); Tue, 24 Oct 2023 09:35:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234720AbjJXNf2 (ORCPT ); Tue, 24 Oct 2023 09:35:28 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 425816A7B for ; Tue, 24 Oct 2023 06:27:57 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-408ffb55b35so1895265e9.1 for ; Tue, 24 Oct 2023 06:27:57 -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=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=AX7Kg3pLTr22HxmtrSzH05kFw/tkq3Ew+3ARfiqVrfA=; b=OyVBZos68gZ3uKgmCwXMtsYUjogWMwz/jJwmNiVJqmRmbFwfyxK946EjgVT7mSyuxJ b/DCZIPoE/hSxmjjQggOMZ/gNK/ThsTLFSUegbtLxKlGmcw1oOReD3QZ7OtFfQFfsVJd Ao/eFatz2AGO+hA1qXQILBIe8v88y+l5YYgTs4qbUlnB4DTy32IKa0wK5AQb1dOrUmNE BeycJa4ddcRZoEYt/FyI4GrHeQ+niHeFAUpLPeXn1JBAqZ9Ta3tZxabcLC2bgH644fI7 4sQCIBV8or+Dfii9cLtyrdEGbV9QyCHamlsNBmDF4mdKqRZrgq0CCUbvMrLKVaTWgg61 hAww== 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=p7eQA1NmYE2Gu+jGHcc9T7RRt54Lvww9Lv9HQa7l6dIEl3dsQmqwxD0p3vkTp8zY4p bjnsXLjGRKu2HpKdM3qQuMA5fmz6vBrDaYrcWkpRqBTX8HHiNbfhznYhyxd9no9hKMxb swhREDdFFHHb+DhM5zjtrCJvA2qG//zwwWNdpuN9X1+M6QTtg8Ah23D33GUo0Ee4gosT BVsmZXtzdenZkRvl1tGekzL3FPzq5TxBx0OJvovgzkJJ0DVENiFCOwK0jPiFxGS1gx77 UsZA8tTlNr88v3a9ZwwJnfYdE7BqNDl0Aety+bcO/pB+00VpIZzdGOhpAuI8lerdFc6p HBWQ== X-Gm-Message-State: AOJu0YwuGQgEaWntmO6/waRYH6Aa5HMc+RSKLOUGnPHVw5/OzfRG5J6v GJ5XYkwAcBazGbXqkQRIp25hRw== 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?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Anup Patel , Atish Patra , Andrew Jones Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , 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 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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 24 Oct 2023 06:35:54 -0700 (PDT) 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 -- 2.42.0