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

Re: [Xen-devel] [PATCH] EFI: add efi=mapbs option and parse efi= early


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Thu, 8 Aug 2019 15:25:19 +0000
  • Accept-language: en-US
  • 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-SenderADCheck; bh=Wz2K3lH0HPQwJ1kv1V0/hSELkRQWtlCQcXHdHXT5d0I=; b=b+DZL0tmpKntQ/8oxpdzzCGYeqinSyZsHWHcLOuaPe7KVV9Eyu9togIhooM+dCv54mg4KScNtFYrB0Spw8vhpyR+PJv2tb4QT9y2HhQOCNduAAkY91cyxZDPJr+Bg63q7jgCZhO1xPRlSK4ufGiflD04EHsCgyaFpGmsqZFf3drfhHjIVqckTdGjvEuPmumdaquRjO5xnVa3nThebmsH8egKCrTZzjTm+wztZRyvGFml3RCIFYh0E7rLU0EvPQA7+KePCIVFi1j/PWjY8kOMVSfvxy3XgXNDVMkf7zp3lYBEBH+EY49yeFGT7RzSgBx3QGQrPiO3ZSliny3QSaivbQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G1+V45H1Et/zwWDTrSV2giE7tTD0lhOvC+q6p0NHCFUm3ET/LqaLMmLJ0v2yZhV2TnOf+FJfzbPdURtlg4kpC7Qd+FS3z9ddRecttKM3V6VnBWd7idlFokqnMcjg8cueGdcpFnlPchDLiTMQhp5+hrj8SaYzhIu1xy6KU6nGf+0yNLvYOOBs4opahZ71neCwpFtoRs+casq3YwuS/wsm1D2WvCpnd7VEl5NwYG8Oxhv7n8o/dZOIvHgXo+gDYoK4tSRkYKNMm86wtocQEqOmaqZnSl6Y5OXmfYf4jonSV7cA/eBmCucsQV96KSMtn0Er7kDG4WKmj8h2+itcBj/fzg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 08 Aug 2019 15:26:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVTYDiJDDJv46naU6f+B83HbCEaabxCy2A///vXyCAAGVmgA==
  • Thread-topic: [PATCH] EFI: add efi=mapbs option and parse efi= early

On 08.08.2019 11:21, Marek Marczykowski-Górecki  wrote:
> On Thu, Aug 08, 2019 at 08:21:54AM +0000, Jan Beulich wrote:
>> On 08.08.2019 02:31, Marek Marczykowski-Górecki  wrote:
>>> When booting Xen via xen.efi, there is /mapbs option to workaround
>>> certain platform issues (added in f36886bdf4 "EFI/early: add /mapbs to
>>> map EfiBootServices{Code,Data}"). Add support for efi=mapbs on Xen
>>> cmdline for the same effect and parse it very early in the
>>> multiboot2+EFI boot path.
>>>
>>> Normally cmdline is parsed after relocating MB2 structure, which happens
>>> too late. To have efi= parsed early enough, save cmdline pointer in
>>> head.S and pass it as yet another argument to efi_multiboot2(). This
>>> way we avoid introducing yet another MB2 structure parser.
>>
>> I can where you're coming from here, but I'm not at all happy to
>> see the amount of assembly code further grow.
> 
> I need to add some anyway, because otherwise efi_multiboot2() don't have
> pointer to MB2 structure. But yes, it would probably be less new asm
> code. Just to be clear: do you prefer third MB2 parser instead of adding
> this into the one in head.S?

No, I don't. I'm not happy about either variant. Looking at the
code I can't help thinking that it shouldn't be overly difficult
to have mbi_reloc2() peek into the command line as it relocates
it. head.S would simply need to pass in the address of opt_map_bs
(or a suitable intermediate variable / structure) as it seems.

>>> --- a/xen/arch/x86/efi/efi-boot.h
>>> +++ b/xen/arch/x86/efi/efi-boot.h
>>> @@ -315,8 +315,10 @@ static void __init efi_arch_handle_cmdline(CHAR16 
>>> *image_name,
>>>            name.s = "xen";
>>>        place_string(&mbi.cmdline, name.s);
>>>    
>>> -    if ( mbi.cmdline )
>>> +    if ( mbi.cmdline ) {
>>>            mbi.flags |= MBI_CMDLINE;
>>> +        efi_early_parse_cmdline(mbi.cmdline);
>>> +    }
>>
>> Why? This is the xen.efi boot path, isn't it?
> 
> Yes, as explained in commit message, this is to make it less confusing
> what option can be used when. To say "efi=mapbs does X" instead of
> "efi=mapbs does X, but only if Y, Z and K".

Otoh it is going to be confusing why there are two ways of setting
this with xen.efi.

>>> @@ -1412,16 +1417,32 @@ static int __init parse_efi_param(const char *s)
>>>               else
>>>                   rc = -EINVAL;
>>>           }
>>> +        else if ( (val = parse_boolean("mapbs", s, ss)) >= 0 )
>>> +        {
>>> +            map_bs = val;
>>> +        }
>>
>> This may _not_ be accepted when called the "normal" way, since it
>> would then fail to affect efi_arch_process_memory_map(), but it
>> would affect efi_init_memory().
> 
> What do you mean? Have I missed some EFI boot code path? Where it would
> miss to affect efi_arch_process_memory_map() ?

I'm implying the change to efi_arch_handle_cmdline() above to
not be there. And I'm also considering the case where, due to
some oversight (like is the case here as mentioned in other
places), the two command line processing steps potentially
produce different results (the example with the current code
would be "efi=no-rs efi=mapbs").

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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