All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86: partially revert use of 2M mappings for hypervisor image
Date: Mon, 14 Mar 2016 16:10:17 +0000	[thread overview]
Message-ID: <56E6E269.7090504@citrix.com> (raw)
In-Reply-To: <56E6E9D502000078000DC202@prv-mh.provo.novell.com>

On 14/03/16 15:41, Jan Beulich wrote:
>>>> On 14.03.16 at 16:23, <andrew.cooper3@citrix.com> wrote:
>> On 14/03/16 15:12, Jan Beulich wrote:
>>> --- a/xen/arch/x86/setup.c
>>> +++ b/xen/arch/x86/setup.c
>>> @@ -497,6 +497,17 @@ static void __init kexec_reserve_area(st
>>>  #endif
>>>  }
>>>  
>>> +static inline bool_t using_2M_mapping(void)
>>> +{
>>> +    return !l1_table_offset((unsigned long)__2M_text_end) &&
>>> +           !l1_table_offset((unsigned long)__2M_rodata_start) &&
>>> +           !l1_table_offset((unsigned long)__2M_rodata_end) &&
>>> +           !l1_table_offset((unsigned long)__2M_init_start) &&
>>> +           !l1_table_offset((unsigned long)__2M_init_end) &&
>>> +           !l1_table_offset((unsigned long)__2M_rwdata_start) &&
>>> +           !l1_table_offset((unsigned long)__2M_rwdata_end);
>> I would recommend
>>
>> #ifdef EFI
>> return 1;
>> #else
>> return 0;
>> #endif
>>
>> The compiler is unable to collapse that expression into a constant,
>> because it can only be evaluated at link time.
> But that wouldn't work, since setup.c gets compiled just once. The
> only usable difference in building is the linking stage. (And
> performance here is of no issue - this gets executed exactly twice.)

Oh yes - that fact keeps on escaping me.  It is only an interim
solution, so is fine to stay.

>>> @@ -922,6 +942,8 @@ void __init noreturn __start_xen(unsigne
>>>               * Undo the temporary-hooking of the l1_identmap.  __2M_text_start
>>>               * is contained in this PTE.
>>>               */
>>> +            BUG_ON(l2_table_offset((unsigned long)_erodata) ==
>>> +                   l2_table_offset((unsigned long)_stext));
>> Is this intentional to stay, or the remnants of debugging?
> This is intentional, as it documents the validity of the immediately
> following page table write: The change is not undoing the RWX ->
> RX change that your original patch did, and using RX past
> _erodata would obviously be wrong.

Ah yes.

~Andrew

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

      reply	other threads:[~2016-03-14 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14 15:12 [PATCH] x86: partially revert use of 2M mappings for hypervisor image Jan Beulich
2016-03-14 15:23 ` Andrew Cooper
2016-03-14 15:41   ` Jan Beulich
2016-03-14 16:10     ` Andrew Cooper [this message]

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=56E6E269.7090504@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.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.