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

Re: [PATCH v3 3/3] arm/efi: load dom0 modules from DT using UEFI


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Wed, 29 Sep 2021 12:22:25 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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; bh=NDZ4UAaVY9nZhTYxXxBTCLNMI93JXhz8iuH2JFsvWMQ=; b=G+6Fn+5xDQN/HFYtn2EqfDNLrMtmcl2W/UQiY7RAAYMwPUyfduef3Danhnkh1bi8+GB0zqHbQtFVTz2A/+ktD4hcfAWNsBWFPCbfqCLIJSn+8UdSUKIS3eAwW8gzpQ2aoCUv2gtBgf7iHOnbjkqUd76YS7pe42hFnWeEtE+G4CAhqf0hdp93WOHej4G9SRgRGVWmosLEnG+InCxQf1+Lox0qfU/fWhS57aDuETkf9tz34/1E3coiOjHiJn3UrXdMIFmiIdcXDdtIwVKAujfdyjPk382BJM/92Yxct/21MljZwoNeGERLpctMj44830R28ktuzMwfcftrtWYpmtqvoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AUiQDHmyooUefWf8Jgd6m0vQo6gNlTzPzAmcvGbevnsxdwVM/ruJViCctaXKiur9Mamo8Obwo4prHQp/kAMSG2VJE/rtc9NVYTABbgU9dqdB6/qOG53WvsIBxyYdGLrSz3mnfqsaJnvif7OeezbfLz15FLapnYwt2+ea94VUJbDTswRlMrq+O/qrKlLk3k8dBlL5J8ARhMMAMsoU3wpk67dagwg2ZgmvvdcjdX8I5oyCYvoyyt1b9HGPHxLoUrQDVt7GqnIiT2VfLcXtXIDuUoym53otMLxW+BjRNmZusn5b8bzBhvsnaCin1D+s/8G6k7b5EPGv95ganxaZuL2z0A==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, wei.chen@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 29 Sep 2021 11:23:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;


> On 29 Sep 2021, at 09:00, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 28.09.2021 18:32, Luca Fancellu wrote:
>> --- a/xen/common/efi/boot.c
>> +++ b/xen/common/efi/boot.c
>> @@ -1296,11 +1296,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE 
>> *SystemTable)
>>         {
>>             read_file(dir_handle, s2w(&name), &kernel, option_str);
>>             efi_bs->FreePool(name.w);
>> -
>> -            if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
>> -                            (void **)&shim_lock)) &&
>> -                 (status = shim_lock->Verify(kernel.ptr, kernel.size)) != 
>> EFI_SUCCESS )
>> -                PrintErrMesg(L"Dom0 kernel image could not be verified", 
>> status);
>>         }
>> 
>>         if ( !read_section(loaded_image, L"ramdisk", &ramdisk, NULL) )
>> @@ -1372,6 +1367,13 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE 
>> *SystemTable)
>>     if (dt_module_found < 0)
>>         /* efi_arch_check_dt_boot throws some error */
>>         blexit(L"Error processing boot modules on DT.");
>> +
>> +    /* If Dom0 is specified, verify it */
>> +    if ( kernel.ptr &&
>> +         !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
>> +                                           (void **)&shim_lock)) &&
>> +        (status = shim_lock->Verify(kernel.ptr, kernel.size)) != 
>> EFI_SUCCESS )
>> +        PrintErrMesg(L"Dom0 kernel image could not be verified", status);
> 
> Why does this code need moving in the first place? That's (to me at least)
> not obvious from looking just at the common (i.e. non-Arm-specific) part.
> Hence I would wish for the comment to be slightly extended to indicate
> that the kernel image may also have been loaded by <whichever function>.
> 

Sure I will improve the comment to explain that.

> Also, two nits: You've broken indentation here (you've lost a space too
> much compared to the original code) and ...

Yes sorry for that, we didn’t see it, I will fix it.

> 
>>     /*
>>      * Check if a proper configuration is provided to start Xen:
>>      *  - Dom0 specified (minimum required)
>> 
> 
> ... you will want to insert a blank line not only before, but also after
> your insertion (or, imo less desirable, neither of the two blank lines).
> 
> Further I wonder whether your addition wouldn't better be after the code
> following this comment.
> 
> And finally I wonder (looking back at the earlier patch) why you use
> kernel.addr there when kernel.ptr is being used here. Unless there's a
> reason for the difference, being consistent would be better.

I will do all of the above for the v4.

Thanks for all the feedbacks.

Cheers,
Luca

> 
> Jan
> 




 


Rackspace

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