From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by mx.groups.io with SMTP id smtpd.web11.102.1572583930072463777 for ; Thu, 31 Oct 2019 21:52:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OSyXW8wm; spf=pass (domain: gmail.com, ip: 209.85.166.195, mailfrom: prabhakar.pkin@gmail.com) Received: by mail-il1-f195.google.com with SMTP id h5so7652563ilh.11 for ; Thu, 31 Oct 2019 21:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YQWiwvd8bbU+952y5xX6tWwcBkrxDCkXzoIjObrhqE8=; b=OSyXW8wmoXjskRYGIkcgzmiiJ823WvYKsC/QBEpqgBH/Zff1umGQgNziiXw3gnHW0y 5gB/2O/0B61UjRlaaN5alaa/zxDZw15HooTKXa3nQ5HxweGCSfVT7CV7I+6rWKEslBdn yMni1KpT/h+hr96lyLT4lidSqNoCCF8WRw1c58oxdX0TBHeVWF8roQ6HyS3r81di8Y6R ZthTpHaWrk1FzZXLaaF7cctT+mIPopX88nL2YMRVr1vMXIiTZRqJAfvq0crmN210Yk0S mL2PeA9sL6+2rV0aAivd3Iqmz/AvezwVxZeXTAsofbbAZ+A9cybkFcbJxvdQTBW3M0cE IA5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YQWiwvd8bbU+952y5xX6tWwcBkrxDCkXzoIjObrhqE8=; b=bxC13bfqZVO4mvqCHoaoViD5AkkOEdRUQBNyEoONQ7loSzYRuTV7CMBxB4v658nH4J 4r1uRtVPPh7vogzmjtAS9STcLGf8O30rjJQLpfARTIdtyT3R03dfEJ5Qxr12+VFC5+W+ 5d/0Sv7ct7MPiL4OZ8b9YKtHVlMeq/X1mYOxEoKGgUxOisMdrcrZO1o+NzSkAKJDXmPW 90zgg6WhFIkrWlcBtTIkJ0Agx9fVe53008L74PSKVwqY6yIT7oo+q6H2kkVBkTfYPXbS i8KHroLFLeKWrrABhKbcNwKsBVLkrlD2j0ftN/XqgK9EFUrEMUpL3IHGREjK+Js696So axOg== X-Gm-Message-State: APjAAAUUJutk2Xm1qfi7vyY/b+m/RzdJX6twPYw36CGrr6w8/wmm0RHf 9i21MuWGYJbXi1m4kGyj5AWMkTX/IbU2s6rJU0ISlotoHdI= X-Google-Smtp-Source: APXvYqzW+mKkFLFZK5cgG4GN8/zg3BaJwz6uQ7zHdap2ISl3txFsgGe5v/eicT/f9lf1ly9LqAAmo2nEsMtkwTVg6H4= X-Received: by 2002:a92:d643:: with SMTP id x3mr10558869ilp.203.1572583929435; Thu, 31 Oct 2019 21:52:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Prabhakar Kushwaha" Date: Fri, 1 Nov 2019 10:21:56 +0530 Message-ID: Subject: Re: [edk2-devel] How /sys/firmware/fdt getting created To: Bhupesh Sharma Cc: Ard Biesheuvel , Naresh Bhat , edk2-devel-groups-io , kexec mailing list Content-Type: text/plain; charset="UTF-8" Hi Bhupesh, On Fri, Nov 1, 2019 at 1:59 AM Bhupesh Sharma wrote: > > Hi Prabhakar, > > On Wed, Oct 30, 2019 at 1:47 PM 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. > > There are a couple of things I can suggest: > > 1. Try to see if it is a kexec-tools specific issue or is the kernel > itself passed an incorrectly fixed DTB (by grub?) with incorrect > #address-cells and #size-cells values (in the past I have seen > kexec-tools sometimes reports incorrect #address-cells and #size-cells > values, but they should be fixed in the newer kexec-tools versions): > > a). Can you check the kexec-tools version and share the same: > $ kexec -v > > b). Using 'dtc' tool, you can confirm if it reports a correct > #address-cells and #size-cells values: > # dtc -I dtb -O dts /sys/firmware/fdt | grep cells | less > > For e.g on my fedora arm64 system, it reports: > #address-cells = <0x2>; > #size-cells = <0x2>; > > 2a). If its not a kexec-tools specific issue, it is most probably a > bootloader (grub?) issue in your case: > > For e.g. I use the following grub2 on my Fedora arm64 board: > > and > contains the changes to send the correct #address-cells and > #size-cells values to Linux (and hence user-space tools like > kexec-tools later). > > I believe the same grub2 is used (backported) for CentOS, so things > should be fine there. > > 2b). I see that the latest devel branch of ubuntu grub2 > () also contains this > fix, but I am not sure which grub2 version you have on your ubuntu > machine. > Ubuntu 18.04 has grub 2.02. When i migrated to grub 2.05, this issue is not there. Most probably the patch which is mentioned by Laszlo done the fix. http://git.savannah.gnu.org/cgit/grub.git/commit/?id=347210a5d5ce655b95315f320faa515afb723c11 Thanks --pk