Re: [PATCH] KVM: Clean up kvm_vm_ioctl_create_vcpu()

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

 



On 6/5/23 15:03, Yuan Yao wrote:
> On Mon, Jun 05, 2023 at 01:44:19PM +0200, Michal Luczaj wrote:
>> Since c9d601548603 ("KVM: allow KVM_BUG/KVM_BUG_ON to handle 64-bit cond")
>> 'cond' is internally converted to boolean, so caller's explicit conversion
>> from void* is unnecessary.
>>
>> Remove the double bang.
>> ...
>> -	if (KVM_BUG_ON(!!xa_store(&kvm->vcpu_array, vcpu->vcpu_idx, vcpu, 0), kvm)) {
>> +	if (KVM_BUG_ON(xa_store(&kvm->vcpu_array, vcpu->vcpu_idx, vcpu, 0), kvm)) {
> 
> Looks the only one place for KVM_BUG_ON().
> 
> Reviewed-by: Yuan Yao <yuan.yao@xxxxxxxxx>
> 
> BTW: svm_get_lbr_msr() is using KVM_BUG(false, ...) and
> handle_cr() is using KVM_BUG(1, ...), a chance to
> change them to same style ?

Sure, but KVM_BUG(false, ...) is a no-op, right? Would you like me to fix it
separately with KVM_BUG(1, ...) as a (hardly significant) functional change?

Also, am I correct to assume that (1, ) is the preferred style?
arch/powerpc/kvm/book3s_64_mmu_host.c:kvmppc_mmu_map_page() seems to be the only
exception (within KVM) with a `WARN_ON(true)`.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux