public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeffrey Hugo <jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Sameer Goel <sgoel-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Ard Biesheuvel
	<ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] efi/libstub/arm*: Set default address and size cells values for an empty dtb
Date: Tue, 7 Feb 2017 12:07:56 -0700	[thread overview]
Message-ID: <c49cc64e-4ca1-8d82-5faf-74c0355c35ef@codeaurora.org> (raw)
In-Reply-To: <20170207190113.GG26173@leverpostej>

On 2/7/2017 12:01 PM, Mark Rutland wrote:
> On Tue, Feb 07, 2017 at 11:54:55AM -0700, Jeffrey Hugo wrote:
>> On 2/7/2017 11:12 AM, Ard Biesheuvel wrote:
>>> On 7 February 2017 at 17:59, Jeffrey Hugo <jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> wrote:
>>>> From: Sameer Goel <sgoel-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
>>>>
>>>> In cases where a device tree is not provided (ie ACPI based system), an
>>>> empty fdt is generated by efistub.  Sets the address and size cell values
>>>> in a generated fdt to support 64 bit addressing.
>>>>
>>>> This enables kexec/kdump on Qualcomm Technologies QDF24XX platforms as those
>>>> utilities will read the address/size values from the fdt, and such values
>>>> may exceed the range provided by the 32 bit default.
>>>>
>>>
>>> As far as I know, those properties are explicitly associated with the
>>> 'reg' properties of subordinate nodes. So which nodes are we talking
>>> about here? Are we producing an incorrect DT by not setting these? Or
>>> is this simply a convenience to work around bugs in the tooling?
>>
>> I think we are producing an incorrect DT, in some instances.
>>
>> So we are starting from the same baseline, this is specific to ACPI
>> systems, as an ACPI system won't have a DT from the bootloader.  DT
>> based systems will already have a DT from the bootloader which is
>> assumed to be correct.  On ACPI systems without a DT, efistub
>> generates a default one.
>>
>> That default is assumed to be for a 32-bit system.  The cell width
>> defaults to 1, which is 4 bytes.  You cannot represent a 64-bit
>> value in that instance.
>>
>> What happens is that kexec inserts properties into the fdt which
>> contain the start address and size on the crash kernel.  On our
>> system, the start address is a 64-bit value, and while its not the
>> case today, I see no reason why size could not also be a 64-bit
>> value.  However the values that are inserted into the fdt are
>> governed by the address and size cell values already present in the
>> fdt.
>>
>> Kexec attempts to insert these values in the fdt.  The fdt only
>> accepts 32-bit values, so it truncates what is put in.  Then later
>> kexec/kdump read the values from the fdt, and get garbage.
>
> I take it this is specific to the kdump properties?
>
> I can't immediately see what would matter for the !kdump case.
> properties inserted under /chosen are not truncated?

The kexec/kdump properties are added under /chosen, therefore yes, 
properties added under /chosen are truncated, per our observations.

>
>> By changing the defaults to 2 (the proposed change), 64-bit values
>> can be inserted into the fdt, so the values we put in don't get
>> truncated, and thus kexec/kdump read the correct thing when they
>> need the values.
>>
>> I don't see how the tools could be fixed - fdt is truncating the
>> values, and the generated fdt is already "static" at the point the
>> tools run. We haven't had luck changing the cell size at the point
>> the tools run. Additionally, this seems to be an issue for
>> everything using the fdt - pushing the problem to every tool instead
>> of fixing once at the top seems like playing a game of whack-a-mole.
>>
>> Does that clarify that issue for you?  Obviously the commit text
>> needs some work, but I'd like to get on the same page first.
>
> If you could update the commit message to explicitly mention the
> properties being inserted for which this matters, this generally sounds
> fine to me.
>
> Please Cc me on v2.
>
> Thanks,
> Mark.
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>


-- 
Jeffrey Hugo
Qualcomm Datacenter Technologies as an affiliate of Qualcomm 
Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

  parent reply	other threads:[~2017-02-07 19:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 17:59 [PATCH] efi/libstub/arm*: Set default address and size cells values for an empty dtb Jeffrey Hugo
     [not found] ` <1486490390-25251-1-git-send-email-jhugo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-07 18:12   ` Ard Biesheuvel
2017-02-07 18:54     ` Jeffrey Hugo
     [not found]       ` <1f47fcdd-c5d8-4082-70a3-ca9b1746d7ca-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-07 19:01         ` Mark Rutland
2017-02-07 19:06           ` Mark Rutland
2017-02-07 19:07           ` Jeffrey Hugo [this message]
     [not found]             ` <c49cc64e-4ca1-8d82-5faf-74c0355c35ef-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-02-07 19:12               ` Ard Biesheuvel
2017-02-07 19:13               ` Mark Rutland
2017-02-07 19:29                 ` Jeffrey Hugo
2017-02-07 19:55                   ` Mark Rutland
2017-02-08  7:43                     ` AKASHI, Takahiro
     [not found]                       ` <20170208074301.GB18445-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-08 10:40                         ` Ard Biesheuvel
2017-02-09  8:27                           ` AKASHI, Takahiro
     [not found]                             ` <20170209082702.GC18445-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-02-13 20:55                               ` Timur Tabi
     [not found]                           ` <CAKv+Gu8OXn20JvtFkE_bS=cbWV3XZ5b7a+XaG7tvea+4BqrHfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-13 20:51                             ` Timur Tabi
2017-02-08 11:35                         ` Mark Rutland
2017-02-07 18:15   ` Mark Rutland
2017-02-07 18:41     ` Jeffrey Hugo
2017-02-07 19:24     ` Timur Tabi
2017-02-07 19:37       ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c49cc64e-4ca1-8d82-5faf-74c0355c35ef@codeaurora.org \
    --to=jhugo-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=sgoel-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox