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

Re: [Xen-devel] [PATCH V5 02/15] Move x86 specific funtions/variables to arch header



>>> On 22.09.14 at 12:52, <Ian.Campbell@xxxxxxxxxx> wrote:
> On Fri, 2014-09-19 at 09:37 +0100, Jan Beulich wrote:
>> >>> On 19.09.14 at 00:49, <roy.franz@xxxxxxxxxx> wrote:
>> > @@ -687,82 +645,6 @@ static int __init set_color(u32 mask, int bpp, u8 
> *pos, u8 *sz)
>> >     return max(*pos + *sz, bpp);
>> >  }
>> >  
>> > -extern const intpte_t __page_tables_start[], __page_tables_end[];
>> > -#define in_page_tables(v) ((intpte_t *)(v) >= __page_tables_start && \
>> > -                           (intpte_t *)(v) < __page_tables_end)
>> > -
>> > -#define PE_BASE_RELOC_ABS      0
>> > -#define PE_BASE_RELOC_HIGHLOW  3
>> > -#define PE_BASE_RELOC_DIR64   10
>> > -
>> > -extern const struct pe_base_relocs {
>> > -    u32 rva;
>> > -    u32 size;
>> > -    u16 entries[];
>> > -} __base_relocs_start[], __base_relocs_end[];
>> > -
>> > -static void __init relocate_image(unsigned long delta)
>> > -{
>> > -    const struct pe_base_relocs *base_relocs;
>> > -
>> > -    for ( base_relocs = __base_relocs_start; base_relocs < 
> __base_relocs_end; )
>> > -    {
>> > -        unsigned int i, n;
>> > -
>> > -        n = (base_relocs->size - sizeof(*base_relocs)) /
>> > -            sizeof(*base_relocs->entries);
>> > -        for ( i = 0; i < n; ++i )
>> > -        {
>> > -            unsigned long addr = xen_phys_start + base_relocs->rva +
>> > -                                 (base_relocs->entries[i] & 0xfff);
>> > -
>> > -            switch ( base_relocs->entries[i] >> 12 )
>> > -            {
>> > -            case PE_BASE_RELOC_ABS:
>> > -                break;
>> > -            case PE_BASE_RELOC_HIGHLOW:
>> > -                if ( delta )
>> > -                {
>> > -                    *(u32 *)addr += delta;
>> > -                    if ( in_page_tables(addr) )
>> > -                        *(u32 *)addr += xen_phys_start;
>> > -                }
>> > -                break;
>> > -            case PE_BASE_RELOC_DIR64:
>> > -                if ( delta )
>> > -                {
>> > -                    *(u64 *)addr += delta;
>> > -                    if ( in_page_tables(addr) )
>> > -                        *(intpte_t *)addr += xen_phys_start;
>> > -                }
>> > -                break;
>> > -            default:
>> > -                blexit(L"Unsupported relocation type");
>> > -            }
>> > -        }
>> > -        base_relocs = (const void *)(base_relocs->entries + i + (i & 1));
>> > -    }
>> > -}
>> 
>> Hmm, so you're still moving the relocation processing code - why? I
>> don't recall you having said you're sure you'll not need this on ARM.
> 
> ARM relocates itself to the top of memory during bringup already. I
> don't think we need to do it here as well/instead.

There are two relocations (on x86) actually: One (always used) is
to move the hypervisor image to high physical memory. The other
(needed under UEFI only) is to relocate the hypervisor from where
the UEFI loader put it (running in physical mode, virtual and
physical addresses are the same) to its linked virtual address. Are
you saying that ARM isn't in need of this?

Jan


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


 


Rackspace

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