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-changelog

[Xen-changelog] [xen-3.2-testing] hvm: Better gating of hvm_get_segment_

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.2-testing] hvm: Better gating of hvm_get_segment_register() in __hvm_copy().
From: "Xen patchbot-3.2-testing" <patchbot-3.2-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Feb 2008 07:12:14 -0800
Delivery-date: Fri, 22 Feb 2008 07:43:55 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1203370171 0
# Node ID f2704afb68504c54df3b865512bcd3cae283fce6
# Parent  9dfaec830ed21efab8b29c2d054c2057045ab4d9
hvm: Better gating of hvm_get_segment_register() in __hvm_copy().
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   17062:8848d9e075848a09f130dc205298a8ce55809ef5
xen-unstable date:        Mon Feb 18 21:26:57 2008 +0000
---
 xen/arch/x86/hvm/hvm.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diff -r 9dfaec830ed2 -r f2704afb6850 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Mon Feb 18 14:18:37 2008 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Mon Feb 18 21:29:31 2008 +0000
@@ -1279,20 +1279,18 @@ static enum hvm_copy_result __hvm_copy(
     int count, todo;
     uint32_t pfec = PFEC_page_present;
 
-    if ( virt )
-    {
-        /*
-         * We cannot use hvm_get_segment_register() while executing in
-         * vmx_realmode() as segment register state is cached. Furthermore,
-         * VMREADs on every data access hurts emulation performance.
-         */
-        if ( !curr->arch.hvm_vmx.vmxemul )
-        {
-            struct segment_register sreg;
-            hvm_get_segment_register(curr, x86_seg_ss, &sreg);
-            if ( sreg.attr.fields.dpl == 3 )
-                pfec |= PFEC_user_mode;
-        }
+    /*
+     * We cannot use hvm_get_segment_register() while executing in
+     * vmx_realmode() as segment register state is cached. Furthermore,
+     * VMREADs on every data access hurts emulation performance.
+     * Hence we do not gather extra PFEC flags if CR0.PG == 0.
+     */
+    if ( virt && (curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PG) )
+    {
+        struct segment_register sreg;
+        hvm_get_segment_register(curr, x86_seg_ss, &sreg);
+        if ( sreg.attr.fields.dpl == 3 )
+            pfec |= PFEC_user_mode;
 
         if ( dir ) 
             pfec |= PFEC_write_access;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.2-testing] hvm: Better gating of hvm_get_segment_register() in __hvm_copy()., Xen patchbot-3.2-testing <=