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

Re: [Xen-devel] [PATCH v7 4/4] xen/common: use SYMBOL_HIDE when required



>>> On 10.01.19 at 19:52, <sstabellini@xxxxxxxxxx> wrote:
> On Thu, 10 Jan 2019, Stefano Stabellini wrote:
>> diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
>> index 548b64d..3fa56ff 100644
>> --- a/xen/include/xen/kernel.h
>> +++ b/xen/include/xen/kernel.h
>> @@ -66,27 +66,27 @@
>>  })
>>  
>>  extern char _start[], _end[], start[];
>> -#define is_kernel(p) ({                         \
>> -    char *__p = (char *)(unsigned long)(p);     \
>> -    (__p >= _start) && (__p < _end);            \
>> +#define is_kernel(p) ({                                             \
>> +    const char *p__ = (char *)(unsigned long)(p);                   \
>> +    (p__ >= SYMBOL_HIDE(_start)) && (p__ < SYMBOL_HIDE(_end));      \
>>  })
>>  
>>  extern char _stext[], _etext[];
>> -#define is_kernel_text(p) ({                    \
>> -    char *__p = (char *)(unsigned long)(p);     \
>> -    (__p >= _stext) && (__p < _etext);          \
>> +#define is_kernel_text(p) ({                                        \
>> +    const char *p__ = (char *)(unsigned long)(p);                   \
>> +    (p__ >= SYMBOL_HIDE(_stext)) && (p__ < SYMBOL_HIDE(_etext));    \
>>  })
>>  
>>  extern const char _srodata[], _erodata[];
>> -#define is_kernel_rodata(p) ({                  \
>> -    const char *__p = (const char *)(unsigned long)(p);     \
>> -    (__p >= _srodata) && (__p < _erodata);      \
>> +#define is_kernel_rodata(p) ({                                      \
>> +    const char *p__ = (const char *)(unsigned long)(p);             \
>> +    (p__ >= SYMBOL_HIDE(_srodata)) && (p__ < SYMBOL_HIDE(_erodata));\
>>  })
>>  
>>  extern char _sinittext[], _einittext[];
>> -#define is_kernel_inittext(p) ({                \
>> -    char *__p = (char *)(unsigned long)(p);     \
>> -    (__p >= _sinittext) && (__p < _einittext);  \
>> +#define is_kernel_inittext(p) ({                                         \
>> +    const char *p__ = (char *)(unsigned long)(p);                        \
>> +    (p__ >= SYMBOL_HIDE(_sinittext)) && (p__ < SYMBOL_HIDE(_einittext)); \
>>  })
> 
> I have just realized that it would be nicer to also switch the casts to
> const char*.

Yes indeed.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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