Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1714088

Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid().

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid().
Date 2017-08-17 16:40 +0200
Message-ID <ufu7L-67i-13@gated-at.bofh.it> (permalink)
References (1 earlier) <ufrCV-4m1-5@gated-at.bofh.it> <ufs5Y-4Nj-35@gated-at.bofh.it> <ufspj-4V5-9@gated-at.bofh.it> <ufsSm-5nC-9@gated-at.bofh.it> <uftln-5z4-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 17/08/2017 15:20, Yu Zhang wrote:
>>
> 
> OK. And to return 0 for eax/ebx/ecx/edx if check_cpuid_limit() is also
> to be omitted,
> I'd better refactor this patch and move the "out:" before the if
> statement. :-)
> 
>                 best = check_cpuid_limit(vcpu, function, index);
>         }
> 
> +out:
>         if (best) {
>                 *eax = best->eax;
>                 *ebx = best->ebx;
> @@ -887,7 +888,6 @@ bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32
> *ebx,
>         } else
>                 *eax = *ebx = *ecx = *edx = 0;
> 
> -out:
>         trace_kvm_cpuid(function, *eax, *ebx, *ecx, *edx, entry_found);
>         return entry_found;
>  }
> 
> And for all get_cpuid() callers which is testing the existence of a
> feature, we do not need to
> check the return value, just checking the flag in the register should be
> fine, correct?

Yes, correct!

Paolo

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid(). Yu Zhang <yu.c.zhang@linux.intel.com> - 2017-08-17 14:00 +0200
  Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid(). Paolo Bonzini <pbonzini@redhat.com> - 2017-08-17 14:30 +0200
    Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid(). Yu Zhang <yu.c.zhang@linux.intel.com> - 2017-08-17 14:50 +0200
      Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid(). Yu Zhang <yu.c.zhang@linux.intel.com> - 2017-08-17 15:00 +0200
        Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid(). Paolo Bonzini <pbonzini@redhat.com> - 2017-08-17 15:20 +0200
      Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid(). Paolo Bonzini <pbonzini@redhat.com> - 2017-08-17 15:20 +0200
        Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid(). Yu Zhang <yu.c.zhang@linux.intel.com> - 2017-08-17 15:50 +0200
          Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid(). Paolo Bonzini <pbonzini@redhat.com> - 2017-08-17 16:40 +0200

csiph-web