[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] xen/arm: Add support for booting gzip compressed uImages


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 2 Feb 2023 12:12:10 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BOOdZC2Gys58TDEiEBfUnSIl8yoQUjGHUk8cDgdbzVQ=; b=Y/DWlRiGct0VcyqKaJKL8eNPQfewKe1PHk98HEHwfc/46hPhbmoS/4NFFitu/URwFuX/wk50mZUe1LO7rWySaKBQy1spYqiCgxCZpbtVT6Hfvy87XmtyYatDZ9Tw4yDAdX0jYFze8M0JkZymT1daDbW5Q1OYXlS05HRLemSenuHz7UBF3fDsFRBpMFjEDSmg+slYeYUa4VttLTQpSuVmt+NHLJZon1RBHjAJSIFywscs/JLwJe2WXQrKZxEPhKjoQtY3MKwUvn6wrvkC1JctFru8ktXFjA6gQXZYgQoSAjY09uw2e3GmH6m1swsrgVs5L4KzhDIxIKWJVcpT+6lNqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mhTMi5YTZZPnRDDb9CFv5S/T5HkXiFknjQeZKtRA+I4lkQG/dtTuSTdGczb58NtleOJvWJm/EoXYgdU0iZqqWkk1KhPG/BhEs8U2yS/dQu1rBTMc2uInsMkbOvcpgVpG2PFiy78xcASGDkAWV0MWMACyZgGtdUW/Ls9oUtUX3amatsbpxOz01GgP8NmxZjEiztfprKI8Z+o8SbrekMIyXTkcGlxq4giglW8QnXzCbwiZ+OPXPsigNqkg4UrWzTFBQokBsm09LGUk7u1EyeD1JG/7lat44l6JBfDbv6HUcYjBVF/lL745pstb8SmYv/zdghliSB0xy1EF0HUfZmHiJw==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, <ayankuma@xxxxxxx>
  • Delivery-date: Thu, 02 Feb 2023 11:12:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 02/02/2023 12:01, Julien Grall wrote:
> 
> 
> Hi Michal,
> 
> On 02/02/2023 08:49, Michal Orzel wrote:
>> @@ -265,11 +284,14 @@ static __init int kernel_decompress(struct bootmodule 
>> *mod)
>>   #define IH_ARCH_ARM             2       /* ARM          */
>>   #define IH_ARCH_ARM64           22      /* ARM64        */
>>
>> +/* uImage Compression Types */
>> +#define IH_COMP_GZIP            1
>> +
>>   /*
>>    * Check if the image is a uImage and setup kernel_info
>>    */
>>   static int __init kernel_uimage_probe(struct kernel_info *info,
>> -                                      paddr_t addr, paddr_t size)
>> +                                      struct bootmodule *mod)
>>   {
>>       struct {
>>           __be32 magic;   /* Image Header Magic Number */
>> @@ -287,6 +309,8 @@ static int __init kernel_uimage_probe(struct kernel_info 
>> *info,
>>       } uimage;
>>
>>       uint32_t len;
>> +    paddr_t addr = mod->start;
>> +    paddr_t size = mod->size;
>>
>>       if ( size < sizeof(uimage) )
>>           return -EINVAL;
> 
> Shouldn't we return -ENOENT here?
Frankly speaking, I do not want to fall through in such a case.
If a kernel size is less than 64B, something is wrong, isn't it?
I am not sure if Xen would handle a kernel whose size is less than a page.

I do not like the whole falling through in kernel_probe even in case of obvious 
violations.
But this is something not related to this series so I added to my TODO to 
properly handle
the return types from kernel_probe path. If you really think, we should return 
-ENOENT here,
then ok (although I do not like it). Could this be done on commit if you insist 
on that?

> 
> The rest look good to me.
Thanks,

> 
> Cheers,
> 
> --
> Julien Grall

~Michal



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.