Return-path: Received: from us-smtp-2.mimecast.com ([205.139.110.61] helo=us-smtp-delivery-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQ7N2-0003Ug-RG for kexec@lists.infradead.org; Thu, 31 Oct 2019 10:08:02 +0000 Subject: Re: [edk2-devel] How /sys/firmware/fdt getting created References: From: Laszlo Ersek Message-ID: <2b268378-d9be-adb5-f139-a0ca8dab4329@redhat.com> Date: Thu, 31 Oct 2019 11:07:52 +0100 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: devel@edk2.groups.io, prabhakar.pkin@gmail.com, Ard Biesheuvel Cc: naresh.bhat@linaro.org, kexec@lists.infradead.org, Leif Lindholm +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 = <0x02>; >>> #address-cells = <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? > > I am trying to test kexec -p (kdump feature) on CentOS-release > 7.7.1908 and Ubuntu-18.04 distributions. > > "kexec -p" command show error on Ubuntu. While no error on CentOS > > CentOS: > $ kexec -p /boot/vmlinuz-`uname -r` --initrd=/boot/initramfs-`uname > -r`.img --reuse-cmdline > $ ==> No error > > Ubuntu > $ kexec -p /boot/vmlinuz-`uname -r` --initrd=/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+ > > Note: Both CentOS and Ubuntu has Linux-5.4-rc4 tag. > > 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 =dtb_sys /sys/firmware/fdt > get_cells_size: #address-cells:1 #size-cells:1 > > On CentOS both values are "2". > log from kexec tool :- > load_crashdump_segments: elfcorehdr 0xbf98bf0000-0xbf98bf33ff > read_1st_dtb: found nmae=dtb_sys /sys/firmware/fdt > get_cells_size: #address-cells:2 #size-cells:2 > > Note: Kexec tool read values from /sys/firmware/fdt. > > I am trying to figure out why 2 distributions showing different values. http://git.savannah.gnu.org/cgit/grub.git/commit/?id=347210a5d5ce655b95315f320faa515afb723c11 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 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec