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/
Home Products Support Community News


Re: [Xen-devel] [PATCH 3/4] Enable VirtualPC 2007 run on top of XEN: REP

To: "Su, Disheng" <disheng.su@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3/4] Enable VirtualPC 2007 run on top of XEN: REPS prefix emulation
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Fri, 1 Feb 2008 09:36:59 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 01 Feb 2008 01:39:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <FF386CB4AE0E4648B0A96060EC00F36C759650@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <FF386CB4AE0E4648B0A96060EC00F36C759650@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)

At 14:24 +0800 on 01 Feb (1201875864), Su, Disheng wrote:
> REPS prefix emulation for INS and OUTS is already in xen. Can we enable
> REPS for "stos" and "movs" in paging mode? Although it doesn't benefit a
> lot for normal hvm guest, in virtualpc case, I have to do that.
> VirtualPC will call "reps stos"(ecx=0x400, eax=0) a lot, about 1000
> times per second. It seems to clear a L1 page table page, it can't be
> fast unshadowed in check_for_early_unshadow and it's even ReadOnly in
> guest page table(CR0.wp = 0). So we get 0x400 * 1000 times page faults
> per second, so CPU cycle is almost wasted on it.

This patch looks fine to me; I'll let Keir decide whether the extra 200
lines or so of shadow/emulate code is worthwhile for running VPC under Xen. 

Keir, even if we don't take this, please do take this hunk:

diff -r 05b3bdb3b7fa xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c    Wed Jan 30 00:09:03 2008 +0800
+++ b/xen/arch/x86/mm/shadow/multi.c    Wed Jan 30 00:09:04 2008 +0800
@@ -4076,8 +4091,8 @@ static void *emulate_map_dest(struct vcp
         sh_ctxt->mfn2 = emulate_gva_to_mfn(v, (vaddr + bytes - 1) & PAGE_MASK,
         if ( !mfn_valid(sh_ctxt->mfn2) ) 
-            return ((mfn_x(sh_ctxt->mfn1) == BAD_GVA_TO_GFN) ?
+            return ((mfn_x(sh_ctxt->mfn2) == BAD_GVA_TO_GFN) ?
         /* Cross-page writes mean probably not a pagetable */
         sh_remove_shadows(v, sh_ctxt->mfn2, 0, 0 /* Slow, can fail */ );



Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

Xen-devel mailing list

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