Re: [Xen-devel] [PATCH v2] x86/hvm: Extend HVM cpuid leaf with vcpu id

2014-12-12 Thread Paul Durrant
> -Original Message-
> From: Matt Wilson [mailto:mswil...@gmail.com] On Behalf Of Matt Wilson
> Sent: 11 December 2014 23:17
> To: Paul Durrant
> Cc: xen-devel@lists.xen.org; Keir (Xen.org); Jan Beulich
> Subject: Re: [Xen-devel] [PATCH v2] x86/hvm: Extend HVM cpuid leaf with
> vcpu id
> 
> On Thu, Nov 06, 2014 at 03:26:24PM +, 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.
> 
> One more tangent on this, since this is partially considered in a
> Windows context. Why not use the existing Viridian virtual processor
> index MSR for this, since that would work on Xen today.
> 
> xen/arch/x86/hvm/viridian.c:
> > #define VIRIDIAN_MSR_VP_INDEX   0x4002
> > ...
> > case VIRIDIAN_MSR_VP_INDEX:
> >perfc_incr(mshv_rdmsr_vp_index);
> >*val = v->vcpu_id;
> >break;
> 

Yes, that would work for VMs where viridian is enabled, but there's no 
requirement that viridian is enabled to install PV drivers even in Windows. I 
guess ACPI is the only robust way to get vcpu id in an HVM guest in the absence 
of the new cpuid leaf.

  Paul

> --msw

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2] x86/hvm: Extend HVM cpuid leaf with vcpu id

2014-12-11 Thread Matt Wilson
On Thu, Nov 06, 2014 at 03:26:24PM +, 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.

One more tangent on this, since this is partially considered in a
Windows context. Why not use the existing Viridian virtual processor
index MSR for this, since that would work on Xen today.

xen/arch/x86/hvm/viridian.c:
> #define VIRIDIAN_MSR_VP_INDEX   0x4002
> ...
> case VIRIDIAN_MSR_VP_INDEX:
>perfc_incr(mshv_rdmsr_vp_index);
>*val = v->vcpu_id;
>break;

--msw

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel