Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4816698ybl; Mon, 13 Jan 2020 21:41:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyhAv9JHZFbucDLGOEH77wgMfpZFkCw2FcYh+rz5mesM2JVcYK3fWYYna7zrY04VmH2Q0MN X-Received: by 2002:a9d:2de5:: with SMTP id g92mr15795737otb.217.1578980461344; Mon, 13 Jan 2020 21:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578980461; cv=none; d=google.com; s=arc-20160816; b=hO+7H5W7xe2X0tC0em5yzNWzgvx2ZLi//IkJmxAZx2s1bLNR+tUdj0AEAxPQhshHGp ZgBeRkl2HEWSAPZwJQ9sobpEQd7DBpL4NyTx1WtMt/nsKyooJ5Kc+aa6292/ibN6zuLX MqT9cpEcIdiYu+Z7ezn1AocgjWOTaDytbnxeoKAO4jfmf+nr9U/tbm273k3DjTxac/p6 xZzAQ5rRjAu5E6ulCC2BiwSKTaiVqTzM+Erf5YvuTrMeWLCG3lJkVVOrI6ar938MRcfw FeZ+p1E1s+zfUFR71mQ36vvugTVv8yw6Aoh1/VMNqh/4hk4SDhLGjALqjg6GinC0n0Xj 9j6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=b7n7f6CO+MVHSnzRHpdk3x7t2oPCQj5a+pENYzfOC30=; b=dbThDSoYF/aVs0JVKswWqLs5nXE8wLQJsCAVej5UuHNXNXCZdePXruuLxPpPrmoWJR HpYaHl1bH6CcuM8FLkmW5L3Za9Rs8ZHrXznKD7tAuIMNRE3ytpwGx7kimFsS2GtUIYZp FRqS39i+IBt3N9LbCQilUs5R/WEHrMc3VsE/ik8nhWg13jNSZdWgcuyhuFzE/griu5IF E+kHfI2jAe1rGba0j185AF8KnDaxTJ8m7DuehCtEAiiA84OVZ3V6XG1CZ3T7DUS94r3p KmW9r1A7UhzoVrP93bWf3FLjeU7C0LiDUOcqz0HtYnGsySUdCQVlevtMrBpWxU6EIv8j yr5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YJPiX4Ge; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si8343122oti.273.2020.01.13.21.40.49; Mon, 13 Jan 2020 21:41:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YJPiX4Ge; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727556AbgANFjD (ORCPT + 99 others); Tue, 14 Jan 2020 00:39:03 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40327 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbgANFjD (ORCPT ); Tue, 14 Jan 2020 00:39:03 -0500 Received: by mail-pg1-f196.google.com with SMTP id k25so5848813pgt.7 for ; Mon, 13 Jan 2020 21:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=b7n7f6CO+MVHSnzRHpdk3x7t2oPCQj5a+pENYzfOC30=; b=YJPiX4Ge01qi2cDTShLqn/kh8bn3kNpTe5wc6z/fyvCC9EDLk8Rmj0/aHpYr/8VEnV YgRfBvDscL6BZ77SuTmaBS/tzT4b3aYb/dPDxvP1bIOoqHvbAwBa7c/JN/2A7YFYN1xl wDdCTjGzHguRdQQvj6H5wwLErsVRa8E1qKtUw+g8/hmPUWofSJdFNSfZrSVVo3OiQuHG 8GO31cKYHdcndYcuBoGB1dfAgfV52zThePZTYGmm5TPq1Ikq/t3J0NPSQ7DxMHrtyzpN /z9qoQ+GcscNZOsihnHhrxHfIFF9Y5j74lHiAx7Ng2p2+Yb/gCNsfgdJQb0+vf4wfy7w Z61g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=b7n7f6CO+MVHSnzRHpdk3x7t2oPCQj5a+pENYzfOC30=; b=mFxbYzRGl8mA5g7fGB3Fh+pheXFS2Qy1gCkYQe1b6LUb/s1xUi8aYd5DvZxFJG0EVA FyX0vgd3R42iR7Kh+UZ64l4WS7IXECieSLAIYxtQB7ZrQw5MQs1r1lejlTCNfEsykmwJ bfWMc9mfMHfACFgu6x64GSwapD8Jdodw10L3c1sVrteqksEixEYAMwFCUgp3v4dmrn/b GP1HlOcsnNazS+vd0uGRh9GNEdjktrGcWfjTCs0UEYnsRTSi7lxnJZk59WwTgF5twhBx rRta+0osYHQxXwpDqyrKU5UO7LmT/AyatRQ0BinPR0o0CBv1EvAfDx6dKqdYtMQlE/Ca SN5Q== X-Gm-Message-State: APjAAAUfGeZW3or9UlqJe0sb6PXBLD2425NWslr/S/Ji/NSOkHQlpq6c Wn2sfySEHmDtqO/0WP+Z/g3Akg== X-Received: by 2002:a62:be12:: with SMTP id l18mr24082217pff.226.1578980342200; Mon, 13 Jan 2020 21:39:02 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id y5sm5803030pfn.185.2020.01.13.21.38.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jan 2020 21:39:01 -0800 (PST) Date: Tue, 14 Jan 2020 14:38:26 +0900 From: AKASHI Takahiro To: Will Deacon Cc: Pavel Tatashin , Catalin Marinas , Will Deacon , robh+dt@kernel.org, frowand.list@gmail.com, Bhupesh Sharma , kexec mailing list , LKML , James Morse , Linux ARM Subject: Re: [PATCH v4 2/2] arm64: kexec_file: add crash dump support Message-ID: <20200114053825.GC28530@linaro.org> Mail-Followup-To: AKASHI Takahiro , Will Deacon , Pavel Tatashin , Catalin Marinas , Will Deacon , robh+dt@kernel.org, frowand.list@gmail.com, Bhupesh Sharma , kexec mailing list , LKML , James Morse , Linux ARM References: <20191216021247.24950-1-takahiro.akashi@linaro.org> <20191216021247.24950-3-takahiro.akashi@linaro.org> <20200108174839.GB21242@willie-the-truck> <20200109004654.GA28530@linaro.org> <20200109083254.GA7280@willie-the-truck> <20200110160549.GA25437@willie-the-truck> <20200113112105.GB2337@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200113112105.GB2337@willie-the-truck> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Will, Pavel, On Mon, Jan 13, 2020 at 11:21:06AM +0000, Will Deacon wrote: > On Fri, Jan 10, 2020 at 11:19:16AM -0500, Pavel Tatashin wrote: > > On Fri, Jan 10, 2020 at 11:05 AM Will Deacon wrote: > > > > > > On Thu, Jan 09, 2020 at 08:32:54AM +0000, Will Deacon wrote: > > > > On Thu, Jan 09, 2020 at 09:46:55AM +0900, AKASHI Takahiro wrote: > > > > > On Wed, Jan 08, 2020 at 05:48:39PM +0000, Will Deacon wrote: > > > > > > On Mon, Dec 16, 2019 at 11:12:47AM +0900, AKASHI Takahiro wrote: > > > > > > > diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h > > > > > > > index 12a561a54128..d24b527e8c00 100644 > > > > > > > --- a/arch/arm64/include/asm/kexec.h > > > > > > > +++ b/arch/arm64/include/asm/kexec.h > > > > > > > @@ -96,6 +96,10 @@ static inline void crash_post_resume(void) {} > > > > > > > struct kimage_arch { > > > > > > > void *dtb; > > > > > > > unsigned long dtb_mem; > > > > > > > + /* Core ELF header buffer */ > > > > > > > + void *elf_headers; > > > > > > > + unsigned long elf_headers_mem; > > > > > > > + unsigned long elf_headers_sz; > > > > > > > }; > > > > > > > > > > > > This conflicts with the cleanup work from Pavel. Please can you check my > > > > > > resolution? [1] > > > > > > > > > > I don't know why we need to change a type of dtb_mem, > > > > > otherwise it looks good. > > > > > > > > > > (I also assume that you notice that kimage_arch is of no use for kexec.) > > > > > > > > Yes, that's why I'd like the resolution checked. If you reckon it's cleaner > > > > to drop Pavel's patch altogether in light of your changes, we can do that > > > > instead. > > > > > > > > Thoughts? > > > > > > Well, I've reverted the cleanup patch so please shout if you'd prefer > > > something else. > > > > As I understand, the only concern was the type change for dtb_mem. > > This was one of the review comments for my patch > > https://lore.kernel.org/lkml/20191204155938.2279686-21-pasha.tatashin@soleen.com/ > > > > (I believe it was from Marc Zyngier), I add a number of new fields, > > and they all should be phys_addr_t, this is why I change dtb_mem to > > phys_addr_t to be consistent. > > Sure, but I've only queued the first part of your series and that cleanup > patch doesn't make a lot of sense when applied against Akashi's work. I'm > happy to take stuff on top if you both agree to it, but having half of the > struct use unsigned long and the other half use phys_addr_t is messy. Logically, whether dtb_mem is a "unsigned long" or phys_addr_t doesn't matter unless the kernel is compiled under LLP64. As far as the existing kexec code, either generic or arm64-specific, is concerned, however, "unsigned long is widely used as a physical address (For example, see kexec_buf definition) over the code. (Oops, reboot_code_buffer_phys is a phys_addr_t :) So as long as my kexec_file (and associated kdump) patch comes first before Pavel's, I'd like to keep using "unsigned long". Then, you can change "unsigned long" to phys_addr_t in your patch for whatever reason it is. Please note that, if you want to do that, it would be better to modify not only kimage_arch but also all the occurrences of "unsigned long" to phys_addr_t for maintaining the integrity. In addition, in my kexec_file kdump code, I still believe that "#ifdef CONFIG_KEXEC_FILE" should stay before the definition of kimage_arch as kimage_arch is of no use for normal kexec code. Again, "#ifdef" statement may be moved forward once additional fields be added later by Pavel's patch, say, "[PATCH v8 15/25] arm64: kexec: move relocation function setup" for any reason. I believe that this way gives us a logical and consistent view of history of changes. Make sense? Thanks, -Takahiro Akashi > Will