Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp416898imm; Thu, 26 Jul 2018 22:39:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdnku0jrAuUsrmIX4fNot7i/JLKwLyXZ+PHfOZ00hY+o2i0WtHhAXTbvqyfclNXQCxYvAbZ X-Received: by 2002:a17:902:22e:: with SMTP id 43-v6mr4816711plc.82.1532669940500; Thu, 26 Jul 2018 22:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532669940; cv=none; d=google.com; s=arc-20160816; b=xojTF4U5Fhil6Yz/ZsXLnqLjFBQHqUDzeCzersn5TQbSQzVZjyw2i7o/jnvGxn7HcK 4SGCDlKc3Nj6MJx9ZgpgltpMV7ys314V6iSVyq37haRO2575IkjgMhzx1W+E6nfXcoYQ LUWrly806pavbCVM9ccMjaldS80liTa8rU3nc7pxJ3Vc0bat250fKSvoYGSDXFhMIsFQ QQ7v/Qcj7mkGCSHbz7mzmqZAuOFQ2U2cD0cd/4rWt08YK9TwSiM11AKNY0IKcMTDBFDa 6K8Z5v1sWB8s/zcQJH0QfNtR8xEL8QsMRK5Pd9jYZm8jL4/s4odGF/E8ZBLGO7C73RJ4 xDYw== 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 :arc-authentication-results; bh=2BTwNVIxSxeSJ961T1ybkAUG3jFiabkb5o7rQ2hOygw=; b=Vs9mNHSQSoN2Px9OSFhahJXh6yDr4xm/mWlj10EZ9XG7pMvAO3T8MC7X98SBBV6Ut7 t/KA1Em00OWwALQ1/ZQzCWHCvbJZcyXSYVfTxD7taGUddSb14mIcF9pnQX3SAAQCxXwK KnpTGgp662xLJdqf/4LJaCmvtL29GP+/wlioAo27FDUH64InOeRMk1ZSXekS0g0o05PV rMyKqdf0s1xzciAhfVmOpA1E+LNBhBkEdALTyA9KtnIecAwc7DY/WBGLMp1wCBnl6M5f t2apuR0doIM1wdqfaEG0ygftuFMxtfdjP2N7SM3AuTXXFPRXzd/08MrOhO4VED5oTR3B dwdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QKKT1L6P; 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 v71-v6si3415239pfj.354.2018.07.26.22.38.43; Thu, 26 Jul 2018 22:39:00 -0700 (PDT) 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=QKKT1L6P; 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 S1729537AbeG0G4c (ORCPT + 99 others); Fri, 27 Jul 2018 02:56:32 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43158 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725983AbeG0G4b (ORCPT ); Fri, 27 Jul 2018 02:56:31 -0400 Received: by mail-pg1-f195.google.com with SMTP id v13-v6so2544504pgr.10 for ; Thu, 26 Jul 2018 22:36:21 -0700 (PDT) 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=2BTwNVIxSxeSJ961T1ybkAUG3jFiabkb5o7rQ2hOygw=; b=QKKT1L6P1PxgDLr5My0hlVDsUa0426+Hw2aVtJCNRbVjy0Uf/YmvFg5Os80+ZB9zo/ f+y96vFQLqMGNs+hSWLww71f9k2dgpv12ecdbYwuhNewKYArUQ0Rzi0xk8M4tW1mNLmX nQ0cuXXROE5PFWWPRETRS9QvUFYRXuCy++xE8= 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=2BTwNVIxSxeSJ961T1ybkAUG3jFiabkb5o7rQ2hOygw=; b=cRG/aVqXkKMlclK4pwU9sK7M3Lo2YEPtAvlN2uXo8wxfsX7HOK+El9ccBfejNAHkgI 6HwSa2ejV+rgns6qhhS9yz3B3wMiwQBtfQwu0lhisjw99VU9WBDQ2HD1+qZ3epaXs1yQ lGpTu15bHk9Y8VKbJCbWazB6DBqKey2ZA+QSGgoPDcP/sxRHWtzVkPRZV7f7o6vLIcgw 6xhJn2uhOod1K3oC+KeiuXu4ttR3sMAd/06UG4kVwmT3vZpxUroAhEfm/19HQJbLLE1f g7574rAqpDujEMRobbiw8EEs+U70YFAPpQKeP7iyUCodOkdpNtQPcK9Iv+juiqjLZUAu nwEg== X-Gm-Message-State: AOUpUlGZizoLDy5hBEzerg9OrDT+WnF6u91dyAI5dddFh35xdmKRzfkR JInwU2CzmW+Bnf5/gY255apjgA== X-Received: by 2002:a65:6551:: with SMTP id a17-v6mr4711030pgw.132.1532669781233; Thu, 26 Jul 2018 22:36:21 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id y27-v6sm9376649pff.181.2018.07.26.22.36.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 22:36:20 -0700 (PDT) Date: Fri, 27 Jul 2018 14:37:55 +0900 From: AKASHI Takahiro To: James Morse Cc: catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, dyoung@redhat.com, bhe@redhat.com, arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v12 10/16] arm64: kexec_file: load initrd and device-tree Message-ID: <20180727053754.GF11258@linaro.org> Mail-Followup-To: AKASHI Takahiro , James Morse , catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, dyoung@redhat.com, bhe@redhat.com, arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180724065759.19186-1-takahiro.akashi@linaro.org> <20180724065759.19186-11-takahiro.akashi@linaro.org> <99f87d6c-b5e3-4f98-5f3b-7032ff4780b1@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99f87d6c-b5e3-4f98-5f3b-7032ff4780b1@arm.com> 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 On Thu, Jul 26, 2018 at 02:34:55PM +0100, James Morse wrote: > Hi Akashi, > > On 24/07/18 07:57, AKASHI Takahiro wrote: > > load_other_segments() is expected to allocate and place all the necessary > > memory segments other than kernel, including initrd and device-tree > > blob (and elf core header for crash). > > While most of the code was borrowed from kexec-tools' counterpart, > > users may not be allowed to specify dtb explicitly, instead, the dtb > > presented by the original boot loader is reused. > > > > arch_kimage_kernel_post_load_cleanup() is responsible for freeing arm64- > > specific data allocated in load_other_segments(). > > Since v11 you've renamed struct kimage_arch's dtb_buf as dtb, but not changed > the struct. This series doesn't build until patch 12 where you fix it. This will > cause anyone trying to bisect through here a problem. Right. My last-minute change introduced this screw-up. I will double-check at v13. Thanks, -Takahiro AKASHI > > Thanks, > > James > > > diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h > > index e17f0529a882..026f7e408f0c 100644 > > --- a/arch/arm64/include/asm/kexec.h > > +++ b/arch/arm64/include/asm/kexec.h > > > +struct kimage_arch { > > + void *dtb_buf; > > + unsigned long dtb_mem; > > +}; > > > diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c > > index c38a8048ed00..b28fbb0659c9 100644 > > --- a/arch/arm64/kernel/machine_kexec_file.c > > +++ b/arch/arm64/kernel/machine_kexec_file.c > > > +int arch_kimage_file_post_load_cleanup(struct kimage *image) > > +{ > > + vfree(image->arch.dtb); > > + image->arch.dtb = NULL; > > + > > + return kexec_image_post_load_cleanup_default(image); > > +} >