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

Re: [Xen-devel] [PATCH] x86/EFI + Live Patch: avoid symbol address truncation



On 28/06/16 17:11, Jan Beulich wrote:
>>> --- a/xen/arch/x86/xen.lds.S
>>> +++ b/xen/arch/x86/xen.lds.S
>>> @@ -40,9 +40,20 @@ SECTIONS
>>>  #if !defined(EFI)
>>>    . = __XEN_VIRT_START;
>>>    __image_base__ = .;
>>> +#else
>>> +  . = __image_base__;
>>>  #endif
>>>  
>>> +#if 0
>>> +/*
>>> + * We don't really use this symbol anywhere, and the way it would get 
>>> defined
>>> + * here would result in it having a negative (wrapped to huge positive)
>>> + * offset relative to the .text section. That, in turn, causes an assembler
>>> + * truncation warning when including all symbols in the symbol table for 
>>> Live
>>> + * Patching code.
>>> + */
>>>    __2M_text_start = .;         /* Start of 2M superpages, mapped RX. */
>>> +#endif
>>>  
>>>    . = __XEN_VIRT_START + MB(1);
>>>    _start = .;
>>> @@ -194,14 +205,13 @@ SECTIONS
>>>         *(.ctors)
>>>         __ctors_end = .;
>>>    } :text
>>> -  . = ALIGN(PAGE_SIZE);
>>> -  __init_end = .;
>>>  
>>>  #ifdef EFI
>>>    . = ALIGN(MB(2));
>>>  #else
>>>    . = ALIGN(PAGE_SIZE);
>>>  #endif
>>> +  __init_end = .;
>>>    __2M_init_end = .;
>>>  
>>>    __2M_rwdata_start = .;       /* Start of 2M superpages, mapped RW. */
>>> @@ -296,7 +306,6 @@ ASSERT(__image_base__ > XEN_VIRT_START |
>>>  ASSERT(kexec_reloc_size - kexec_reloc <= PAGE_SIZE, "kexec_reloc is too 
>> large")
>>>  #endif
>>>  
>>> -ASSERT(IS_ALIGNED(__2M_text_start,   MB(2)), "__2M_text_start misaligned")
>> If we are #if 0'ing the symbol for documentation purposes, can we #if 0
>> this as well?
> I considered it, but the two #if-s would end up disconnected. And
> with the symbol being first thing in the image (plus the fact that so
> far the assertion was there _without_ triggering despite there
> being a problem - just one it couldn't detect), I think chances are
> slim that it getting fully removed would be a significant problem.
> I.e. I'd prefer the patch to remain as is in this regard, but if the
> only way to get it acked is to do as you suggest, I would
> (hesitantly) do so.

Ok.  I suppose it is sufficiently well documented because of the other
alignment assertions.

With the %lu fix, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

~Andrew

_______________________________________________
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®.