All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 3/3] x86/EFI: don't accept 64-bit base relocations on page tables
Date: Fri, 19 Aug 2016 13:39:44 +0100	[thread overview]
Message-ID: <aa9e18cb-a5a9-a7a4-c25e-1f0b5b268a5c@citrix.com> (raw)
In-Reply-To: <57B6D6C40200007800107465@prv-mh.provo.novell.com>


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

On 19/08/16 08:52, Jan Beulich wrote:
> Page tables get pre-populated with physical addresses which, due to
> living inside the Xen image, will never exceed 32 bits in width. That
> in turn results in the tool generating the relocations to produce
> 32-bit relocations for them instead of the 64-bit ones needed for
> relocating virtual addresses. Hence instead of special casing page
> tables in the processing of 64-bit relocations, let's be more rigid
> and refuse them (as being indicative of something else having gone
> wrong in the build process).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Is it an ABI requirement to use the minimal available relocation?  It is
certainly suboptimal to use a 64bit relocation when a 32bit one would
do, but I wouldn't bet that it is unconditional avoided by all toolchains.

It is currently the case that Xen needs to live below 4GB physical, so
from that point of view a 64bit relocation will not be required in the
pagetables.

~Andrew

>
> --- a/xen/arch/x86/efi/efi-boot.h
> +++ b/xen/arch/x86/efi/efi-boot.h
> @@ -81,12 +81,9 @@ static void __init efi_arch_relocate_ima
>                  }
>                  break;
>              case PE_BASE_RELOC_DIR64:
> -                if ( delta )
> -                {
> -                    *(u64 *)addr += delta;
> -                    if ( in_page_tables(addr) )
> -                        *(intpte_t *)addr += xen_phys_start;
> -                }
> +                if ( in_page_tables(addr) )
> +                    blexit(L"Unexpected relocation type");
> +                *(u64 *)addr += delta;
>                  break;
>              default:
>                  blexit(L"Unsupported relocation type");
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 2699 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:[~2016-08-19 12:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-19  7:39 [PATCH 0/3] x86/EFI: boot adjustments Jan Beulich
2016-08-19  7:50 ` [PATCH 1/3] x86/EFI: don't apply relocations to l{2, 3}_bootmap Jan Beulich
2016-08-19 10:34   ` Andrew Cooper
2016-08-19 12:05     ` Jan Beulich
2016-08-19  7:51 ` [PATCH 2/3] x86/EFI: be cautious about being handed control with CR4.PGE enabled Jan Beulich
2016-08-19 12:26   ` Andrew Cooper
2016-08-19  7:52 ` [PATCH 3/3] x86/EFI: don't accept 64-bit base relocations on page tables Jan Beulich
2016-08-19 12:39   ` Andrew Cooper [this message]
2016-08-19 12:57     ` Jan Beulich
2016-08-30 16:35       ` Andrew Cooper
2016-08-31 12:28         ` Jan Beulich
2016-08-31 12:32           ` Andrew Cooper
2016-08-31 13:03             ` Jan Beulich
2016-08-30 16:18   ` Ping: " Jan Beulich

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=aa9e18cb-a5a9-a7a4-c25e-1f0b5b268a5c@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.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 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.