Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2874252imm; Thu, 24 May 2018 18:01:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqpSar9uDUq6CR9fy+qa4JPlWs7EU1ZgZ97vLIxwPJV6sN/9HXXGucrBuehE82NdxLipDc2 X-Received: by 2002:a17:902:301:: with SMTP id 1-v6mr319200pld.328.1527210119600; Thu, 24 May 2018 18:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527210119; cv=none; d=google.com; s=arc-20160816; b=RMC/1xu52jnwspPhQm7MBl6x5w6Rt4xsqUDd+uUKjNmhCfQdGcCrsjKYFxrxtVO41B tPqu0w5tCPIa27JcdAlNX6PspEed6oVS+Q1FZy37w/dsjuE2imgRuwURobjYx5UdU9eI 6IVIKyu27GcXJ3bpKDOjqPjwvzHXMBzwKSYcnbBOJN4sdEsTBrU7Du8nc19F130r30mw YOsTj3jdK1qwKbDfzZBybVsMTnWn7A5qBoipawZCVR5uPqbGSQr1mS+IfTyD0BB2yw+H lUq3S2Dl+3bOQbhxV/0jA3l6AeW0dFyJzy9lA1gRXKJ4PtTKQ/FT5lP/aJlFDFLHz6OE pRhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=/f5rSM6gW40ESyGEjlNtPkPCbYvDRzHp3+HdEd5zcH8=; b=er3H6IIEfk+quLEBVImaRYz1hfD5/6u/TrxV9kYzRcEOxSEcrR2J5V7XTsqxVWxT33 pWCgF4k8MjdASxgRWtTcPOzvdjRoCUlYRCRle6djUkMjcyl3Ac7rh/4EvGQD00DMLylD 1cfIkOG5zm7Y+Odq/sOw6KEBiHb4m2Gpx0pbPxBqnugeTBfIIgeN1aydcP9Un23m4Vx5 mLGIBsjdfWxwsWJ+vcYpNsbPXO3ufRdfsdShaWwcTtTCiFIj0bqgTBK8zr7ti/Vbn1BJ 1hGbZ97+fuAGeVgrZlXpCQgdSmKZm7WOgmn1F9P+Byf4jZ73E8GETmTziA+VXuosryab wLOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zM17fG0H; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n17-v6si22793043pfg.227.2018.05.24.18.01.44; Thu, 24 May 2018 18:01:59 -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=@kernel.org header.s=default header.b=zM17fG0H; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033073AbeEXO0J (ORCPT + 99 others); Thu, 24 May 2018 10:26:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:44170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030656AbeEXO0F (ORCPT ); Thu, 24 May 2018 10:26:05 -0400 Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 055BC20899; Thu, 24 May 2018 14:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527171965; bh=Ozy9zQvHEuNSCPKtc2kKFN6mzPUXxiDJF11B/oTmXec=; h=In-Reply-To:References:From:Date:Subject:To:From; b=zM17fG0Hk2UwYlhQbT3uv5t2NAtJqvok+1XgJyzWI6/Xgxfzh4zZkQ97R3XJ+E5un A5WtIMDC4rG1PC34STJrxQYcqgfyPt04Brviv9iOEwf1qci9QHvAAltVIQdWcs0TS7 0GBAxZTAyOdVYVb2aRkRC7Sa2XqPHXV/vqnSYYI4= Received: by mail-qk0-f175.google.com with SMTP id d125-v6so1401173qkb.8; Thu, 24 May 2018 07:26:04 -0700 (PDT) X-Gm-Message-State: ALKqPwdRc0yZgLhz5j7hkhtnTAIwsdsfecLbFz/K/y3WoBeg/PcEV6QB vk0azAClt+t4WOu2iBqKg5ghfqS7nzv3DwJFRA== X-Received: by 2002:a37:d7cf:: with SMTP id t76-v6mr2015704qkt.96.1527171964127; Thu, 24 May 2018 07:26:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9b02:0:0:0:0:0 with HTTP; Thu, 24 May 2018 07:25:43 -0700 (PDT) In-Reply-To: <20180521101425.GC9887@linaro.org> References: <20180425062629.29404-1-takahiro.akashi@linaro.org> <20180425062629.29404-8-takahiro.akashi@linaro.org> <0aba6388-8a73-d371-7b92-3594639eb27e@arm.com> <20180518153552.GA23468@rob-hp-laptop> <20180521101425.GC9887@linaro.org> From: Rob Herring Date: Thu, 24 May 2018 09:25:43 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v9 07/11] arm64: kexec_file: add crash dump support To: AKASHI Takahiro , Rob Herring , James Morse , Catalin Marinas , Will Deacon , David Howells , Vivek Goyal , Herbert Xu , David Miller , dyoung@redhat.com, Baoquan He , Arnd Bergmann , Ard Biesheuvel , bhsharma@redhat.com, kexec@lists.infradead.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 21, 2018 at 5:14 AM, AKASHI Takahiro wrote: > Hi Rob, > > On Fri, May 18, 2018 at 10:35:52AM -0500, Rob Herring wrote: >> On Tue, May 15, 2018 at 06:12:59PM +0100, James Morse wrote: >> > Hi guys, >> > >> > (CC: +RobH, devicetree list) >> >> Thanks. >> >> > On 25/04/18 07:26, AKASHI Takahiro wrote: >> > > Enabling crash dump (kdump) includes >> > > * prepare contents of ELF header of a core dump file, /proc/vmcore, >> > > using crash_prepare_elf64_headers(), and >> > > * add two device tree properties, "linux,usable-memory-range" and >> > > "linux,elfcorehdr", which represent repsectively a memory range >> > > to be used by crash dump kernel and the header's location >> >> BTW, I intend to move existing parsing these out of the arch code. >> Please don't add more DT handling to arch/ unless it is *really* arch >> specific. I'd assume that the next arch to add kexec support will use >> these bindings instead of the powerpc way. > > So do you expect all the fdt-related stuff in my current implementation > for arm64 to be put into libfdt, or at least drivers/of, from the beginning? Yes. > I'm not sure how arch-specific the properties here are. For instance, > it is only arm64 that uses "linux,usable-memory-range" right now but > if some other arch follows, it is no more arch-specific. > # I remember that you didn't like this property :) The question I guess is what will the next arch use. I don't think any other DT based arch supports crashdump or kexec yet. >> > > +{ >> > > + void *buf, *prop; >> > > + size_t buf_size; >> > > + int result; >> > > + >> > > + buf_size = (__dt_root_addr_cells + __dt_root_size_cells) * sizeof(u32); >> > > + prop = buf = vmalloc(buf_size); >> >> This can go on the stack instead (and would be required to to work in >> libfdt). > > Well, I can't agree with you here since we are now in effort, as far as > I correctly understand, of purging all the variable-sized arrays on a local > stack out of the kernel code. You don't need a variable sized array. The array size just needs to the the maximum size (16 bytes). Rob