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

Re: [PATCH 04/65] x86/hypercall: Annotate fnptr targets



On 26/11/2021 14:21, Jan Beulich wrote:
> On 26.11.2021 13:33, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> I understand there's not much to say here, but the title saying just
> "annotate" without any context as to the purpose of the annotation
> is too little information imo. I guess this then goes for many more
> titles in this series.

I really couldn't think of anything useful to say.  Lots of these
patches are entirely mechanical.

>
>> --- a/xen/include/xen/hypercall.h
>> +++ b/xen/include/xen/hypercall.h
>> @@ -18,12 +18,12 @@
>>  #include <asm/hypercall.h>
>>  #include <xsm/xsm.h>
>>  
>> -extern long
>> +extern long cf_check
>>  do_sched_op(
>>      int cmd,
>>      XEN_GUEST_HANDLE_PARAM(void) arg);
> What purpose does the attribute serve on a declaration? On the surface
> I would consider it meaningful only on definitions, like e.g. __init.

Because GCC treats cf_check (and nocf_check) as part of the function
type.  Simply getting it wrong will yield a "definition doesn't match
prototype" error.

Furthermore, it needs to be visible across translation units so one TU
can spot (and complain at) creating a function pointer to a non-local
non-endbr'd function.

~Andrew



 


Rackspace

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