From: Paolo Bonzini <pbonzini@redhat.com>
To: Yu Zhang <yu.c.zhang@linux.intel.com>, kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, rkrcmar@redhat.com,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
xiaoguangrong@tencent.com, joro@8bytes.org
Subject: Re: [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid().
Date: Thu, 17 Aug 2017 16:29:38 +0200 [thread overview]
Message-ID: <d8b0cea2-9e0b-1622-a253-a17cf642efc7@redhat.com> (raw)
In-Reply-To: <78090cb4-9a7b-dea0-c2b2-d266f242e6d6@linux.intel.com>
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
next prev parent reply other threads:[~2017-08-17 14:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 19:52 [PATCH v2 0/5] KVM: MMU: 5 level EPT/shadow support Yu Zhang
2017-08-17 19:52 ` [PATCH v2 1/5] KVM: x86: Add return value to kvm_cpuid() Yu Zhang
2017-08-17 12:29 ` Paolo Bonzini
2017-08-17 12:23 ` Yu Zhang
2017-08-17 12:33 ` Yu Zhang
2017-08-17 13:18 ` Paolo Bonzini
2017-08-17 13:17 ` Paolo Bonzini
2017-08-17 13:20 ` Yu Zhang
2017-08-17 14:29 ` Paolo Bonzini [this message]
2017-08-17 19:52 ` [PATCH v2 2/5] KVM: MMU: check guest CR3 reserved bits based on its physical address width Yu Zhang
2017-08-17 12:31 ` Paolo Bonzini
2017-08-17 12:25 ` Yu Zhang
2017-08-17 19:52 ` [PATCH v2 3/5] KVM: MMU: Rename PT64_ROOT_LEVEL to PT64_ROOT_4LEVEL Yu Zhang
2017-08-17 19:52 ` [PATCH v2 4/5] KVM: MMU: Add 5 level EPT & Shadow page table support Yu Zhang
2017-08-17 19:52 ` [PATCH v2 5/5] KVM: MMU: Expose the LA57 feature to VM Yu Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d8b0cea2-9e0b-1622-a253-a17cf642efc7@redhat.com \
--to=pbonzini@redhat.com \
--cc=hpa@zytor.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=xiaoguangrong@tencent.com \
--cc=yu.c.zhang@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®