[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-3.2-testing] hvm: Better gating of hvm_get_segment_register() in __hvm_copy().
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |