From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web09.3966.1572516479808567034 for ; Thu, 31 Oct 2019 03:08:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X+4VlAqg; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572516478; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gc/OlmBktQXoJ2zKzgI75ZpNAflSdHScjTfPoKL/jyc=; b=X+4VlAqgjK4/5y/m+8Ty/N2pkj5sjn+sG23IxwkH4o8IL2Z9gpr+5C7+hY1lRk4hvlPeju iTnsKrydyPrsRCu4TyrMAgSvF5U//02QfIQZH/+HS8DLIvqI/jrziYpy6xxvzidfm/F8Ud 1z+INo2TZMniLEg41jY/pND8lSXHe9w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-154-g1mLBRwrOBehoPEaGY2PwA-1; Thu, 31 Oct 2019 06:07:55 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7D12D1005500; Thu, 31 Oct 2019 10:07:54 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-6.ams2.redhat.com [10.36.117.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 087D4A7EA; Thu, 31 Oct 2019 10:07:52 +0000 (UTC) Subject: Re: [edk2-devel] How /sys/firmware/fdt getting created To: devel@edk2.groups.io, prabhakar.pkin@gmail.com, Ard Biesheuvel Cc: naresh.bhat@linaro.org, kexec@lists.infradead.org, Leif Lindholm References: From: "Laszlo Ersek" Message-ID: <2b268378-d9be-adb5-f139-a0ca8dab4329@redhat.com> Date: Thu, 31 Oct 2019 11:07:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: g1mLBRwrOBehoPEaGY2PwA-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +Leif, comment at bottom On 10/30/19 09:16, Prabhakar Kushwaha wrote: > On Wed, Oct 30, 2019 at 1:14 PM Ard Biesheuvel > wrote: >> >> On Wed, 30 Oct 2019 at 08:36, Prabhakar Kushwaha >> wrote: >>> >>> On Wed, Oct 30, 2019 at 12:43 PM Ard Biesheuvel >>> wrote: >>>> >>>> On Tue, 29 Oct 2019 at 18:17, Prabhakar Kushwaha >>>> wrote: >>>>> >>>>> Hi All, >>>>> >>>>> I am working on Ubuntu-18.04 with UEFI on ARM64(64 bit) platform. The >>>>> UEFI used is having ACPI tables. >>>>> >>>>> I am trying to understand where and how /sys/firmware/fdt is getting >>>>> created. is it created by UEFI or grub and passed to Linux? >>>>> >>>> >>>> Neither. It is created by Linux itself. >>>> >>>> >>>> >>> >>> Thanks Ard, >>> >>> Can you please point me the code where it is getting created. >>> I want to add below in /sys/firmware/fdt. >>> >>> #size-cells =3D <0x02>; >>> #address-cells =3D <0x02>; >>> >> >> Actually, in your case it is GRUB not the kernel that creates the FDT. >> It does this to pass the initrd information. >> >> So if you want to add these properties, you should add them there. >> >> Can you explain why doing this is necessary? >=20 > I am trying to test kexec -p (kdump feature) on CentOS-release > 7.7.1908 and Ubuntu-18.04 distributions. >=20 > "kexec -p" command show error on Ubuntu. While no error on CentOS >=20 > CentOS: > $ kexec -p /boot/vmlinuz-`uname -r` --initrd=3D/boot/initramfs-`uname > -r`.img --reuse-cmdline > $ =3D=3D> No error >=20 > Ubuntu > $ kexec -p /boot/vmlinuz-`uname -r` --initrd=3D/boot/initrd.img-`uname > -r` --reuse-cmdline > $ kexec: elfcorehdr doesn't fit cells-size. > $ kexec: setup_2nd_dtb failed. > $ kexec: load failed. > $ Cannot load /boot/vmlinuz-5.4.0-rc4+ >=20 > Note: Both CentOS and Ubuntu has Linux-5.4-rc4 tag. >=20 > When i debugged further reason for Ubuntu error is due to > address-cells and size-cells as "1" > log from kexec tool :- > load_crashdump_segments: elfcorehdr 0x7f7cbfc000-0x7f7cbff7ff > read_1st_dtb: found name =3Ddtb_sys /sys/firmware/fdt > get_cells_size: #address-cells:1 #size-cells:1 >=20 > On CentOS both values are "2". > log from kexec tool :- > load_crashdump_segments: elfcorehdr 0xbf98bf0000-0xbf98bf33ff > read_1st_dtb: found nmae=3Ddtb_sys /sys/firmware/fdt > get_cells_size: #address-cells:2 #size-cells:2 >=20 > Note: Kexec tool read values from /sys/firmware/fdt. >=20 > I am trying to figure out why 2 distributions showing different values. http://git.savannah.gnu.org/cgit/grub.git/commit/?id=3D347210a5d5ce655b9531= 5f320faa515afb723c11 Ubuntu probably ships a grub version that lacks this commit. (The commit was first released as part of upstream grub-2.04. I have no idea what version of grub is shipped in the CentOS distro you mention above -- it could be based upon upstream 2.04, or the upstream patch may have been backported to CentOS.) Thanks Laszlo