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: 13434519 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 16609C07545 for ; Tue, 24 Oct 2023 13:28:09 +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=kWakTq/Z4T2xZY+9Gx8J2aNQoseJAN+ZMdhmMIUzvIU=; b=dsf/kmOWsjHVYU RNOwmi14ns7wnoDMpvQnklXv7EkIaKzVhPsQ0d3LiP0D6pS6zCb0wdN5o0CujSv2Hh5dzo7CD9Hg3 1vSCdZD+0y+2JZbVxJA3dYyuCASX0m275My48EhKGAbZXIPjmrAuIGWTDc4G5yjzDuPAGWwy609pz weoFQej73e1R6mhzCEhY5yXzMblCmi4H1muPCER8QEDmgsnTa7HIyHPMsTvLQTV1mBQGXOI1XoOoD XCngF0bjKqfg0vgPPA2rTBqSxL5ENCNsJ48BU42ndQU2hSD/Q/sT37VNfG/gvmg1kHyu+gvlFjTIL GgnC6fGPj2RsfA+EVDEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvHS0-009wrj-1G; Tue, 24 Oct 2023 13:28:04 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvHRv-009wmV-0J for linux-riscv@lists.infradead.org; Tue, 24 Oct 2023 13:28:00 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-507a3af69d8so1560440e87.0 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=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=EJFNx5rx7qhUkqIPLwjnmrfGOQmOs2H4ET4l8FDTOVI=; b=YAnxaKKi6pbHchsxtGqeP4D9n6fD2p9Kes5bBKvR7mtsiayuM1Z8iEH6mnIl7GEjXj FbdPQFglINuD61SUBeSsGE60afQhzSFPYIaP2ISO7xcXH6NKOF/kbNnSrt6iR/SdzFlu tnKsmDy5piXMnkJpOqSrvtIxIbW0PfeXEENYbaXZkQAnfGfq3eI4VsDlL4fBDpMkhXJ0 JS0sZplE4FgzBY9skzxPS5yljvLlIJFxW6F0zGYHMXGLMonIFPb1PIBDb9epeLaKO5ia ehiSHArfXmdCgmKuHFrO1d96+419V9r3s/o+wfKz0CnYC36mr+JLBLw0FkoDEmlO5D5k 2ssw== 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=e0q3aefcY6TXQnObQuwFljgt4ADe9flA1hoerq6GjzqVHv15AqRsDFq1SXR73e9WyM m0Hh1L3y35ltm/1IRca0waFZpwAHNP4TckBoPBeaUvbSXsle+NH//nDgi+qyna1bdg+a NZvYmYb/XJkPC+MTmwWekbeDrrFoXvEN6dNMfMeVd2epLCjU8EiHDEpf0S91Xr5ipedE SbfOW6Mb6JXqpJCWsOt/o8ujUflBdOUWJldKGEZwkYKKcvaBOcrL8n74OPDsDPYy82bo puA+3PsNjxaE5fY6rucunOZdQWueDI3d2iyMWBmNp8mNxwnwd9csoE5cV/9DzymzWtdH Te0w== X-Gm-Message-State: AOJu0YxZHQpYGa1ACK67n2Vq1lO5irGzclDS4WihbjA9R0gHGGtP4jae hit18UYxmpMkNVKq6Agc69E2Dg== X-Google-Smtp-Source: AGHT+IFWdNIkY0t6ET2TzgVKN75LNnZuJm4w1A0MxXp+TA6JlTnULSfRKZHPZd/CGJzYRaN7/ZBuVA== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231024_062759_135030_26F1A58B X-CRM114-Status: GOOD ( 10.12 ) 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 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