From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8608C5321E for ; Sun, 25 Aug 2024 18:16:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B5C948D0024; Sun, 25 Aug 2024 14:16:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B09498D0022; Sun, 25 Aug 2024 14:16:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C3958D0024; Sun, 25 Aug 2024 14:16:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3B62B8D0024 for ; Sun, 25 Aug 2024 14:16:50 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F3907A8006 for ; Sun, 25 Aug 2024 18:16:49 +0000 (UTC) X-FDA: 82491573738.07.6DCC165 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf13.hostedemail.com (Postfix) with ESMTP id 5022C2000F for ; Sun, 25 Aug 2024 18:16:48 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Gjk0vFXQ; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of will@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=will@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724609739; a=rsa-sha256; cv=none; b=lzmueLb1/IskBmUIWhHHk0W01x8tVm4O5rZFpkru0mPDt1C6g8Vdl4ZXUu6bd7vxVKXkJn 4w7ea6158URfgu9bgiuezCloo0CuGkHL0PFIPeLiL+M8lLdY1cej7B+Pr4rbM0EM2bvzqp 7HWoTDdgBWH2MH6fk14iExdflZGyJA4= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Gjk0vFXQ; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf13.hostedemail.com: domain of will@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=will@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724609739; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/94DPm1x/HdmNGZme+ySYHVQb34Q8ro3O75+DrRm70Q=; b=v9O+Jp+celu/XYXKaQUdkZCwuxIHP2Wlem5WW+e/Zijm7Z6vr1MC/6+k3Wl/Xj5cgiKdGR oumtx5lxjVjzDkKGVvRbzQZ0jQjF5bp19qA5q8tr51ozGINjvYg92CgX4uF1/VSzKqz4ru ybG5kdxOv8ggqzW03q00+zDNBGpV21A= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 90296A426C3; Fri, 23 Aug 2024 13:38:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6ABFBC4AF09; Fri, 23 Aug 2024 13:38:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724420328; bh=dB0mTfCvDgSTO3JcUqKUWZ1+AcU5IS80RPGy27fBN60=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gjk0vFXQG27UTeP4xLbfFFmvTaURku60g3BAidJvUrf4IPa7idaSUqVW0g5GfPzQm n7TTlsV9Ne61NzS5Hv4fbn9MG/5yyDJ/sj9WqJiAUNLqx7kx/mXhqZcGNYAYked8If NF46xcDbXxveTE81faPrBJxAzyzFQ0wnF6JBj4H69CJN5NRrZB2fNFTbtPDHS5tfEN qgG5WbRu9Mu/bNdyXEUhpFacTPYYrohd+uqM3ejE/1drA8meIuMA47tD1VRpGhn5im vQKSUfnpmmSP689tWktFN64OxkkTniuoIwAOS53OQVfGp+QgRm9Zne5SfYkq84/J+V wjqKlxSqT/WdA== Date: Fri, 23 Aug 2024 14:38:42 +0100 From: Will Deacon To: Breno Leitao Cc: Mark Rutland , Rob Herring , kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, catalin.marinas@arm.com, rmikey@meta.com Subject: Re: arm64: Kexec: Warning: virt_to_phys used for non-linear address Message-ID: <20240823133842.GE32156@willie-the-truck> References: <20240624113614.GA8361@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 5022C2000F X-Stat-Signature: qu3rexpetmtkieqynth6oywdiwzfgksu X-Rspam-User: X-HE-Tag: 1724609808-938985 X-HE-Meta: U2FsdGVkX1/gg1mr7kD7NNVgDggCoRSXM0v30h/cbexmTaqdE+sA+jHO2ByWoFF3Ir25xgym+xMS2y/aYgAKRiJAIQqMjX/t1kHZemGPZW0oHpDS5dsduOmZcBflZJ/IjUhxCg25zFoRrzTVMDe/QUxqnDivL2n3Qe+z/GJIl9it1zcVZl00ecE+S3h+0dtWXCd2yHb/9hTHzITdpOy4eVa2Dcennufscy1TDoD8/blkt8DOrSo8bsmWoosCJHYegU8ZTYsEbGYFTnOdx8sC+wXcdFobIvYWEhP5ZDluz34BOtjpPR3iDgbHwCI0oa64+W/XEYwg0lCNag6MAXCjU8L8VoU3ydpcEHY6lBOsS1Lazsjueb2CX+NNZkHqAA/38VBi9mFUYD6VdYmfnx1ZHNypndUZCgnmeLgaBhwczSAtTZjow2iiKOYXUsKRf0oAWr5V0fGcSoJ40VAlawbW0X4+yIzCkbAs384TbWF7AZsRWuGD3fGRnbrqlnBDmuJPYxd5X/xI+lkwm1+2i8V07ZVHoEQFFA3LhU8Eu270hhFRDazOLesu5P4BUbulGNhwGn36ujUPyFP4SJgUFJxvCBqiCjrS4RY0NnJ9CsOJX/NXlGgnsDuLUdL2Qs+57gMV9kRiCy+/GWi99tYsQKn+zAXjTjZoLVFReNr6t/EIFcaBBn5IqWTEMbihX0jEpJZ1sDjVqf+tC1crpucOW/HAMO5H22yvwNPjq0q0lisSqbL5z588iHfXbXBIlkikG0+w+Ug2sXa6qqPG5LwmfJW+Ts4yfU3RR0+nGzMF+9iyB5JkGDPkjAnh0/ty2UENxnQCO00iriKkK1BCMWXNcKrbFnrUWCkkm7Sj+iqx2xJs+JTn/SiJZ9UT+YWCzxkoSoFSMTiyN4ri1tJsX4Phf5/NsuG/eagHw2dmmpY/ZPATjrzCCaENTS0RYKKsnC3XbqmVPOlsziGt3xy21C8aJEV ldVyS4yb /nVInw26G3YIbNZX1wt0JJ2kU2sr/OBM9sesFFe4SGNyQYs7dh9Usd+1wAFprYrS87AaxLyChCbDiwV2oMpM4bSuEs8Y0drvqzSgVHzmS1YlcrIymf76Qa90adhbD28XbKOADVsnmCrf2njvbnSb9RCyvOCGbLmIauTLk0S75uigYvEHKb2TbyiBIJ3gluTs1o+S5ZOVRASM2zTbcoYiK+KK/AzI8Szi2PUcWApYZCP9hOuX3AfvDcJ3AD0sGg733dDOP/K873sAkkjKkhmpmPQmBEQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Aug 22, 2024 at 02:28:03AM -0700, Breno Leitao wrote: > On Mon, Jun 24, 2024 at 12:36:14PM +0100, Will Deacon wrote: > > On Tue, Jun 18, 2024 at 12:36:03PM +0100, Mark Rutland wrote: > > > On Tue, Jun 18, 2024 at 01:49:22AM -0700, Breno Leitao wrote: > > > > > Since __pa() is a macro to __virt_to_phys(): > > > > > > > > #define __pa(x) __virt_to_phys((unsigned long)(x)) > > > > > > > > I am curious why this address is special that makes __virt_to_phys() > > > > unhappy. > > > > > > It's a fixmap address rather than a linear-map address. Confusingly > > > 'virt' generally means the linear map rather than any virtual address, > > > and usually virt_to_*() only work on linear map addresses. > > > > > > I'm not sure how to fix this; the major reason we fixmap the FDT is so > > > that it can be anywhere in memory (and e.g. may not be in the linear map > > > at all), so we can't always generate a linear map VA. > > > > > > We could stash the PA at boot time, and pass this as an argument to > > > of_kexec_alloc_and_setup_fdt(). > > > > Yeah, if it was passed as an additional argument to early_init_dt_scan(), > > then the core could could track it. Alternatively, we'd need a helper > > macro to get the PA and have an arm64-variant for the fixmap (everybody > > else could use __pa()). > > > > > Rob, any thoughts? I couldn't see a neat way of doing this, but maybe we > > > could initialise an initial_boot_params_phys at setup time, with a bit > > > of churn to early_init_dt_verify() and friends? > > > > Rob? > > Hello, is there anything I can do or test to have this moving? I've not seen anything from Rob, so the best bet is probably to see if you can hack up a patch to fix it yourself and then cc the rest of us when you post it. Will