All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Paul Durrant <Paul.Durrant@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "Keir (Xen.org)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH] x86/hvm: Extend HVM cpuid leaf with vcpu id
Date: Thu, 6 Nov 2014 15:20:53 +0000	[thread overview]
Message-ID: <545B91D5.8030608@citrix.com> (raw)
In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD0111465F1@AMSPEX01CL01.citrite.net>

On 06/11/14 15:16, Paul Durrant wrote:
>> -----Original Message-----
>> From: Andrew Cooper
>> Sent: 06 November 2014 15:14
>> To: Paul Durrant; xen-devel@lists.xen.org
>> Cc: Keir (Xen.org); Jan Beulich
>> Subject: Re: [Xen-devel] [PATCH] x86/hvm: Extend HVM cpuid leaf with vcpu
>> id
>>
>> On 06/11/14 15:07, Paul Durrant wrote:
>>> To perform certain hypercalls HVM guests need to use Xen's idea of
>>> vcpu id, which may well not match the guest OS idea of CPU id.
>>> This patch adds vcpu id to the HVM cpuid leaf allowing the guest
>>> to build a mapping.
>>>
>>> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
>>> Cc: Keir Fraser <keir@xen.org>
>>> Cc: Jan Beulich <jbeulich@suse.com>
>>> ---
>>>  xen/arch/x86/hvm/hvm.c              |    4 ++++
>>>  xen/include/public/arch-x86/cpuid.h |    5 +++--
>>>  2 files changed, 7 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
>>> index 78f519d..d9a5706 100644
>>> --- a/xen/arch/x86/hvm/hvm.c
>>> +++ b/xen/arch/x86/hvm/hvm.c
>>> @@ -4189,6 +4189,10 @@ void hvm_hypervisor_cpuid_leaf(uint32_t
>> sub_idx,
>>>           * foreign pages) has valid IOMMU entries.
>>>           */
>>>          *eax |= XEN_HVM_CPUID_IOMMU_MAPPINGS;
>>> +
>>> +        /* Indicate presence of vcpu id and set it in ebx */
>>> +        *eax |= XEN_HVM_CPUID_VCPU_ID_PRESENT;
>>> +        *ebx = current->vcpu_id;
>>>      }
>>>  }
>>>
>>> diff --git a/xen/include/public/arch-x86/cpuid.h b/xen/include/public/arch-
>> x86/cpuid.h
>>> index 6005dfe..8ccb6e1 100644
>>> --- a/xen/include/public/arch-x86/cpuid.h
>>> +++ b/xen/include/public/arch-x86/cpuid.h
>>> @@ -76,13 +76,14 @@
>>>  /*
>>>   * Leaf 5 (0x40000x04)
>>>   * HVM-specific features
>>> + * EAX: Features
>>> + * EBX: VCPU ID
>> Probably want "iff EAX & VCPU_ID_PRESENT" in this comment.
>>
> Yes, I guess.
>
>>>   */
>>> -
>>> -/* EAX Features */
>> Spurious delete?
>>
> Nope - it moved up into the above block.

Ah - I see now.  That looks ok.

With the other changes, Reviewed-by: Andrew Cooper
<andrew.cooper3@citrix.com>

~Andrew

  reply	other threads:[~2014-11-06 15:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 15:07 [PATCH] x86/hvm: Extend HVM cpuid leaf with vcpu id Paul Durrant
2014-11-06 15:14 ` Andrew Cooper
2014-11-06 15:16   ` Paul Durrant
2014-11-06 15:20     ` Andrew Cooper [this message]
2014-11-06 19:32 ` Konrad Rzeszutek Wilk
2014-11-06 21:27   ` Andrew Cooper
2014-12-10  6:00     ` Matt Wilson
2014-12-10 10:29       ` Jan Beulich
2014-12-11 18:07         ` Matt Wilson
2014-12-10 10:36       ` Andrew Cooper
2014-12-11 18:19         ` Matt Wilson
2014-12-11 19:00           ` Andrew Cooper
2014-12-11 20:27             ` Matt Wilson

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=545B91D5.8030608@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --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 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.