[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] merge?



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID d4d69c509371fc2019156cb1bf76a62c89d44bb6
# Parent  d6d77aa96aa1465d287069e809b489a569a9b3fb
# Parent  8f21344e78171fde10c9f93f824e81b46868bf94
merge?

diff -r d6d77aa96aa1 -r d4d69c509371 
linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c     Tue Sep  6 16:59:14 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c     Tue Sep  6 17:00:25 2005
@@ -588,7 +588,15 @@
                pmd_k = pmd_offset(pud_k, address);
                if (!pmd_present(*pmd_k))
                        goto no_context;
+#ifndef CONFIG_XEN
                set_pmd(pmd, *pmd_k);
+#else
+               /*
+                * When running on Xen we must launder *pmd_k through
+                * pmd_val() to ensure that _PAGE_PRESENT is correctly set.
+                */
+               set_pmd(pmd, __pmd(pmd_val(*pmd_k)));
+#endif
 
                pte_k = pte_offset_kernel(pmd_k, address);
                if (!pte_present(*pte_k))
diff -r d6d77aa96aa1 -r d4d69c509371 tools/xenstore/Makefile
--- a/tools/xenstore/Makefile   Tue Sep  6 16:59:14 2005
+++ b/tools/xenstore/Makefile   Tue Sep  6 17:00:25 2005
@@ -12,7 +12,7 @@
 # Make gcc generate dependencies.
 BASECFLAGS += -Wp,-MD,.$(@F).d
 PROG_DEP = .*.d
-#BASECFLAGS+= -O3 $(PROFILE)
+BASECFLAGS+= -O3 $(PROFILE)
 #BASECFLAGS+= -I$(XEN_ROOT)/tools
 BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
 BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
diff -r d6d77aa96aa1 -r d4d69c509371 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Tue Sep  6 16:59:14 2005
+++ b/tools/xenstore/xenstored_core.c   Tue Sep  6 17:00:25 2005
@@ -1310,8 +1310,12 @@
 
 static void consider_message(struct connection *conn)
 {
-       struct buffered_data *in = NULL;
-       enum xsd_sockmsg_type type = conn->in->hdr.msg.type;
+       /*
+        * 'volatile' qualifier prevents register allocation which fixes:
+        *   warning: variable 'xxx' might be clobbered by 'longjmp' or 'vfork'
+        */
+       struct buffered_data *volatile in = NULL;
+       enum xsd_sockmsg_type volatile type = conn->in->hdr.msg.type;
        jmp_buf talloc_fail;
 
        assert(conn->state == OK);
@@ -1449,7 +1453,11 @@
 
 struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
 {
-       struct connection *new;
+       /*
+        * 'volatile' qualifier prevents register allocation which fixes:
+        *   warning: variable 'xxx' might be clobbered by 'longjmp' or 'vfork'
+        */
+       struct connection *volatile new;
        jmp_buf talloc_fail;
 
        new = talloc(talloc_autofree_context(), struct connection);
diff -r d6d77aa96aa1 -r d4d69c509371 tools/xenstore/xs.c
--- a/tools/xenstore/xs.c       Tue Sep  6 16:59:14 2005
+++ b/tools/xenstore/xs.c       Tue Sep  6 17:00:25 2005
@@ -628,7 +628,8 @@
        if (ret) {
                char c;
                /* Wait for it to actually shutdown. */
-               read(h->fd, &c, 1);
+               while ((read(h->fd, &c, 1) < 0) && (errno == EINTR))
+                       continue;
        }
        return ret;
 }
diff -r d6d77aa96aa1 -r d4d69c509371 xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c        Tue Sep  6 16:59:14 2005
+++ b/xen/arch/x86/vmx.c        Tue Sep  6 17:00:25 2005
@@ -730,7 +730,7 @@
 int
 vmx_copy(void *buf, unsigned long laddr, int size, int dir)
 {
-    unsigned long mfn;
+    unsigned long gpa, mfn;
     char *addr;
     int count;
 
@@ -739,8 +739,14 @@
        if (count > size)
            count = size;
 
-       mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
-       /* XXX check whether laddr is valid */
+       if (vmx_paging_enabled(current)) {
+               gpa = gva_to_gpa(laddr);
+               mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
+       } else
+               mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
+       if (mfn == INVALID_MFN)
+               return 0;
+
        addr = (char *)map_domain_page(mfn) + (laddr & ~PAGE_MASK);
 
        if (dir == VMX_COPY_IN)
diff -r d6d77aa96aa1 -r d4d69c509371 xen/arch/x86/vmx_platform.c
--- a/xen/arch/x86/vmx_platform.c       Tue Sep  6 16:59:14 2005
+++ b/xen/arch/x86/vmx_platform.c       Tue Sep  6 17:00:25 2005
@@ -583,49 +583,13 @@
     }
 }
 
-/* XXX use vmx_copy instead */
 int inst_copy_from_guest(unsigned char *buf, unsigned long guest_eip, int 
inst_len)
 {
-    unsigned long gpa;
-    unsigned long mfn;
-    unsigned char *inst_start;
-    int remaining = 0;
-        
-    if ( (inst_len > MAX_INST_LEN) || (inst_len <= 0) )
+    if (inst_len > MAX_INST_LEN || inst_len <= 0)
         return 0;
-
-    if ( vmx_paging_enabled(current) )
-    {
-        gpa = gva_to_gpa(guest_eip);
-        mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
-
-        /* Does this cross a page boundary ? */
-        if ( (guest_eip & PAGE_MASK) != ((guest_eip + inst_len) & PAGE_MASK) )
-        {
-            remaining = (guest_eip + inst_len) & ~PAGE_MASK;
-            inst_len -= remaining;
-        }
-    }
-    else
-    {
-        mfn = get_mfn_from_pfn(guest_eip >> PAGE_SHIFT);
-    }
-
-    inst_start = map_domain_page(mfn);
-    memcpy((char *)buf, inst_start + (guest_eip & ~PAGE_MASK), inst_len);
-    unmap_domain_page(inst_start);
-
-    if ( remaining )
-    {
-        gpa = gva_to_gpa(guest_eip+inst_len+remaining);
-        mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
-
-        inst_start = map_domain_page(mfn);
-        memcpy((char *)buf+inst_len, inst_start, remaining);
-        unmap_domain_page(inst_start);
-    }
-
-    return inst_len+remaining;
+    if (!vmx_copy(buf, guest_eip, inst_len, VMX_COPY_IN))
+        return 0;
+    return inst_len;
 }
 
 void send_mmio_req(unsigned char type, unsigned long gpa, 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.