ia64/xen-unstable

changeset 8098:b3f8d3158a1c

merge
author Michael.Fetterman@cl.cam.ac.uk
date Mon Nov 28 15:30:48 2005 +0100 (2005-11-28)
parents 367b9ca30e88 7363637e2721
children 66e16c4685f5
files xen/arch/x86/shadow.c xen/arch/x86/shadow32.c xen/arch/x86/shadow_public.c xen/common/grant_table.c xen/include/asm-x86/shadow.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile	Mon Nov 28 14:08:53 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile	Mon Nov 28 15:30:48 2005 +0100
     1.3 @@ -21,6 +21,12 @@ c-obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
     1.4  $(obj)/syscall32.o: $(src)/syscall32.c \
     1.5  	$(foreach F,int80 sysenter syscall,$(obj)/vsyscall-$F.so)
     1.6  
     1.7 +# syscall32.c currently contains inline asm which has .incbin directives.
     1.8 +# This defeats ccache's signature checks, and also breaks distcc.
     1.9 +# Make sure neither ccache nor distcc compiles this file.
    1.10 +#
    1.11 +$(obj)/syscall32.o: override CC := env CCACHE_DISABLE=1 DISTCC_HOSTS=localhost $(CC)
    1.12 +
    1.13  # Teach kbuild about targets
    1.14  targets := $(foreach F,int80 sysenter syscall,vsyscall-$F.o vsyscall-$F.so)
    1.15  
     3.1 --- a/xen/arch/x86/shadow.c	Mon Nov 28 14:08:53 2005 +0100
     3.2 +++ b/xen/arch/x86/shadow.c	Mon Nov 28 15:30:48 2005 +0100
     3.3 @@ -1075,8 +1075,8 @@ static void shadow_mark_va_out_of_sync(
     3.4      entry->next = d->arch.out_of_sync;
     3.5      d->arch.out_of_sync = entry;
     3.6  
     3.7 -    FSH_LOG("mark_out_of_sync(va=%lx -> writable_pl1e=%lx)",
     3.8 -            va, entry->writable_pl1e);
     3.9 +    FSH_LOG("%s(va=%lx -> writable_pl1e=%lx)",
    3.10 +            __func__, va, entry->writable_pl1e);
    3.11  }
    3.12  
    3.13  /*
     4.1 --- a/xen/arch/x86/shadow32.c	Mon Nov 28 14:08:53 2005 +0100
     4.2 +++ b/xen/arch/x86/shadow32.c	Mon Nov 28 15:30:48 2005 +0100
     4.3 @@ -1411,7 +1411,7 @@ int shadow_mode_control(struct domain *d
     4.4  }
     4.5  
     4.6  unsigned long
     4.7 -gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
     4.8 +get_mfn_from_pfn_foreign(struct domain *d, unsigned long gpfn)
     4.9  {
    4.10      unsigned long va, tabpfn;
    4.11      l1_pgentry_t *l1, l1e;
    4.12 @@ -1419,7 +1419,7 @@ gpfn_to_mfn_foreign(struct domain *d, un
    4.13  
    4.14      ASSERT(shadow_mode_translate(d));
    4.15  
    4.16 -    perfc_incrc(gpfn_to_mfn_foreign);
    4.17 +    perfc_incrc(get_mfn_from_pfn_foreign);
    4.18  
    4.19      va = gpfn << PAGE_SHIFT;
    4.20      tabpfn = pagetable_get_pfn(d->arch.phys_table);
    4.21 @@ -1428,8 +1428,8 @@ gpfn_to_mfn_foreign(struct domain *d, un
    4.22      unmap_domain_page(l2);
    4.23      if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
    4.24      {
    4.25 -        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l2e=%" PRIpte "\n",
    4.26 -               d->domain_id, gpfn, l2e_get_intpte(l2e));
    4.27 +        printk("%s(d->id=%d, gpfn=%lx) => 0 l2e=%" PRIpte "\n",
    4.28 +               __func__, d->domain_id, gpfn, l2e_get_intpte(l2e));
    4.29          return INVALID_MFN;
    4.30      }
    4.31      l1 = map_domain_page(l2e_get_pfn(l2e));
    4.32 @@ -1437,14 +1437,14 @@ gpfn_to_mfn_foreign(struct domain *d, un
    4.33      unmap_domain_page(l1);
    4.34  
    4.35  #if 0
    4.36 -    printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => %lx tabpfn=%lx l2e=%lx l1tab=%lx, l1e=%lx\n",
    4.37 -           d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, tabpfn, l2e, l1tab, l1e);
    4.38 +    printk("%s(d->id=%d, gpfn=%lx) => %lx tabpfn=%lx l2e=%lx l1tab=%lx, l1e=%lx\n",
    4.39 +           __func__, d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, tabpfn, l2e, l1tab, l1e);
    4.40  #endif
    4.41  
    4.42      if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) )
    4.43      {
    4.44 -        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l1e=%" PRIpte "\n",
    4.45 -               d->domain_id, gpfn, l1e_get_intpte(l1e));
    4.46 +        printk("%s(d->id=%d, gpfn=%lx) => 0 l1e=%" PRIpte "\n",
    4.47 +               __func__, d->domain_id, gpfn, l1e_get_intpte(l1e));
    4.48          return INVALID_MFN;
    4.49      }
    4.50  
    4.51 @@ -1933,8 +1933,8 @@ void shadow_mark_va_out_of_sync(
    4.52      entry->next = d->arch.out_of_sync;
    4.53      d->arch.out_of_sync = entry;
    4.54  
    4.55 -    FSH_LOG("mark_out_of_sync(va=%lx -> writable_pl1e=%lx)",
    4.56 -            va, entry->writable_pl1e);
    4.57 +    FSH_LOG("%s(va=%lx -> writable_pl1e=%lx)",
    4.58 +            __func__, va, entry->writable_pl1e);
    4.59  }
    4.60  
    4.61  /*
     5.1 --- a/xen/arch/x86/shadow_public.c	Mon Nov 28 14:08:53 2005 +0100
     5.2 +++ b/xen/arch/x86/shadow_public.c	Mon Nov 28 15:30:48 2005 +0100
     5.3 @@ -1593,7 +1593,7 @@ remove_shadow(struct domain *d, unsigned
     5.4  }
     5.5  
     5.6  unsigned long
     5.7 -gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
     5.8 +get_mfn_from_pfn_foreign(struct domain *d, unsigned long gpfn)
     5.9  {
    5.10      unsigned long va, tabpfn;
    5.11      l1_pgentry_t *l1, l1e;
    5.12 @@ -1601,7 +1601,7 @@ gpfn_to_mfn_foreign(struct domain *d, un
    5.13  
    5.14      ASSERT(shadow_mode_translate(d));
    5.15  
    5.16 -    perfc_incrc(gpfn_to_mfn_foreign);
    5.17 +    perfc_incrc(get_mfn_from_pfn_foreign);
    5.18  
    5.19      va = gpfn << PAGE_SHIFT;
    5.20      tabpfn = pagetable_get_pfn(d->arch.phys_table);
    5.21 @@ -1610,8 +1610,8 @@ gpfn_to_mfn_foreign(struct domain *d, un
    5.22      unmap_domain_page(l2);
    5.23      if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
    5.24      {
    5.25 -        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l2e=%" PRIpte "\n",
    5.26 -               d->domain_id, gpfn, l2e_get_intpte(l2e));
    5.27 +        printk("%s(d->id=%d, gpfn=%lx) => 0 l2e=%" PRIpte "\n",
    5.28 +               __func__, d->domain_id, gpfn, l2e_get_intpte(l2e));
    5.29          return INVALID_MFN;
    5.30      }
    5.31      l1 = map_domain_page(l2e_get_pfn(l2e));
    5.32 @@ -1619,14 +1619,14 @@ gpfn_to_mfn_foreign(struct domain *d, un
    5.33      unmap_domain_page(l1);
    5.34  
    5.35  #if 0
    5.36 -    printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => %lx tabpfn=%lx l2e=%lx l1tab=%lx, l1e=%lx\n",
    5.37 -           d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, tabpfn, l2e, l1tab, l1e);
    5.38 +    printk("%s(d->id=%d, gpfn=%lx) => %lx tabpfn=%lx l2e=%lx l1tab=%lx, l1e=%lx\n",
    5.39 +           __func__, d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, tabpfn, l2e, l1tab, l1e);
    5.40  #endif
    5.41  
    5.42      if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) )
    5.43      {
    5.44 -        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l1e=%" PRIpte "\n",
    5.45 -               d->domain_id, gpfn, l1e_get_intpte(l1e));
    5.46 +        printk("%s(d->id=%d, gpfn=%lx) => 0 l1e=%" PRIpte "\n",
    5.47 +               __func__, d->domain_id, gpfn, l1e_get_intpte(l1e));
    5.48          return INVALID_MFN;
    5.49      }
    5.50  
     6.1 --- a/xen/common/grant_table.c	Mon Nov 28 14:08:53 2005 +0100
     6.2 +++ b/xen/common/grant_table.c	Mon Nov 28 15:30:48 2005 +0100
     6.3 @@ -234,7 +234,7 @@ static int
     6.4  
     6.5          /* rmb(); */ /* not on x86 */
     6.6  
     6.7 -        frame = __gpfn_to_mfn_foreign(rd, sha->frame);
     6.8 +        frame = __gpfn_to_mfn(rd, sha->frame);
     6.9  
    6.10          if ( unlikely(!pfn_valid(frame)) ||
    6.11               unlikely(!((dev_hst_ro_flags & GNTMAP_readonly) ?
     7.1 --- a/xen/include/asm-x86/shadow.h	Mon Nov 28 14:08:53 2005 +0100
     7.2 +++ b/xen/include/asm-x86/shadow.h	Mon Nov 28 15:30:48 2005 +0100
     7.3 @@ -283,26 +283,21 @@ static inline void shadow_mode_disable(s
     7.4  
     7.5  /************************************************************************/
     7.6  
     7.7 -#define __mfn_to_gpfn(_d, mfn)                  \
     7.8 -    ( (shadow_mode_translate(_d))               \
     7.9 -      ? get_pfn_from_mfn(mfn)                   \
    7.10 +#define __mfn_to_gpfn(_d, mfn)                         \
    7.11 +    ( (shadow_mode_translate(_d))                      \
    7.12 +      ? get_pfn_from_mfn(mfn)                          \
    7.13        : (mfn) )
    7.14  
    7.15 -#define __gpfn_to_mfn(_d, gpfn)                 \
    7.16 -    ({                                          \
    7.17 -        (shadow_mode_translate(_d))             \
    7.18 -        ? (((_d) == current->domain) ?          \
    7.19 -           get_mfn_from_pfn(gpfn) :             \
    7.20 -           gpfn_to_mfn_foreign((_d), (gpfn)))   \
    7.21 -        : (gpfn);                               \
    7.22 +#define __gpfn_to_mfn(_d, gpfn)                        \
    7.23 +    ({                                                 \
    7.24 +        unlikely(shadow_mode_translate(_d))            \
    7.25 +        ? (likely(current->domain == (_d))             \
    7.26 +           ? get_mfn_from_pfn(gpfn)                    \
    7.27 +           : get_mfn_from_pfn_foreign(_d, gpfn))       \
    7.28 +        : (gpfn);                                      \
    7.29      })
    7.30  
    7.31 -#define __gpfn_to_mfn_foreign(_d, gpfn)         \
    7.32 -    ( (shadow_mode_translate(_d))               \
    7.33 -      ? gpfn_to_mfn_foreign(_d, gpfn)           \
    7.34 -      : (gpfn) )
    7.35 -
    7.36 -extern unsigned long gpfn_to_mfn_foreign(
    7.37 +extern unsigned long get_mfn_from_pfn_foreign(
    7.38      struct domain *d, unsigned long gpfn);
    7.39  
    7.40  /************************************************************************/
    7.41 @@ -860,18 +855,7 @@ static inline void hl2e_propagate_from_g
    7.42  
    7.43      if ( l2e_get_flags(gpde) & _PAGE_PRESENT )
    7.44      {
    7.45 -        if ( unlikely((current->domain != d) && !shadow_mode_external(d)) )
    7.46 -        {
    7.47 -            // Can't use __gpfn_to_mfn() if we don't have one of this domain's
    7.48 -            // page tables currently installed.
    7.49 -            // This isn't common -- it only happens during shadow mode setup
    7.50 -            // and mode changes.
    7.51 -            //
    7.52 -            mfn = gpfn_to_mfn_foreign(d, pfn);
    7.53 -        }
    7.54 -        else
    7.55 -            mfn = __gpfn_to_mfn(d, pfn);
    7.56 -
    7.57 +        mfn = __gpfn_to_mfn(d, pfn);
    7.58          if ( VALID_MFN(mfn) && (mfn < max_page) )
    7.59              hl2e = l1e_from_pfn(mfn, __PAGE_HYPERVISOR);
    7.60      }
     8.1 --- a/xen/include/xen/perfc_defn.h	Mon Nov 28 14:08:53 2005 +0100
     8.2 +++ b/xen/include/xen/perfc_defn.h	Mon Nov 28 15:30:48 2005 +0100
     8.3 @@ -114,7 +114,7 @@ PERFCOUNTER_CPU(shadow_get_page_fail,   
     8.4  PERFCOUNTER_CPU(validate_hl2e_calls,    "calls to validate_hl2e_change")
     8.5  PERFCOUNTER_CPU(validate_hl2e_changes,  "validate_hl2e makes changes")
     8.6  PERFCOUNTER_CPU(exception_fixed,        "pre-exception fixed")
     8.7 -PERFCOUNTER_CPU(gpfn_to_mfn_foreign,    "calls to gpfn_to_mfn_foreign")
     8.8 +PERFCOUNTER_CPU(get_mfn_from_pfn_foreign, "calls to get_mfn_from_pfn_foreign")
     8.9  PERFCOUNTER_CPU(remove_all_access,      "calls to remove_all_access")
    8.10  PERFCOUNTER_CPU(remove_write_access,    "calls to remove_write_access")
    8.11  PERFCOUNTER_CPU(remove_write_access_easy, "easy outs of remove_write_access")