>>> On 2/1/2008 at 2:36 AM, Tim Deegan <Tim.Deegan@xxxxxxxxxx> wrote:
> 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) &
> 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) ?
> MAPPING_EXCEPTION : MAPPING_UNHANDLEABLE);
> /* Cross-page writes mean probably not a pagetable */
> sh_remove_shadows(v, sh_ctxt->mfn2, 0, 0 /* Slow, can fail */ );
If I could chime in here, I'm all for better support of CR0.WP = 0 guests.
NetWare has traditionally run in this mode, and although we've recently made it
capable of running with WP bit set as part of the paravirtualization effort,
there would be benefit to running older versions as HVM guests. I haven't had
the cycles myself to work on that, but with all the other changes to real mode
support, it looks like we're really close to having NetWare run fully
virtualized. (Another gottcha is that we write the debug registers in real
mode, but that should be a fairly simple hypervisor fix.)
Thanks to everyone who has worked on getting HVM support more robust.
Xen-devel mailing list