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

Re: [XEN v1] xen/Arm: Probe the entry point address of an uImage correctly


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 8 Dec 2022 16:37:53 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; 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=fbRdUMaK+Marz8+3bYJyfREhkRFbkc6N0kAcWt/xB00=; b=mf8sNgmjutdMqPOiTQvcaPwun6rXJEFh7Tv+NrMIfMTLDODqfYj4sRX/zR4FxCsfFND7ZbKqdAE0WBIyszRi+yQH+ft2asgPZnfVkpN4d2JjOodDzINfnvfiTX8bk13j5JA2ajOUK02MLrwFGc0U2cSeyiTzqEUMQKMaZRhbS2IRLUy5WvkQft0TScfPGl23E1roRBXfu5OUaDOoKMYEj0z9FB11a42pmYK1szTGlPnS3fDpRD0XG9Gw9azv+QjSk54+w8YMRELPX+LjlBFH2G1ni9QWNxOvSGnDDTmea33s5nmnVhj1Ouq+CjVQwFe0LYbR4wqV1TZpJCyomG1mGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UYBMFxtlKet9X7P0G+C05Gi1rc0pfUnrLjKLxR50nD/jPXQu4JquOMfXIP2QLe/UByawme7CZsHVU6b35yTGtLgjVLJANyS292zwWCZ3Viq40G+O8UNHeBj5Yo3DDN3maJrjsbOVJ00/gqRPSZ5C3e69k90wea3ipev6lkDx4AHOD+a9+IjA459uf79UKUyITjwK5KSjXYX6RBj/J/2OnuTD5EMjBd3JcXZZCGVwnINs6Wn8Nw1vts4fq00lRm0XttjT7gAfWS+zTVo1/Gas6WK7cYVpLO1UV0CRrKkwmpPab61k68/hduHXZwh4FtOAN9k3vwCoEARNUgm8X7mcGQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, stefanos@xxxxxxxxxx, Volodymyr_Babchuk@xxxxxxxx, bertrand.marquis@xxxxxxx, michal.orzel@xxxxxxx, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 08 Dec 2022 15:38:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.12.2022 14:51, Julien Grall wrote:
> On 08/12/2022 12:49, Ayan Kumar Halder wrote:
>> Currently, kernel_uimage_probe() does not set info->zimage.start. As a
>> result, it contains the default value (ie 0). This causes,
>> kernel_zimage_place() to treat the binary (contained within uImage) as
>> position independent executable. Thus, it loads it at an incorrect address.
>>
>> The correct approach would be to read "uimage.ep" and set
>> info->zimage.start. This will ensure that the binary is loaded at the
>> correct address.
> 
> In non-statically allocated setup, a user doesn't know where the memory 
> for dom0/domU will be allocated.
> 
> So I think this was correct to ignore the address. In fact, I am worry 
> that...
> 
>> --- a/xen/arch/arm/kernel.c
>> +++ b/xen/arch/arm/kernel.c
>> @@ -222,6 +222,8 @@ static int __init kernel_uimage_probe(struct kernel_info 
>> *info,
>>       if ( len > size - sizeof(uimage) )
>>           return -EINVAL;
>>   
>> +    info->zimage.start = be32_to_cpu(uimage.ep);
> ... this will now ended up to break anyone that may have set an address 
> but didn't care where it should be loaded.
> 
> I also understand your use case but now, we have contradictory 
> approaches. I am not entirely sure how we can solve it. We may have to 
> break those users (Cc some folks that may use it). But we should figure 
> out what is the alternative for them.

I don't know anything about the uimage format, but is the ep field
required to be non-zero? If not, it being non-zero would retain
prior behavior.

Jan



 


Rackspace

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