direct-io.hg

changeset 8664:ac04112c45b9

Callers of __gpfn_to_mfn() do not need to check
shadow-translate mode.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Jan 25 19:16:07 2006 +0100 (2006-01-25)
parents c9362a31ba5d
children 5b004f4e76cf
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Jan 25 19:09:28 2006 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Wed Jan 25 19:16:07 2006 +0100
     1.3 @@ -1826,8 +1826,7 @@ int do_mmuext_op(
     1.4              break;
     1.5  
     1.6          case MMUEXT_NEW_BASEPTR:
     1.7 -            if (shadow_mode_translate(current->domain))
     1.8 -                mfn = __gpfn_to_mfn(current->domain, mfn);
     1.9 +            mfn = __gpfn_to_mfn(current->domain, mfn);
    1.10              okay = new_guest_cr3(mfn);
    1.11              percpu_info[cpu].deferred_ops &= ~DOP_FLUSH_TLB;
    1.12              break;
    1.13 @@ -2679,10 +2678,9 @@ long set_gdt(struct vcpu *v,
    1.14  
    1.15  long do_set_gdt(unsigned long *frame_list, unsigned int entries)
    1.16  {
    1.17 -    int nr_pages = (entries + 511) / 512;
    1.18 +    int i, nr_pages = (entries + 511) / 512;
    1.19      unsigned long frames[16];
    1.20      long ret;
    1.21 -    int x;
    1.22  
    1.23      /* Rechecked in set_gdt, but ensures a sane limit for copy_from_user(). */
    1.24      if ( entries > FIRST_RESERVED_GDT_ENTRY )
    1.25 @@ -2691,10 +2689,8 @@ long do_set_gdt(unsigned long *frame_lis
    1.26      if ( copy_from_user(frames, frame_list, nr_pages * sizeof(unsigned long)) )
    1.27          return -EFAULT;
    1.28  
    1.29 -    if (shadow_mode_translate(current->domain)) {
    1.30 -        for (x = 0; x < nr_pages; x++)
    1.31 -            frames[x] = __gpfn_to_mfn(current->domain, frames[x]);
    1.32 -    }
    1.33 +    for ( i = 0; i < nr_pages; i++ )
    1.34 +        frames[i] = __gpfn_to_mfn(current->domain, frames[i]);
    1.35  
    1.36      LOCK_BIGLOCK(current->domain);
    1.37