direct-io.hg

changeset 6713:813c37b68376

merge?
author cl349@firebug.cl.cam.ac.uk
date Fri Sep 09 17:40:39 2005 +0000 (2005-09-09)
parents 31c257b9a360 0c7379b702e5
children 41a74438bcba
files linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendNode.py tools/python/xen/xend/xenstore/xstransact.py xen/arch/x86/dom0_ops.c xen/arch/x86/mm.c xen/arch/x86/setup.c xen/arch/x86/traps.c xen/arch/x86/vmx.c xen/common/Makefile xen/common/kernel.c xen/drivers/char/Makefile xen/include/asm-x86/mm.h xen/include/asm-x86/vmx.h xen/include/public/dom0_ops.h xen/include/public/version.h
line diff
     2.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Fri Sep 09 17:36:39 2005 +0000
     2.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Fri Sep 09 17:40:39 2005 +0000
     2.3 @@ -690,6 +690,8 @@ static PyObject *pyxc_physinfo(PyObject 
     2.4  {
     2.5      XcObject *xc = (XcObject *)self;
     2.6      xc_physinfo_t info;
     2.7 +    char cpu_cap[128], *p=cpu_cap, *q=cpu_cap;
     2.8 +    int i;
     2.9      
    2.10      if ( !PyArg_ParseTuple(args, "") )
    2.11          return NULL;
    2.12 @@ -697,14 +699,25 @@ static PyObject *pyxc_physinfo(PyObject 
    2.13      if ( xc_physinfo(xc->xc_handle, &info) != 0 )
    2.14          return PyErr_SetFromErrno(xc_error);
    2.15  
    2.16 -    return Py_BuildValue("{s:i,s:i,s:i,s:i,s:l,s:l,s:i}",
    2.17 +    *q=0;
    2.18 +    for(i=0;i<sizeof(info.hw_cap)/4;i++)
    2.19 +    {
    2.20 +        p+=sprintf(p,"%08x:",info.hw_cap[i]);
    2.21 +        if(info.hw_cap[i])
    2.22 +	    q=p;
    2.23 +    }
    2.24 +    if(q>cpu_cap)
    2.25 +        *(q-1)=0;
    2.26 +
    2.27 +    return Py_BuildValue("{s:i,s:i,s:i,s:i,s:l,s:l,s:i,s:s}",
    2.28                           "threads_per_core", info.threads_per_core,
    2.29                           "cores_per_socket", info.cores_per_socket,
    2.30                           "sockets_per_node", info.sockets_per_node,
    2.31                           "nr_nodes",         info.nr_nodes,
    2.32                           "total_pages",      info.total_pages,
    2.33                           "free_pages",       info.free_pages,
    2.34 -                         "cpu_khz",          info.cpu_khz);
    2.35 +                         "cpu_khz",          info.cpu_khz,
    2.36 +                         "hw_caps",          cpu_cap);
    2.37  }
    2.38  
    2.39  static PyObject *pyxc_xeninfo(PyObject *self,
    2.40 @@ -715,7 +728,10 @@ static PyObject *pyxc_xeninfo(PyObject *
    2.41      xen_extraversion_t xen_extra;
    2.42      xen_compile_info_t xen_cc;
    2.43      xen_changeset_info_t xen_chgset;
    2.44 +    xen_capabilities_info_t xen_caps;
    2.45 +    xen_parameters_info_t xen_parms;
    2.46      long xen_version;
    2.47 +    char str[128];
    2.48  
    2.49      xen_version = xc_version(xc->xc_handle, XENVER_version, NULL);
    2.50  
    2.51 @@ -728,10 +744,20 @@ static PyObject *pyxc_xeninfo(PyObject *
    2.52      if ( xc_version(xc->xc_handle, XENVER_changeset, &xen_chgset) != 0 )
    2.53          return PyErr_SetFromErrno(xc_error);
    2.54  
    2.55 -    return Py_BuildValue("{s:i,s:i,s:s,s:s,s:s,s:s,s:s,s:s}",
    2.56 +    if ( xc_version(xc->xc_handle, XENVER_capabilities, &xen_caps) != 0 )
    2.57 +        return PyErr_SetFromErrno(xc_error);
    2.58 +
    2.59 +    if ( xc_version(xc->xc_handle, XENVER_parameters, &xen_parms) != 0 )
    2.60 +        return PyErr_SetFromErrno(xc_error);
    2.61 +
    2.62 +    sprintf(str,"virt_start=0x%lx",xen_parms.virt_start);
    2.63 +
    2.64 +    return Py_BuildValue("{s:i,s:i,s:s,s:s,s:s,s:s,s:s,s:s,s:s,s:s}",
    2.65                           "xen_major", xen_version >> 16,
    2.66                           "xen_minor", (xen_version & 0xffff),
    2.67                           "xen_extra", xen_extra,
    2.68 +                         "xen_caps",  xen_caps,
    2.69 +                         "xen_params", str,
    2.70                           "xen_changeset", xen_chgset,
    2.71                           "cc_compiler", xen_cc.compiler,
    2.72                           "cc_compile_by", xen_cc.compile_by,
     4.1 --- a/tools/python/xen/xend/XendNode.py	Fri Sep 09 17:36:39 2005 +0000
     4.2 +++ b/tools/python/xen/xend/XendNode.py	Fri Sep 09 17:40:39 2005 +0000
     4.3 @@ -58,20 +58,26 @@ class XendNode:
     4.4  
     4.5      def physinfo(self):
     4.6          pinfo = self.xc.physinfo()
     4.7 -        info = [['cores_per_socket', pinfo['cores_per_socket']],
     4.8 +        info = [['nr_cpus',          pinfo['nr_nodes']*pinfo['sockets_per_node']*pinfo['cores_per_socket']*pinfo['threads_per_core']],
     4.9 +                ['nr_nodes',         pinfo['nr_nodes']],
    4.10 +                ['sockets_per_node', pinfo['sockets_per_node']],
    4.11 +                ['cores_per_socket', pinfo['cores_per_socket']],
    4.12                  ['threads_per_core', pinfo['threads_per_core']],
    4.13 -                ['cpu_mhz', pinfo['cpu_khz']/1000],
    4.14 -                ['memory', pinfo['total_pages']/256],
    4.15 -                ['free_memory', pinfo['free_pages']/256]]
    4.16 +                ['cpu_mhz',          pinfo['cpu_khz']/1000],
    4.17 +                ['hw_caps',          pinfo['hw_caps']],
    4.18 +                ['memory',           pinfo['total_pages']/256],
    4.19 +                ['free_memory',      pinfo['free_pages']/256]]
    4.20          return info
    4.21          
    4.22      def xeninfo(self):
    4.23          xinfo = self.xc.xeninfo()
    4.24 -	return [['xen_major', xinfo['xen_major']],
    4.25 -	        ['xen_minor', xinfo['xen_minor']],
    4.26 -	        ['xen_extra', xinfo['xen_extra']],
    4.27 -		['xen_changeset', xinfo['xen_changeset']],
    4.28 -		['cc_compiler', xinfo['cc_compiler']],
    4.29 +        return [['xen_major', xinfo['xen_major']],
    4.30 +                ['xen_minor', xinfo['xen_minor']],
    4.31 +                ['xen_extra', xinfo['xen_extra']],
    4.32 +                ['xen_caps',  xinfo['xen_caps']],
    4.33 +                ['xen_params',xinfo['xen_params']],
    4.34 +                ['xen_changeset', xinfo['xen_changeset']],
    4.35 +                ['cc_compiler', xinfo['cc_compiler']],
    4.36                  ['cc_compile_by', xinfo['cc_compile_by']],
    4.37                  ['cc_compile_domain', xinfo['cc_compile_domain']],
    4.38                  ['cc_compile_date', xinfo['cc_compile_date']]]
     6.1 --- a/xen/arch/x86/dom0_ops.c	Fri Sep 09 17:36:39 2005 +0000
     6.2 +++ b/xen/arch/x86/dom0_ops.c	Fri Sep 09 17:40:39 2005 +0000
     6.3 @@ -19,6 +19,7 @@
     6.4  #include <xen/console.h>
     6.5  #include <asm/shadow.h>
     6.6  #include <asm/irq.h>
     6.7 +#include <asm/processor.h>
     6.8  #include <public/sched_ctl.h>
     6.9  
    6.10  #include <asm/mtrr.h>
    6.11 @@ -34,13 +35,13 @@ static unsigned long msr_hi;
    6.12  
    6.13  static void write_msr_for(void *unused)
    6.14  {
    6.15 -    if (((1 << current->processor) & msr_cpu_mask))
    6.16 +    if ( ((1 << current->processor) & msr_cpu_mask) )
    6.17          (void)wrmsr_user(msr_addr, msr_lo, msr_hi);
    6.18  }
    6.19  
    6.20  static void read_msr_for(void *unused)
    6.21  {
    6.22 -    if (((1 << current->processor) & msr_cpu_mask))
    6.23 +    if ( ((1 << current->processor) & msr_cpu_mask) )
    6.24          (void)rdmsr_user(msr_addr, msr_lo, msr_hi);
    6.25  }
    6.26  
    6.27 @@ -188,9 +189,11 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
    6.28          pi->total_pages      = max_page;
    6.29          pi->free_pages       = avail_domheap_pages();
    6.30          pi->cpu_khz          = cpu_khz;
    6.31 -
    6.32 -        copy_to_user(u_dom0_op, op, sizeof(*op));
    6.33 +        memset(pi->hw_cap, 0, sizeof(pi->hw_cap));
    6.34 +        memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4);
    6.35          ret = 0;
    6.36 +        if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
    6.37 +	    ret = -EFAULT;
    6.38      }
    6.39      break;
    6.40      
     7.1 --- a/xen/arch/x86/mm.c	Fri Sep 09 17:36:39 2005 +0000
     7.2 +++ b/xen/arch/x86/mm.c	Fri Sep 09 17:40:39 2005 +0000
     7.3 @@ -3185,7 +3185,7 @@ int ptwr_do_page_fault(struct domain *d,
     7.4      struct pfn_info *page;
     7.5      l1_pgentry_t     pte;
     7.6      l2_pgentry_t    *pl2e, l2e;
     7.7 -    int              which;
     7.8 +    int              which, flags;
     7.9      unsigned long    l2_idx;
    7.10  
    7.11      if ( unlikely(shadow_mode_enabled(d)) )
    7.12 @@ -3206,8 +3206,24 @@ int ptwr_do_page_fault(struct domain *d,
    7.13      pfn  = l1e_get_pfn(pte);
    7.14      page = &frame_table[pfn];
    7.15  
    7.16 +#ifdef CONFIG_X86_64
    7.17 +#define WRPT_PTE_FLAGS (_PAGE_RW | _PAGE_PRESENT | _PAGE_USER)
    7.18 +#else
    7.19 +#define WRPT_PTE_FLAGS (_PAGE_RW | _PAGE_PRESENT)
    7.20 +#endif
    7.21 +
    7.22 +    /*
    7.23 +     * Check the required flags for a valid wrpt mapping. If the page is
    7.24 +     * already writable then we can return straight to the guest (SMP race).
    7.25 +     * We decide whether or not to propagate the fault by testing for write
    7.26 +     * permissions in page directories by writing back to the linear mapping.
    7.27 +     */
    7.28 +    if ( (flags = l1e_get_flags(pte) & WRPT_PTE_FLAGS) == WRPT_PTE_FLAGS )
    7.29 +        return !__put_user(
    7.30 +            pte.l1, &linear_pg_table[l1_linear_offset(addr)].l1);
    7.31 +
    7.32      /* We are looking only for read-only mappings of p.t. pages. */
    7.33 -    if ( ((l1e_get_flags(pte) & (_PAGE_RW|_PAGE_PRESENT)) != _PAGE_PRESENT) ||
    7.34 +    if ( ((flags | _PAGE_RW) != WRPT_PTE_FLAGS) ||
    7.35           ((page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table) ||
    7.36           ((page->u.inuse.type_info & PGT_count_mask) == 0) ||
    7.37           (page_get_owner(page) != d) )
     8.1 --- a/xen/arch/x86/setup.c	Fri Sep 09 17:36:39 2005 +0000
     8.2 +++ b/xen/arch/x86/setup.c	Fri Sep 09 17:40:39 2005 +0000
     8.3 @@ -12,6 +12,8 @@
     8.4  #include <xen/trace.h>
     8.5  #include <xen/multiboot.h>
     8.6  #include <xen/domain_page.h>
     8.7 +#include <xen/compile.h>
     8.8 +#include <public/version.h>
     8.9  #include <asm/bitops.h>
    8.10  #include <asm/smp.h>
    8.11  #include <asm/processor.h>
    8.12 @@ -529,6 +531,46 @@ void __init __start_xen(multiboot_info_t
    8.13      startup_cpu_idle_loop();
    8.14  }
    8.15  
    8.16 +void arch_get_xen_caps(xen_capabilities_info_t info)
    8.17 +{
    8.18 +    char *p = info;
    8.19 +
    8.20 +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
    8.21 +
    8.22 +    p += sprintf(p, "xen_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
    8.23 +    if ( hvm_enabled )
    8.24 +        p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
    8.25 +
    8.26 +#elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
    8.27 +
    8.28 +    p += sprintf(p, "xen_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
    8.29 +    if ( hvm_enabled )
    8.30 +    {
    8.31 +        //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
    8.32 +        //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
    8.33 +    }
    8.34 +
    8.35 +#elif defined(CONFIG_X86_64)
    8.36 +
    8.37 +    p += sprintf(p, "xen_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION);
    8.38 +    if ( hvm_enabled )
    8.39 +    {
    8.40 +        //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
    8.41 +        //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
    8.42 +        p += sprintf(p, "hvm_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION);
    8.43 +    }
    8.44 +
    8.45 +#else
    8.46 +
    8.47 +    p++;
    8.48 +
    8.49 +#endif
    8.50 +    
    8.51 +    *(p-1) = 0;
    8.52 +
    8.53 +    BUG_ON((p - info) > sizeof(info));
    8.54 +}
    8.55 +
    8.56  /*
    8.57   * Local variables:
    8.58   * mode: C
     9.1 --- a/xen/arch/x86/traps.c	Fri Sep 09 17:36:39 2005 +0000
     9.2 +++ b/xen/arch/x86/traps.c	Fri Sep 09 17:40:39 2005 +0000
     9.3 @@ -470,20 +470,32 @@ static int handle_perdomain_mapping_faul
     9.4      return EXCRET_fault_fixed;
     9.5  }
     9.6  
     9.7 -asmlinkage int do_page_fault(struct cpu_user_regs *regs)
     9.8 +#ifdef HYPERVISOR_VIRT_END
     9.9 +#define IN_HYPERVISOR_RANGE(va) \
    9.10 +    (((va) >= HYPERVISOR_VIRT_START) && ((va) < HYPERVISOR_VIRT_END))
    9.11 +#else
    9.12 +#define IN_HYPERVISOR_RANGE(va) \
    9.13 +    (((va) >= HYPERVISOR_VIRT_START))
    9.14 +#endif
    9.15 +
    9.16 +static int fixup_page_fault(unsigned long addr, struct cpu_user_regs *regs)
    9.17  {
    9.18 -    unsigned long addr, fixup;
    9.19 -    struct vcpu *v = current;
    9.20 +    struct vcpu   *v = current;
    9.21      struct domain *d = v->domain;
    9.22  
    9.23 -    __asm__ __volatile__ ("mov %%cr2,%0" : "=r" (addr) : );
    9.24 -
    9.25 -    DEBUGGER_trap_entry(TRAP_page_fault, regs);
    9.26 -
    9.27 -    perfc_incrc(page_faults);
    9.28 -
    9.29 -    if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables) &&
    9.30 -                !shadow_mode_enabled(d)) )
    9.31 +    if ( unlikely(IN_HYPERVISOR_RANGE(addr)) )
    9.32 +    {
    9.33 +        if ( shadow_mode_external(d) && GUEST_CONTEXT(v, regs) )
    9.34 +            return shadow_fault(addr, regs);
    9.35 +        if ( (addr >= PERDOMAIN_VIRT_START) && (addr < PERDOMAIN_VIRT_END) )
    9.36 +            return handle_perdomain_mapping_fault(
    9.37 +                addr - PERDOMAIN_VIRT_START, regs);
    9.38 +    }
    9.39 +    else if ( unlikely(shadow_mode_enabled(d)) )
    9.40 +    {
    9.41 +        return shadow_fault(addr, regs);
    9.42 +    }
    9.43 +    else if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) )
    9.44      {
    9.45          LOCK_BIGLOCK(d);
    9.46          if ( unlikely(d->arch.ptwr[PTWR_PT_ACTIVE].l1va) &&
    9.47 @@ -495,14 +507,9 @@ asmlinkage int do_page_fault(struct cpu_
    9.48              return EXCRET_fault_fixed;
    9.49          }
    9.50  
    9.51 -        if ( ((addr < HYPERVISOR_VIRT_START) 
    9.52 -#if defined(__x86_64__)
    9.53 -              || (addr >= HYPERVISOR_VIRT_END)
    9.54 -#endif        
    9.55 -            )     
    9.56 -             &&
    9.57 -             KERNEL_MODE(v, regs) &&
    9.58 -             ((regs->error_code & 3) == 3) && /* write-protection fault */
    9.59 +        if ( KERNEL_MODE(v, regs) &&
    9.60 +             /* Protection violation on write? No reserved-bit violation? */
    9.61 +             ((regs->error_code & 0xb) == 0x3) &&
    9.62               ptwr_do_page_fault(d, addr, regs) )
    9.63          {
    9.64              UNLOCK_BIGLOCK(d);
    9.65 @@ -511,44 +518,52 @@ asmlinkage int do_page_fault(struct cpu_
    9.66          UNLOCK_BIGLOCK(d);
    9.67      }
    9.68  
    9.69 -    if ( unlikely(shadow_mode_enabled(d)) &&
    9.70 -         ((addr < HYPERVISOR_VIRT_START) ||
    9.71 -#if defined(__x86_64__)
    9.72 -          (addr >= HYPERVISOR_VIRT_END) ||
    9.73 -#endif
    9.74 -          (shadow_mode_external(d) && GUEST_CONTEXT(v, regs))) &&
    9.75 -         shadow_fault(addr, regs) )
    9.76 -        return EXCRET_fault_fixed;
    9.77 +    return 0;
    9.78 +}
    9.79 +
    9.80 +/*
    9.81 + * #PF error code:
    9.82 + *  Bit 0: Protection violation (=1) ; Page not present (=0)
    9.83 + *  Bit 1: Write access
    9.84 + *  Bit 2: Supervisor mode
    9.85 + *  Bit 3: Reserved bit violation
    9.86 + *  Bit 4: Instruction fetch
    9.87 + */
    9.88 +asmlinkage int do_page_fault(struct cpu_user_regs *regs)
    9.89 +{
    9.90 +    unsigned long addr, fixup;
    9.91 +    int rc;
    9.92 +
    9.93 +    __asm__ __volatile__ ("mov %%cr2,%0" : "=r" (addr) : );
    9.94 +
    9.95 +    DEBUGGER_trap_entry(TRAP_page_fault, regs);
    9.96 +
    9.97 +    perfc_incrc(page_faults);
    9.98  
    9.99 -    if ( unlikely(addr >= PERDOMAIN_VIRT_START) &&
   9.100 -         unlikely(addr < PERDOMAIN_VIRT_END) &&
   9.101 -         handle_perdomain_mapping_fault(addr - PERDOMAIN_VIRT_START, regs) )
   9.102 -        return EXCRET_fault_fixed;
   9.103 +    if ( unlikely((rc = fixup_page_fault(addr, regs)) != 0) )
   9.104 +        return rc;
   9.105  
   9.106 -    if ( !GUEST_MODE(regs) )
   9.107 -        goto xen_fault;
   9.108 +    if ( unlikely(!GUEST_MODE(regs)) )
   9.109 +    {
   9.110 +        if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
   9.111 +        {
   9.112 +            perfc_incrc(copy_user_faults);
   9.113 +            regs->eip = fixup;
   9.114 +            return 0;
   9.115 +        }
   9.116 +
   9.117 +        DEBUGGER_trap_fatal(TRAP_page_fault, regs);
   9.118 +
   9.119 +        show_registers(regs);
   9.120 +        show_page_walk(addr);
   9.121 +        panic("CPU%d FATAL PAGE FAULT\n"
   9.122 +              "[error_code=%04x]\n"
   9.123 +              "Faulting linear address: %p\n",
   9.124 +              smp_processor_id(), regs->error_code, addr);
   9.125 +    }
   9.126  
   9.127      propagate_page_fault(addr, regs->error_code);
   9.128      return 0;
   9.129 -
   9.130 - xen_fault:
   9.131 -
   9.132 -    if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
   9.133 -    {
   9.134 -        perfc_incrc(copy_user_faults);
   9.135 -        regs->eip = fixup;
   9.136 -        return 0;
   9.137 -    }
   9.138 -
   9.139 -    DEBUGGER_trap_fatal(TRAP_page_fault, regs);
   9.140 -
   9.141 -    show_registers(regs);
   9.142 -    show_page_walk(addr);
   9.143 -    panic("CPU%d FATAL PAGE FAULT\n"
   9.144 -          "[error_code=%04x]\n"
   9.145 -          "Faulting linear address: %p\n",
   9.146 -          smp_processor_id(), regs->error_code, addr);
   9.147 -    return 0;
   9.148  }
   9.149  
   9.150  long do_fpu_taskswitch(int set)
    10.1 --- a/xen/arch/x86/vmx.c	Fri Sep 09 17:36:39 2005 +0000
    10.2 +++ b/xen/arch/x86/vmx.c	Fri Sep 09 17:40:39 2005 +0000
    10.3 @@ -44,6 +44,8 @@
    10.4  
    10.5  #include <public/io/ioreq.h>
    10.6  
    10.7 +int hvm_enabled;
    10.8 +
    10.9  #ifdef CONFIG_VMX
   10.10  
   10.11  int vmcs_size;
   10.12 @@ -345,6 +347,8 @@ int start_vmx(void)
   10.13  
   10.14      vmx_save_init_msrs();
   10.15  
   10.16 +    hvm_enabled = 1;
   10.17 +
   10.18      return 1;
   10.19  }
   10.20  
    11.1 --- a/xen/common/Makefile	Fri Sep 09 17:36:39 2005 +0000
    11.2 +++ b/xen/common/Makefile	Fri Sep 09 17:40:39 2005 +0000
    11.3 @@ -19,3 +19,6 @@ common.o: $(OBJS)
    11.4  
    11.5  clean:
    11.6  	rm -f *.o *~ core
    11.7 +
    11.8 +# Object file contains changeset and compiler information.
    11.9 +kernel.o: $(BASEDIR)/include/xen/compile.h
    12.1 --- a/xen/common/kernel.c	Fri Sep 09 17:36:39 2005 +0000
    12.2 +++ b/xen/common/kernel.c	Fri Sep 09 17:40:39 2005 +0000
    12.3 @@ -113,14 +113,24 @@ long do_xen_version(int cmd, void *arg)
    12.4  
    12.5      case XENVER_capabilities:
    12.6      {
    12.7 -        struct xen_capabilities_info info;
    12.8 -        
    12.9 -        /* FIXME */
   12.10 -        info.arch = 0;
   12.11 -        info.pae = 0;
   12.12 +        xen_capabilities_info_t info;
   12.13 +        extern void arch_get_xen_caps(xen_capabilities_info_t info);
   12.14 +
   12.15 +        memset(info, 0, sizeof(info));
   12.16 +        arch_get_xen_caps(info);
   12.17 +
   12.18 +        if ( copy_to_user(arg, info, sizeof(info)) )
   12.19 +            return -EFAULT;
   12.20 +        return 0;
   12.21 +    }
   12.22 +    
   12.23 +    case XENVER_parameters:
   12.24 +    {
   12.25 +        xen_parameters_info_t info = { .virt_start = HYPERVISOR_VIRT_START };
   12.26          if ( copy_to_user(arg, &info, sizeof(info)) )
   12.27              return -EFAULT;
   12.28          return 0;
   12.29 +        
   12.30      }
   12.31      
   12.32      case XENVER_changeset:
    13.1 --- a/xen/drivers/char/Makefile	Fri Sep 09 17:36:39 2005 +0000
    13.2 +++ b/xen/drivers/char/Makefile	Fri Sep 09 17:40:39 2005 +0000
    13.3 @@ -8,4 +8,5 @@ driver.o: $(OBJS)
    13.4  clean:
    13.5  	rm -f *.o *~ core
    13.6  
    13.7 +# Object file contains changeset and compiler information.
    13.8  console.o: $(BASEDIR)/include/xen/compile.h
    14.1 --- a/xen/include/asm-x86/mm.h	Fri Sep 09 17:36:39 2005 +0000
    14.2 +++ b/xen/include/asm-x86/mm.h	Fri Sep 09 17:40:39 2005 +0000
    14.3 @@ -98,9 +98,10 @@ struct pfn_info
    14.4   /* 16-bit count of uses of this frame as its current type. */
    14.5  #define PGT_count_mask      ((1U<<16)-1)
    14.6  
    14.7 -#define PGT_mfn_mask        ((1U<<20)-1) /* mfn mask for shadow types */
    14.8 + /* 23-bit mfn mask for shadow types: good for up to 32GB RAM. */
    14.9 +#define PGT_mfn_mask        ((1U<<23)-1)
   14.10  
   14.11 -#define PGT_score_shift     20
   14.12 +#define PGT_score_shift     23
   14.13  #define PGT_score_mask      (((1U<<4)-1)<<PGT_score_shift)
   14.14  
   14.15   /* Cleared when the owning guest 'frees' this page. */
    15.1 --- a/xen/include/asm-x86/vmx.h	Fri Sep 09 17:36:39 2005 +0000
    15.2 +++ b/xen/include/asm-x86/vmx.h	Fri Sep 09 17:40:39 2005 +0000
    15.3 @@ -28,6 +28,8 @@
    15.4  
    15.5  #include <public/io/ioreq.h>
    15.6  
    15.7 +extern int hvm_enabled;
    15.8 +
    15.9  extern void vmx_asm_vmexit_handler(struct cpu_user_regs);
   15.10  extern void vmx_asm_do_resume(void);
   15.11  extern void vmx_asm_do_launch(void);
    16.1 --- a/xen/include/public/dom0_ops.h	Fri Sep 09 17:36:39 2005 +0000
    16.2 +++ b/xen/include/public/dom0_ops.h	Fri Sep 09 17:40:39 2005 +0000
    16.3 @@ -213,6 +213,7 @@ typedef struct {
    16.4      u32      cpu_khz;
    16.5      unsigned long total_pages;
    16.6      unsigned long free_pages;
    16.7 +    u32      hw_cap[8];
    16.8  } dom0_physinfo_t;
    16.9  
   16.10  /*
    17.1 --- a/xen/include/public/version.h	Fri Sep 09 17:36:39 2005 +0000
    17.2 +++ b/xen/include/public/version.h	Fri Sep 09 17:40:39 2005 +0000
    17.3 @@ -29,12 +29,14 @@ typedef struct xen_compile_info {
    17.4  } xen_compile_info_t;
    17.5  
    17.6  #define XENVER_capabilities 3
    17.7 -typedef struct xen_capabilities_info {
    17.8 -    int pae;
    17.9 -    int arch;
   17.10 -} xen_capabilities_info_t;
   17.11 +typedef char xen_capabilities_info_t[1024];
   17.12  
   17.13  #define XENVER_changeset 4
   17.14  typedef char xen_changeset_info_t[64];
   17.15  
   17.16 +#define XENVER_parameters 5
   17.17 +typedef struct xen_parameters_info {
   17.18 +    unsigned long virt_start;
   17.19 +} xen_parameters_info_t;
   17.20 +
   17.21  #endif /* __XEN_PUBLIC_VERSION_H__ */