From patchwork Tue Oct 24 13:26:55 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: 157477 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1946898vqx; Tue, 24 Oct 2023 06:37:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyfTq8lzFpqQi/0HdgTNH8wB0cve57+bCm3VBQsrZeHp2RwIJa/xxl+Ulwv9HV0A8VTwb6 X-Received: by 2002:a05:6359:2e88:b0:168:dc05:b3fe with SMTP id rp8-20020a0563592e8800b00168dc05b3femr5955289rwb.14.1698154636304; Tue, 24 Oct 2023 06:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698154636; cv=none; d=google.com; s=arc-20160816; b=FHT6v2eq9uo3lKsV0OsQLQ/0zQl+ARJFLkDLZmLQYmVyAau/7sCksITzv9C8U2+T4/ QDuwHTXWvWPvmp9Ig0mbUpJBx1xNvAfiXeZe6evfMbHCtt4ab8EY3J1o987udPZp0VXX Twrfg1svpPQEXmddlEUbxEsM2sWd1Gbf7Wd3r5Vm22sdPAgMH8y+WAqWgo8IH99mDRvP 45kxCWkkT6uKAdjy9hEXzJz7tlo/hh8O+1CViE7mqce15KGQs0gsBtKTG9Vx0GrF8XEI eRKIqyd4Fc6gjR7wrJ/2JIa+nRG76zMWes2I/ORtzGHDILwVmfXd9NEt+XSs/4MMTV+e DA6w== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ca27-20020a056a02069b00b0058bfcc0f4b7si8890386pgb.473.2023.10.24.06.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:37:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; 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:5 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 groat.vger.email (Postfix) with ESMTP id 2F4A18058A22; Tue, 24 Oct 2023 06:37:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234488AbjJXNhE (ORCPT + 26 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?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 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 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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 24 Oct 2023 06:37:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780644195433600407 X-GMAIL-MSGID: 1780644195433600407 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 Acked-by: Palmer Dabbelt --- 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