From: Borislav Petkov <bp@alien8.de>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: KVM <kvm@vger.kernel.org>, lkml <linux-kernel@vger.kernel.org>,
"Jim Mattson" <jmattson@google.com>,
"Joerg Roedel" <joro@8bytes.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Tom Lendacky" <thomas.lendacky@amd.com>,
"Tony Luck" <tony.luck@intel.com>,
"Yazen Ghannam" <Yazen.Ghannam@amd.com>
Subject: Re: [PATCH -v5] x86/kvm: Implement HWCR support
Date: Mon, 8 Apr 2019 16:57:16 +0200 [thread overview]
Message-ID: <20190408145716.GG15689@zn.tnic> (raw)
In-Reply-To: <20190408144115.GA25880@linux.intel.com>
On Mon, Apr 08, 2019 at 07:41:15AM -0700, Sean Christopherson wrote:
> > +{
> > + if (guest_cpuid_is_amd(vcpu)) {
> > + struct msr_data tmp;
> > +
> > + tmp.index = MSR_K7_HWCR;
> > +
> > + if (kvm_get_msr_common(vcpu, &tmp))
>
> No need to get through kvm_get_msr_common(), vcpu->arch.msr_hwcr can be
> queried directly. Going that route would likely eliminate the need for a
> helper func, i.e. avoid the naming confusion and the comment below.
Agree with every point except this: the helper function abstracts
the guest cpuid check and the rest of the handling nicely. If I put
everything in an already too big default: label in set_msr_mce(), then
the code there will become even more unreadable than it is.
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
next prev parent reply other threads:[~2019-04-08 14:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-08 9:09 [PATCH -v5] x86/kvm: Implement HWCR support Borislav Petkov
2019-04-08 14:41 ` Sean Christopherson
2019-04-08 14:57 ` Borislav Petkov [this message]
2019-04-18 12:28 ` [PATCH -v5.1] " Borislav Petkov
2019-04-18 13:56 ` Sean Christopherson
2019-04-18 14:19 ` Borislav Petkov
2019-04-18 14:38 ` Sean Christopherson
2019-04-18 16:36 ` Paolo Bonzini
2019-04-18 16:34 ` 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=20190408145716.GG15689@zn.tnic \
--to=bp@alien8.de \
--cc=Yazen.Ghannam@amd.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=thomas.lendacky@amd.com \
--cc=tony.luck@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