Re: [PATCH] KVM: s390/vsie: avoid sparse warning

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

 



On 16.07.2018 15:10, Christian Borntraeger wrote:
> 
> 
> On 07/16/2018 01:43 PM, David Hildenbrand wrote:
>> On 16.07.2018 10:37, Christian Borntraeger wrote:
>>> This is a non-functional change that avoids
>>> arch/s390/kvm/vsie.c:839:25: warning: context imbalance in 'do_vsie_run' - unexpected unlock
>>>
>>> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
>>> ---
>>>  arch/s390/kvm/vsie.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
>>> index 5dd9f7dc5b28..63844b95c22c 100644
>>> --- a/arch/s390/kvm/vsie.c
>>> +++ b/arch/s390/kvm/vsie.c
>>> @@ -823,6 +823,8 @@ static int handle_stfle(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
>>>   *          - < 0 if an error occurred
>>>   */
>>>  static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
>>> +	__releases(vcpu->kvm->srcu)
>>> +	__acquires(vcpu->kvm->srcu)
>>>  {
>>>  	struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
>>>  	struct kvm_s390_sie_block *scb_o = vsie_page->scb_o;
>>>
>>
>> Why isn't the same needed in __vcpu_run() ?
> 
> Because it first takes the lock. sparse complains if the first action is to release the lock.
> 

Indeed, I ignored the first lock outside of the loop.

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

-- 

Thanks,

David / dhildenb
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux