direct-io.hg

changeset 7866:80e393599413

Merged.
author emellor@leeni.uk.xensource.com
date Thu Nov 17 12:59:58 2005 +0100 (2005-11-17)
parents 418954da5c0f c640c0c7f821
children 65e0699dc9e1 34d9095e79e3
files
line diff
     1.1 --- a/docs/man/xm.pod.1	Thu Nov 17 12:59:12 2005 +0100
     1.2 +++ b/docs/man/xm.pod.1	Thu Nov 17 12:59:58 2005 +0100
     1.3 @@ -550,10 +550,10 @@ will be allowed to run before being pree
     1.4  
     1.5  =item B<sched-sedf> I<period> I<slice> I<latency-hint> I<extratime> I<weight>
     1.6  
     1.7 -Set Simple EDF scheduler parameters.  This scheduler provides weighted
     1.8 -CPU sharing in an intuitive way and uses realtime-algorithms to ensure
     1.9 -time guarantees.  For more information see
    1.10 -docs/misc/sedf_scheduler_mini-HOWTO.txt in the Xen distribution.
    1.11 +Set Simple EDF (Earliest Deadline First) scheduler parameters.  This
    1.12 +scheduler provides weighted CPU sharing in an intuitive way and uses
    1.13 +realtime-algorithms to ensure time guarantees.  For more information
    1.14 +see docs/misc/sedf_scheduler_mini-HOWTO.txt in the Xen distribution.
    1.15  
    1.16  B<PARAMETERS>
    1.17  
    1.18 @@ -640,11 +640,54 @@ sexpression formatted.
    1.19  
    1.20  =head2 NETWORK DEVICES
    1.21  
    1.22 -=item B<network-attach> I<domain-id> I<[script=script]> I<[ip=ipaddr]>
    1.23 +=item B<network-attach> I<domain-id> I<[script=scriptname]> I<[ip=ipaddr]>
    1.24  I<[mac=macaddr]> I<[bridge=bridge-name]> I<[backend=bedomain-id]>
    1.25  
    1.26 +Creates a new network device in the domain specified by domain-id.  It
    1.27 +takes the following optional options:
    1.28 +
    1.29 +B<OPTIONS>
    1.30 +
    1.31 +=over 4
    1.32 +
    1.33 +=item I<script=scriptname>
    1.34 +
    1.35 +Use the specified script name to bring up the network.  Defaults to
    1.36 +the default setting in xend-config.sxp for I<vif-script>.
    1.37 +
    1.38 +=item I<ip=ipaddr>
    1.39 +
    1.40 +Passes the specified IP Address to the adapter on creation.  
    1.41 +
    1.42 +FIXME: this currently appears to be B<broken>.  I'm not sure under what
    1.43 +circumstances this should actually work.
    1.44 +
    1.45 +=item I<mac=macaddr>
    1.46 +
    1.47 +The MAC address that the domain will see on its ethernet device.  If
    1.48 +the device is not specified it will be randomly generated with the
    1.49 +00:16:3e vendor id prefix.
    1.50 +
    1.51 +=item I<bridge=bridge-name>
    1.52 +
    1.53 +The name of the bridge to attach the vif to, in case you have more
    1.54 +than one.  This defaults to 
    1.55 +
    1.56 +=item I<backend=bedomain-id>
    1.57 +
    1.58 +The backend domain id.  By default this is domain 0.
    1.59 +
    1.60 +=back
    1.61 +
    1.62  =item B<network-detach> I<domain-id> I<devid>
    1.63  
    1.64 +Removes the network device from the domain specified by I<domain-id>.
    1.65 +I<devid> is the virtual interface device number within the domain
    1.66 +(i.e. the 3 in vif22.3).
    1.67 +
    1.68 +FIXME: this is currently B<broken>.  Network devices aren't completely
    1.69 +removed from domain 0.
    1.70 +
    1.71  =item B<network-list> I<domain-id>
    1.72  
    1.73  List virtual network interfaces for a domain.  The returned output is
     2.1 --- a/docs/src/user/installation.tex	Thu Nov 17 12:59:12 2005 +0100
     2.2 +++ b/docs/src/user/installation.tex	Thu Nov 17 12:59:58 2005 +0100
     2.3 @@ -24,11 +24,6 @@ required if you wish to build from sourc
     2.4  \item [$\dag$] The Linux hotplug system\footnote{Available from {\tt
     2.5        http://linux-hotplug.sourceforge.net/}} (e.g., \path{/sbin/hotplug}
     2.6        and related scripts)
     2.7 -\item [$\dag$] An installation of Twisted~v1.3 or
     2.8 -  above\footnote{Available from {\tt http://www.twistedmatrix.com}}.
     2.9 -  There may be a binary package available for your distribution;
    2.10 -  alternatively it can be installed by running `{\sl make
    2.11 -    install-twisted}' in the root of the Xen source tree.
    2.12  \item [$*$] Build tools (gcc v3.2.x or v3.3.x, binutils, GNU make).
    2.13  \item [$*$] Development installation of libcurl (e.g.,\ libcurl-devel).
    2.14  \item [$*$] Development installation of zlib (e.g.,\ zlib-dev).
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Thu Nov 17 12:59:12 2005 +0100
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Thu Nov 17 12:59:58 2005 +0100
     3.3 @@ -219,7 +219,6 @@ static int privcmd_ioctl(struct inode *i
     3.4  
     3.5  #ifndef __ia64__
     3.6  	case IOCTL_PRIVCMD_GET_MACH2PHYS_MFNS: {
     3.7 -
     3.8  		pgd_t *pgd; 
     3.9  		pud_t *pud; 
    3.10  		pmd_t *pmd; 
    3.11 @@ -235,13 +234,13 @@ static int privcmd_ioctl(struct inode *i
    3.12  
    3.13  		p = m.arr; 
    3.14  
    3.15 -		for(i=0; i < m.num; i++) { 
    3.16 -
    3.17 +		for (i=0; i < m.num; i++) { 
    3.18  			pgd = pgd_offset_k(m2pv);
    3.19  			pud = pud_offset(pgd, m2pv);
    3.20  			pmd = pmd_offset(pud, m2pv);
    3.21 -			m2p_mfn = (*(uint64_t *)pmd >> PAGE_SHIFT)&0xFFFFFFFF;
    3.22 -			
    3.23 +			m2p_mfn  = (*(uint64_t *)pmd >> PAGE_SHIFT)&0xFFFFFFFF;
    3.24 +			m2p_mfn += pte_index(m2pv);
    3.25 +
    3.26  			if (put_user(m2p_mfn, p + i))
    3.27  				return -EFAULT;
    3.28  
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Thu Nov 17 12:59:12 2005 +0100
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Thu Nov 17 12:59:58 2005 +0100
     4.3 @@ -299,8 +299,8 @@ static void otherend_changed(struct xenb
     4.4  
     4.5  	DPRINTK("state is %d, %s, %s",
     4.6  		state, dev->otherend_watch.node, vec[XS_WATCH_PATH]);
     4.7 -
     4.8 -	drv->otherend_changed(dev, state);
     4.9 +	if (drv->otherend_changed)
    4.10 +		drv->otherend_changed(dev, state);
    4.11  }
    4.12  
    4.13  
     5.1 --- a/tools/libxc/xc_linux_restore.c	Thu Nov 17 12:59:12 2005 +0100
     5.2 +++ b/tools/libxc/xc_linux_restore.c	Thu Nov 17 12:59:58 2005 +0100
     5.3 @@ -146,7 +146,7 @@ int xc_linux_restore(int xc_handle, int 
     5.4      unsigned long buf[PAGE_SIZE/sizeof(unsigned long)];
     5.5  
     5.6      struct mmuext_op pin[MAX_PIN_BATCH];
     5.7 -    unsigned int nr_pins = 0;
     5.8 +    unsigned int nr_pins; 
     5.9  
    5.10  
    5.11      max_pfn = nr_pfns; 
    5.12 @@ -501,8 +501,17 @@ int xc_linux_restore(int xc_handle, int 
    5.13       * Pin page tables. Do this after writing to them as otherwise Xen
    5.14       * will barf when doing the type-checking.
    5.15       */
    5.16 +    nr_pins = 0; 
    5.17      for (i = 0; i < max_pfn; i++) {
    5.18  
    5.19 +        if (i == (max_pfn-1) || nr_pins == MAX_PIN_BATCH) {
    5.20 +            if (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) { 
    5.21 +                ERR("Failed to pin batch of %d page tables", nr_pins); 
    5.22 +                goto out;
    5.23 +            } 
    5.24 +            nr_pins = 0;
    5.25 +        }
    5.26 +
    5.27          if ( (pfn_type[i] & LPINTAB) == 0 )
    5.28              continue;
    5.29  
    5.30 @@ -529,16 +538,8 @@ int xc_linux_restore(int xc_handle, int 
    5.31          }
    5.32  
    5.33          pin[nr_pins].arg1.mfn = p2m[i];
    5.34 +        nr_pins++; 
    5.35  
    5.36 -        nr_pins ++; 
    5.37 -        
    5.38 -        if (i == (max_pfn-1) || nr_pins == MAX_PIN_BATCH) {
    5.39 -            if (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) { 
    5.40 -                ERR("Failed to pin batch of %d page tables", nr_pins); 
    5.41 -                goto out;
    5.42 -            } 
    5.43 -            nr_pins = 0;
    5.44 -        }
    5.45      }
    5.46  
    5.47      DPRINTF("\b\b\b\b100%%\n");
     6.1 --- a/tools/xm-test/README	Thu Nov 17 12:59:12 2005 +0100
     6.2 +++ b/tools/xm-test/README	Thu Nov 17 12:59:58 2005 +0100
     6.3 @@ -38,26 +38,60 @@ source.  All source needed for this proc
     6.4  downloaded, extracted, and compiled.  Due to the need to create
     6.5  special files, this process must be done as root:
     6.6  
     6.7 +   # ./autogen
     6.8     # ./configure
     6.9     # make
    6.10  
    6.11 -NB: If you have the initrd.img from a previous version of xm-test, you
    6.12 -can copy it into the ramdisk directory to eliminate the need to
    6.13 -rebuild it.  So far, nothing has changed in the ramdisk since xm-test
    6.14 -version 0.1.1.  If you do this, there is no need to run 'make' again.
    6.15 +NB: If you have the initrd.img from another installation of xm-test,
    6.16 +you can copy it into the ramdisk directory to eliminate the need to
    6.17 +rebuild it.  If you do this, there is no need to run 'make' again.
    6.18  Simply copy the initrd.img file into ramdisk/ and then run the
    6.19 -runtest.sh script.
    6.20 +runtest.sh script.  Note that in general, you should not attempt to
    6.21 +use a ramdisk from a previous minor version of xm-test (i.e., don't
    6.22 +use a ramdisk from 0.4.0 with 0.5.0.  0.5.0 should work for 0.5.3
    6.23 +though)
    6.24  
    6.25  
    6.26  Running
    6.27  =======
    6.28  
    6.29 -By running "./runtest.sh logfile" at the top level, all tests will be
    6.30 -run in alphabetic order.  To run a specific test group, run "make
    6.31 -check" from inside that group directory.  For example:
    6.32 +To run the full test suite, do the following as root:
    6.33 +
    6.34 +   # ./runtest.sh <logfile>
    6.35 +
    6.36 +This will run all tests, as well as generate and submit a report at
    6.37 +the end.  All output files will begin with "<logfile>."  If you wish to
    6.38 +prevent submission of a report, add "-d" to the command line like this:
    6.39 +
    6.40 +   # ./runtest.sh -d <logfile>
    6.41 +
    6.42 +It may be useful to run tests without submission as above, and then
    6.43 +submit the report at a later time.  To do so, run runtest.sh with the
    6.44 +-s flag and the name of the previously-generated report:
    6.45 +
    6.46 +   # ./runtest.sh -s <logfile>
    6.47 +
    6.48 +For people needing a quick test run instead the full suite, a quick
    6.49 +mode has been added that will attempt to run a representative subset
    6.50 +of tests.  This is not a substitute for the whole suite, but will
    6.51 +verify that some of the major functions of xen and xm are working:
    6.52 +
    6.53 +   # ./runtest.sh -q <logfile>
    6.54 +
    6.55 +Because of the current structure of the reporting software, submission
    6.56 +of quick test run results is not supported.
    6.57 +
    6.58 +It may be desirable to run a specific test group.  This can be
    6.59 +accomplished by doing the following:
    6.60  
    6.61     # cd tests/create
    6.62 -   # make check
    6.63 +   # TEST_VERBOSE=1 make check
    6.64 +
    6.65 +When developing or debugging a specific feature, a single test can be
    6.66 +run to avoid having to run even a whole test group:
    6.67 +
    6.68 +   # cd tests/create
    6.69 +   # TEST_VERBOSE=1 make check TESTS=01_create_basic_pos.test
    6.70  
    6.71  The runtest.sh script will create several files, including a .report
    6.72  file, which is the cleaned up, email-friendly report of failures.
    6.73 @@ -69,15 +103,9 @@ Note: you should generally run xm-test w
    6.74  allocated to Dom0.  More memory available for allocation to DomUs
    6.75  means a more rigorous test.
    6.76  
    6.77 -If you wish to run xm-test in an automated batch environment, you can
    6.78 -run the script with the "-b" flag, which will try to prevent it from
    6.79 -asking any questions interactively.  You should run it manually at
    6.80 -least once to generate the "contact_info" file, which will be used in
    6.81 -subsequent runs.
    6.82 -
    6.83 -BIG FAT WARNING: The framework assumes it is running on a dedicated
    6.84 -machine.  As such, the library automatically destroys any running
    6.85 -DomUs on the sytem to provide each test with a "clean slate".
    6.86 +BIG FAT WARNING: The test framework assumes it is running on a
    6.87 +dedicated machine.  As such, the library automatically destroys any
    6.88 +running DomUs on the system to provide each test with a "clean slate".
    6.89  
    6.90  
    6.91  Extending
    6.92 @@ -99,6 +127,9 @@ New subcommand groups should be added as
    6.93  subcommand itself.  The "Makefile.am.template" should be copied into
    6.94  the new group directory as "Makefile.am".
    6.95  
    6.96 +See the Writing_Tests_HOWTO file for more detailed information on
    6.97 +adding tests to the suite.
    6.98 +
    6.99  
   6.100  Developer Notes
   6.101  ===============
   6.102 @@ -114,21 +145,6 @@ use it with relatively few problems.
   6.103  Known Issues
   6.104  ============
   6.105  
   6.106 -- 08/22/2005 Dan Smith:
   6.107 -    Current versions of Xen experience long delays on
   6.108 -    boot, due to the blkif frontend waiting (and timing
   6.109 -    out) for the backend.  We now implicitly introduce
   6.110 -    a pause in XmTestDomain.start() to remedy
   6.111 -    this across all tests that need it.
   6.112 -
   6.113 -- 09/22/2005 Dan Smith:
   6.114 -    The save, restore, and migrate tests have been turned
   6.115 -    back on, as we have implemented timeout functionality 
   6.116 -    in "traceCommand".  Since migrate is known to hang, we 
   6.117 -    can now safely include it in the default test run, and
   6.118 -    have it be killed if it never finishes.  As before,
   6.119 -    feedback about these tests would be specifically
   6.120 -    appreciated.
   6.121  
   6.122  Reporting Bugs
   6.123  ==============
     7.1 --- a/tools/xm-test/lib/XmTestLib/Console.py	Thu Nov 17 12:59:12 2005 +0100
     7.2 +++ b/tools/xm-test/lib/XmTestLib/Console.py	Thu Nov 17 12:59:58 2005 +0100
     7.3 @@ -33,9 +33,13 @@ import select
     7.4  
     7.5  from Test import *
     7.6  
     7.7 +TIMEDOUT = 1
     7.8 +RUNAWAY  = 2
     7.9 +
    7.10  class ConsoleError(Exception):
    7.11 -    def __init__(self, msg):
    7.12 +    def __init__(self, msg, reason=TIMEDOUT):
    7.13          self.errMsg = msg
    7.14 +        self.reason = reason
    7.15  
    7.16      def __str__(self):
    7.17          return str(self.errMsg)
    7.18 @@ -149,7 +153,7 @@ class XmConsole:
    7.19  
    7.20              if self.limit and bytes >= self.limit:
    7.21                  raise ConsoleError("Console run-away (exceeded %i bytes)"
    7.22 -                                   % self.limit)
    7.23 +                                   % self.limit, RUNAWAY)
    7.24  
    7.25          if self.debugMe:
    7.26              print "Ignored %i bytes of miscellaneous console output" % bytes
    7.27 @@ -187,7 +191,7 @@ class XmConsole:
    7.28  
    7.29              if self.limit and bytes >= self.limit:
    7.30                  raise ConsoleError("Console run-away (exceeded %i bytes)"
    7.31 -                                   % self.limit)
    7.32 +                                   % self.limit, RUNAWAY)
    7.33  
    7.34              if str == "\n":
    7.35                  if lines > 0:
     8.1 --- a/tools/xm-test/tests/memset/04_memset_smallmem_pos.py	Thu Nov 17 12:59:12 2005 +0100
     8.2 +++ b/tools/xm-test/tests/memset/04_memset_smallmem_pos.py	Thu Nov 17 12:59:58 2005 +0100
     8.3 @@ -36,6 +36,17 @@ try:
     8.4      # See if this hits the byte limit
     8.5      console.runCmd("ls")
     8.6  except ConsoleError, e:
     8.7 -    FAIL(str(e))
     8.8 +    if e.reason == RUNAWAY:
     8.9 +        # Need to stop the domain before we restart the console daemon
    8.10 +        domain.destroy()
    8.11 +        if verbose:
    8.12 +            print "*** Attempting restart of xenconsoled"
    8.13 +            s, o = traceCommand("killall xenconsoled")
    8.14 +            s, o = traceCommand("xenconsoled")
    8.15 +            if s != 0:
    8.16 +                print "*** Starting xenconsoled failed: %i" % s
    8.17 +        FAIL("Bug #380: I crashed the console system")
    8.18 +    else:
    8.19 +        FAIL(str(e))
    8.20  
    8.21  domain.destroy()
     9.1 --- a/tools/xm-test/tests/pause/01_pause_basic_pos.py	Thu Nov 17 12:59:12 2005 +0100
     9.2 +++ b/tools/xm-test/tests/pause/01_pause_basic_pos.py	Thu Nov 17 12:59:58 2005 +0100
     9.3 @@ -49,12 +49,9 @@ status, output = traceCommand("xm pause 
     9.4  if status != 0:
     9.5  	FAIL("xm pause returned invalid %i != 0", status)
     9.6  
     9.7 -# Attach a console to it
     9.8 +# Try to attach a console to it
     9.9  try:
    9.10      console = XmConsole(domain.getName(), historySaveCmds=True)
    9.11 -except ConsoleError, e:
    9.12 -    FAIL(str(e))
    9.13 -try:
    9.14      run = console.runCmd("ls")
    9.15      #If we get here, console attached to paused domain (unexpected)
    9.16      FAIL("console attached to supposedly paused domain")
    10.1 --- a/xen/arch/x86/domain.c	Thu Nov 17 12:59:12 2005 +0100
    10.2 +++ b/xen/arch/x86/domain.c	Thu Nov 17 12:59:58 2005 +0100
    10.3 @@ -240,7 +240,10 @@ void free_vcpu_struct(struct vcpu *v)
    10.4  
    10.5  void free_perdomain_pt(struct domain *d)
    10.6  {
    10.7 -    free_xenheap_page(d->arch.mm_perdomain_pt);
    10.8 +    free_xenheap_pages(
    10.9 +        d->arch.mm_perdomain_pt,
   10.10 +        get_order_from_bytes(PDPT_L1_ENTRIES * sizeof(l1_pgentry_t)));
   10.11 +
   10.12  #ifdef __x86_64__
   10.13      free_xenheap_page(d->arch.mm_perdomain_l2);
   10.14      free_xenheap_page(d->arch.mm_perdomain_l3);
   10.15 @@ -251,7 +254,7 @@ void arch_do_createdomain(struct vcpu *v
   10.16  {
   10.17      struct domain *d = v->domain;
   10.18      l1_pgentry_t gdt_l1e;
   10.19 -    int vcpuid;
   10.20 +    int vcpuid, pdpt_order;
   10.21  
   10.22      if ( is_idle_task(d) )
   10.23          return;
   10.24 @@ -263,13 +266,10 @@ void arch_do_createdomain(struct vcpu *v
   10.25      v->vcpu_info = &d->shared_info->vcpu_data[v->vcpu_id];
   10.26      v->cpumap = CPUMAP_RUNANYWHERE;
   10.27      SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d);
   10.28 -    set_pfn_from_mfn(virt_to_phys(d->shared_info) >> PAGE_SHIFT,
   10.29 -            INVALID_M2P_ENTRY);
   10.30  
   10.31 -    d->arch.mm_perdomain_pt = alloc_xenheap_page();
   10.32 -    memset(d->arch.mm_perdomain_pt, 0, PAGE_SIZE);
   10.33 -    set_pfn_from_mfn(virt_to_phys(d->arch.mm_perdomain_pt) >> PAGE_SHIFT,
   10.34 -            INVALID_M2P_ENTRY);
   10.35 +    pdpt_order = get_order_from_bytes(PDPT_L1_ENTRIES * sizeof(l1_pgentry_t));
   10.36 +    d->arch.mm_perdomain_pt = alloc_xenheap_pages(pdpt_order);
   10.37 +    memset(d->arch.mm_perdomain_pt, 0, PAGE_SIZE << pdpt_order);
   10.38      v->arch.perdomain_ptes = d->arch.mm_perdomain_pt;
   10.39  
   10.40      /*
   10.41 @@ -293,9 +293,11 @@ void arch_do_createdomain(struct vcpu *v
   10.42  
   10.43      d->arch.mm_perdomain_l2 = alloc_xenheap_page();
   10.44      memset(d->arch.mm_perdomain_l2, 0, PAGE_SIZE);
   10.45 -    d->arch.mm_perdomain_l2[l2_table_offset(PERDOMAIN_VIRT_START)] =
   10.46 -        l2e_from_page(virt_to_page(d->arch.mm_perdomain_pt),
   10.47 -                        __PAGE_HYPERVISOR);
   10.48 +    for ( i = 0; i < (1 << pdpt_order); i++ )
   10.49 +        d->arch.mm_perdomain_l2[l2_table_offset(PERDOMAIN_VIRT_START)+i] =
   10.50 +            l2e_from_page(virt_to_page(d->arch.mm_perdomain_pt)+i,
   10.51 +                          __PAGE_HYPERVISOR);
   10.52 +
   10.53      d->arch.mm_perdomain_l3 = alloc_xenheap_page();
   10.54      memset(d->arch.mm_perdomain_l3, 0, PAGE_SIZE);
   10.55      d->arch.mm_perdomain_l3[l3_table_offset(PERDOMAIN_VIRT_START)] =
    11.1 --- a/xen/arch/x86/mm.c	Thu Nov 17 12:59:12 2005 +0100
    11.2 +++ b/xen/arch/x86/mm.c	Thu Nov 17 12:59:58 2005 +0100
    11.3 @@ -738,7 +738,7 @@ static int create_pae_xen_mappings(l3_pg
    11.4      memcpy(&pl2e[L2_PAGETABLE_FIRST_XEN_SLOT & (L2_PAGETABLE_ENTRIES-1)],
    11.5             &idle_pg_table_l2[L2_PAGETABLE_FIRST_XEN_SLOT],
    11.6             L2_PAGETABLE_XEN_SLOTS * sizeof(l2_pgentry_t));
    11.7 -    for ( i = 0; i < (PERDOMAIN_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
    11.8 +    for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
    11.9          pl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i] =
   11.10              l2e_from_page(
   11.11                  virt_to_page(page_get_owner(page)->arch.mm_perdomain_pt) + i,
    12.1 --- a/xen/arch/x86/shadow.c	Thu Nov 17 12:59:12 2005 +0100
    12.2 +++ b/xen/arch/x86/shadow.c	Thu Nov 17 12:59:58 2005 +0100
    12.3 @@ -2710,7 +2710,7 @@ static unsigned long shadow_l3_table(
    12.4             &idle_pg_table_l2[L2_PAGETABLE_FIRST_XEN_SLOT],
    12.5             L2_PAGETABLE_XEN_SLOTS * sizeof(l2_pgentry_t));       
    12.6  
    12.7 -        for ( i = 0; i < (PERDOMAIN_MBYTES >> (L2_PAGETABLE_SHIFT - 20)); i++ )
    12.8 +        for ( i = 0; i < PDPT_L2_ENTRIES; i++ )
    12.9              spl2e[l2_table_offset(PERDOMAIN_VIRT_START) + i] =
   12.10                  l2e_from_page(
   12.11                      virt_to_page(page_get_owner(&frame_table[gmfn])->arch.mm_perdomain_pt) + i, 
    13.1 --- a/xen/include/asm-x86/config.h	Thu Nov 17 12:59:12 2005 +0100
    13.2 +++ b/xen/include/asm-x86/config.h	Thu Nov 17 12:59:58 2005 +0100
    13.3 @@ -291,6 +291,9 @@ extern unsigned long xenheap_phys_end; /
    13.4  
    13.5  #define PDPT_VCPU_SHIFT       5
    13.6  #define PDPT_VCPU_VA_SHIFT    (PDPT_VCPU_SHIFT + PAGE_SHIFT)
    13.7 +#define PDPT_L1_ENTRIES       (MAX_VIRT_CPUS << PDPT_VCPU_SHIFT)
    13.8 +#define PDPT_L2_ENTRIES       \
    13.9 +    ((PDPT_L1_ENTRIES + (1 << PAGETABLE_ORDER) - 1) >> PAGETABLE_ORDER)
   13.10  
   13.11  #if defined(__x86_64__)
   13.12  #define ELFSIZE 64