public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>, X86 ML <x86@kernel.org>,
	KVM <kvm@vger.kernel.org>
Subject: Re: [RFC PATCH 1/3] x86/cpu: Unify CPU family, model, stepping calculation
Date: Wed, 18 Nov 2015 12:35:24 +0100	[thread overview]
Message-ID: <564C627C.5030904@redhat.com> (raw)
In-Reply-To: <20151118112846.GD4138@pd.tnic>



On 18/11/2015 12:28, Borislav Petkov wrote:
>> On 14/11/2015 11:37, Borislav Petkov wrote:
>>> > >  	vendor = x86_vendor();
>>> > > -	family = x86_family();
>>> > > +	family = x86_family_cpuid();
>> > 
>> > What about renaming x86_vendor() so that this looks like
>> > 
>> > -	vendor = x86_vendor();
>> > -	family = x86_family();
>> > +	vendor = x86_cpuid_vendor();
>> > +	family = x86_cpuid_family();
> 
> The idea is that x86_family_cpuid() gives the family *after* having
> executed CPUID while x86_family() only computes the family from a
> supplied CPUID_1_EAX. I.e., the last saves us the CPUID call.

Yes, exactly.  I'm suggesting that the same applies to x86_vendor().  I
also prefer x86_cpuid_* to x86_*_cpuid because, once you add two
functions in the same family it's nice that they share a prefix.

Paolo

> Hmm, maybe I should make that more clear ...

  reply	other threads:[~2015-11-18 11:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-14 10:37 [RFC PATCH 0/3] x86, kvm: Unify CPUID computation and fix MSR accessing Borislav Petkov
2015-11-14 10:37 ` [RFC PATCH 1/3] x86/cpu: Unify CPU family, model, stepping calculation Borislav Petkov
2015-11-18 11:10   ` Paolo Bonzini
2015-11-18 11:28     ` Borislav Petkov
2015-11-18 11:35       ` Paolo Bonzini [this message]
2015-11-18 18:50         ` Borislav Petkov
2015-11-19  9:34           ` Paolo Bonzini
2015-11-19  9:47             ` Borislav Petkov
2015-11-14 10:37 ` [RFC PATCH 2/3] kvm: Add accessors for guest CPU's family, model, stepping Borislav Petkov
2015-11-18 11:10   ` Paolo Bonzini
2015-11-14 10:37 ` [RFC PATCH 3/3] x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSR Borislav Petkov
2015-11-18 11:11   ` 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=564C627C.5030904@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bp@alien8.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /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