Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4307819imm; Fri, 18 May 2018 02:59:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqttHiAKUMDHIPPcPKj1HH+9kD3Mc8vjZOp4F/AIT0QgsXXyq3+NBiiXPkZRf1QwSSZKjI X-Received: by 2002:aa7:8305:: with SMTP id t5-v6mr8694538pfm.198.1526637561613; Fri, 18 May 2018 02:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526637561; cv=none; d=google.com; s=arc-20160816; b=hQwS1ceAcLDhH+k4cPvOL9ymYWpon5lA98MaKINxdfmcJp+C0oheEssn6lYn3Lcv1A SpmCDh/FrX+5IobU82qJi03WVgT5nrESvemvXn6VRpWr31g39kHsp54CkAroCHYY17q1 xf7P6F8rW92FVD/SqF3L22ZhJWBnz+fm0v26nvYn7EXyLW5V4l7Jci/82QamqD+gayhD HD42okx3/un72GIqPjSgGMXztea1wE+hfDoe08sWRbBm6maToyfLf0MJLy4cjVwc3Lbs MOyvyTGnRochZ2l9UJN9v4TD6YtE7wI6dLGYfh4Nt2hx8pO2Cpr9/xB1XCIIHp4h8+XG jyKw== 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=teshLBkB46fw9OsdVj2RVdLMimHd2LpPPXkyoqmxtBI=; b=K+po+oByz6X6V7jLO3uxxNC1+itvCPLDOeQhSaG6Nfw9I0PE+LlcgKKChm9mp1u76T EfHqysHxG0P0iXwrrE8Lf4BwGORhkAMSk9IyGWDvxeSZZvKrhBT0G7nf2FO9xN0NAdMs Rj+n10KKSR72FKE9uFnzZk4fTvlBrbvlY/rMPFw8ibjuhfK0429OeXsOdEs1pMA5d9HN FMAOq0TUqieSqW/7uoJ5zL33n5v9FgJeZEk9E87fzRwH/RNxvE0MAyGXVMkJDqWvfuyz lf03UXL/8ja6NGFhKuNQ2RJFM+c9QJUGUozv7VvVEdwG1YVQE4NoA5avtA8o0CRbGYQY GhAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kh80zTe5; 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 f19-v6si6923523plr.13.2018.05.18.02.59.07; Fri, 18 May 2018 02:59:21 -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=Kh80zTe5; 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 S1752165AbeERJ6u (ORCPT + 99 others); Fri, 18 May 2018 05:58:50 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:37769 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbeERJ6s (ORCPT ); Fri, 18 May 2018 05:58:48 -0400 Received: by mail-pl0-f66.google.com with SMTP id w19-v6so4305291plq.4 for ; Fri, 18 May 2018 02:58:48 -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=teshLBkB46fw9OsdVj2RVdLMimHd2LpPPXkyoqmxtBI=; b=Kh80zTe5GA+/zmagJ+sg503xrsptLkesgsdj45g6P+xiCt2sIyO/hhHJgz6tkCdxZR UgDaltP8Lf6T9UfYnn7t9Tkz3s83+v4qfI8qFCtntaKm9/2jFvlnU+4BYd1iWOPW+nhX IE+EO6ekSpjrVb5DnK70b9g3bN/+sv4c2/nAA= 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=teshLBkB46fw9OsdVj2RVdLMimHd2LpPPXkyoqmxtBI=; b=HetlwtFLOcBLdidD5+cPDTvD8msBxFaz3gMg8cZBYyZnk6TMNOhLtjbAN/Ew/W/Saj 9WChTgu8hPKdgac/yhecdgjXAsET3oXQoRRFa2i6VQZHizrzy2S0U3dYqZgFuubFcLTN SmUQoev+llBtlXRxae9NVFHQQN32j9n7MzUZKCc5sn4JIK1VMa+evPtMfQGAvlqEWuV3 CGbRDdRmhAtpRZUquWkw+CF4xkrls3P17GPa8fHGVN1dBdn1pewe8UBAkmZLQNgtG7AA 2vqnrRPetYMXfX1RiW3uIWzLxd2cu9MTfWUG7yedo3fqbN9wEbhUfNetG/3MyQnpvSbV Oj9A== X-Gm-Message-State: ALKqPwc603Wn87nMu5GzQ0Qy7I91eECCMe3u5mCouAaB5ucKuAP7b7OG 1Sc3cXEJY0vvmFCQni/v6gdCyA== X-Received: by 2002:a17:902:52ed:: with SMTP id a100-v6mr8874176pli.131.1526637528429; Fri, 18 May 2018 02:58:48 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id v15-v6sm13917274pfa.107.2018.05.18.02.58.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 02:58:47 -0700 (PDT) Date: Fri, 18 May 2018 18:58:48 +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, 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 v9 07/11] arm64: kexec_file: add crash dump support Message-ID: <20180518095847.GO2737@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, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180425062629.29404-1-takahiro.akashi@linaro.org> <20180425062629.29404-8-takahiro.akashi@linaro.org> <3d70c7d1-4985-a427-ecc6-a7edc84edfff@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3d70c7d1-4985-a427-ecc6-a7edc84edfff@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 Wed, May 16, 2018 at 09:34:41AM +0100, James Morse wrote: > Hi Akashi, > > On 15/05/18 18:11, James Morse wrote: > > 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 > > >> diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c > >> index 37c0a9dc2e47..ec674f4d267c 100644 > >> --- a/arch/arm64/kernel/machine_kexec_file.c > >> +++ b/arch/arm64/kernel/machine_kexec_file.c > >> @@ -76,6 +81,78 @@ int arch_kexec_walk_mem(struct kexec_buf *kbuf, > > >> +static void fill_property(void *buf, u64 val64, int cells) > >> +{ > >> + u32 val32; > >> + > >> + if (cells == 1) { > >> + val32 = cpu_to_fdt32((u32)val64); > >> + memcpy(buf, &val32, sizeof(val32)); > >> + } else { > > > >> + memset(buf, 0, cells * sizeof(u32) - sizeof(u64)); > >> + buf += cells * sizeof(u32) - sizeof(u64); > > > > Is this trying to clear the 'top' cells and shuffle the pointer to point at the > > 'bottom' 2? I'm pretty sure this isn't endian safe. > > It came to me at 2am: this only works on big-endian, which is exactly what you > want as that is the DT format. Oops, I was almost tricked as I haven't tested kexec on BE for a long time :) Thanks, -Takahiro AKASHI > > > Do we really expect a system to have #address-cells > 2? > > > Thanks, > > James