xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Dirk Behme <dirk.behme@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Dirk Behme <dirk.behme@de.bosch.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v3] xen: arm: Update arm64 image header
Date: Sun, 26 Jun 2016 20:39:46 +0100	[thread overview]
Message-ID: <017324b1-8a99-931e-91d2-c8bb2e7cc661@arm.com> (raw)
In-Reply-To: <576FA0CF.2010505@gmail.com>



On 26/06/2016 10:30, Dirk Behme wrote:
> Hi Julien,

Hi Dirk,

> On 26.06.2016 10:29, Julien Grall wrote:
>> Hello Dirk,
>>
>> On 26/06/2016 06:47, Dirk Behme wrote:
>>> On 23.06.2016 17:18, Julien Grall wrote:
>>>> On 23/06/16 07:38, Dirk Behme wrote:
>>>>> +        uint64_t res2;
>>>>>           uint64_t res3;
>>>>>           uint64_t res4;
>>>>> -        uint64_t res5;
>>>>> -        uint32_t magic1;
>>>>> -        uint32_t res6;
>>>>> +        uint32_t magic;        /* Magic number, little endian,
>>>>> "ARM\x64" */
>>>>> +        uint32_t res5;
>>>>>       } zimage;
>>>>>       uint64_t start, end;
>>>>>
>>>>> @@ -354,20 +353,30 @@ static int kernel_zimage64_probe(struct
>>>>> kernel_info *info,
>>>>>
>>>>>       copy_from_paddr(&zimage, addr, sizeof(zimage));
>>>>>
>>>>> -    if ( zimage.magic0 != ZIMAGE64_MAGIC_V0 &&
>>>>> -         zimage.magic1 != ZIMAGE64_MAGIC_V1 )
>>>>> +    if ( zimage.magic != ZIMAGE64_MAGIC ) {
>>>>> +        printk(XENLOG_ERR "No valid magic found in header! Kernel
>>>>> too old?\n");
>>>>
>>>> I have found why there were no error messages here before. The
>>>> function kernel_probe will try the different formats supported one by
>>>> one.
>>>>
>>>> So this message will be printed if the kernel is an ARM32 image, which
>>>> will confuse the user. So I would print this message only when
>>>> zimage.magic0 is equal to ZIMAGE64_MAGIC_V0.
>>>
>>>
>>> Which we don't have with the recent header format any more.
>>
>> Well, we control the structure in Xen. So we could re-introduce the
>> field magic0 through an union.
>>
>>  > This does
>>> mean I drop this message again, as it doesn't make sense if the
>>> magic is
>>> used for the format detection.
>>
>> I would still prefer to keep an error message when only MAGIC_V0 is
>> present. This will avoid people to spend time understanding why it
>> does not work anymore.
>
>
> This way
>
> if ( zimage.magic != ZIMAGE64_MAGIC ) {
>       if ( zimage.magic0 == ZIMAGE64_MAGIC_V0 )
>             printk(XENLOG_ERR "No valid magic found in header! Kernel
> too old?\n");
>       return -EINVAL;
> }
>
> with magic0 being a union with code0?

Yes, although I would drop the question marks at the end of the second 
sentence. We know that the kernel is too old.

Thank you for doing this.

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

      reply	other threads:[~2016-06-26 19:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23  6:38 [PATCH v3] xen: arm: Update arm64 image header Dirk Behme
2016-06-23 15:18 ` Julien Grall
2016-06-26  5:47   ` Dirk Behme
2016-06-26  8:29     ` Julien Grall
2016-06-26  9:30       ` Dirk Behme
2016-06-26 19:39         ` Julien Grall [this message]

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=017324b1-8a99-931e-91d2-c8bb2e7cc661@arm.com \
    --to=julien.grall@arm.com \
    --cc=dirk.behme@de.bosch.com \
    --cc=dirk.behme@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).