WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH][RFC] FPU LWP 4/5: enable LWP for SVM guest

To: "Wei Huang" <wei.huang2@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH][RFC] FPU LWP 4/5: enable LWP for SVM guest
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 15 Apr 2011 10:17:30 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 15 Apr 2011 02:16:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DA75B64.30709@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4DA75B64.30709@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> On 14.04.11 at 22:39, Wei Huang <wei.huang2@xxxxxxx> wrote:
>+static void svm_lwp_save(struct vcpu *v)
>+{
>+    if ( cpu_has_lwp )
>+    {
>+        rdmsrl(MSR_AMD64_LWP_CFG, v->arch.hvm_svm.guest_lwp_cfg);
>+        wrmsrl(MSR_AMD64_LWP_CFG, 0x0);
>+        /* Disable LWP for next VCPU */
>+        wrmsrl(MSR_AMD64_LWP_CBADDR, 0x0);
>+    }
>+}
>+
>+static void svm_lwp_load(struct vcpu *v)
>+{
>+    if ( cpu_has_lwp ) 
>+    {
>+        /* Only LWP_CFG is reloaded. LWP_CBADDR will be reloaded via xrstor */
>+        wrmsrl(MSR_AMD64_LWP_CFG, v->arch.hvm_svm.guest_lwp_cfg);
>+    }
>+}

I think I had pointed this out before - to avoid these MSR accesses
for guests not using LWP, you should track whether the vCPU has
LWP support enabled (e.g. non-zero written into LWP_CFG) and
key off of that instead of cpu_has_lwp.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>