xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] tools/libxc: Properly increment ApicIdCoreSize field on AMD
Date: Fri, 22 Jul 2016 18:38:20 +0100	[thread overview]
Message-ID: <20160722173820.GN927@citrix.com> (raw)
In-Reply-To: <1469207641-20662-1-git-send-email-boris.ostrovsky@oracle.com>

On Fri, Jul 22, 2016 at 01:14:01PM -0400, Boris Ostrovsky wrote:
> Current code incorrectly adds 1 to full register instead of
> incrementing the field in bits 15:12.
> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

I trust your expertise in this field. :-)

> ---
>  tools/libxc/xc_cpuid_x86.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
> index 84f4e08..fbbac9e 100644
> --- a/tools/libxc/xc_cpuid_x86.c
> +++ b/tools/libxc/xc_cpuid_x86.c
> @@ -331,7 +331,8 @@ static void amd_xc_cpuid_policy(xc_interface *xch,
>           * ECX[15:12] is ApicIdCoreSize: ECX[7:0] is NumberOfCores (minus one).
>           * Update to reflect vLAPIC_ID = vCPU_ID * 2.
>           */
> -        regs[2] = ((regs[2] & 0xf000u) + 1) | ((regs[2] & 0xffu) << 1) | 1u;
> +        regs[2] = ((regs[2] + (1u << 12)) & 0xf000u) |
> +                  ((regs[2] & 0xffu) << 1) | 1u;
>          break;
>  
>      case 0x8000000a: {
> -- 
> 1.8.3.1
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-07-22 17:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 17:14 [PATCH] tools/libxc: Properly increment ApicIdCoreSize field on AMD Boris Ostrovsky
2016-07-22 17:38 ` Wei Liu [this message]
2016-07-22 17:45   ` Boris Ostrovsky
2016-07-22 17:50     ` Wei Liu
2016-07-25 11:33       ` Ian Jackson
2016-07-25 13:22         ` Wei Liu
2016-07-26 10:00           ` Ian Jackson

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=20160722173820.GN927@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).