Re: [Qemu-devel] [qemu-s390x] [PATCH v2] s390x/tcg: add various alignment check

2018-02-15 Thread Eric Blake

On 02/15/2018 03:49 AM, Cornelia Huck wrote:

On Thu, 15 Feb 2018 10:47:45 +0100
David Hildenbrand  wrote:


On 14.02.2018 20:04, Richard Henderson wrote:

On 02/14/2018 09:31 AM, David Hildenbrand wrote:

Let's add proper alignment checks for a handful of instructions that
require a SPECIFICATION exception in case alignment is violated.

Introduce new wout/in functions. Declare them as "static inline" to avoid
warnings about not being used for CONFIG_USER_ONLY (as we are right
now only using them for privileged instructions).


Annoyingly, clang will still warn for this.
   


Hm, so the only solution is to add nasty idfefs then :(


Yup, very annoying indeed, but probably the only way to shut clang up...


Does marking the function __attribute__((unused)) shut up clang?

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



Re: [Qemu-devel] [qemu-s390x] [PATCH v2] s390x/tcg: add various alignment check

2018-02-15 Thread David Hildenbrand
On 15.02.2018 15:13, Eric Blake wrote:
> On 02/15/2018 03:49 AM, Cornelia Huck wrote:
>> On Thu, 15 Feb 2018 10:47:45 +0100
>> David Hildenbrand  wrote:
>>
>>> On 14.02.2018 20:04, Richard Henderson wrote:
 On 02/14/2018 09:31 AM, David Hildenbrand wrote:
> Let's add proper alignment checks for a handful of instructions that
> require a SPECIFICATION exception in case alignment is violated.
>
> Introduce new wout/in functions. Declare them as "static inline" to avoid
> warnings about not being used for CONFIG_USER_ONLY (as we are right
> now only using them for privileged instructions).

 Annoyingly, clang will still warn for this.

>>>
>>> Hm, so the only solution is to add nasty idfefs then :(
>>
>> Yup, very annoying indeed, but probably the only way to shut clang up...
> 
> Does marking the function __attribute__((unused)) shut up clang?
> 

Guess so, seems to be used in tcg/tcg.c. But I don't think that's a
major improvement, as these warnings can actually point you at bugs.

-- 

Thanks,

David / dhildenb



Re: [Qemu-devel] [qemu-s390x] [PATCH v2] s390x/tcg: add various alignment check

2018-02-15 Thread David Hildenbrand
On 15.02.2018 10:49, Cornelia Huck wrote:
> On Thu, 15 Feb 2018 10:47:45 +0100
> David Hildenbrand  wrote:
> 
>> On 14.02.2018 20:04, Richard Henderson wrote:
>>> On 02/14/2018 09:31 AM, David Hildenbrand wrote:  
 Let's add proper alignment checks for a handful of instructions that
 require a SPECIFICATION exception in case alignment is violated.

 Introduce new wout/in functions. Declare them as "static inline" to avoid
 warnings about not being used for CONFIG_USER_ONLY (as we are right
 now only using them for privileged instructions).  
>>>
>>> Annoyingly, clang will still warn for this.
>>>   
>>
>> Hm, so the only solution is to add nasty idfefs then :(
> 
> Yup, very annoying indeed, but probably the only way to shut clang up...
> 

Will resend soon!

-- 

Thanks,

David / dhildenb



Re: [Qemu-devel] [qemu-s390x] [PATCH v2] s390x/tcg: add various alignment check

2018-02-15 Thread Cornelia Huck
On Thu, 15 Feb 2018 10:47:45 +0100
David Hildenbrand  wrote:

> On 14.02.2018 20:04, Richard Henderson wrote:
> > On 02/14/2018 09:31 AM, David Hildenbrand wrote:  
> >> Let's add proper alignment checks for a handful of instructions that
> >> require a SPECIFICATION exception in case alignment is violated.
> >>
> >> Introduce new wout/in functions. Declare them as "static inline" to avoid
> >> warnings about not being used for CONFIG_USER_ONLY (as we are right
> >> now only using them for privileged instructions).  
> > 
> > Annoyingly, clang will still warn for this.
> >   
> 
> Hm, so the only solution is to add nasty idfefs then :(

Yup, very annoying indeed, but probably the only way to shut clang up...



Re: [Qemu-devel] [qemu-s390x] [PATCH v2] s390x/tcg: add various alignment check

2018-02-15 Thread David Hildenbrand
On 14.02.2018 20:04, Richard Henderson wrote:
> On 02/14/2018 09:31 AM, David Hildenbrand wrote:
>> Let's add proper alignment checks for a handful of instructions that
>> require a SPECIFICATION exception in case alignment is violated.
>>
>> Introduce new wout/in functions. Declare them as "static inline" to avoid
>> warnings about not being used for CONFIG_USER_ONLY (as we are right
>> now only using them for privileged instructions).
> 
> Annoyingly, clang will still warn for this.
> 

Hm, so the only solution is to add nasty idfefs then :(

Thanks!

> Otherwise,
> Reviewed-by: Richard Henderson 
> 
> 
> r~
> 


-- 

Thanks,

David / dhildenb