All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Juergen Gross <JGross@suse.com>,
	sstabellini@kernel.org, andrew.cooper3@citrix.com,
	Doug Goldstein <cardoe@cardoe.com>,
	pgnet.dev@gmail.com, ning.sun@intel.com, julien.grall@arm.com,
	xen-devel@lists.xenproject.org, qiaowei.ren@intel.com,
	gang.wei@intel.com, fu.wei@linaro.org
Subject: Re: [PATCH v13 4/9] x86: add multiboot2 protocol support for EFI platforms
Date: Tue, 31 Jan 2017 08:14:24 -0700	[thread overview]
Message-ID: <5890B7E0020000780013584E@prv-mh.provo.novell.com> (raw)
In-Reply-To: <20170131142340.GJ16671@olila.local.net-space.pl>

>>> On 31.01.17 at 15:23, <daniel.kiper@oracle.com> wrote:
> On Tue, Jan 31, 2017 at 05:33:12AM -0700, Jan Beulich wrote:
>> >>> On 25.01.17 at 23:49, <daniel.kiper@oracle.com> wrote:
>> > On Wed, Jan 25, 2017 at 04:20:30PM -0600, Doug Goldstein wrote:
>> > @@ -123,6 +116,15 @@ efi_platform:
>> >  .Lbad_ldr_nih: .asciz "ERR: EFI ImageHandle is not provided by bootloader!"
>> >  .Lbad_efi_msg: .asciz "ERR: EFI IA-32 platforms are not supported!"
>> >
>> > +        .section .init.data, "a", @progbits
>>
>> This needs to be a writable section.
> 
> AIUI, it is by default but if you wish I can replace "a" with "aw" here.

To me it would smell like a binutils bug if any flag was added despite
the explicit setting here. Things would be different if you omitted
those arguments.

>> > +        /* Get topmost low-memory stack address. */
>> > +        add     $TRAMPOLINE_SPACE,%ecx
>>
>> The top-most address of the stack is
>> %ecx + TRAMPOLINE_SPACE + TRAMPOLINE_STACK_SPACE - 1.
>> Please don't add misleading comments.
> 
> Right, it is misleading. Do you think that:
> 
> Get the lowest low-memory stack address.
> 
> ...is better?

That or "bottom-most" (to avoid the double "low").

>> >          /*
>> > +         * Now trampoline_phys points to the following structure (lowest
>> > +         * address is at the top):
>> > +         *
>> > +         * +------------------------+
>> > +         * |    TRAMPOLINE_SPACE    |
>> > +         * +- - - - - - - - - - - - +
>> > +         * |       mbi struct       |
>> > +         * +------------------------+
>> > +         * | TRAMPOLINE_STACK_SPACE |
>> > +         * +------------------------+
>> > +         *
>> > +         * mbi struct lives at the end of TRAMPOLINE_SPACE. The rest of
>> > +         * TRAMPOLINE_SPACE is reserved for trampoline code and data.
>> > +         */
>>
>> Please can you clarify here that the MBI data grows downwards
>> from the beginning of the stack to the end of the trampoline?
> 
> OK, but I think that "beginning of the stack" should be replaced
> with "the end of TRAMPOLINE_SPACE" here.

That would be in lines with the #define-s, but not with the drawing
above (which btw also applies to the comment that's there above).

>> > --- a/xen/arch/x86/efi/stub.c
>> > +++ b/xen/arch/x86/efi/stub.c
>> > @@ -20,7 +20,8 @@
>> >  paddr_t __init noreturn efi_multiboot2(EFI_HANDLE ImageHandle,
>> >                                         EFI_SYSTEM_TABLE *SystemTable)
>> >  {
>> > -    CHAR16 *err = L"Xen does not have EFI code build in!!!\r\nSystem halted!!!\r\n";
>> > +    static const CHAR16 __initconst err[] =
>> > +        L"(XEN) Xen does not have EFI code build in!\r\n(XEN) System halted!\r\n";
>>
>> Why did you add these (XEN) prefixes?
> 
> To align message format with messages printed from most places. And I realized
> that it will be nice to do the same thing in head.S and the rest of EFI code.
> This way it is much easier to differentiate between a bootloader and Xen messages.

I disagree. Those prefixes should be used only for messages ending
up in Xen's log.

>> > --- a/xen/arch/x86/xen.lds.S
>> > +++ b/xen/arch/x86/xen.lds.S
>> > @@ -334,5 +334,5 @@ ASSERT(IS_ALIGNED(trampoline_end,   4), "trampoline_end
>> > misaligned")
>> >  ASSERT(IS_ALIGNED(__bss_start,      8), "__bss_start misaligned")
>> >  ASSERT(IS_ALIGNED(__bss_end,        8), "__bss_end misaligned")
>> >
>> > -ASSERT((trampoline_end - trampoline_start) < MB_TRAMPOLINE_SIZE,
>> > +ASSERT((trampoline_end - trampoline_start) < TRAMPOLINE_SPACE,
>> >      "not enough room for trampoline")
>>
>> Didn't you mean to make sure there are at least two pages for
>> MBI data?
> 
> Do you wish plain number here or constant like MBI_SIZE defined somewhere.
> I think that constant is better thing.

I'd prefer MBI_SPACE_MIN (or whatever else making clear that this
is a bound, not an exact size).

Jan


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

  reply	other threads:[~2017-01-31 15:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 22:11 [PATCH v13 0/9] x86: multiboot2 protocol support Daniel Kiper
2017-01-25 22:11 ` [PATCH v13 1/9] x86: add " Daniel Kiper
2017-01-25 22:11 ` [PATCH v13 2/9] efi: build xen.gz with EFI code Daniel Kiper
2017-01-25 22:11 ` [PATCH v13 3/9] efi: create new early memory allocator Daniel Kiper
2017-01-25 22:11 ` [PATCH v13 4/9] x86: add multiboot2 protocol support for EFI platforms Daniel Kiper
2017-01-25 22:20   ` Doug Goldstein
2017-01-25 22:49     ` Daniel Kiper
2017-01-31 12:33       ` Jan Beulich
2017-01-31 14:23         ` Daniel Kiper
2017-01-31 15:14           ` Jan Beulich [this message]
2017-01-25 22:11 ` [PATCH v13 5/9] x86: change default load address from 1 MiB to 2 MiB Daniel Kiper
2017-01-25 22:11 ` [PATCH v13 6/9] x86/setup: use XEN_IMG_OFFSET instead of Daniel Kiper
2017-01-25 22:11 ` [PATCH v13 7/9] x86: make Xen early boot code relocatable Daniel Kiper
2017-01-25 22:11 ` [PATCH v13 8/9] x86/boot: rename sym_phys() to sym_offs() Daniel Kiper
2017-01-25 22:11 ` [PATCH v13 9/9] x86: add multiboot2 protocol support for relocatable images Daniel Kiper

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=5890B7E0020000780013584E@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=JGross@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=daniel.kiper@oracle.com \
    --cc=fu.wei@linaro.org \
    --cc=gang.wei@intel.com \
    --cc=julien.grall@arm.com \
    --cc=ning.sun@intel.com \
    --cc=pgnet.dev@gmail.com \
    --cc=qiaowei.ren@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.