Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1892557rda; Tue, 24 Oct 2023 06:37:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxMymE7K+QurAmIeg1DrlXf6o8YoDvsx704K8cG7n1Hw+hPoaGxZ7PIHNQnPvc4SUYD6J+ X-Received: by 2002:a05:6a21:6810:b0:171:4f38:b475 with SMTP id wr16-20020a056a21681000b001714f38b475mr2542146pzb.58.1698154634225; Tue, 24 Oct 2023 06:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698154634; cv=none; d=google.com; s=arc-20160816; b=KIVmYOYIJImM16sAi6bPDnzle1VkGMZrhLCO7kl8DNiuVWRUF9HOmf3lDybPUpeGDf /Sz6fHZAF5jS0qne9Ka+BHUTygNj9xZMMx5KXtTmUwHFZ469pkvzrUvdBzyp/SKySBjx oylwCh6n56/4mz8NPjghRLXUWgWlEwl8jNApn5djybbkuIXubFfuPjIXY5NZN9yRCEPG W2nFfl8kEjn6vq7dHsWrdVWZEmKTU5xjQyhGUKXAUZ7n8dejOazjReswefbHRQYRPtBX MzGmi59tGt96rHdz+r7mUoL2UsZ9o6BgnG3aj8DsztSdBcFVW9SFc1q1b0/TGef53Q1E kIqg== 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=EJFNx5rx7qhUkqIPLwjnmrfGOQmOs2H4ET4l8FDTOVI=; fh=Rc5BA83UGq8xI+benUSDUMXSpsH6SOD8MT9gG1locMQ=; b=dWeabqIEdhiiOVUncTlT+gYH0LYKqKMK1nR55ReOOHY4F6tEYzwFJp2AZWc62Fr2PI 5lmvdE5pFasQng5Sa5wOOXOFmuBcEcjQ17FF529GI3y3Td5W+VKOl+SwDtzXYuCAhNqq coOA/cb4MZvR5dwR6EG9C4L/3buAkmahMNQIaU1k78v0aoPvgeWEbdc+8DPcZ5yNIkle dWgQu2u2Tlb4lRztL4y78H1s2gHs5Sl+ZKWHU10rZg5Z0mSvsU1Htl7ww5APPlMD0KqX EANmrcK8/Lvw4oDRYOrSUeGqiRn3B9e5KbG01wP1WJ+b3XU8UjxXCpYWwqrzio6XzK6E AEhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=Zbyz6T5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id fi39-20020a056a0039a700b006ba0f2747c1si8381720pfb.7.2023.10.24.06.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:37:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=Zbyz6T5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 64B8A80401F2; Tue, 24 Oct 2023 06:37:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234742AbjJXNhE (ORCPT + 99 others); Tue, 24 Oct 2023 09:37:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234734AbjJXNgn (ORCPT ); Tue, 24 Oct 2023 09:36:43 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A45776E82 for ; Tue, 24 Oct 2023 06:27:58 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-507a80e2a86so1552125e87.1 for ; Tue, 24 Oct 2023 06:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698154077; x=1698758877; 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=EJFNx5rx7qhUkqIPLwjnmrfGOQmOs2H4ET4l8FDTOVI=; b=Zbyz6T5qbkAMpwaeneQdg3zL3d47suRKNRrvsFDD+y3Ei0XN24YX430fRV1uiUpXrC Ho35mh39xUWgM+tsLLTefNAshXDfuhoJIINl+Pv2mjsgk/ZY7I71iIpPGM97nDFyHYAx TMzqoVJ1M0MFdvWdH7hlCqzp4NdoZrbzwyYwAEAH5pWIcJfbYSwWei6D4TrjsBVIW9YD g6DtBPKZMqUFMxnSyWEJ5fbPxIK1UdVT4QmZaVniG4OzeornVF+LI/pnHKlqMddH1ydw P0frM3i3i1uH3gUMhfJR4nkh7UNliUnPBx/EbrYnzMY3SZha/xujawddGvjYQcjAeJ4u TZyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698154077; x=1698758877; 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=EJFNx5rx7qhUkqIPLwjnmrfGOQmOs2H4ET4l8FDTOVI=; b=DWQ+/ahpoq63zwwPbDs+KYMfiRQGr98NRhyEUu0aTriSkOtF9kXWFrNmdTY328lfhi XsAM9lMCN4MdBy63WPAt11uKKODnq3YGVrotV/7kB9kDmHhpBTuHTp0ee4AYchoXF+h9 p1/MP7ydpHyBSemRzdL1OoxvkqnMTekCLiKAfL4oHHTpdSR0VwifCjcvazriE9JThDlt bOcG4Ygkz1f55nNtiUElnNPAOTlkcC6dFNELGSyQjsiweBlhX6DLPHXVuVlNC4+q/p7R Fy3axfysembtAvsZuTQKRx2BIdd3IX24zX6RmUwB3XePfORLajKgR//WQLbjKiprH0BO R4zg== X-Gm-Message-State: AOJu0Yxk2HumCOSKm0mNr0MnrMR9c1l9mJDK7CQe1l9sBw/+ZyzMS0CT UuXqlZrgLZzNWMgnryJNYdyibQ== X-Received: by 2002:a05:6512:ac3:b0:505:7123:21ae with SMTP id n3-20020a0565120ac300b00505712321aemr8618901lfu.6.1698154076939; Tue, 24 Oct 2023 06:27:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:27:56 -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 5/5] riscv: kvm: use ".L" local labels in assembly when applicable Date: Tue, 24 Oct 2023 15:26:55 +0200 Message-ID: <20231024132655.730417-6-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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 24 Oct 2023 06:37:11 -0700 (PDT) For the sake of coherency, use local labels in assembly when applicable. This also avoid kprobes being confused when applying a kprobe since the size of function is computed by checking where the next visible symbol is located. This might end up in computing some function size to be way shorter than expected and thus failing to apply kprobes to the specified offset. Signed-off-by: Clément Léger Reviewed-by: Andrew Jones --- arch/riscv/kvm/vcpu_switch.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kvm/vcpu_switch.S b/arch/riscv/kvm/vcpu_switch.S index 8b18473780ac..0c26189aa01c 100644 --- a/arch/riscv/kvm/vcpu_switch.S +++ b/arch/riscv/kvm/vcpu_switch.S @@ -45,7 +45,7 @@ SYM_FUNC_START(__kvm_riscv_switch_to) REG_L t0, (KVM_ARCH_GUEST_SSTATUS)(a0) REG_L t1, (KVM_ARCH_GUEST_HSTATUS)(a0) REG_L t2, (KVM_ARCH_GUEST_SCOUNTEREN)(a0) - la t4, __kvm_switch_return + la t4, .Lkvm_switch_return REG_L t5, (KVM_ARCH_GUEST_SEPC)(a0) /* Save Host and Restore Guest SSTATUS */ @@ -113,7 +113,7 @@ SYM_FUNC_START(__kvm_riscv_switch_to) /* Back to Host */ .align 2 -__kvm_switch_return: +.Lkvm_switch_return: /* Swap Guest A0 with SSCRATCH */ csrrw a0, CSR_SSCRATCH, a0 -- 2.42.0