From nobody Wed Feb 11 05:43:40 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D501A17BA3 for ; Fri, 3 Jan 2025 14:18:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735913906; cv=none; b=VzH5Gywr+27/U9uE/UAR+TuBNcolFhBNx/9/eeMjsd+TxuUgt2SNCQjIUMZVGhOFT4hDm3Sl5NkraKqatl3V2peefIX3TtzHBgyY1Br0HdU1qb+gPWRswCmGajnGmNaRBc6Uzj1ihUzsVNtjmy4VUhnk15Ca1+UKKyulTUePOCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735913906; c=relaxed/simple; bh=NT8SXtd3av/6+E9Au/mBT8fB6lhsgPSC3UhrDTuEF7s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=mmQ+Ee2Pdq5Q7zRqDj0Guf6CY6Li+oruf2NJXmYLOW8zhvmc6l0K5rQwD3+ftc27EBRpjYDhcMPtVBk03AA1ytCrVK7qbMMiGq4BdRug2Mam42gm8FXjGk2Qc5woY/YjSzXoNRARsB0zmUjsB0lQ6eXx/GZ+WjlAhE0ThP2BrG8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=UwPyBx1D; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="UwPyBx1D" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3862d161947so5936952f8f.3 for ; Fri, 03 Jan 2025 06:18:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1735913902; x=1736518702; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tBy9PE8TWuZDv2fRcvS0TjEzuOQDtwvmfnwH0FPbUik=; b=UwPyBx1DWwpLJrJ7ZrSlnGOQZc2QwDT17wpcDonUy3QVtnYqcwqxjM0f4BKGqr8R3h Nnt7qXLcWXHWA6zengh+fcqK4+KTOODOTlYHCwlgHmOTdz+vgv7S7O3uIrXlVC3fCxu3 4CEJEP2Z/WqxuJTk+QniKXO0nsX6FjPWacgkfFQwBj3ZAP3CcVxak4gXBRPaLR796i6z Jdf0Ekqb3ZOXhGwkKFysd9Ir9KcRnV+r6F7otJiBYwaoSN+D9ZNgfHMTsA68yM8BsJPs +O31uVEFiTPEmWfeC8J7XF/camscMbHSVpumLOotc5aqlJ8BrL43KJV4pUERwpUv7kd2 M23w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735913902; x=1736518702; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tBy9PE8TWuZDv2fRcvS0TjEzuOQDtwvmfnwH0FPbUik=; b=nuScjPoMujaXQzawZga82e8UIuUBtwF/YYn1BnXXAv2giCy0wdKAMTspzoSFvJU6nC IEw42kUrJrtC8Dxf6ARzAs36+ynpNlj2cfPMIO7r/4YdcEMUSVDR93t+fYPLigRTZM6i AxCRF4ROc1wU9/iixsZvbrAYISe+lJa1HYiG40dGHYVMK20TkFttfqrZNu8Q5jDxrF89 XK2v739siRG5fqmKPL8RkLWFSznNgdDCuyBXWOboDvQbFzpB3lofa/u8CQ5oI5XzqDqG bdkAroHcowbKAq+IIwUsIu6wXsUQ75f63NHiLCghZ6VHqXU8RE0cLOPeNyxKDAy/9rMr h6Dw== X-Forwarded-Encrypted: i=1; AJvYcCUw+nnzz8fOf64Ute2xNceneYyLatLCrRNYqHGvb0nZlXDhju4lu8NRoBF80ATD83r1pQ4F1aybwxlh44I=@vger.kernel.org X-Gm-Message-State: AOJu0Ywzt89jLHJ5tnHL+gY0FpFbkd+a6ebgxK/c4MDo5+CmuatZ2qAL +WrG0nggontwhdFldJrKDWLJo2N623vn4UOzi/sd06UdIBE8oUzxEp24DOnLntM= X-Gm-Gg: ASbGncv2Afnfb3foAc7+BSEmwu1A8ZC2FJVd3mSc3aN+3xlw0z3QLQkA+yF1NYC/vfP dTHjiTFFeaQnXO5dRzROEaTyXJ32QZJJS5/j9Ss6Trt8WRmxWv5ZjCtEVT6lBZd49IsPofD47kE F+S9R9Jtc2i4ovLV7S3BIY5xglYbnzq2uDmpH/DiYrCLPDj4rHmV1JbAtKUWV+THH3l3ibmK50Z 4ksjI2UCaqd9Wzr0dMXUQ/GhFKexp6wzZfjArkquJmiCozxPAPAHM1Qgg== X-Google-Smtp-Source: AGHT+IEun2+E1U+TFbIHehM21Z0MjItj4zYwFpux1RYNvw5R3ZYIGoDopmCYq7/CItWQSTlaIPV1Bg== X-Received: by 2002:a5d:47c8:0:b0:385:f470:c2e1 with SMTP id ffacd0b85a97d-38a221e2f49mr41252194f8f.2.1735913902182; Fri, 03 Jan 2025 06:18:22 -0800 (PST) Received: from carbon-x1.. ([2a01:e0a:e17:9700:16d2:7456:6634:9626]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8acafesm40675693f8f.98.2025.01.03.06.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 06:18:21 -0800 (PST) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Alexandre Ghiti Subject: [PATCH] riscv: use local label names instead of global ones in assembly Date: Fri, 3 Jan 2025 15:17:58 +0100 Message-ID: <20250103141814.508865-1-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Local labels should be prefix by '.L' or they'll be exported in the symbol table. Additionally, this messes up the backtrace by displaying an incorrect symbol: ... [ 12.751810] [] _copy_from_user+0x28/0xc2 [ 12.752035] [] handle_misaligned_load+0x1ca/0x2fc [ 12.752310] [] do_trap_load_misaligned+0x24/0xee [ 12.752596] [] _new_vmalloc_restore_context_a0+0xc2/= 0xce After: ... [ 10.243916] [] _copy_from_user+0x28/0xc2 [ 10.244026] [] handle_misaligned_load+0x1ca/0x2fc [ 10.244150] [] do_trap_load_misaligned+0x24/0xee [ 10.244268] [] handle_exception+0x146/0x152 Signed-off-by: Cl=C3=A9ment L=C3=A9ger Reviewed-by: Alexandre Ghiti --- arch/riscv/kernel/entry.S | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index c200d329d4bd..216581835eb0 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -23,21 +23,21 @@ REG_S a0, TASK_TI_A0(tp) csrr a0, CSR_CAUSE /* Exclude IRQs */ - blt a0, zero, _new_vmalloc_restore_context_a0 + blt a0, zero, .Lnew_vmalloc_restore_context_a0 =20 REG_S a1, TASK_TI_A1(tp) /* Only check new_vmalloc if we are in page/protection fault */ li a1, EXC_LOAD_PAGE_FAULT - beq a0, a1, _new_vmalloc_kernel_address + beq a0, a1, .Lnew_vmalloc_kernel_address li a1, EXC_STORE_PAGE_FAULT - beq a0, a1, _new_vmalloc_kernel_address + beq a0, a1, .Lnew_vmalloc_kernel_address li a1, EXC_INST_PAGE_FAULT - bne a0, a1, _new_vmalloc_restore_context_a1 + bne a0, a1, .Lnew_vmalloc_restore_context_a1 =20 -_new_vmalloc_kernel_address: +.Lnew_vmalloc_kernel_address: /* Is it a kernel address? */ csrr a0, CSR_TVAL - bge a0, zero, _new_vmalloc_restore_context_a1 + bge a0, zero, .Lnew_vmalloc_restore_context_a1 =20 /* Check if a new vmalloc mapping appeared that could explain the trap */ REG_S a2, TASK_TI_A2(tp) @@ -69,7 +69,7 @@ _new_vmalloc_kernel_address: /* Check the value of new_vmalloc for this cpu */ REG_L a2, 0(a0) and a2, a2, a1 - beq a2, zero, _new_vmalloc_restore_context + beq a2, zero, .Lnew_vmalloc_restore_context =20 /* Atomically reset the current cpu bit in new_vmalloc */ amoxor.d a0, a1, (a0) @@ -83,11 +83,11 @@ _new_vmalloc_kernel_address: csrw CSR_SCRATCH, x0 sret =20 -_new_vmalloc_restore_context: +.Lnew_vmalloc_restore_context: REG_L a2, TASK_TI_A2(tp) -_new_vmalloc_restore_context_a1: +.Lnew_vmalloc_restore_context_a1: REG_L a1, TASK_TI_A1(tp) -_new_vmalloc_restore_context_a0: +.Lnew_vmalloc_restore_context_a0: REG_L a0, TASK_TI_A0(tp) .endm =20 --=20 2.45.2