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))
     2.1 --- a/tools/xenstore/Makefile	Tue Sep 06 16:59:14 2005 +0000
     2.2 +++ b/tools/xenstore/Makefile	Tue Sep 06 17:00:25 2005 +0000
     2.3 @@ -12,7 +12,7 @@ BASECFLAGS=-Wall -W -g -Werror
     2.4  # Make gcc generate dependencies.
     2.5  BASECFLAGS += -Wp,-MD,.$(@F).d
     2.6  PROG_DEP = .*.d
     2.7 -#BASECFLAGS+= -O3 $(PROFILE)
     2.8 +BASECFLAGS+= -O3 $(PROFILE)
     2.9  #BASECFLAGS+= -I$(XEN_ROOT)/tools
    2.10  BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
    2.11  BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
     3.1 --- a/tools/xenstore/xenstored_core.c	Tue Sep 06 16:59:14 2005 +0000
     3.2 +++ b/tools/xenstore/xenstored_core.c	Tue Sep 06 17:00:25 2005 +0000
     3.3 @@ -1310,8 +1310,12 @@ static int out_of_mem(void *data)
     3.4  
     3.5  static void consider_message(struct connection *conn)
     3.6  {
     3.7 -	struct buffered_data *in = NULL;
     3.8 -	enum xsd_sockmsg_type type = conn->in->hdr.msg.type;
     3.9 +	/*
    3.10 +	 * 'volatile' qualifier prevents register allocation which fixes:
    3.11 +	 *   warning: variable 'xxx' might be clobbered by 'longjmp' or 'vfork'
    3.12 +	 */
    3.13 +	struct buffered_data *volatile in = NULL;
    3.14 +	enum xsd_sockmsg_type volatile type = conn->in->hdr.msg.type;
    3.15  	jmp_buf talloc_fail;
    3.16  
    3.17  	assert(conn->state == OK);
    3.18 @@ -1449,7 +1453,11 @@ static void unblock_connections(void)
    3.19  
    3.20  struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
    3.21  {
    3.22 -	struct connection *new;
    3.23 +	/*
    3.24 +	 * 'volatile' qualifier prevents register allocation which fixes:
    3.25 +	 *   warning: variable 'xxx' might be clobbered by 'longjmp' or 'vfork'
    3.26 +	 */
    3.27 +	struct connection *volatile new;
    3.28  	jmp_buf talloc_fail;
    3.29  
    3.30  	new = talloc(talloc_autofree_context(), struct connection);
     4.1 --- a/tools/xenstore/xs.c	Tue Sep 06 16:59:14 2005 +0000
     4.2 +++ b/tools/xenstore/xs.c	Tue Sep 06 17:00:25 2005 +0000
     4.3 @@ -628,7 +628,8 @@ bool xs_shutdown(struct xs_handle *h)
     4.4  	if (ret) {
     4.5  		char c;
     4.6  		/* Wait for it to actually shutdown. */
     4.7 -		read(h->fd, &c, 1);
     4.8 +		while ((read(h->fd, &c, 1) < 0) && (errno == EINTR))
     4.9 +			continue;
    4.10  	}
    4.11  	return ret;
    4.12  }
     5.1 --- a/xen/arch/x86/vmx.c	Tue Sep 06 16:59:14 2005 +0000
     5.2 +++ b/xen/arch/x86/vmx.c	Tue Sep 06 17:00:25 2005 +0000
     5.3 @@ -730,7 +730,7 @@ static void vmx_io_instruction(struct cp
     5.4  int
     5.5  vmx_copy(void *buf, unsigned long laddr, int size, int dir)
     5.6  {
     5.7 -    unsigned long mfn;
     5.8 +    unsigned long gpa, mfn;
     5.9      char *addr;
    5.10      int count;
    5.11  
    5.12 @@ -739,8 +739,14 @@ vmx_copy(void *buf, unsigned long laddr,
    5.13  	if (count > size)
    5.14  	    count = size;
    5.15  
    5.16 -	mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
    5.17 -	/* XXX check whether laddr is valid */
    5.18 +	if (vmx_paging_enabled(current)) {
    5.19 +		gpa = gva_to_gpa(laddr);
    5.20 +		mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
    5.21 +	} else
    5.22 +		mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
    5.23 +	if (mfn == INVALID_MFN)
    5.24 +		return 0;
    5.25 +
    5.26  	addr = (char *)map_domain_page(mfn) + (laddr & ~PAGE_MASK);
    5.27  
    5.28  	if (dir == VMX_COPY_IN)
     6.1 --- a/xen/arch/x86/vmx_platform.c	Tue Sep 06 16:59:14 2005 +0000
     6.2 +++ b/xen/arch/x86/vmx_platform.c	Tue Sep 06 17:00:25 2005 +0000
     6.3 @@ -583,49 +583,13 @@ static int vmx_decode(unsigned char *opc
     6.4      }
     6.5  }
     6.6  
     6.7 -/* XXX use vmx_copy instead */
     6.8  int inst_copy_from_guest(unsigned char *buf, unsigned long guest_eip, int inst_len)
     6.9  {
    6.10 -    unsigned long gpa;
    6.11 -    unsigned long mfn;
    6.12 -    unsigned char *inst_start;
    6.13 -    int remaining = 0;
    6.14 -        
    6.15 -    if ( (inst_len > MAX_INST_LEN) || (inst_len <= 0) )
    6.16 +    if (inst_len > MAX_INST_LEN || inst_len <= 0)
    6.17          return 0;
    6.18 -
    6.19 -    if ( vmx_paging_enabled(current) )
    6.20 -    {
    6.21 -        gpa = gva_to_gpa(guest_eip);
    6.22 -        mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
    6.23 -
    6.24 -        /* Does this cross a page boundary ? */
    6.25 -        if ( (guest_eip & PAGE_MASK) != ((guest_eip + inst_len) & PAGE_MASK) )
    6.26 -        {
    6.27 -            remaining = (guest_eip + inst_len) & ~PAGE_MASK;
    6.28 -            inst_len -= remaining;
    6.29 -        }
    6.30 -    }
    6.31 -    else
    6.32 -    {
    6.33 -        mfn = get_mfn_from_pfn(guest_eip >> PAGE_SHIFT);
    6.34 -    }
    6.35 -
    6.36 -    inst_start = map_domain_page(mfn);
    6.37 -    memcpy((char *)buf, inst_start + (guest_eip & ~PAGE_MASK), inst_len);
    6.38 -    unmap_domain_page(inst_start);
    6.39 -
    6.40 -    if ( remaining )
    6.41 -    {
    6.42 -        gpa = gva_to_gpa(guest_eip+inst_len+remaining);
    6.43 -        mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
    6.44 -
    6.45 -        inst_start = map_domain_page(mfn);
    6.46 -        memcpy((char *)buf+inst_len, inst_start, remaining);
    6.47 -        unmap_domain_page(inst_start);
    6.48 -    }
    6.49 -
    6.50 -    return inst_len+remaining;
    6.51 +    if (!vmx_copy(buf, guest_eip, inst_len, VMX_COPY_IN))
    6.52 +        return 0;
    6.53 +    return inst_len;
    6.54  }
    6.55  
    6.56  void send_mmio_req(unsigned char type, unsigned long gpa,