ia64/xen-unstable

changeset 6657:d4d69c509371

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 06 17:00:25 2005 +0000 (2005-09-06)
parents d6d77aa96aa1 8f21344e7817
children 6d7b05e1c1e5
files linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c tools/console/daemon/io.c tools/console/daemon/utils.c tools/console/daemon/utils.h tools/python/xen/xend/XendDomainInfo.py tools/xenstore/Makefile tools/xenstore/xenstored_core.c tools/xenstore/xenstored_domain.c tools/xenstore/xenstored_domain.h tools/xenstore/xs.c xen/arch/x86/vmx.c xen/arch/x86/vmx_platform.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c	Tue Sep 06 16:59:14 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c	Tue Sep 06 17:00:25 2005 +0000
     1.3 @@ -588,7 +588,15 @@ vmalloc_fault:
     1.4  		pmd_k = pmd_offset(pud_k, address);
     1.5  		if (!pmd_present(*pmd_k))
     1.6  			goto no_context;
     1.7 +#ifndef CONFIG_XEN
     1.8  		set_pmd(pmd, *pmd_k);
     1.9 +#else
    1.10 +		/*
    1.11 +		 * When running on Xen we must launder *pmd_k through
    1.12 +		 * pmd_val() to ensure that _PAGE_PRESENT is correctly set.
    1.13 +		 */
    1.14 +		set_pmd(pmd, __pmd(pmd_val(*pmd_k)));
    1.15 +#endif
    1.16  
    1.17  		pte_k = pte_offset_kernel(pmd_k, address);
    1.18  		if (!pte_present(*pte_k))
     6.1 --- a/tools/xenstore/Makefile	Tue Sep 06 16:59:14 2005 +0000
     6.2 +++ b/tools/xenstore/Makefile	Tue Sep 06 17:00:25 2005 +0000
     6.3 @@ -12,7 +12,7 @@ BASECFLAGS=-Wall -W -g -Werror
     6.4  # Make gcc generate dependencies.
     6.5  BASECFLAGS += -Wp,-MD,.$(@F).d
     6.6  PROG_DEP = .*.d
     6.7 -#BASECFLAGS+= -O3 $(PROFILE)
     6.8 +BASECFLAGS+= -O3 $(PROFILE)
     6.9  #BASECFLAGS+= -I$(XEN_ROOT)/tools
    6.10  BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
    6.11  BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
     7.1 --- a/tools/xenstore/xenstored_core.c	Tue Sep 06 16:59:14 2005 +0000
     7.2 +++ b/tools/xenstore/xenstored_core.c	Tue Sep 06 17:00:25 2005 +0000
     7.3 @@ -1310,8 +1310,12 @@ static int out_of_mem(void *data)
     7.4  
     7.5  static void consider_message(struct connection *conn)
     7.6  {
     7.7 -	struct buffered_data *in = NULL;
     7.8 -	enum xsd_sockmsg_type type = conn->in->hdr.msg.type;
     7.9 +	/*
    7.10 +	 * 'volatile' qualifier prevents register allocation which fixes:
    7.11 +	 *   warning: variable 'xxx' might be clobbered by 'longjmp' or 'vfork'
    7.12 +	 */
    7.13 +	struct buffered_data *volatile in = NULL;
    7.14 +	enum xsd_sockmsg_type volatile type = conn->in->hdr.msg.type;
    7.15  	jmp_buf talloc_fail;
    7.16  
    7.17  	assert(conn->state == OK);
    7.18 @@ -1449,7 +1453,11 @@ static void unblock_connections(void)
    7.19  
    7.20  struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
    7.21  {
    7.22 -	struct connection *new;
    7.23 +	/*
    7.24 +	 * 'volatile' qualifier prevents register allocation which fixes:
    7.25 +	 *   warning: variable 'xxx' might be clobbered by 'longjmp' or 'vfork'
    7.26 +	 */
    7.27 +	struct connection *volatile new;
    7.28  	jmp_buf talloc_fail;
    7.29  
    7.30  	new = talloc(talloc_autofree_context(), struct connection);
    10.1 --- a/tools/xenstore/xs.c	Tue Sep 06 16:59:14 2005 +0000
    10.2 +++ b/tools/xenstore/xs.c	Tue Sep 06 17:00:25 2005 +0000
    10.3 @@ -628,7 +628,8 @@ bool xs_shutdown(struct xs_handle *h)
    10.4  	if (ret) {
    10.5  		char c;
    10.6  		/* Wait for it to actually shutdown. */
    10.7 -		read(h->fd, &c, 1);
    10.8 +		while ((read(h->fd, &c, 1) < 0) && (errno == EINTR))
    10.9 +			continue;
   10.10  	}
   10.11  	return ret;
   10.12  }
    11.1 --- a/xen/arch/x86/vmx.c	Tue Sep 06 16:59:14 2005 +0000
    11.2 +++ b/xen/arch/x86/vmx.c	Tue Sep 06 17:00:25 2005 +0000
    11.3 @@ -730,7 +730,7 @@ static void vmx_io_instruction(struct cp
    11.4  int
    11.5  vmx_copy(void *buf, unsigned long laddr, int size, int dir)
    11.6  {
    11.7 -    unsigned long mfn;
    11.8 +    unsigned long gpa, mfn;
    11.9      char *addr;
   11.10      int count;
   11.11  
   11.12 @@ -739,8 +739,14 @@ vmx_copy(void *buf, unsigned long laddr,
   11.13  	if (count > size)
   11.14  	    count = size;
   11.15  
   11.16 -	mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
   11.17 -	/* XXX check whether laddr is valid */
   11.18 +	if (vmx_paging_enabled(current)) {
   11.19 +		gpa = gva_to_gpa(laddr);
   11.20 +		mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
   11.21 +	} else
   11.22 +		mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
   11.23 +	if (mfn == INVALID_MFN)
   11.24 +		return 0;
   11.25 +
   11.26  	addr = (char *)map_domain_page(mfn) + (laddr & ~PAGE_MASK);
   11.27  
   11.28  	if (dir == VMX_COPY_IN)
    12.1 --- a/xen/arch/x86/vmx_platform.c	Tue Sep 06 16:59:14 2005 +0000
    12.2 +++ b/xen/arch/x86/vmx_platform.c	Tue Sep 06 17:00:25 2005 +0000
    12.3 @@ -583,49 +583,13 @@ static int vmx_decode(unsigned char *opc
    12.4      }
    12.5  }
    12.6  
    12.7 -/* XXX use vmx_copy instead */
    12.8  int inst_copy_from_guest(unsigned char *buf, unsigned long guest_eip, int inst_len)
    12.9  {
   12.10 -    unsigned long gpa;
   12.11 -    unsigned long mfn;
   12.12 -    unsigned char *inst_start;
   12.13 -    int remaining = 0;
   12.14 -        
   12.15 -    if ( (inst_len > MAX_INST_LEN) || (inst_len <= 0) )
   12.16 +    if (inst_len > MAX_INST_LEN || inst_len <= 0)
   12.17          return 0;
   12.18 -
   12.19 -    if ( vmx_paging_enabled(current) )
   12.20 -    {
   12.21 -        gpa = gva_to_gpa(guest_eip);
   12.22 -        mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
   12.23 -
   12.24 -        /* Does this cross a page boundary ? */
   12.25 -        if ( (guest_eip & PAGE_MASK) != ((guest_eip + inst_len) & PAGE_MASK) )
   12.26 -        {
   12.27 -            remaining = (guest_eip + inst_len) & ~PAGE_MASK;
   12.28 -            inst_len -= remaining;
   12.29 -        }
   12.30 -    }
   12.31 -    else
   12.32 -    {
   12.33 -        mfn = get_mfn_from_pfn(guest_eip >> PAGE_SHIFT);
   12.34 -    }
   12.35 -
   12.36 -    inst_start = map_domain_page(mfn);
   12.37 -    memcpy((char *)buf, inst_start + (guest_eip & ~PAGE_MASK), inst_len);
   12.38 -    unmap_domain_page(inst_start);
   12.39 -
   12.40 -    if ( remaining )
   12.41 -    {
   12.42 -        gpa = gva_to_gpa(guest_eip+inst_len+remaining);
   12.43 -        mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
   12.44 -
   12.45 -        inst_start = map_domain_page(mfn);
   12.46 -        memcpy((char *)buf+inst_len, inst_start, remaining);
   12.47 -        unmap_domain_page(inst_start);
   12.48 -    }
   12.49 -
   12.50 -    return inst_len+remaining;
   12.51 +    if (!vmx_copy(buf, guest_eip, inst_len, VMX_COPY_IN))
   12.52 +        return 0;
   12.53 +    return inst_len;
   12.54  }
   12.55  
   12.56  void send_mmio_req(unsigned char type, unsigned long gpa,