direct-io.hg

changeset 13864:7286802c9619

merge with xen-unstable.hg
author awilliam@xenbuild2.aw
date Sun Jan 28 16:47:12 2007 -0700 (2007-01-28)
parents e5cfd902d7e4 f8ddcb758117
children d0b2022e2403
files
line diff
     1.1 --- a/tools/firmware/hvmloader/32bitbios_support.c	Sun Jan 28 16:37:02 2007 -0700
     1.2 +++ b/tools/firmware/hvmloader/32bitbios_support.c	Sun Jan 28 16:47:12 2007 -0700
     1.3 @@ -17,7 +17,12 @@
     1.4   * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
     1.5   * Place - Suite 330, Boston, MA 02111-1307 USA.
     1.6   */
     1.7 +#include <inttypes.h>
     1.8  #include <elf.h>
     1.9 +#ifdef __sun__
    1.10 +#include <sys/machelf.h>
    1.11 +#endif
    1.12 +
    1.13  #include <xen/hvm/e820.h>
    1.14  #include "util.h"
    1.15  #include "config.h"
    1.16 @@ -35,7 +40,7 @@ static int relocate_elf(unsigned char *e
    1.17      int i;
    1.18  
    1.19      if (ehdr->e_type != ET_REL) {
    1.20 -        printf("Not a relocatabel BIOS object file. Has type %d, need %d\n",
    1.21 +        printf("Not a relocatable BIOS object file. Has type %d, need %d\n",
    1.22                 ehdr->e_type, ET_REL);
    1.23          return -1;
    1.24      }
     2.1 --- a/tools/firmware/rombios/32bit/Makefile	Sun Jan 28 16:37:02 2007 -0700
     2.2 +++ b/tools/firmware/rombios/32bit/Makefile	Sun Jan 28 16:47:12 2007 -0700
     2.3 @@ -30,7 +30,7 @@ clean:
     2.4  	done;
     2.5  
     2.6  $(TARGET): subdirs 32bitbios.o util.o
     2.7 -	ld $(LDFLAGS_DIRECT) -r 32bitbios.o $(MODULES) util.o -o 32bitbios_all.o
     2.8 +	$(LD) $(LDFLAGS_DIRECT) -r 32bitbios.o $(MODULES) util.o -o 32bitbios_all.o
     2.9  	@nm 32bitbios_all.o |                                \
    2.10  	  grep -E -q '^ +U ' && {                            \
    2.11  	    echo "There are undefined symbols in the BIOS:"; \
     3.1 --- a/tools/firmware/rombios/32bit/tcgbios/Makefile	Sun Jan 28 16:37:02 2007 -0700
     3.2 +++ b/tools/firmware/rombios/32bit/tcgbios/Makefile	Sun Jan 28 16:47:12 2007 -0700
     3.3 @@ -19,4 +19,4 @@ clean:
     3.4  	rm -rf *.o $(TARGET)
     3.5  
     3.6  $(TARGET): $(OBJECTS)
     3.7 -	ld $(LDFLAGS_DIRECT) -r $^ -o $@
     3.8 +	$(LD) $(LDFLAGS_DIRECT) -r $^ -o $@
     4.1 --- a/tools/python/xen/xend/XendDomain.py	Sun Jan 28 16:37:02 2007 -0700
     4.2 +++ b/tools/python/xen/xend/XendDomain.py	Sun Jan 28 16:47:12 2007 -0700
     4.3 @@ -943,6 +943,9 @@ class XendDomain:
     4.4                                   POWER_STATE_NAMES[dominfo.state])
     4.5              
     4.6              dominfo.start(is_managed = True)
     4.7 +            self.domain_sched_credit_set(dominfo.getDomid(),
     4.8 +                                         dominfo.getWeight(),
     4.9 +                                         dominfo.getCap())
    4.10          finally:
    4.11              self.domains_lock.release()
    4.12          dominfo.waitForDevices()
     5.1 --- a/tools/python/xen/xend/server/ConsoleController.py	Sun Jan 28 16:37:02 2007 -0700
     5.2 +++ b/tools/python/xen/xend/server/ConsoleController.py	Sun Jan 28 16:47:12 2007 -0700
     5.3 @@ -27,3 +27,5 @@ class ConsoleController(DevController):
     5.4                         if val != None])
     5.5          return config
     5.6  
     5.7 +    def migrate(self, deviceConfig, network, dst, step, domName):
     5.8 +        return 0
     6.1 --- a/tools/python/xen/xm/main.py	Sun Jan 28 16:37:02 2007 -0700
     6.2 +++ b/tools/python/xen/xm/main.py	Sun Jan 28 16:47:12 2007 -0700
     6.3 @@ -706,6 +706,15 @@ def parse_doms_info(info):
     6.4          'seclabel' : security.get_security_printlabel(info),
     6.5          }
     6.6  
     6.7 +def check_sched_type(sched):
     6.8 +    current = 'unknown'
     6.9 +    for x in server.xend.node.info()[1:]:
    6.10 +        if len(x) > 1 and x[0] == 'xen_scheduler':
    6.11 +            current = x[1]
    6.12 +            break
    6.13 +    if sched != current:
    6.14 +        err("Xen is running with the %s scheduler" % current)
    6.15 +        sys.exit(1)
    6.16  
    6.17  def parse_sedf_info(info):
    6.18      def get_info(n, t, d):
    6.19 @@ -1098,6 +1107,8 @@ def xm_sched_sedf(args):
    6.20          print( ("%(name)-32s %(domid)3d %(period)9.1f %(slice)9.1f" +
    6.21                  " %(latency)7.1f %(extratime)6d %(weight)6d") % info)
    6.22  
    6.23 +    check_sched_type('sedf')
    6.24 +
    6.25      # we want to just display current info if no parameters are passed
    6.26      if len(args) == 0:
    6.27          domid = None
    6.28 @@ -1170,6 +1181,8 @@ def xm_sched_sedf(args):
    6.29  def xm_sched_credit(args):
    6.30      """Get/Set options for Credit Scheduler."""
    6.31      
    6.32 +    check_sched_type('credit')
    6.33 +
    6.34      try:
    6.35          opts, params = getopt.getopt(args, "d:w:c:",
    6.36              ["domain=", "weight=", "cap="])
     7.1 --- a/tools/xenstat/xentop/xentop.c	Sun Jan 28 16:37:02 2007 -0700
     7.2 +++ b/tools/xenstat/xentop/xentop.c	Sun Jan 28 16:47:12 2007 -0700
     7.3 @@ -998,9 +998,11 @@ int main(int argc, char **argv)
     7.4  
     7.5  	while ((opt = getopt_long(argc, argv, sopts, lopts, &optind)) != -1) {
     7.6  		switch (opt) {
     7.7 -		case 'h':
     7.8 +		default:
     7.9 +			usage(argv[0]);
    7.10 +			exit(1);
    7.11  		case '?':
    7.12 -		default:
    7.13 +		case 'h':
    7.14  			usage(argv[0]);
    7.15  			exit(0);
    7.16  		case 'V':
     8.1 --- a/xen/arch/x86/hvm/hvm.c	Sun Jan 28 16:37:02 2007 -0700
     8.2 +++ b/xen/arch/x86/hvm/hvm.c	Sun Jan 28 16:47:12 2007 -0700
     8.3 @@ -189,10 +189,27 @@ void hvm_domain_destroy(struct domain *d
     8.4          unmap_domain_page_global((void *)d->arch.hvm_domain.buffered_io_va);
     8.5  }
     8.6  
     8.7 +#define HVM_VCPU_CTXT_MAGIC 0x85963130
     8.8 +void hvm_save_cpu_ctxt(hvm_domain_context_t *h, void *opaque)
     8.9 +{
    8.10 +    struct vcpu *v = opaque;
    8.11 +
    8.12 +    if ( test_bit(_VCPUF_down, &v->vcpu_flags) ) {
    8.13 +        hvm_put_32u(h, 0x0);
    8.14 +        return;
    8.15 +    }
    8.16 +
    8.17 +    hvm_put_32u(h, HVM_VCPU_CTXT_MAGIC);
    8.18 +    hvm_funcs.save_cpu_ctxt(h, opaque);
    8.19 +}
    8.20 +
    8.21  int hvm_load_cpu_ctxt(hvm_domain_context_t *h, void *opaque, int version)
    8.22  {
    8.23      struct vcpu *v = opaque;
    8.24  
    8.25 +    if ( hvm_get_32u(h) != HVM_VCPU_CTXT_MAGIC )
    8.26 +        return 0;
    8.27 +
    8.28      if ( hvm_funcs.load_cpu_ctxt(h, opaque, version) < 0 )
    8.29          return -EINVAL;
    8.30  
    8.31 @@ -208,7 +225,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
    8.32      int rc;
    8.33  
    8.34      hvm_register_savevm(v->domain, "xen_hvm_cpu", v->vcpu_id, 1,
    8.35 -                        hvm_funcs.save_cpu_ctxt, hvm_load_cpu_ctxt, 
    8.36 +                        hvm_save_cpu_ctxt, hvm_load_cpu_ctxt, 
    8.37                          (void *)v);
    8.38  
    8.39      if ( (rc = vlapic_init(v)) != 0 )
     9.1 --- a/xen/common/libelf/libelf-private.h	Sun Jan 28 16:37:02 2007 -0700
     9.2 +++ b/xen/common/libelf/libelf-private.h	Sun Jan 28 16:47:12 2007 -0700
     9.3 @@ -1,7 +1,13 @@
     9.4 +#ifndef __LIBELF_PRIVATE_H__
     9.5 +#define __LIBELF_PRIVATE_H_
     9.6 +
     9.7  #ifdef __XEN__
     9.8  
     9.9 +#include <xen/config.h>
    9.10 +#include <xen/types.h>
    9.11  #include <xen/string.h>
    9.12  #include <xen/lib.h>
    9.13 +#include <asm/byteorder.h>
    9.14  #include <public/elfnote.h>
    9.15  #include <public/libelf.h>
    9.16  
    9.17 @@ -11,29 +17,25 @@
    9.18  	printk(fmt, ## args )
    9.19  
    9.20  #define strtoull(str, end, base) simple_strtoull(str, end, base)
    9.21 -#define bswap_16(x) \
    9.22 -     ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
    9.23 -#define bswap_32(x) \
    9.24 -     (  (((x) & 0xff000000) >> 24)  \
    9.25 -      | (((x) & 0x00ff0000) >>  8)  \
    9.26 -      | (((x) & 0x0000ff00) <<  8)  \
    9.27 -      | (((x) & 0x000000ff) << 24))
    9.28 -#define bswap_64(x) \
    9.29 -     (  (((x) & 0xff00000000000000ull) >> 56)  \
    9.30 -      | (((x) & 0x00ff000000000000ull) >> 40)  \
    9.31 -      | (((x) & 0x0000ff0000000000ull) >> 24)  \
    9.32 -      | (((x) & 0x000000ff00000000ull) >> 8)   \
    9.33 -      | (((x) & 0x00000000ff000000ull) << 8)   \
    9.34 -      | (((x) & 0x0000000000ff0000ull) << 24)  \
    9.35 -      | (((x) & 0x000000000000ff00ull) << 40)  \
    9.36 -      | (((x) & 0x00000000000000ffull) << 56))
    9.37 +#define bswap_16(x) swab16(x)
    9.38 +#define bswap_32(x) swab32(x)
    9.39 +#define bswap_64(x) swab64(x)
    9.40  
    9.41  #else /* !__XEN__ */
    9.42  
    9.43  #include <stdio.h>
    9.44  #include <stdlib.h>
    9.45  #include <string.h>
    9.46 +#include <stddef.h>
    9.47 +#include <inttypes.h>
    9.48 +#ifdef __sun__
    9.49 +#include <sys/byteorder.h>
    9.50 +#define bswap_16(x) BSWAP_16(x)
    9.51 +#define bswap_32(x) BSWAP_32(x)
    9.52 +#define bswap_64(x) BSWAP_64(x)
    9.53 +#else
    9.54  #include <byteswap.h>
    9.55 +#endif
    9.56  #include <xen/elfnote.h>
    9.57  #include <xen/libelf.h>
    9.58  
    9.59 @@ -49,3 +51,5 @@
    9.60  	} while (0)
    9.61  
    9.62  #endif
    9.63 +
    9.64 +#endif /* __LIBELF_PRIVATE_H_ */
    10.1 --- a/xen/common/libelf/libelf-tools.c	Sun Jan 28 16:37:02 2007 -0700
    10.2 +++ b/xen/common/libelf/libelf-tools.c	Sun Jan 28 16:47:12 2007 -0700
    10.3 @@ -7,7 +7,7 @@
    10.4  /* ------------------------------------------------------------------------ */
    10.5  
    10.6  uint64_t elf_access_unsigned(struct elf_binary * elf, const void *ptr,
    10.7 -			     off_t offset, size_t size)
    10.8 +			     uint64_t offset, size_t size)
    10.9  {
   10.10      int need_swap = elf_swap(elf);
   10.11      const uint8_t *u8;
   10.12 @@ -35,7 +35,7 @@ uint64_t elf_access_unsigned(struct elf_
   10.13  }
   10.14  
   10.15  int64_t elf_access_signed(struct elf_binary *elf, const void *ptr,
   10.16 -			  off_t offset, size_t size)
   10.17 +			  uint64_t offset, size_t size)
   10.18  {
   10.19      int need_swap = elf_swap(elf);
   10.20      const int8_t *s8;
    11.1 --- a/xen/include/Makefile	Sun Jan 28 16:37:02 2007 -0700
    11.2 +++ b/xen/include/Makefile	Sun Jan 28 16:47:12 2007 -0700
    11.3 @@ -30,8 +30,8 @@ cppflags-y                := -include pu
    11.4  cppflags-$(CONFIG_X86)    += -m32
    11.5  
    11.6  # 8-byte types are 4-byte aligned on x86_32 ...
    11.7 -prefix-$(CONFIG_X86)      := \#pragma pack(push, 4)
    11.8 -suffix-$(CONFIG_X86)      := \#pragma pack(pop)
    11.9 +prefix-$(CONFIG_X86)      := \#pragma pack(4)
   11.10 +suffix-$(CONFIG_X86)      := \#pragma pack()
   11.11  
   11.12  endif
   11.13  
    12.1 --- a/xen/include/public/domctl.h	Sun Jan 28 16:37:02 2007 -0700
    12.2 +++ b/xen/include/public/domctl.h	Sun Jan 28 16:47:12 2007 -0700
    12.3 @@ -386,7 +386,7 @@ struct xen_domctl_settimeoffset {
    12.4  typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
    12.5  DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
    12.6   
    12.7 -#define HVM_CTXT_SIZE        6144
    12.8 +#define HVM_CTXT_SIZE        8192
    12.9  typedef struct hvm_domain_context {
   12.10      uint32_t cur;
   12.11      uint32_t size;
    13.1 --- a/xen/include/public/foreign/mkheader.py	Sun Jan 28 16:37:02 2007 -0700
    13.2 +++ b/xen/include/public/foreign/mkheader.py	Sun Jan 28 16:47:12 2007 -0700
    13.3 @@ -24,10 +24,10 @@ inttypes["x86_32"] = {
    13.4  };
    13.5  header["x86_32"] = """
    13.6  #define __i386___X86_32 1
    13.7 -#pragma pack(push, 4)
    13.8 +#pragma pack(4)
    13.9  """;
   13.10  footer["x86_32"] = """
   13.11 -#pragma pack(pop)
   13.12 +#pragma pack()
   13.13  """;
   13.14  
   13.15  # x86_64
    14.1 --- a/xen/include/public/libelf.h	Sun Jan 28 16:37:02 2007 -0700
    14.2 +++ b/xen/include/public/libelf.h	Sun Jan 28 16:47:12 2007 -0700
    14.3 @@ -1,25 +1,12 @@
    14.4  #ifndef __XC_LIBELF__
    14.5  #define __XC_LIBELF__ 1
    14.6  
    14.7 -#ifdef __XEN__
    14.8 -
    14.9 -#include <xen/inttypes.h>
   14.10 -#include <public/features.h>
   14.11 -typedef uint64_t off_t;
   14.12 -
   14.13 -#define LITTLE_ENDIAN 1234
   14.14 -#define BIG_ENDIAN    4321
   14.15  #if defined(__i386__) || defined(__x86_64) || defined(__ia64__)
   14.16 -#define BYTE_ORDER LITTLE_ENDIAN
   14.17 +#define XEN_ELF_LITTLE_ENDIAN
   14.18  #elif defined(__powerpc__)
   14.19 -#define BYTE_ORDER BIG_ENDIAN
   14.20 -#endif
   14.21 -
   14.22 -#else /* !__XEN__ */
   14.23 -
   14.24 -#include <stddef.h>
   14.25 -#include <inttypes.h>
   14.26 -
   14.27 +#define XEN_ELF_BIG_ENDIAN
   14.28 +#else
   14.29 +#error define architectural endianness
   14.30  #endif
   14.31  
   14.32  #undef ELFSIZE
   14.33 @@ -91,14 +78,10 @@ struct elf_binary {
   14.34  /* ------------------------------------------------------------------------ */
   14.35  /* accessing elf header fields                                              */
   14.36  
   14.37 -#if !defined(BYTE_ORDER)
   14.38 -# error BYTE_ORDER not defined
   14.39 -#elif BYTE_ORDER == BIG_ENDIAN
   14.40 +#ifdef XEN_ELF_BIG_ENDIAN
   14.41  # define NATIVE_ELFDATA ELFDATA2MSB
   14.42 -#elif BYTE_ORDER == LITTLE_ENDIAN
   14.43 +#else
   14.44  # define NATIVE_ELFDATA ELFDATA2LSB
   14.45 -#else
   14.46 -# error BYTE_ORDER unknown
   14.47  #endif
   14.48  
   14.49  #define elf_32bit(elf) (ELFCLASS32 == (elf)->class)
   14.50 @@ -131,9 +114,9 @@ struct elf_binary {
   14.51  	: sizeof((str)->e32))
   14.52  
   14.53  uint64_t elf_access_unsigned(struct elf_binary *elf, const void *ptr,
   14.54 -			     off_t offset, size_t size);
   14.55 +			     uint64_t offset, size_t size);
   14.56  int64_t elf_access_signed(struct elf_binary *elf, const void *ptr,
   14.57 -			  off_t offset, size_t size);
   14.58 +			  uint64_t offset, size_t size);
   14.59  
   14.60  uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr);
   14.61  
    15.1 --- a/xen/tools/compat-build-header.py	Sun Jan 28 16:37:02 2007 -0700
    15.2 +++ b/xen/tools/compat-build-header.py	Sun Jan 28 16:47:12 2007 -0700
    15.3 @@ -3,7 +3,7 @@
    15.4  import re,sys
    15.5  
    15.6  pats = [
    15.7 - [ r"__InClUdE__", r"#include" ],
    15.8 + [ r"__InClUdE__(.*)", r"#include\1\n#pragma pack(4)" ],
    15.9   [ r"\"xen-compat.h\"", r"<public/xen-compat.h>" ],
   15.10   [ r"(struct|union|enum)\s+(xen_?)?(\w)", r"\1 compat_\3" ],
   15.11   [ r"@KeeP@", r"" ],