xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, jiewen.yao@intel.com, jeff.fan@intel.com
Subject: Re: [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass
Date: Wed, 02 Aug 2017 13:11:00 +0100	[thread overview]
Message-ID: <1501675860.4771.407.camel@infradead.org> (raw)
In-Reply-To: <5981BDDB02000078001032AC@prv-mh.provo.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 1510 bytes --]

On Wed, 2017-08-02 at 05:56 -0600, Jan Beulich wrote:
> > 
> > > 
> > > > 
> > > > David Woodhouse <dwmw2@infradead.org> 08/02/17 1:30 PM >>>
> > --- a/xen/arch/x86/efi/efi-boot.h
> > +++ b/xen/arch/x86/efi/efi-boot.h
> > @@ -87,7 +87,8 @@ static void __init efi_arch_relocate_image(unsigned long delta)
> > case PE_BASE_RELOC_DIR64:
> > if ( in_page_tables(addr) )
> > blexit(L"Unexpected relocation type");
> > -                *(u64 *)addr += delta;
> > +                if ( delta )
> > +                    *(u64 *)addr += delta;
> > break;
> > default:
> > blexit(L"Unsupported relocation type");
>
> While of course this and the other half of the necessary changes are
> independent (i.e. this patch could be taken as is), I really had intended
> to deal with both sides of this issue at once, and hence I'm not entirely
> happy for this partial change to go in on its own. Nevertheless if need
> be it can have my ack.

I am, evidently, still being dense.

This change is sufficient (we believe) to make EFI builds of Xen
actually boot again on current EDK2, is it not?

What is the "other half" of which you speak? You mentioned marking the
section RWX — but for that to be a long-term solution to the issue,
we'd basically have to ensure that we always mark *all* sections which
might have relocations (even .rodata) as writeable, in case UEFI
decides to honour their read-only status at some point in the future.

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4938 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

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

  reply	other threads:[~2017-08-02 12:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 15:20 xen/link: Move .data.rel.ro sections into .rodata for final link David Woodhouse
2017-07-20 16:46 ` Wei Liu
2017-07-20 16:54   ` Wei Liu
2017-07-21 10:43     ` Julien Grall
2017-07-21 16:41       ` Andrew Cooper
2017-07-25  9:21 ` [PATCH v2] " David Woodhouse
2017-07-30  6:16 ` Jan Beulich
2017-07-30 12:50   ` Andrew Cooper
2017-07-30 23:18     ` David Woodhouse
2017-07-31  9:57       ` Jan Beulich
2017-07-31 10:15         ` David Woodhouse
2017-07-31  9:55     ` Jan Beulich
2017-07-31 11:02   ` David Woodhouse
2017-07-31 13:15     ` Jan Beulich
2017-07-31 15:56       ` David Woodhouse
2017-08-02  9:17         ` Jan Beulich
2017-08-02 11:30           ` [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass David Woodhouse
2017-08-02 11:56             ` Jan Beulich
2017-08-02 12:11               ` David Woodhouse [this message]
2017-08-02 13:58                 ` Jan Beulich
2017-08-02 14:45                   ` David Woodhouse
2017-08-02 15:16                     ` Jan Beulich
2017-08-02 15:56                       ` David Woodhouse
2017-08-02 11:43           ` xen/link: Move .data.rel.ro sections into .rodata for final link David Woodhouse

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=1501675860.4771.407.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=jbeulich@suse.com \
    --cc=jeff.fan@intel.com \
    --cc=jiewen.yao@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).