Message ID | 20231004143054.482091-6-cleger@rivosinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp178367vqb; Wed, 4 Oct 2023 07:35:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqufOWPftNI8/0xhn95o2z4jIcVgc09jAysYTrd3o7R12HtpvA+zDZtjrTej7pODfnHZBO X-Received: by 2002:a05:6358:71c:b0:14c:e2d3:fb2d with SMTP id e28-20020a056358071c00b0014ce2d3fb2dmr1910939rwj.5.1696430104049; Wed, 04 Oct 2023 07:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696430104; cv=none; d=google.com; s=arc-20160816; b=td2qlD8JvYBVcorRraCgx06z4Njpi3iVkWrXhNCWqRXpL9DH4mB5W+ZR7CFuDCK90j Ruw1NAESy+mXIkZZwhNsF+a3E1xSLRqrNryn2UuEZA/KfESkcetqz/KUI/CDGE99Dv/9 yWdDsl7DkLdKK9G+EZW7RAZLQfi2evBgDEIDs6Xuao6l0h20ZLLx9PxKFIzhJYEHNU/g DLXjdZwOPO10U1ilbmHPkgCrmtnnG9EqJ4GikURf67NkO7SDxgGH5SofrA3ZpOkGjFgg 1bk9RL0q0Mf2/7f86T+R3TF69v+VdwrMvAb0uf1ADT9M70RzJhk0fvcSw8X9XpHqRGnE 5QAQ== 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=OyQJmck1/pI5OX/IX07IDtTyF+FKPIka6gVUOADEZr8=; fh=LGqxV//S2dNc9ZXry/APvah5P8y0u5J065Xrxe/jE+g=; b=bAzufWR07q8jUOpNn6wdpO0F5EVz1rHyJKundVHanG2RhSNS0yhiDA6zmahaow9/Jn N8Ca3QFDyTrR0QTRDx4C9bg6faiMaIwAF6Vvzbc/pcV1SJv9iKQAcqV9UCJYdwYJEEdg /olfGXJTnlMD2tFzOHgW+3Z4Ujk47qBxaG4gF9bdbltfeIsdLUwBdjblSmgkb+YkvmVy F7uEcjxToKdPYs9W3YwniCv7FNh8df+z6oJbzHqsn5iMFQV5UjKstjS9RX+yo/zELQEQ D3ofMOt9DInv8lkk0O9/k/kwiYTQb0q9INt4dT48oV8DdvpapoL3HTCSBPyAd8kizDr7 Isnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=HuiX6L5h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s140-20020a632c92000000b0057d3b77a9e2si3992473pgs.98.2023.10.04.07.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:35:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=HuiX6L5h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 81DD08220762; Wed, 4 Oct 2023 07:35:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242811AbjJDOe7 (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Wed, 4 Oct 2023 10:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242814AbjJDOey (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Oct 2023 10:34:54 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F12DCCE for <linux-kernel@vger.kernel.org>; Wed, 4 Oct 2023 07:34:50 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4053e6e8ca7so5615385e9.1 for <linux-kernel@vger.kernel.org>; Wed, 04 Oct 2023 07:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1696430089; x=1697034889; 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=OyQJmck1/pI5OX/IX07IDtTyF+FKPIka6gVUOADEZr8=; b=HuiX6L5hojurAbfmxheJJzTFOLB3kiq38MPPBpO6IIf2HKgom5FfHDxWnDnQ7HkUgz DRlnzfQeDaFmqGom0Jy4ZaSvdNnbQ5dqftYwklkcJJQUmGr84CJtE9kz/5om9oEwmQV2 s1N3K6HVmcb7pzY3wPXY07Ne3VMsiHfl4TWQYaWjWfevxmD2mJsFF+9wqG7zsb4sDJV7 kK9jTH9IzwsH088wAgCXrrdPxq45zLaGvmWeKKZ4rTg04p6t3gbrTFEn4NPXAbiML69x eij7XkZ5ISob9947THJfb5fbmWny1J6+6FkEHX9uAH+0lXS+kQEGdkDloiNkVqPGOFKr W5Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696430089; x=1697034889; 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=OyQJmck1/pI5OX/IX07IDtTyF+FKPIka6gVUOADEZr8=; b=ZIRyB0mHqhg+cHVyvUBCN6Lbc4YxPNYd6K8KyVJ0Jo7wXRTSZ4YD1k84CTuR3Yj3Kf MUzyRCDen9isK+ZOlMByTp26l3RTNSQhsQ0DIzyp79KRCVQFEu2oFhekeqKRl+JUzONP cIk+dYnVIVNlxi4QLSbQT8XLz5cr44bfDHF2DArq+0uNLqgYRPl2D11pxkwLqJz7UWME X/Oy9/miLbd1WjhgLzM4oypAPJd2xF8ow597Hb5ceTTN3wVyDCF2Sh05UtyLRgxwVu9D 24a4wLfj6W2aqy8w5ldqYSVi2JIUcUSFf0izC8p4STZRNC5Uvg8It5qgDjVe5HASCj+A LJLQ== X-Gm-Message-State: AOJu0YxDHQA6ijJZIvsdYcbr1n6YSwbKRHBimutQpn4wJxTMWUIhBBFs GzS8d8iLSYjMm93m1QGR6NDj2g== X-Received: by 2002:adf:ecc3:0:b0:31f:edc3:c5fb with SMTP id s3-20020adfecc3000000b0031fedc3c5fbmr2087729wro.5.1696430089475; Wed, 04 Oct 2023 07:34:49 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:9474:8d75:5115:42cb]) by smtp.gmail.com with ESMTPSA id t20-20020a1c7714000000b00401e32b25adsm1686205wmi.4.2023.10.04.07.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 07:34:49 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <cleger@rivosinc.com> To: Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Anup Patel <anup@brainfault.org>, Atish Patra <atishp@atishpatra.org> Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <cleger@rivosinc.com>, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org Subject: [PATCH 5/5] riscv: kvm: use ".L" local labels in assembly when applicable Date: Wed, 4 Oct 2023 16:30:54 +0200 Message-ID: <20231004143054.482091-6-cleger@rivosinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231004143054.482091-1-cleger@rivosinc.com> References: <20231004143054.482091-1-cleger@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 07:35:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778835892499433174 X-GMAIL-MSGID: 1778835892499433174 |
Series |
riscv: cleanup assembly usage of ENTRY()/END() and use local labels
|
|
Commit Message
Clément Léger
Oct. 4, 2023, 2:30 p.m. UTC
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 <cleger@rivosinc.com>
---
arch/riscv/kvm/vcpu_switch.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Wed, Oct 04, 2023 at 04:30:54PM +0200, Clément Léger wrote: > 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 <cleger@rivosinc.com> > --- > 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 > Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
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