From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+f3985126b746b3d59c9d@syzkaller.appspotmail.com,
Alexander Potapenko <glider@google.com>
Subject: Re: [PATCH 2/2] KVM: x86: Manually retrieve CPUID.0x1 when getting FMS for RESET/INIT
Date: Thu, 30 Sep 2021 10:25:23 +0200 [thread overview]
Message-ID: <75632fa9-e813-266c-7b72-cf9d8142cebf@redhat.com> (raw)
In-Reply-To: <20210929222426.1855730-3-seanjc@google.com>
On 30/09/21 00:24, Sean Christopherson wrote:
> * RESET since KVM emulates RESET before exposing the vCPU to userspace,
> * i.e. it'simpossible for kvm_cpuid() to find a valid entry on RESET.
> + * But, go through the motions in case that's ever remedied. Note, the
> + * index for CPUID.0x1 is not significant, arbitrarily specify '0'.
Just one nit, this comment change is not really needed because almost
all callers are using '0' for the same reason.
But, perhaps adding kvm_find_cpuid_entry_index and removing the last
parameter from kvm_find_cpuid_entry would be a good idea.
Also, the kvm_cpuid() reference needs to be changed, which I did upon
commit.
Paolo
> */
> - eax = 1;
> - if (!kvm_cpuid(vcpu, &eax, &dummy, &dummy, &dummy, true))
> - eax = 0x600;
> - kvm_rdx_write(vcpu, eax);
> + cpuid_0x1 = kvm_find_cpuid_entry(vcpu, 1, 0);
> + kvm_rdx_write(vcpu, cpuid_0x1 ? cpuid_0x1->eax : 0x600);
next prev parent reply other threads:[~2021-09-30 8:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-29 22:24 [PATCH 0/2] KVM: x86: Fix mostly theoretical undefined behavior Sean Christopherson
2021-09-29 22:24 ` [PATCH 1/2] KVM: x86: Swap order of CPUID entry "index" vs. "significant flag" checks Sean Christopherson
2021-09-29 22:51 ` Jim Mattson
2021-09-29 22:24 ` [PATCH 2/2] KVM: x86: Manually retrieve CPUID.0x1 when getting FMS for RESET/INIT Sean Christopherson
2021-09-29 22:49 ` Jim Mattson
2021-09-30 8:25 ` Paolo Bonzini [this message]
2021-09-30 15:11 ` Sean Christopherson
2021-09-30 16:45 ` Paolo Bonzini
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=75632fa9-e813-266c-7b72-cf9d8142cebf@redhat.com \
--to=pbonzini@redhat.com \
--cc=glider@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.com \
--cc=syzbot+f3985126b746b3d59c9d@syzkaller.appspotmail.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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