ia64/xen-unstable

changeset 6733: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
     1.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Fri Sep 09 17:36:39 2005 +0000
     1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Fri Sep 09 17:40:39 2005 +0000
     1.3 @@ -690,6 +690,8 @@ static PyObject *pyxc_physinfo(PyObject 
     1.4  {
     1.5      XcObject *xc = (XcObject *)self;
     1.6      xc_physinfo_t info;
     1.7 +    char cpu_cap[128], *p=cpu_cap, *q=cpu_cap;
     1.8 +    int i;
     1.9      
    1.10      if ( !PyArg_ParseTuple(args, "") )
    1.11          return NULL;
    1.12 @@ -697,14 +699,25 @@ static PyObject *pyxc_physinfo(PyObject 
    1.13      if ( xc_physinfo(xc->xc_handle, &info) != 0 )
    1.14          return PyErr_SetFromErrno(xc_error);
    1.15  
    1.16 -    return Py_BuildValue("{s:i,s:i,s:i,s:i,s:l,s:l,s:i}",
    1.17 +    *q=0;
    1.18 +    for(i=0;i<sizeof(info.hw_cap)/4;i++)
    1.19 +    {
    1.20 +        p+=sprintf(p,"%08x:",info.hw_cap[i]);
    1.21 +        if(info.hw_cap[i])
    1.22 +	    q=p;
    1.23 +    }
    1.24 +    if(q>cpu_cap)
    1.25 +        *(q-1)=0;
    1.26 +
    1.27 +    return Py_BuildValue("{s:i,s:i,s:i,s:i,s:l,s:l,s:i,s:s}",
    1.28                           "threads_per_core", info.threads_per_core,
    1.29                           "cores_per_socket", info.cores_per_socket,
    1.30                           "sockets_per_node", info.sockets_per_node,
    1.31                           "nr_nodes",         info.nr_nodes,
    1.32                           "total_pages",      info.total_pages,
    1.33                           "free_pages",       info.free_pages,
    1.34 -                         "cpu_khz",          info.cpu_khz);
    1.35 +                         "cpu_khz",          info.cpu_khz,
    1.36 +                         "hw_caps",          cpu_cap);
    1.37  }
    1.38  
    1.39  static PyObject *pyxc_xeninfo(PyObject *self,
    1.40 @@ -715,7 +728,10 @@ static PyObject *pyxc_xeninfo(PyObject *
    1.41      xen_extraversion_t xen_extra;
    1.42      xen_compile_info_t xen_cc;
    1.43      xen_changeset_info_t xen_chgset;
    1.44 +    xen_capabilities_info_t xen_caps;
    1.45 +    xen_parameters_info_t xen_parms;
    1.46      long xen_version;
    1.47 +    char str[128];
    1.48  
    1.49      xen_version = xc_version(xc->xc_handle, XENVER_version, NULL);
    1.50  
    1.51 @@ -728,10 +744,20 @@ static PyObject *pyxc_xeninfo(PyObject *
    1.52      if ( xc_version(xc->xc_handle, XENVER_changeset, &xen_chgset) != 0 )
    1.53          return PyErr_SetFromErrno(xc_error);
    1.54  
    1.55 -    return Py_BuildValue("{s:i,s:i,s:s,s:s,s:s,s:s,s:s,s:s}",
    1.56 +    if ( xc_version(xc->xc_handle, XENVER_capabilities, &xen_caps) != 0 )
    1.57 +        return PyErr_SetFromErrno(xc_error);
    1.58 +
    1.59 +    if ( xc_version(xc->xc_handle, XENVER_parameters, &xen_parms) != 0 )
    1.60 +        return PyErr_SetFromErrno(xc_error);
    1.61 +
    1.62 +    sprintf(str,"virt_start=0x%lx",xen_parms.virt_start);
    1.63 +
    1.64 +    return Py_BuildValue("{s:i,s:i,s:s,s:s,s:s,s:s,s:s,s:s,s:s,s:s}",
    1.65                           "xen_major", xen_version >> 16,
    1.66                           "xen_minor", (xen_version & 0xffff),
    1.67                           "xen_extra", xen_extra,
    1.68 +                         "xen_caps",  xen_caps,
    1.69 +                         "xen_params", str,
    1.70                           "xen_changeset", xen_chgset,
    1.71                           "cc_compiler", xen_cc.compiler,
    1.72                           "cc_compile_by", xen_cc.compile_by,
     2.1 --- a/tools/python/xen/xend/XendNode.py	Fri Sep 09 17:36:39 2005 +0000
     2.2 +++ b/tools/python/xen/xend/XendNode.py	Fri Sep 09 17:40:39 2005 +0000
     2.3 @@ -58,20 +58,26 @@ class XendNode:
     2.4  
     2.5      def physinfo(self):
     2.6          pinfo = self.xc.physinfo()
     2.7 -        info = [['cores_per_socket', pinfo['cores_per_socket']],
     2.8 +        info = [['nr_cpus',          pinfo['nr_nodes']*pinfo['sockets_per_node']*pinfo['cores_per_socket']*pinfo['threads_per_core']],
     2.9 +                ['nr_nodes',         pinfo['nr_nodes']],
    2.10 +                ['sockets_per_node', pinfo['sockets_per_node']],
    2.11 +                ['cores_per_socket', pinfo['cores_per_socket']],
    2.12                  ['threads_per_core', pinfo['threads_per_core']],
    2.13 -                ['cpu_mhz', pinfo['cpu_khz']/1000],
    2.14 -                ['memory', pinfo['total_pages']/256],
    2.15 -                ['free_memory', pinfo['free_pages']/256]]
    2.16 +                ['cpu_mhz',          pinfo['cpu_khz']/1000],
    2.17 +                ['hw_caps',          pinfo['hw_caps']],
    2.18 +                ['memory',           pinfo['total_pages']/256],
    2.19 +                ['free_memory',      pinfo['free_pages']/256]]
    2.20          return info
    2.21          
    2.22      def xeninfo(self):
    2.23          xinfo = self.xc.xeninfo()
    2.24 -	return [['xen_major', xinfo['xen_major']],
    2.25 -	        ['xen_minor', xinfo['xen_minor']],
    2.26 -	        ['xen_extra', xinfo['xen_extra']],
    2.27 -		['xen_changeset', xinfo['xen_changeset']],
    2.28 -		['cc_compiler', xinfo['cc_compiler']],
    2.29 +        return [['xen_major', xinfo['xen_major']],
    2.30 +                ['xen_minor', xinfo['xen_minor']],
    2.31 +                ['xen_extra', xinfo['xen_extra']],
    2.32 +                ['xen_caps',  xinfo['xen_caps']],
    2.33 +                ['xen_params',xinfo['xen_params']],
    2.34 +                ['xen_changeset', xinfo['xen_changeset']],
    2.35 +                ['cc_compiler', xinfo['cc_compiler']],
    2.36                  ['cc_compile_by', xinfo['cc_compile_by']],
    2.37                  ['cc_compile_domain', xinfo['cc_compile_domain']],
    2.38                  ['cc_compile_date', xinfo['cc_compile_date']]]
     3.1 --- a/xen/arch/x86/dom0_ops.c	Fri Sep 09 17:36:39 2005 +0000
     3.2 +++ b/xen/arch/x86/dom0_ops.c	Fri Sep 09 17:40:39 2005 +0000
     3.3 @@ -19,6 +19,7 @@
     3.4  #include <xen/console.h>
     3.5  #include <asm/shadow.h>
     3.6  #include <asm/irq.h>
     3.7 +#include <asm/processor.h>
     3.8  #include <public/sched_ctl.h>
     3.9  
    3.10  #include <asm/mtrr.h>
    3.11 @@ -34,13 +35,13 @@ static unsigned long msr_hi;
    3.12  
    3.13  static void write_msr_for(void *unused)
    3.14  {
    3.15 -    if (((1 << current->processor) & msr_cpu_mask))
    3.16 +    if ( ((1 << current->processor) & msr_cpu_mask) )
    3.17          (void)wrmsr_user(msr_addr, msr_lo, msr_hi);
    3.18  }
    3.19  
    3.20  static void read_msr_for(void *unused)
    3.21  {
    3.22 -    if (((1 << current->processor) & msr_cpu_mask))
    3.23 +    if ( ((1 << current->processor) & msr_cpu_mask) )
    3.24          (void)rdmsr_user(msr_addr, msr_lo, msr_hi);
    3.25  }
    3.26  
    3.27 @@ -188,9 +189,11 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
    3.28          pi->total_pages      = max_page;
    3.29          pi->free_pages       = avail_domheap_pages();
    3.30          pi->cpu_khz          = cpu_khz;
    3.31 -
    3.32 -        copy_to_user(u_dom0_op, op, sizeof(*op));
    3.33 +        memset(pi->hw_cap, 0, sizeof(pi->hw_cap));
    3.34 +        memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4);
    3.35          ret = 0;
    3.36 +        if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
    3.37 +	    ret = -EFAULT;
    3.38      }
    3.39      break;
    3.40      
     4.1 --- a/xen/arch/x86/mm.c	Fri Sep 09 17:36:39 2005 +0000
     4.2 +++ b/xen/arch/x86/mm.c	Fri Sep 09 17:40:39 2005 +0000
     4.3 @@ -3185,7 +3185,7 @@ int ptwr_do_page_fault(struct domain *d,
     4.4      struct pfn_info *page;
     4.5      l1_pgentry_t     pte;
     4.6      l2_pgentry_t    *pl2e, l2e;
     4.7 -    int              which;
     4.8 +    int              which, flags;
     4.9      unsigned long    l2_idx;
    4.10  
    4.11      if ( unlikely(shadow_mode_enabled(d)) )
    4.12 @@ -3206,8 +3206,24 @@ int ptwr_do_page_fault(struct domain *d,
    4.13      pfn  = l1e_get_pfn(pte);
    4.14      page = &frame_table[pfn];
    4.15  
    4.16 +#ifdef CONFIG_X86_64
    4.17 +#define WRPT_PTE_FLAGS (_PAGE_RW | _PAGE_PRESENT | _PAGE_USER)
    4.18 +#else
    4.19 +#define WRPT_PTE_FLAGS (_PAGE_RW | _PAGE_PRESENT)
    4.20 +#endif
    4.21 +
    4.22 +    /*
    4.23 +     * Check the required flags for a valid wrpt mapping. If the page is
    4.24 +     * already writable then we can return straight to the guest (SMP race).
    4.25 +     * We decide whether or not to propagate the fault by testing for write
    4.26 +     * permissions in page directories by writing back to the linear mapping.
    4.27 +     */
    4.28 +    if ( (flags = l1e_get_flags(pte) & WRPT_PTE_FLAGS) == WRPT_PTE_FLAGS )
    4.29 +        return !__put_user(
    4.30 +            pte.l1, &linear_pg_table[l1_linear_offset(addr)].l1);
    4.31 +
    4.32      /* We are looking only for read-only mappings of p.t. pages. */
    4.33 -    if ( ((l1e_get_flags(pte) & (_PAGE_RW|_PAGE_PRESENT)) != _PAGE_PRESENT) ||
    4.34 +    if ( ((flags | _PAGE_RW) != WRPT_PTE_FLAGS) ||
    4.35           ((page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table) ||
    4.36           ((page->u.inuse.type_info & PGT_count_mask) == 0) ||
    4.37           (page_get_owner(page) != d) )
     5.1 --- a/xen/arch/x86/setup.c	Fri Sep 09 17:36:39 2005 +0000
     5.2 +++ b/xen/arch/x86/setup.c	Fri Sep 09 17:40:39 2005 +0000
     5.3 @@ -12,6 +12,8 @@
     5.4  #include <xen/trace.h>
     5.5  #include <xen/multiboot.h>
     5.6  #include <xen/domain_page.h>
     5.7 +#include <xen/compile.h>
     5.8 +#include <public/version.h>
     5.9  #include <asm/bitops.h>
    5.10  #include <asm/smp.h>
    5.11  #include <asm/processor.h>
    5.12 @@ -529,6 +531,46 @@ void __init __start_xen(multiboot_info_t
    5.13      startup_cpu_idle_loop();
    5.14  }
    5.15  
    5.16 +void arch_get_xen_caps(xen_capabilities_info_t info)
    5.17 +{
    5.18 +    char *p = info;
    5.19 +
    5.20 +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
    5.21 +
    5.22 +    p += sprintf(p, "xen_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
    5.23 +    if ( hvm_enabled )
    5.24 +        p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
    5.25 +
    5.26 +#elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
    5.27 +
    5.28 +    p += sprintf(p, "xen_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
    5.29 +    if ( hvm_enabled )
    5.30 +    {
    5.31 +        //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
    5.32 +        //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
    5.33 +    }
    5.34 +
    5.35 +#elif defined(CONFIG_X86_64)
    5.36 +
    5.37 +    p += sprintf(p, "xen_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION);
    5.38 +    if ( hvm_enabled )
    5.39 +    {
    5.40 +        //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
    5.41 +        //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
    5.42 +        p += sprintf(p, "hvm_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION);
    5.43 +    }
    5.44 +
    5.45 +#else
    5.46 +
    5.47 +    p++;
    5.48 +
    5.49 +#endif
    5.50 +    
    5.51 +    *(p-1) = 0;
    5.52 +
    5.53 +    BUG_ON((p - info) > sizeof(info));
    5.54 +}
    5.55 +
    5.56  /*
    5.57   * Local variables:
    5.58   * mode: C
     6.1 --- a/xen/arch/x86/traps.c	Fri Sep 09 17:36:39 2005 +0000
     6.2 +++ b/xen/arch/x86/traps.c	Fri Sep 09 17:40:39 2005 +0000
     6.3 @@ -470,20 +470,32 @@ static int handle_perdomain_mapping_faul
     6.4      return EXCRET_fault_fixed;
     6.5  }
     6.6  
     6.7 -asmlinkage int do_page_fault(struct cpu_user_regs *regs)
     6.8 +#ifdef HYPERVISOR_VIRT_END
     6.9 +#define IN_HYPERVISOR_RANGE(va) \
    6.10 +    (((va) >= HYPERVISOR_VIRT_START) && ((va) < HYPERVISOR_VIRT_END))
    6.11 +#else
    6.12 +#define IN_HYPERVISOR_RANGE(va) \
    6.13 +    (((va) >= HYPERVISOR_VIRT_START))
    6.14 +#endif
    6.15 +
    6.16 +static int fixup_page_fault(unsigned long addr, struct cpu_user_regs *regs)
    6.17  {
    6.18 -    unsigned long addr, fixup;
    6.19 -    struct vcpu *v = current;
    6.20 +    struct vcpu   *v = current;
    6.21      struct domain *d = v->domain;
    6.22  
    6.23 -    __asm__ __volatile__ ("mov %%cr2,%0" : "=r" (addr) : );
    6.24 -
    6.25 -    DEBUGGER_trap_entry(TRAP_page_fault, regs);
    6.26 -
    6.27 -    perfc_incrc(page_faults);
    6.28 -
    6.29 -    if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables) &&
    6.30 -                !shadow_mode_enabled(d)) )
    6.31 +    if ( unlikely(IN_HYPERVISOR_RANGE(addr)) )
    6.32 +    {
    6.33 +        if ( shadow_mode_external(d) && GUEST_CONTEXT(v, regs) )
    6.34 +            return shadow_fault(addr, regs);
    6.35 +        if ( (addr >= PERDOMAIN_VIRT_START) && (addr < PERDOMAIN_VIRT_END) )
    6.36 +            return handle_perdomain_mapping_fault(
    6.37 +                addr - PERDOMAIN_VIRT_START, regs);
    6.38 +    }
    6.39 +    else if ( unlikely(shadow_mode_enabled(d)) )
    6.40 +    {
    6.41 +        return shadow_fault(addr, regs);
    6.42 +    }
    6.43 +    else if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) )
    6.44      {
    6.45          LOCK_BIGLOCK(d);
    6.46          if ( unlikely(d->arch.ptwr[PTWR_PT_ACTIVE].l1va) &&
    6.47 @@ -495,14 +507,9 @@ asmlinkage int do_page_fault(struct cpu_
    6.48              return EXCRET_fault_fixed;
    6.49          }
    6.50  
    6.51 -        if ( ((addr < HYPERVISOR_VIRT_START) 
    6.52 -#if defined(__x86_64__)
    6.53 -              || (addr >= HYPERVISOR_VIRT_END)
    6.54 -#endif        
    6.55 -            )     
    6.56 -             &&
    6.57 -             KERNEL_MODE(v, regs) &&
    6.58 -             ((regs->error_code & 3) == 3) && /* write-protection fault */
    6.59 +        if ( KERNEL_MODE(v, regs) &&
    6.60 +             /* Protection violation on write? No reserved-bit violation? */
    6.61 +             ((regs->error_code & 0xb) == 0x3) &&
    6.62               ptwr_do_page_fault(d, addr, regs) )
    6.63          {
    6.64              UNLOCK_BIGLOCK(d);
    6.65 @@ -511,44 +518,52 @@ asmlinkage int do_page_fault(struct cpu_
    6.66          UNLOCK_BIGLOCK(d);
    6.67      }
    6.68  
    6.69 -    if ( unlikely(shadow_mode_enabled(d)) &&
    6.70 -         ((addr < HYPERVISOR_VIRT_START) ||
    6.71 -#if defined(__x86_64__)
    6.72 -          (addr >= HYPERVISOR_VIRT_END) ||
    6.73 -#endif
    6.74 -          (shadow_mode_external(d) && GUEST_CONTEXT(v, regs))) &&
    6.75 -         shadow_fault(addr, regs) )
    6.76 -        return EXCRET_fault_fixed;
    6.77 +    return 0;
    6.78 +}
    6.79  
    6.80 -    if ( unlikely(addr >= PERDOMAIN_VIRT_START) &&
    6.81 -         unlikely(addr < PERDOMAIN_VIRT_END) &&
    6.82 -         handle_perdomain_mapping_fault(addr - PERDOMAIN_VIRT_START, regs) )
    6.83 -        return EXCRET_fault_fixed;
    6.84 +/*
    6.85 + * #PF error code:
    6.86 + *  Bit 0: Protection violation (=1) ; Page not present (=0)
    6.87 + *  Bit 1: Write access
    6.88 + *  Bit 2: Supervisor mode
    6.89 + *  Bit 3: Reserved bit violation
    6.90 + *  Bit 4: Instruction fetch
    6.91 + */
    6.92 +asmlinkage int do_page_fault(struct cpu_user_regs *regs)
    6.93 +{
    6.94 +    unsigned long addr, fixup;
    6.95 +    int rc;
    6.96  
    6.97 -    if ( !GUEST_MODE(regs) )
    6.98 -        goto xen_fault;
    6.99 +    __asm__ __volatile__ ("mov %%cr2,%0" : "=r" (addr) : );
   6.100 +
   6.101 +    DEBUGGER_trap_entry(TRAP_page_fault, regs);
   6.102 +
   6.103 +    perfc_incrc(page_faults);
   6.104 +
   6.105 +    if ( unlikely((rc = fixup_page_fault(addr, regs)) != 0) )
   6.106 +        return rc;
   6.107 +
   6.108 +    if ( unlikely(!GUEST_MODE(regs)) )
   6.109 +    {
   6.110 +        if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
   6.111 +        {
   6.112 +            perfc_incrc(copy_user_faults);
   6.113 +            regs->eip = fixup;
   6.114 +            return 0;
   6.115 +        }
   6.116 +
   6.117 +        DEBUGGER_trap_fatal(TRAP_page_fault, regs);
   6.118 +
   6.119 +        show_registers(regs);
   6.120 +        show_page_walk(addr);
   6.121 +        panic("CPU%d FATAL PAGE FAULT\n"
   6.122 +              "[error_code=%04x]\n"
   6.123 +              "Faulting linear address: %p\n",
   6.124 +              smp_processor_id(), regs->error_code, addr);
   6.125 +    }
   6.126  
   6.127      propagate_page_fault(addr, regs->error_code);
   6.128      return 0;
   6.129 -
   6.130 - xen_fault:
   6.131 -
   6.132 -    if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
   6.133 -    {
   6.134 -        perfc_incrc(copy_user_faults);
   6.135 -        regs->eip = fixup;
   6.136 -        return 0;
   6.137 -    }
   6.138 -
   6.139 -    DEBUGGER_trap_fatal(TRAP_page_fault, regs);
   6.140 -
   6.141 -    show_registers(regs);
   6.142 -    show_page_walk(addr);
   6.143 -    panic("CPU%d FATAL PAGE FAULT\n"
   6.144 -          "[error_code=%04x]\n"
   6.145 -          "Faulting linear address: %p\n",
   6.146 -          smp_processor_id(), regs->error_code, addr);
   6.147 -    return 0;
   6.148  }
   6.149  
   6.150  long do_fpu_taskswitch(int set)
     7.1 --- a/xen/arch/x86/vmx.c	Fri Sep 09 17:36:39 2005 +0000
     7.2 +++ b/xen/arch/x86/vmx.c	Fri Sep 09 17:40:39 2005 +0000
     7.3 @@ -44,6 +44,8 @@
     7.4  
     7.5  #include <public/io/ioreq.h>
     7.6  
     7.7 +int hvm_enabled;
     7.8 +
     7.9  #ifdef CONFIG_VMX
    7.10  
    7.11  int vmcs_size;
    7.12 @@ -345,6 +347,8 @@ int start_vmx(void)
    7.13  
    7.14      vmx_save_init_msrs();
    7.15  
    7.16 +    hvm_enabled = 1;
    7.17 +
    7.18      return 1;
    7.19  }
    7.20  
     8.1 --- a/xen/common/Makefile	Fri Sep 09 17:36:39 2005 +0000
     8.2 +++ b/xen/common/Makefile	Fri Sep 09 17:40:39 2005 +0000
     8.3 @@ -19,3 +19,6 @@ common.o: $(OBJS)
     8.4  
     8.5  clean:
     8.6  	rm -f *.o *~ core
     8.7 +
     8.8 +# Object file contains changeset and compiler information.
     8.9 +kernel.o: $(BASEDIR)/include/xen/compile.h
     9.1 --- a/xen/common/kernel.c	Fri Sep 09 17:36:39 2005 +0000
     9.2 +++ b/xen/common/kernel.c	Fri Sep 09 17:40:39 2005 +0000
     9.3 @@ -113,14 +113,24 @@ long do_xen_version(int cmd, void *arg)
     9.4  
     9.5      case XENVER_capabilities:
     9.6      {
     9.7 -        struct xen_capabilities_info info;
     9.8 -        
     9.9 -        /* FIXME */
    9.10 -        info.arch = 0;
    9.11 -        info.pae = 0;
    9.12 +        xen_capabilities_info_t info;
    9.13 +        extern void arch_get_xen_caps(xen_capabilities_info_t info);
    9.14 +
    9.15 +        memset(info, 0, sizeof(info));
    9.16 +        arch_get_xen_caps(info);
    9.17 +
    9.18 +        if ( copy_to_user(arg, info, sizeof(info)) )
    9.19 +            return -EFAULT;
    9.20 +        return 0;
    9.21 +    }
    9.22 +    
    9.23 +    case XENVER_parameters:
    9.24 +    {
    9.25 +        xen_parameters_info_t info = { .virt_start = HYPERVISOR_VIRT_START };
    9.26          if ( copy_to_user(arg, &info, sizeof(info)) )
    9.27              return -EFAULT;
    9.28          return 0;
    9.29 +        
    9.30      }
    9.31      
    9.32      case XENVER_changeset:
    10.1 --- a/xen/drivers/char/Makefile	Fri Sep 09 17:36:39 2005 +0000
    10.2 +++ b/xen/drivers/char/Makefile	Fri Sep 09 17:40:39 2005 +0000
    10.3 @@ -8,4 +8,5 @@ driver.o: $(OBJS)
    10.4  clean:
    10.5  	rm -f *.o *~ core
    10.6  
    10.7 +# Object file contains changeset and compiler information.
    10.8  console.o: $(BASEDIR)/include/xen/compile.h
    11.1 --- a/xen/include/asm-x86/mm.h	Fri Sep 09 17:36:39 2005 +0000
    11.2 +++ b/xen/include/asm-x86/mm.h	Fri Sep 09 17:40:39 2005 +0000
    11.3 @@ -98,9 +98,10 @@ struct pfn_info
    11.4   /* 16-bit count of uses of this frame as its current type. */
    11.5  #define PGT_count_mask      ((1U<<16)-1)
    11.6  
    11.7 -#define PGT_mfn_mask        ((1U<<20)-1) /* mfn mask for shadow types */
    11.8 + /* 23-bit mfn mask for shadow types: good for up to 32GB RAM. */
    11.9 +#define PGT_mfn_mask        ((1U<<23)-1)
   11.10  
   11.11 -#define PGT_score_shift     20
   11.12 +#define PGT_score_shift     23
   11.13  #define PGT_score_mask      (((1U<<4)-1)<<PGT_score_shift)
   11.14  
   11.15   /* Cleared when the owning guest 'frees' this page. */
    12.1 --- a/xen/include/asm-x86/vmx.h	Fri Sep 09 17:36:39 2005 +0000
    12.2 +++ b/xen/include/asm-x86/vmx.h	Fri Sep 09 17:40:39 2005 +0000
    12.3 @@ -28,6 +28,8 @@
    12.4  
    12.5  #include <public/io/ioreq.h>
    12.6  
    12.7 +extern int hvm_enabled;
    12.8 +
    12.9  extern void vmx_asm_vmexit_handler(struct cpu_user_regs);
   12.10  extern void vmx_asm_do_resume(void);
   12.11  extern void vmx_asm_do_launch(void);
    13.1 --- a/xen/include/public/dom0_ops.h	Fri Sep 09 17:36:39 2005 +0000
    13.2 +++ b/xen/include/public/dom0_ops.h	Fri Sep 09 17:40:39 2005 +0000
    13.3 @@ -213,6 +213,7 @@ typedef struct {
    13.4      u32      cpu_khz;
    13.5      unsigned long total_pages;
    13.6      unsigned long free_pages;
    13.7 +    u32      hw_cap[8];
    13.8  } dom0_physinfo_t;
    13.9  
   13.10  /*
    14.1 --- a/xen/include/public/version.h	Fri Sep 09 17:36:39 2005 +0000
    14.2 +++ b/xen/include/public/version.h	Fri Sep 09 17:40:39 2005 +0000
    14.3 @@ -29,12 +29,14 @@ typedef struct xen_compile_info {
    14.4  } xen_compile_info_t;
    14.5  
    14.6  #define XENVER_capabilities 3
    14.7 -typedef struct xen_capabilities_info {
    14.8 -    int pae;
    14.9 -    int arch;
   14.10 -} xen_capabilities_info_t;
   14.11 +typedef char xen_capabilities_info_t[1024];
   14.12  
   14.13  #define XENVER_changeset 4
   14.14  typedef char xen_changeset_info_t[64];
   14.15  
   14.16 +#define XENVER_parameters 5
   14.17 +typedef struct xen_parameters_info {
   14.18 +    unsigned long virt_start;
   14.19 +} xen_parameters_info_t;
   14.20 +
   14.21  #endif /* __XEN_PUBLIC_VERSION_H__ */