[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190408145716.GG15689@zn.tnic>
Date: Mon, 8 Apr 2019 16:57:16 +0200
From: Borislav Petkov <bp@...en8.de>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: KVM <kvm@...r.kernel.org>, lkml <linux-kernel@...r.kernel.org>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Tom Lendacky <thomas.lendacky@....com>,
Tony Luck <tony.luck@...el.com>,
Yazen Ghannam <Yazen.Ghannam@....com>
Subject: Re: [PATCH -v5] x86/kvm: Implement HWCR support
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.
Powered by blists - more mailing lists