Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1280587lqt; Fri, 7 Jun 2024 13:22:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVef5O9dbieG4qtZNxo6VyvXm0v7WRapkH+pJw0JeUr9sC/a94IunYKOP94Tq9nh1ii4jCekYi3C5UZ8SZEQPSGmTBLRG+pGWu8ECuyaA== X-Google-Smtp-Source: AGHT+IHuKxcu+YtIC5w8tj7gl5FZPnGgSvA4twy7ou64RmrmJLj5JLFoFipjrV5HkMzSIo6cku8i X-Received: by 2002:a17:906:c0d4:b0:a69:67e3:57f6 with SMTP id a640c23a62f3a-a6cd5613786mr239441266b.5.1717791750844; Fri, 07 Jun 2024 13:22:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717791750; cv=pass; d=google.com; s=arc-20160816; b=UZp67e4zCShKFxg2wVcUEjVGJ8976SoDmYVco2Hobs0gTAvVD+8C5fJoRoOPp9UsGm Td3HoRX7d4TjQF0wtKPcAMiSrWyKwsYsTM7s5SVvo7gboYlHBtzw+LL/SrrdxAbgFum9 SDraYr26oI/bWPkmZ2zPCRANDvZFIF82xxhEBK6AsDqz67fnSr9oA994BBlB3i5FlnG8 7jwp+0/67Urup8uqX9lFEQluexbH1b6GMo3UN3YAXdQmbbYxFxWSc6x/RSwfYQsU71ry 0EWWJ1haRVyDwUl4c4DSWas+LuxFegYbnvOlIlykcy/eGqQvDi1u2gYBEsPID0Cwvnfb 8JHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:dkim-signature:dkim-signature:from; bh=Cn6XVXZM59Nth6p5tsQDc4XnTOplZUQTrnvegHUFwrU=; fh=NjSy9ELbZGh6EjCqOzE+qeF+VS4OABBeZf5VHCmpp/4=; b=0XFk2AN4GIzUSlalE0E/cQuNShoH5qfgNS8Ug+Gw9Cinl4h36Yj28SPxz5Zz4pgrLL 5nTHhHtzPg5QOspJZKmZVyVLbUyD9trU+tGzIMTNQYeYYoMElpuyME/vfWFiH1bEEprG TMJfuXVcxAp06q4RlRv4veijj4yAPHJIQkMig57W6+Oz+XHFLJOAcRfMya+5an1tzyiD 2PtsMJyCDvpZLmFmIeZE4Q3jszaizldzMieuZCaLTyzERo++3nb+XrI0H2DikphnDGFf XP6PjiiHLuuz0ykLQ/F9yCVNYJyHMdKFox/eNy1mUpu5348/3RySkEi0iNHiICCquhlQ 2IYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="sD84pO/Z"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-206692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206692-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c80708777si226848266b.624.2024.06.07.13.22.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 13:22:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="sD84pO/Z"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-206692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206692-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 548611F23005 for ; Fri, 7 Jun 2024 20:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60C2B14A4C3; Fri, 7 Jun 2024 20:22:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sD84pO/Z"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3ojEtW3h" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CD7833EE for ; Fri, 7 Jun 2024 20:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717791737; cv=none; b=lZcSV8dIgbpBgcZQhXKkkPR6YWkWWq7hLpQ2L0d2sE1bUQEKDDN/iW7W61B22NOgw/k5XJh+wsnSdPZuiR1S3wrKSCiS0lJhFry4H6aJiNUJOOg/qXFYFaNcjKbVFwTKPb2B1TZLW0V8EJfyeloF+1EQ33nYmhXODNY6fHgSnns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717791737; c=relaxed/simple; bh=YxUzYoHE+R+dtYjDWQYkl313ZUeVoqUy01UITCRL2ek=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=APn0MfR3ATJub/uXzdGHUk6QpBZqCsIVKMYhDEjmwgp9JFmpHCLeb8IRoJmEGgYJXGcRW389oCQLZz0mWK8YqGTWqQChVBv24ymRC8V/7djyWXJEfbKtzcomj5pRtqP/JQWLozU9DU5PWsyboT5Uu4aIDZ5I+5HFS2xz3wmyoIw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sD84pO/Z; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3ojEtW3h; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1717791734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cn6XVXZM59Nth6p5tsQDc4XnTOplZUQTrnvegHUFwrU=; b=sD84pO/ZxF8vHvHfZgaOrW5D7kvyq5EI0jJbj4W+SN6ILAClGy5VssRHErCgGiHyp/NwXO OZnpD5JzqSFGWBiat2vuhQB4gv+G0m1PrtfMfafLZDdtPvMeYzJc5IflhGoLSWb8nS8wjt kJxyansVjaEjcaPglhJjXow7vTGq2KNE3FUU8PwsPnJsEz+U+lmyOVSXoaiSAlMvvII/6m k7kxbe5pAKDnVaG9qF4tpQIuGjB6S0rlGDKPQN7uGHI2vG7cMEc4iE3ClM+DExPnVhM7iC 25S7NRNQBIZ7/1eQ8rI9/dWg7InxsXNoQPcxiQvp7GVnNOD1/0d5iPkEUqdbBw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717791734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cn6XVXZM59Nth6p5tsQDc4XnTOplZUQTrnvegHUFwrU=; b=3ojEtW3hB0mfLXr+O+vmKQZ403TBBNLnM77VmV5V/6nREtIuy9sp4RkPWThWftXATWKLaI RaWPtBh1X93IkXBQ== To: Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/8] riscv: don't export va_kernel_pa_offset in vmcoreinfo for XIP kernel Date: Fri, 7 Jun 2024 22:22:07 +0200 Message-Id: <8f8760d3f9a11af4ea0acbc247e4f49ff5d317e9.1717789719.git.namcao@linutronix.de> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The crash utility uses va_kernel_pa_offset to translate virtual addresses. This is incorrect in the case of XIP kernel, because va_kernel_pa_offset is not the virtual-physical address offset (yes, the name is misleading; this variable will be removed for XIP in a following commit). Stop exporting this variable for XIP kernel. The replacement is to be determined, note it as a TODO for now. Signed-off-by: Nam Cao --- arch/riscv/kernel/vmcore_info.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/kernel/vmcore_info.c b/arch/riscv/kernel/vmcore_info.c index 6d7a22522d63..d5e448aa90e7 100644 --- a/arch/riscv/kernel/vmcore_info.c +++ b/arch/riscv/kernel/vmcore_info.c @@ -19,6 +19,13 @@ void arch_crash_save_vmcoreinfo(void) #endif #endif vmcoreinfo_append_str("NUMBER(KERNEL_LINK_ADDR)=0x%lx\n", KERNEL_LINK_ADDR); +#ifdef CONFIG_XIP_KERNEL + /* TODO: Communicate with crash-utility developers on the information to + * export. The XIP case is more complicated, because the virtual-physical + * address offset depends on whether the address is in ROM or in RAM. + */ +#else vmcoreinfo_append_str("NUMBER(va_kernel_pa_offset)=0x%lx\n", kernel_map.va_kernel_pa_offset); +#endif } -- 2.39.2