All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Keir Fraser <keir@xen.org>,
	suravee.suthikulpanit@amd.com
Subject: Re: [PATCH v2 2/3] x86/AMD: support further feature masking MSRs
Date: Wed, 9 Apr 2014 10:39:02 -0500	[thread overview]
Message-ID: <53456996.8060707@amd.com> (raw)
In-Reply-To: <53441255.1070908@oracle.com>

On 4/8/2014 10:14 AM, Boris Ostrovsky wrote:
> On 04/08/2014 10:33 AM, Jan Beulich wrote:
>>>>> On 08.04.14 at 16:14, <boris.ostrovsky@oracle.com> wrote:
>>> On 04/08/2014 10:02 AM, Jan Beulich wrote:
>>>>>>> On 08.04.14 at 15:50, <boris.ostrovsky@oracle.com> wrote:
>>>>> On 04/08/2014 03:15 AM, Jan Beulich wrote:
>>>>>>>>> On 07.04.14 at 17:21, <boris.ostrovsky@oracle.com> wrote:
>>>>>>> On 04/07/2014 05:43 AM, Jan Beulich wrote:
>>>>>>>
>>>>>>> @@ -179,11 +196,39 @@ static void __devinit set_cpuidmask(cons
>>>>>>>          printk("Writing CPUID extended feature mask ECX:EDX -> 
>>>>>>> %08Xh:%08Xh\n",
>>>>>>>                 extfeat_ecx, extfeat_edx);
>>>>>>>      +    if (c->cpuid_level >= 7)
>>>>>>> +        cpuid_count(7, 0, &eax, &ebx, &ecx, &edx);
>>>>>>> +    else
>>>>>>> +        ebx = eax = 0;
>>>>>>> +    if ((eax | ebx) && ~(l7s0_eax & l7s0_ebx)) {
>>>>>>> +        if (l7s0_eax > eax)
>>>>>>> +            l7s0_eax = eax;
>>>>>>> +        l7s0_ebx &= ebx;
>>>>>>>
>>>>>>>
>>>>>>> Can you explain why eax is treated differently here (i.e. not 
>>>>>>> ANDing it
>>>>>>> as is done with ebx)?
>>>>>> Generally I think code like this implies that you know the 
>>>>>> specification:
>>>>>> eax here represents the maximum supported subleaf, and hence
>>>>>> needs to be limited rather than masked.
>>>>> All specs that I have say that bits of CPUID Fn0000_0007_EAX_x0 are
>>>>> reserved.
>>>> Intel's SDM Vol 2 rev 49 (325383-049US) says "07H Sub-leaf 0 (Input
>>>> ECX = 0). EAX Bits 31-00: Reports the maximum input value for
>>>> supported leaf 7 sub-leaves." Not sure what other specs you might
>>>> be looking at.
>>> This is a patch to xen/arch/x86/cpu/amd.c so I was looking at AMD's
>>> BKDGs.  Why is Intel's definition relevant here?
>> Because leaf 7 is (largely) Intel-defined (AMD adds their extensions
>> usually at leaves 800000xx).
>
> I don't know whether we can assume that AMD will follow the same 
> definitions. They usually try not to deliberately do something 
> differently there but this is never guaranteed.
>


Hmm. Boris is right.. All BKDG's I can refer to also say cpuid[7,0].eax 
is reserved.

So, we should be OK with allowing user to mask only cpuid[7,0].ebx ?


-Aravind.

  reply	other threads:[~2014-04-09 15:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07  9:36 [PATCH v2 0/3] x86/AMD: feature masking adjustments Jan Beulich
2014-04-07  9:41 ` [PATCH v2 1/3] x86/AMD: feature masking is unavailable on Fam11 Jan Beulich
2014-04-07 10:14   ` Andrew Cooper
2014-04-07  9:43 ` [PATCH v2 2/3] x86/AMD: support further feature masking MSRs Jan Beulich
2014-04-07 10:23   ` Andrew Cooper
2014-04-07 11:53     ` Jan Beulich
2014-04-07 12:09       ` Andrew Cooper
2014-04-07 15:21   ` Boris Ostrovsky
2014-04-08  7:15     ` Jan Beulich
2014-04-08 13:50       ` Boris Ostrovsky
2014-04-08 14:02         ` Jan Beulich
2014-04-08 14:14           ` Boris Ostrovsky
2014-04-08 14:33             ` Jan Beulich
2014-04-08 15:14               ` Boris Ostrovsky
2014-04-09 15:39                 ` Aravind Gopalakrishnan [this message]
2014-04-09 15:50                   ` Jan Beulich
2014-04-07  9:43 ` [PATCH v2 3/3] x86/AMD: clean up pre-canned family/revision handling for CPUID masking Jan Beulich
2014-04-07 10:48   ` Andrew Cooper
2014-04-07 11:55     ` Jan Beulich

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=53456996.8060707@amd.com \
    --to=aravind.gopalakrishnan@amd.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=keir@xen.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.