WARNING - OLD ARCHIVES

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

xen-changelog

[Xen-changelog] Merged.

# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 243265ade4045314ee4170436cc704afafda54cf
# Parent  7638cf95b63c97aeaa1b5f8a5860c363657f23e7
# Parent  82e48750542cf6709958319a72d2af3bff93b012
Merged.

diff -r 7638cf95b63c -r 243265ade404 
linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile        Mon Nov 28 
16:48:25 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile        Mon Nov 28 
17:22:02 2005
@@ -11,7 +11,7 @@
 
 obj-y  := process.o signal.o entry.o traps.o \
                time.o ioport.o ldt.o setup.o \
-               pci-dma.o i386_ksyms.o irq.o quirks.o
+               pci-dma.o i386_ksyms.o irq.o quirks.o fixup.o
 
 c-obj-y        := semaphore.o vm86.o \
                ptrace.o sys_i386.o \
diff -r 7638cf95b63c -r 243265ade404 
linux-2.6-xen-sparse/arch/xen/kernel/Makefile
--- a/linux-2.6-xen-sparse/arch/xen/kernel/Makefile     Mon Nov 28 16:48:25 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/Makefile     Mon Nov 28 17:22:02 2005
@@ -11,8 +11,8 @@
 
 extra-y += vmlinux.lds
 
-obj-y   := evtchn.o fixup.o reboot.o gnttab.o devmem.o
+obj-y   := evtchn.o reboot.o gnttab.o
 
 obj-$(CONFIG_PROC_FS) += xen_proc.o
 obj-$(CONFIG_NET)     += skbuff.o
-obj-$(CONFIG_SMP)     += smp.o smpboot.o
+obj-$(CONFIG_SMP)     += smpboot.o
diff -r 7638cf95b63c -r 243265ade404 
linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c    Mon Nov 28 16:48:25 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c    Mon Nov 28 17:22:02 2005
@@ -420,6 +420,12 @@
 {
 }
 
+int setup_profiling_timer(unsigned int multiplier)
+{
+       /* Dummy function. */
+       return 0;
+}
+
 /*
  * Local variables:
  *  c-file-style: "linux"
diff -r 7638cf95b63c -r 243265ade404 
linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile
--- a/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile        Mon Nov 28 
16:48:25 2005
+++ b/linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile        Mon Nov 28 
17:22:02 2005
@@ -20,6 +20,12 @@
 
 $(obj)/syscall32.o: $(src)/syscall32.c \
        $(foreach F,int80 sysenter syscall,$(obj)/vsyscall-$F.so)
+
+# syscall32.c currently contains inline asm which has .incbin directives.
+# This defeats ccache's signature checks, and also breaks distcc.
+# Make sure neither ccache nor distcc compiles this file.
+#
+$(obj)/syscall32.o: override CC := env CCACHE_DISABLE=1 DISTCC_HOSTS=localhost 
$(CC)
 
 # Teach kbuild about targets
 targets := $(foreach F,int80 sysenter syscall,vsyscall-$F.o vsyscall-$F.so)
diff -r 7638cf95b63c -r 243265ade404 linux-2.6-xen-sparse/drivers/xen/Makefile
--- a/linux-2.6-xen-sparse/drivers/xen/Makefile Mon Nov 28 16:48:25 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/Makefile Mon Nov 28 17:22:02 2005
@@ -2,6 +2,7 @@
 obj-y  += net_driver_util.o
 obj-y  += util.o
 
+obj-y  += char/
 obj-y  += console/
 obj-y  += evtchn/
 obj-y  += balloon/
diff -r 7638cf95b63c -r 243265ade404 tools/Rules.mk
--- a/tools/Rules.mk    Mon Nov 28 16:48:25 2005
+++ b/tools/Rules.mk    Mon Nov 28 17:22:02 2005
@@ -1,4 +1,7 @@
 #  -*- mode: Makefile; -*-
+
+# `all' is the default target
+all:
 
 include $(XEN_ROOT)/Config.mk
 
@@ -27,3 +30,13 @@
 
 %.o: %.cc
        $(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
+
+mk-symlinks: LINUX_ROOT=$(XEN_ROOT)/linux-2.6-xen-sparse
+mk-symlinks:
+       mkdir -p xen
+       ( cd xen && ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
+       mkdir -p xen/io
+       ( cd xen/io && ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
+       mkdir -p xen/linux
+       ( cd xen/linux && \
+         ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
diff -r 7638cf95b63c -r 243265ade404 tools/blktap/Makefile
--- a/tools/blktap/Makefile     Mon Nov 28 16:48:25 2005
+++ b/tools/blktap/Makefile     Mon Nov 28 17:22:02 2005
@@ -47,17 +47,6 @@
                $(MAKE) -C $$subdir $@;       \
        done
 
-LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
-mk-symlinks:
-       [ -e xen/linux ] || mkdir -p xen/linux
-       [ -e xen/io ]    || mkdir -p xen/io
-       ( cd xen >/dev/null ; \
-         ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
-       ( cd xen/io >/dev/null ; \
-          ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
-       ( cd xen/linux >/dev/null ; \
-         ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
-
 install: all
        $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
        $(INSTALL_DIR) -p $(DESTDIR)/usr/include
diff -r 7638cf95b63c -r 243265ade404 tools/libxc/Makefile
--- a/tools/libxc/Makefile      Mon Nov 28 16:48:25 2005
+++ b/tools/libxc/Makefile      Mon Nov 28 17:22:02 2005
@@ -83,17 +83,6 @@
        false; \
        fi
 
-LINUX_ROOT := $(XEN_ROOT)/linux-2.6-xen-sparse
-mk-symlinks:
-       [ -e xen/linux ] || mkdir -p xen/linux
-       [ -e xen/io ]    || mkdir -p xen/io
-       ( cd xen >/dev/null ; \
-         ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
-       ( cd xen/io >/dev/null ; \
-          ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
-       ( cd xen/linux >/dev/null ; \
-         ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
-
 install: build
        [ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) 
$(DESTDIR)/usr/$(LIBDIR)
        [ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
diff -r 7638cf95b63c -r 243265ade404 tools/security/Makefile
--- a/tools/security/Makefile   Mon Nov 28 16:48:25 2005
+++ b/tools/security/Makefile   Mon Nov 28 17:22:02 2005
@@ -69,14 +69,3 @@
 boot_install: $(POLICYFILE)
        @cp $(POLICYFILE) /boot
        @./updategrub.sh $(POLICY) $(PWD)/$(XEN_ROOT)
-
-LINUX_ROOT := $(XEN_ROOT)/linux-2.6-xen-sparse
-mk-symlinks:
-       [ -e xen/linux ] || mkdir -p xen/linux
-       [ -e xen/io ]    || mkdir -p xen/io
-       ( cd xen >/dev/null ; \
-         ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
-       ( cd xen/io >/dev/null ; \
-         ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
-       ( cd xen/linux >/dev/null ; \
-         ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
diff -r 7638cf95b63c -r 243265ade404 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Mon Nov 28 16:48:25 2005
+++ b/xen/arch/x86/domain.c     Mon Nov 28 17:22:02 2005
@@ -414,9 +414,6 @@
             d->arch.phys_table = v->arch.guest_table;
         v->arch.guest_table = mk_pagetable(0);
 
-        /* Initialize monitor page table */
-        v->arch.monitor_table = mk_pagetable(0);
-
         vmx_final_setup_guest(v);
     }
 
diff -r 7638cf95b63c -r 243265ade404 xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Mon Nov 28 16:48:25 2005
+++ b/xen/arch/x86/shadow.c     Mon Nov 28 17:22:02 2005
@@ -1075,8 +1075,8 @@
     entry->next = d->arch.out_of_sync;
     d->arch.out_of_sync = entry;
 
-    FSH_LOG("mark_out_of_sync(va=%lx -> writable_pl1e=%lx)",
-            va, entry->writable_pl1e);
+    FSH_LOG("%s(va=%lx -> writable_pl1e=%lx)",
+            __func__, va, entry->writable_pl1e);
 }
 
 /*
diff -r 7638cf95b63c -r 243265ade404 xen/arch/x86/shadow32.c
--- a/xen/arch/x86/shadow32.c   Mon Nov 28 16:48:25 2005
+++ b/xen/arch/x86/shadow32.c   Mon Nov 28 17:22:02 2005
@@ -796,8 +796,6 @@
         put_shadow_ref(mfn);
     }
 
-    unmap_domain_page(mpl2e);
-
     /*
      * Then free monitor_table.
      */
@@ -1411,7 +1409,7 @@
 }
 
 unsigned long
-gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
+get_mfn_from_pfn_foreign(struct domain *d, unsigned long gpfn)
 {
     unsigned long va, tabpfn;
     l1_pgentry_t *l1, l1e;
@@ -1419,7 +1417,7 @@
 
     ASSERT(shadow_mode_translate(d));
 
-    perfc_incrc(gpfn_to_mfn_foreign);
+    perfc_incrc(get_mfn_from_pfn_foreign);
 
     va = gpfn << PAGE_SHIFT;
     tabpfn = pagetable_get_pfn(d->arch.phys_table);
@@ -1428,8 +1426,8 @@
     unmap_domain_page(l2);
     if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
     {
-        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l2e=%" PRIpte 
"\n",
-               d->domain_id, gpfn, l2e_get_intpte(l2e));
+        printk("%s(d->id=%d, gpfn=%lx) => 0 l2e=%" PRIpte "\n",
+               __func__, d->domain_id, gpfn, l2e_get_intpte(l2e));
         return INVALID_MFN;
     }
     l1 = map_domain_page(l2e_get_pfn(l2e));
@@ -1437,14 +1435,14 @@
     unmap_domain_page(l1);
 
 #if 0
-    printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => %lx tabpfn=%lx l2e=%lx 
l1tab=%lx, l1e=%lx\n",
-           d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, tabpfn, l2e, 
l1tab, l1e);
+    printk("%s(d->id=%d, gpfn=%lx) => %lx tabpfn=%lx l2e=%lx l1tab=%lx, 
l1e=%lx\n",
+           __func__, d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, 
tabpfn, l2e, l1tab, l1e);
 #endif
 
     if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) )
     {
-        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l1e=%" PRIpte 
"\n",
-               d->domain_id, gpfn, l1e_get_intpte(l1e));
+        printk("%s(d->id=%d, gpfn=%lx) => 0 l1e=%" PRIpte "\n",
+               __func__, d->domain_id, gpfn, l1e_get_intpte(l1e));
         return INVALID_MFN;
     }
 
@@ -1933,8 +1931,8 @@
     entry->next = d->arch.out_of_sync;
     d->arch.out_of_sync = entry;
 
-    FSH_LOG("mark_out_of_sync(va=%lx -> writable_pl1e=%lx)",
-            va, entry->writable_pl1e);
+    FSH_LOG("%s(va=%lx -> writable_pl1e=%lx)",
+            __func__, va, entry->writable_pl1e);
 }
 
 /*
diff -r 7638cf95b63c -r 243265ade404 xen/arch/x86/shadow_public.c
--- a/xen/arch/x86/shadow_public.c      Mon Nov 28 16:48:25 2005
+++ b/xen/arch/x86/shadow_public.c      Mon Nov 28 17:22:02 2005
@@ -389,8 +389,6 @@
         ASSERT(mfn);
         put_shadow_ref(mfn);
     }
-
-    unmap_domain_page(mpl2e);
 
     /*
      * Then free monitor_table.
@@ -1593,7 +1591,7 @@
 }
 
 unsigned long
-gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
+get_mfn_from_pfn_foreign(struct domain *d, unsigned long gpfn)
 {
     unsigned long va, tabpfn;
     l1_pgentry_t *l1, l1e;
@@ -1601,7 +1599,7 @@
 
     ASSERT(shadow_mode_translate(d));
 
-    perfc_incrc(gpfn_to_mfn_foreign);
+    perfc_incrc(get_mfn_from_pfn_foreign);
 
     va = gpfn << PAGE_SHIFT;
     tabpfn = pagetable_get_pfn(d->arch.phys_table);
@@ -1610,8 +1608,8 @@
     unmap_domain_page(l2);
     if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) )
     {
-        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l2e=%" PRIpte 
"\n",
-               d->domain_id, gpfn, l2e_get_intpte(l2e));
+        printk("%s(d->id=%d, gpfn=%lx) => 0 l2e=%" PRIpte "\n",
+               __func__, d->domain_id, gpfn, l2e_get_intpte(l2e));
         return INVALID_MFN;
     }
     l1 = map_domain_page(l2e_get_pfn(l2e));
@@ -1619,14 +1617,14 @@
     unmap_domain_page(l1);
 
 #if 0
-    printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => %lx tabpfn=%lx l2e=%lx 
l1tab=%lx, l1e=%lx\n",
-           d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, tabpfn, l2e, 
l1tab, l1e);
+    printk("%s(d->id=%d, gpfn=%lx) => %lx tabpfn=%lx l2e=%lx l1tab=%lx, 
l1e=%lx\n",
+           __func__, d->domain_id, gpfn, l1_pgentry_val(l1e) >> PAGE_SHIFT, 
tabpfn, l2e, l1tab, l1e);
 #endif
 
     if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) )
     {
-        printk("gpfn_to_mfn_foreign(d->id=%d, gpfn=%lx) => 0 l1e=%" PRIpte 
"\n",
-               d->domain_id, gpfn, l1e_get_intpte(l1e));
+        printk("%s(d->id=%d, gpfn=%lx) => 0 l1e=%" PRIpte "\n",
+               __func__, d->domain_id, gpfn, l1e_get_intpte(l1e));
         return INVALID_MFN;
     }
 
diff -r 7638cf95b63c -r 243265ade404 xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c        Mon Nov 28 16:48:25 2005
+++ b/xen/arch/x86/vmx.c        Mon Nov 28 17:22:02 2005
@@ -61,23 +61,30 @@
 {
     v->arch.schedule_tail = arch_vmx_do_launch;
 
-    if ( v == v->domain->vcpu[0] )
+    if ( v->vcpu_id == 0 )
     {
-        v->domain->arch.vmx_platform.lapic_enable =
-            v->arch.guest_context.user_regs.ecx;
+        struct domain *d = v->domain;
+        struct vcpu *vc;
+
+        d->arch.vmx_platform.lapic_enable = 
v->arch.guest_context.user_regs.ecx;
         v->arch.guest_context.user_regs.ecx = 0;
         VMX_DBG_LOG(DBG_LEVEL_VLAPIC, "lapic enable is %d.\n",
-                    v->domain->arch.vmx_platform.lapic_enable);
+                    d->arch.vmx_platform.lapic_enable);
+
+        /* Initialize monitor page table */
+        for_each_vcpu(d, vc)
+            vc->arch.monitor_table = mk_pagetable(0);
+
         /*
          * Required to do this once per domain
          * XXX todo: add a seperate function to do these.
          */
-        memset(&v->domain->shared_info->evtchn_mask[0], 0xff,
-               sizeof(v->domain->shared_info->evtchn_mask));
+        memset(&d->shared_info->evtchn_mask[0], 0xff,
+               sizeof(d->shared_info->evtchn_mask));
 
         /* Put the domain in shadow mode even though we're going to be using
          * the shared 1:1 page table initially. It shouldn't hurt */
-        shadow_mode_enable(v->domain,
+        shadow_mode_enable(d,
                            SHM_enable|SHM_refcounts|
                            SHM_translate|SHM_external|SHM_wr_pt_pte);
     }
diff -r 7638cf95b63c -r 243265ade404 xen/common/domain.c
--- a/xen/common/domain.c       Mon Nov 28 16:48:25 2005
+++ b/xen/common/domain.c       Mon Nov 28 17:22:02 2005
@@ -376,14 +376,10 @@
 int boot_vcpu(struct domain *d, int vcpuid, struct vcpu_guest_context *ctxt) 
 {
     struct vcpu *v = d->vcpu[vcpuid];
-    int rc;
 
     BUG_ON(test_bit(_VCPUF_initialised, &v->vcpu_flags));
 
-    if ( (rc = arch_set_info_guest(v, ctxt)) != 0 )
-        return rc;
-
-    return rc;
+    return arch_set_info_guest(v, ctxt);
 }
 
 long do_vcpu_op(int cmd, int vcpuid, void *arg)
diff -r 7638cf95b63c -r 243265ade404 xen/common/grant_table.c
--- a/xen/common/grant_table.c  Mon Nov 28 16:48:25 2005
+++ b/xen/common/grant_table.c  Mon Nov 28 17:22:02 2005
@@ -234,7 +234,7 @@
 
         /* rmb(); */ /* not on x86 */
 
-        frame = __gpfn_to_mfn_foreign(rd, sha->frame);
+        frame = __gpfn_to_mfn(rd, sha->frame);
 
         if ( unlikely(!pfn_valid(frame)) ||
              unlikely(!((dev_hst_ro_flags & GNTMAP_readonly) ?
diff -r 7638cf95b63c -r 243265ade404 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h  Mon Nov 28 16:48:25 2005
+++ b/xen/include/asm-x86/cpufeature.h  Mon Nov 28 17:22:02 2005
@@ -94,7 +94,7 @@
 #define cpu_has(c, bit)                test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)      test_bit(bit, boot_cpu_data.x86_capability)
 
-#define cpu_has_fpu            boot_cpu_has(X86_FEATURE_FPU)
+#ifdef __i386__
 #define cpu_has_vme            boot_cpu_has(X86_FEATURE_VME)
 #define cpu_has_de             boot_cpu_has(X86_FEATURE_DE)
 #define cpu_has_pse            boot_cpu_has(X86_FEATURE_PSE)
@@ -102,7 +102,6 @@
 #define cpu_has_pae            boot_cpu_has(X86_FEATURE_PAE)
 #define cpu_has_pge            boot_cpu_has(X86_FEATURE_PGE)
 #define cpu_has_apic           boot_cpu_has(X86_FEATURE_APIC)
-#define cpu_has_sep            boot_cpu_has(X86_FEATURE_SEP)
 #define cpu_has_mtrr           boot_cpu_has(X86_FEATURE_MTRR)
 #define cpu_has_mmx            boot_cpu_has(X86_FEATURE_MMX)
 #define cpu_has_fxsr           boot_cpu_has(X86_FEATURE_FXSR)
@@ -115,10 +114,29 @@
 #define cpu_has_k6_mtrr                boot_cpu_has(X86_FEATURE_K6_MTRR)
 #define cpu_has_cyrix_arr      boot_cpu_has(X86_FEATURE_CYRIX_ARR)
 #define cpu_has_centaur_mcr    boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
-#define cpu_has_xstore         boot_cpu_has(X86_FEATURE_XSTORE)
-#define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN)
-#define cpu_has_xcrypt         boot_cpu_has(X86_FEATURE_XCRYPT)
-#define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN)
+#define cpu_has_clflush                boot_cpu_has(X86_FEATURE_CLFLSH)
+#else /* __x86_64__ */
+#define cpu_has_vme            0
+#define cpu_has_de             1
+#define cpu_has_pse            1
+#define cpu_has_tsc            1
+#define cpu_has_pae            1
+#define cpu_has_pge            1
+#define cpu_has_apic           boot_cpu_has(X86_FEATURE_APIC)
+#define cpu_has_mtrr           1
+#define cpu_has_mmx            1
+#define cpu_has_fxsr           1
+#define cpu_has_xmm            1
+#define cpu_has_xmm2           1
+#define cpu_has_xmm3           boot_cpu_has(X86_FEATURE_XMM3)
+#define cpu_has_ht             boot_cpu_has(X86_FEATURE_HT)
+#define cpu_has_mp             1
+#define cpu_has_nx             boot_cpu_has(X86_FEATURE_NX)
+#define cpu_has_k6_mtrr                0
+#define cpu_has_cyrix_arr      0
+#define cpu_has_centaur_mcr    0
+#define cpu_has_clflush                boot_cpu_has(X86_FEATURE_CLFLSH)
+#endif
 
 #endif /* __ASM_I386_CPUFEATURE_H */
 
diff -r 7638cf95b63c -r 243265ade404 xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h      Mon Nov 28 16:48:25 2005
+++ b/xen/include/asm-x86/shadow.h      Mon Nov 28 17:22:02 2005
@@ -283,26 +283,21 @@
 
 /************************************************************************/
 
-#define __mfn_to_gpfn(_d, mfn)                  \
-    ( (shadow_mode_translate(_d))               \
-      ? get_pfn_from_mfn(mfn)                   \
+#define __mfn_to_gpfn(_d, mfn)                         \
+    ( (shadow_mode_translate(_d))                      \
+      ? get_pfn_from_mfn(mfn)                          \
       : (mfn) )
 
-#define __gpfn_to_mfn(_d, gpfn)                 \
-    ({                                          \
-        (shadow_mode_translate(_d))             \
-        ? (((_d) == current->domain) ?          \
-           get_mfn_from_pfn(gpfn) :             \
-           gpfn_to_mfn_foreign((_d), (gpfn)))   \
-        : (gpfn);                               \
+#define __gpfn_to_mfn(_d, gpfn)                        \
+    ({                                                 \
+        unlikely(shadow_mode_translate(_d))            \
+        ? (likely(current->domain == (_d))             \
+           ? get_mfn_from_pfn(gpfn)                    \
+           : get_mfn_from_pfn_foreign(_d, gpfn))       \
+        : (gpfn);                                      \
     })
 
-#define __gpfn_to_mfn_foreign(_d, gpfn)         \
-    ( (shadow_mode_translate(_d))               \
-      ? gpfn_to_mfn_foreign(_d, gpfn)           \
-      : (gpfn) )
-
-extern unsigned long gpfn_to_mfn_foreign(
+extern unsigned long get_mfn_from_pfn_foreign(
     struct domain *d, unsigned long gpfn);
 
 /************************************************************************/
@@ -860,18 +855,7 @@
 
     if ( l2e_get_flags(gpde) & _PAGE_PRESENT )
     {
-        if ( unlikely((current->domain != d) && !shadow_mode_external(d)) )
-        {
-            // Can't use __gpfn_to_mfn() if we don't have one of this domain's
-            // page tables currently installed.
-            // This isn't common -- it only happens during shadow mode setup
-            // and mode changes.
-            //
-            mfn = gpfn_to_mfn_foreign(d, pfn);
-        }
-        else
-            mfn = __gpfn_to_mfn(d, pfn);
-
+        mfn = __gpfn_to_mfn(d, pfn);
         if ( VALID_MFN(mfn) && (mfn < max_page) )
             hl2e = l1e_from_pfn(mfn, __PAGE_HYPERVISOR);
     }
diff -r 7638cf95b63c -r 243265ade404 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h      Mon Nov 28 16:48:25 2005
+++ b/xen/include/xen/perfc_defn.h      Mon Nov 28 17:22:02 2005
@@ -114,7 +114,7 @@
 PERFCOUNTER_CPU(validate_hl2e_calls,    "calls to validate_hl2e_change")
 PERFCOUNTER_CPU(validate_hl2e_changes,  "validate_hl2e makes changes")
 PERFCOUNTER_CPU(exception_fixed,        "pre-exception fixed")
-PERFCOUNTER_CPU(gpfn_to_mfn_foreign,    "calls to gpfn_to_mfn_foreign")
+PERFCOUNTER_CPU(get_mfn_from_pfn_foreign, "calls to get_mfn_from_pfn_foreign")
 PERFCOUNTER_CPU(remove_all_access,      "calls to remove_all_access")
 PERFCOUNTER_CPU(remove_write_access,    "calls to remove_write_access")
 PERFCOUNTER_CPU(remove_write_access_easy, "easy outs of remove_write_access")
diff -r 7638cf95b63c -r 243265ade404 
linux-2.6-xen-sparse/arch/xen/i386/kernel/fixup.c
--- /dev/null   Mon Nov 28 16:48:25 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/fixup.c Mon Nov 28 17:22:02 2005
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * fixup.c
+ * 
+ * Binary-rewriting of certain IA32 instructions, on notification by Xen.
+ * Used to avoid repeated slow emulation of common instructions used by the
+ * user-space TLS (Thread-Local Storage) libraries.
+ * 
+ * **** NOTE ****
+ *  Issues with the binary rewriting have caused it to be removed. Instead
+ *  we rely on Xen's emulator to boot the kernel, and then print a banner
+ *  message recommending that the user disables /lib/tls.
+ * 
+ * Copyright (c) 2004, K A Fraser
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/version.h>
+
+#define DP(_f, _args...) printk(KERN_ALERT "  " _f "\n" , ## _args )
+
+fastcall void do_fixup_4gb_segment(struct pt_regs *regs, long error_code)
+{
+       static unsigned long printed = 0;
+       char info[100];
+       int i;
+
+       if (test_and_set_bit(0, &printed))
+               return;
+
+       HYPERVISOR_vm_assist(
+               VMASST_CMD_disable, VMASST_TYPE_4gb_segments_notify);
+
+       sprintf(info, "%s (pid=%d)", current->comm, current->tgid);
+
+
+       DP("");
+       DP("***************************************************************");
+       DP("***************************************************************");
+       DP("** WARNING: Currently emulating unsupported memory accesses  **");
+       DP("**          in /lib/tls libraries. The emulation is very     **");
+       DP("**          slow. To ensure full performance you should      **");
+       DP("**          execute the following as root:                   **");
+       DP("**          mv /lib/tls /lib/tls.disabled                    **");
+       DP("** Offending process: %-38.38s **", info);
+       DP("***************************************************************");
+       DP("***************************************************************");
+       DP("");
+
+       for (i = 5; i > 0; i--) {
+               printk("Pausing... %d", i);
+               mdelay(1000);
+               printk("\b\b\b\b\b\b\b\b\b\b\b\b");
+       }
+
+       printk("Continuing...\n\n");
+}
+
+static int __init fixup_init(void)
+{
+       HYPERVISOR_vm_assist(
+               VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify);
+       return 0;
+}
+__initcall(fixup_init);
+
+/*
+ * Local variables:
+ *  c-file-style: "linux"
+ *  indent-tabs-mode: t
+ *  c-indent-level: 8
+ *  c-basic-offset: 8
+ *  tab-width: 8
+ * End:
+ */
diff -r 7638cf95b63c -r 243265ade404 
linux-2.6-xen-sparse/drivers/xen/char/Makefile
--- /dev/null   Mon Nov 28 16:48:25 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/char/Makefile    Mon Nov 28 17:22:02 2005
@@ -0,0 +1,2 @@
+
+obj-y  := mem.o
diff -r 7638cf95b63c -r 243265ade404 linux-2.6-xen-sparse/drivers/xen/char/mem.c
--- /dev/null   Mon Nov 28 16:48:25 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/char/mem.c       Mon Nov 28 17:22:02 2005
@@ -0,0 +1,157 @@
+/*
+ *  Originally from linux/drivers/char/mem.c
+ *
+ *  Copyright (C) 1991, 1992  Linus Torvalds
+ *
+ *  Added devfs support. 
+ *    Jan-11-1998, C. Scott Ananian <cananian@xxxxxxxxxxxxxxxxxxxx>
+ *  Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar <kanoj@xxxxxxx>
+ */
+
+#include <linux/config.h>
+#include <linux/mm.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+#include <linux/mman.h>
+#include <linux/random.h>
+#include <linux/init.h>
+#include <linux/raw.h>
+#include <linux/tty.h>
+#include <linux/capability.h>
+#include <linux/smp_lock.h>
+#include <linux/devfs_fs_kernel.h>
+#include <linux/ptrace.h>
+#include <linux/device.h>
+#include <asm/pgalloc.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+#include <asm/hypervisor.h>
+
+static inline int uncached_access(struct file *file)
+{
+        if (file->f_flags & O_SYNC)
+                return 1;
+        /* Xen sets correct MTRR type on non-RAM for us. */
+        return 0;
+}
+
+/*
+ * This funcion reads the *physical* memory. The f_pos points directly to the 
+ * memory location. 
+ */
+static ssize_t read_mem(struct file * file, char __user * buf,
+                       size_t count, loff_t *ppos)
+{
+       unsigned long i, p = *ppos;
+       ssize_t read = -EFAULT;
+       void __iomem *v;
+
+       if ((v = ioremap(p, count)) == NULL) {
+               /*
+                * Some programs (e.g., dmidecode) groove off into weird RAM
+                * areas where no table scan possibly exist (because Xen will
+                * have stomped on them!). These programs get rather upset if
+                 * we let them know that Xen failed their access, so we fake
+                 * out a read of all zeroes. :-)
+                */
+               for (i = 0; i < count; i++)
+                       if (put_user(0, buf+i))
+                               return -EFAULT;
+               return count;
+       }
+       if (copy_to_user(buf, v, count))
+               goto out;
+
+       read = count;
+       *ppos += read;
+out:
+       iounmap(v);
+       return read;
+}
+
+static ssize_t write_mem(struct file * file, const char __user * buf, 
+                        size_t count, loff_t *ppos)
+{
+       unsigned long p = *ppos;
+       ssize_t written = -EFAULT;
+       void __iomem *v;
+
+       if ((v = ioremap(p, count)) == NULL)
+               return -EFAULT;
+       if (copy_from_user(v, buf, count))
+               goto out;
+
+       written = count;
+       *ppos += written;
+out:
+       iounmap(v);
+       return written;
+}
+
+static int mmap_mem(struct file * file, struct vm_area_struct * vma)
+{
+       if (uncached_access(file))
+               vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
+       if (direct_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
+                                  vma->vm_end - vma->vm_start,
+                                  vma->vm_page_prot, DOMID_IO))
+               return -EAGAIN;
+
+       return 0;
+}
+
+/*
+ * The memory devices use the full 32/64 bits of the offset, and so we cannot
+ * check against negative addresses: they are ok. The return value is weird,
+ * though, in that case (0).
+ *
+ * also note that seeking relative to the "end of file" isn't supported:
+ * it has no meaning, so it returns -EINVAL.
+ */
+static loff_t memory_lseek(struct file * file, loff_t offset, int orig)
+{
+       loff_t ret;
+
+       down(&file->f_dentry->d_inode->i_sem);
+       switch (orig) {
+               case 0:
+                       file->f_pos = offset;
+                       ret = file->f_pos;
+                       force_successful_syscall_return();
+                       break;
+               case 1:
+                       file->f_pos += offset;
+                       ret = file->f_pos;
+                       force_successful_syscall_return();
+                       break;
+               default:
+                       ret = -EINVAL;
+       }
+       up(&file->f_dentry->d_inode->i_sem);
+       return ret;
+}
+
+static int open_mem(struct inode * inode, struct file * filp)
+{
+       return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
+}
+
+struct file_operations mem_fops = {
+       .llseek         = memory_lseek,
+       .read           = read_mem,
+       .write          = write_mem,
+       .mmap           = mmap_mem,
+       .open           = open_mem,
+};
+
+/*
+ * Local variables:
+ *  c-file-style: "linux"
+ *  indent-tabs-mode: t
+ *  c-indent-level: 8
+ *  c-basic-offset: 8
+ *  tab-width: 8
+ * End:
+ */
diff -r 7638cf95b63c -r 243265ade404 
linux-2.6-xen-sparse/arch/xen/kernel/devmem.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c     Mon Nov 28 16:48:25 2005
+++ /dev/null   Mon Nov 28 17:22:02 2005
@@ -1,157 +0,0 @@
-/*
- *  Originally from linux/drivers/char/mem.c
- *
- *  Copyright (C) 1991, 1992  Linus Torvalds
- *
- *  Added devfs support. 
- *    Jan-11-1998, C. Scott Ananian <cananian@xxxxxxxxxxxxxxxxxxxx>
- *  Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar <kanoj@xxxxxxx>
- */
-
-#include <linux/config.h>
-#include <linux/mm.h>
-#include <linux/miscdevice.h>
-#include <linux/slab.h>
-#include <linux/vmalloc.h>
-#include <linux/mman.h>
-#include <linux/random.h>
-#include <linux/init.h>
-#include <linux/raw.h>
-#include <linux/tty.h>
-#include <linux/capability.h>
-#include <linux/smp_lock.h>
-#include <linux/devfs_fs_kernel.h>
-#include <linux/ptrace.h>
-#include <linux/device.h>
-#include <asm/pgalloc.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/hypervisor.h>
-
-static inline int uncached_access(struct file *file)
-{
-        if (file->f_flags & O_SYNC)
-                return 1;
-        /* Xen sets correct MTRR type on non-RAM for us. */
-        return 0;
-}
-
-/*
- * This funcion reads the *physical* memory. The f_pos points directly to the 
- * memory location. 
- */
-static ssize_t read_mem(struct file * file, char __user * buf,
-                       size_t count, loff_t *ppos)
-{
-       unsigned long i, p = *ppos;
-       ssize_t read = -EFAULT;
-       void __iomem *v;
-
-       if ((v = ioremap(p, count)) == NULL) {
-               /*
-                * Some programs (e.g., dmidecode) groove off into weird RAM
-                * areas where no table scan possibly exist (because Xen will
-                * have stomped on them!). These programs get rather upset if
-                 * we let them know that Xen failed their access, so we fake
-                 * out a read of all zeroes. :-)
-                */
-               for (i = 0; i < count; i++)
-                       if (put_user(0, buf+i))
-                               return -EFAULT;
-               return count;
-       }
-       if (copy_to_user(buf, v, count))
-               goto out;
-
-       read = count;
-       *ppos += read;
-out:
-       iounmap(v);
-       return read;
-}
-
-static ssize_t write_mem(struct file * file, const char __user * buf, 
-                        size_t count, loff_t *ppos)
-{
-       unsigned long p = *ppos;
-       ssize_t written = -EFAULT;
-       void __iomem *v;
-
-       if ((v = ioremap(p, count)) == NULL)
-               return -EFAULT;
-       if (copy_from_user(v, buf, count))
-               goto out;
-
-       written = count;
-       *ppos += written;
-out:
-       iounmap(v);
-       return written;
-}
-
-static int mmap_mem(struct file * file, struct vm_area_struct * vma)
-{
-       if (uncached_access(file))
-               vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-
-       if (direct_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
-                                  vma->vm_end - vma->vm_start,
-                                  vma->vm_page_prot, DOMID_IO))
-               return -EAGAIN;
-
-       return 0;
-}
-
-/*
- * The memory devices use the full 32/64 bits of the offset, and so we cannot
- * check against negative addresses: they are ok. The return value is weird,
- * though, in that case (0).
- *
- * also note that seeking relative to the "end of file" isn't supported:
- * it has no meaning, so it returns -EINVAL.
- */
-static loff_t memory_lseek(struct file * file, loff_t offset, int orig)
-{
-       loff_t ret;
-
-       down(&file->f_dentry->d_inode->i_sem);
-       switch (orig) {
-               case 0:
-                       file->f_pos = offset;
-                       ret = file->f_pos;
-                       force_successful_syscall_return();
-                       break;
-               case 1:
-                       file->f_pos += offset;
-                       ret = file->f_pos;
-                       force_successful_syscall_return();
-                       break;
-               default:
-                       ret = -EINVAL;
-       }
-       up(&file->f_dentry->d_inode->i_sem);
-       return ret;
-}
-
-static int open_mem(struct inode * inode, struct file * filp)
-{
-       return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
-}
-
-struct file_operations mem_fops = {
-       .llseek         = memory_lseek,
-       .read           = read_mem,
-       .write          = write_mem,
-       .mmap           = mmap_mem,
-       .open           = open_mem,
-};
-
-/*
- * Local variables:
- *  c-file-style: "linux"
- *  indent-tabs-mode: t
- *  c-indent-level: 8
- *  c-basic-offset: 8
- *  tab-width: 8
- * End:
- */
diff -r 7638cf95b63c -r 243265ade404 
linux-2.6-xen-sparse/arch/xen/kernel/fixup.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/fixup.c      Mon Nov 28 16:48:25 2005
+++ /dev/null   Mon Nov 28 17:22:02 2005
@@ -1,93 +0,0 @@
-/******************************************************************************
- * fixup.c
- * 
- * Binary-rewriting of certain IA32 instructions, on notification by Xen.
- * Used to avoid repeated slow emulation of common instructions used by the
- * user-space TLS (Thread-Local Storage) libraries.
- * 
- * **** NOTE ****
- *  Issues with the binary rewriting have caused it to be removed. Instead
- *  we rely on Xen's emulator to boot the kernel, and then print a banner
- *  message recommending that the user disables /lib/tls.
- * 
- * Copyright (c) 2004, K A Fraser
- * 
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/version.h>
-
-#define DP(_f, _args...) printk(KERN_ALERT "  " _f "\n" , ## _args )
-
-fastcall void do_fixup_4gb_segment(struct pt_regs *regs, long error_code)
-{
-       static unsigned long printed = 0;
-       char info[100];
-       int i;
-
-       if (test_and_set_bit(0, &printed))
-               return;
-
-       HYPERVISOR_vm_assist(
-               VMASST_CMD_disable, VMASST_TYPE_4gb_segments_notify);
-
-       sprintf(info, "%s (pid=%d)", current->comm, current->tgid);
-
-
-       DP("");
-       DP("***************************************************************");
-       DP("***************************************************************");
-       DP("** WARNING: Currently emulating unsupported memory accesses  **");
-       DP("**          in /lib/tls libraries. The emulation is very     **");
-       DP("**          slow. To ensure full performance you should      **");
-       DP("**          execute the following as root:                   **");
-       DP("**          mv /lib/tls /lib/tls.disabled                    **");
-       DP("** Offending process: %-38.38s **", info);
-       DP("***************************************************************");
-       DP("***************************************************************");
-       DP("");
-
-       for (i = 5; i > 0; i--) {
-               printk("Pausing... %d", i);
-               mdelay(1000);
-               printk("\b\b\b\b\b\b\b\b\b\b\b\b");
-       }
-
-       printk("Continuing...\n\n");
-}
-
-static int __init fixup_init(void)
-{
-       HYPERVISOR_vm_assist(
-               VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify);
-       return 0;
-}
-__initcall(fixup_init);
-
-/*
- * Local variables:
- *  c-file-style: "linux"
- *  indent-tabs-mode: t
- *  c-indent-level: 8
- *  c-basic-offset: 8
- *  tab-width: 8
- * End:
- */
diff -r 7638cf95b63c -r 243265ade404 linux-2.6-xen-sparse/arch/xen/kernel/smp.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/smp.c        Mon Nov 28 16:48:25 2005
+++ /dev/null   Mon Nov 28 17:22:02 2005
@@ -1,25 +0,0 @@
-/* Copyright (C) 2004, Christian Limpach */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/threads.h>
-
-/*
- * the frequency of the profiling timer can be changed
- * by writing a multiplier value into /proc/profile.
- */
-int setup_profiling_timer(unsigned int multiplier)
-{
-       printk("setup_profiling_timer\n");
-       return 0;
-}
-
-/*
- * Local variables:
- *  c-file-style: "linux"
- *  indent-tabs-mode: t
- *  c-indent-level: 8
- *  c-basic-offset: 8
- *  tab-width: 8
- * End:
- */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

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