ia64/xen-unstable

changeset 15635:3c28bc13a3f8

[XEN] replace shadow_* with paging_* in common code
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Fri Jul 20 11:36:36 2007 +0100 (2007-07-20)
parents 091134f5555c
children 44e12d5b5178
files xen/common/compat/kernel.c xen/common/domctl.c xen/common/grant_table.c xen/common/kernel.c xen/common/keyhandler.c xen/common/memory.c xen/common/page_alloc.c xen/common/xenoprof.c xen/include/asm-x86/config.h xen/include/xen/paging.h xen/include/xen/shadow.h
line diff
     1.1 --- a/xen/common/compat/kernel.c	Fri Jul 20 10:47:11 2007 +0100
     1.2 +++ b/xen/common/compat/kernel.c	Fri Jul 20 11:36:36 2007 +0100
     1.3 @@ -8,7 +8,6 @@
     1.4  #include <xen/errno.h>
     1.5  #include <xen/version.h>
     1.6  #include <xen/sched.h>
     1.7 -#include <xen/shadow.h>
     1.8  #include <xen/nmi.h>
     1.9  #include <xen/guest_access.h>
    1.10  #include <asm/current.h>
     2.1 --- a/xen/common/domctl.c	Fri Jul 20 10:47:11 2007 +0100
     2.2 +++ b/xen/common/domctl.c	Fri Jul 20 11:36:36 2007 +0100
     2.3 @@ -20,7 +20,6 @@
     2.4  #include <xen/rcupdate.h>
     2.5  #include <xen/guest_access.h>
     2.6  #include <xen/bitmap.h>
     2.7 -#include <xen/shadow.h>
     2.8  #include <asm/current.h>
     2.9  #include <public/domctl.h>
    2.10  #include <acm/acm_hooks.h>
     3.1 --- a/xen/common/grant_table.c	Fri Jul 20 10:47:11 2007 +0100
     3.2 +++ b/xen/common/grant_table.c	Fri Jul 20 11:36:36 2007 +0100
     3.3 @@ -28,7 +28,6 @@
     3.4  #include <xen/iocap.h>
     3.5  #include <xen/lib.h>
     3.6  #include <xen/sched.h>
     3.7 -#include <xen/shadow.h>
     3.8  #include <xen/mm.h>
     3.9  #include <xen/trace.h>
    3.10  #include <xen/guest_access.h>
     4.1 --- a/xen/common/kernel.c	Fri Jul 20 10:47:11 2007 +0100
     4.2 +++ b/xen/common/kernel.c	Fri Jul 20 11:36:36 2007 +0100
     4.3 @@ -10,7 +10,7 @@
     4.4  #include <xen/errno.h>
     4.5  #include <xen/version.h>
     4.6  #include <xen/sched.h>
     4.7 -#include <xen/shadow.h>
     4.8 +#include <xen/paging.h>
     4.9  #include <xen/nmi.h>
    4.10  #include <xen/guest_access.h>
    4.11  #include <asm/current.h>
    4.12 @@ -217,7 +217,7 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
    4.13              fi.submap = 0;
    4.14              if ( VM_ASSIST(d, VMASST_TYPE_pae_extended_cr3) )
    4.15                  fi.submap |= (1U << XENFEAT_pae_pgdir_above_4gb);
    4.16 -            if ( shadow_mode_translate(current->domain) )
    4.17 +            if ( paging_mode_translate(current->domain) )
    4.18                  fi.submap |= 
    4.19                      (1U << XENFEAT_writable_page_tables) |
    4.20                      (1U << XENFEAT_auto_translated_physmap);
     5.1 --- a/xen/common/keyhandler.c	Fri Jul 20 10:47:11 2007 +0100
     5.2 +++ b/xen/common/keyhandler.c	Fri Jul 20 11:36:36 2007 +0100
     5.3 @@ -14,7 +14,6 @@
     5.4  #include <xen/rangeset.h>
     5.5  #include <xen/compat.h>
     5.6  #include <asm/debugger.h>
     5.7 -#include <asm/shadow.h>
     5.8  #include <asm/div64.h>
     5.9  
    5.10  #define KEY_MAX 256
     6.1 --- a/xen/common/memory.c	Fri Jul 20 10:47:11 2007 +0100
     6.2 +++ b/xen/common/memory.c	Fri Jul 20 11:36:36 2007 +0100
     6.3 @@ -14,7 +14,7 @@
     6.4  #include <xen/perfc.h>
     6.5  #include <xen/sched.h>
     6.6  #include <xen/event.h>
     6.7 -#include <xen/shadow.h>
     6.8 +#include <xen/paging.h>
     6.9  #include <xen/iocap.h>
    6.10  #include <xen/guest_access.h>
    6.11  #include <xen/hypercall.h>
    6.12 @@ -127,7 +127,7 @@ static void populate_physmap(struct memo
    6.13  
    6.14          mfn = page_to_mfn(page);
    6.15  
    6.16 -        if ( unlikely(shadow_mode_translate(d)) )
    6.17 +        if ( unlikely(paging_mode_translate(d)) )
    6.18          {
    6.19              for ( j = 0; j < (1 << a->extent_order); j++ )
    6.20                  guest_physmap_add_page(d, gpfn + j, mfn + j);
    6.21 @@ -236,7 +236,7 @@ static long translate_gpfn_list(
    6.22      if ( (d = rcu_lock_domain_by_id(op.domid)) == NULL )
    6.23          return -ESRCH;
    6.24  
    6.25 -    if ( !shadow_mode_translate(d) )
    6.26 +    if ( !paging_mode_translate(d) )
    6.27      {
    6.28          rcu_unlock_domain(d);
    6.29          return -EINVAL;
    6.30 @@ -434,7 +434,7 @@ static long memory_exchange(XEN_GUEST_HA
    6.31                  &gpfn, exch.out.extent_start, (i<<out_chunk_order)+j, 1);
    6.32  
    6.33              mfn = page_to_mfn(page);
    6.34 -            if ( unlikely(shadow_mode_translate(d)) )
    6.35 +            if ( unlikely(paging_mode_translate(d)) )
    6.36              {
    6.37                  for ( k = 0; k < (1UL << exch.out.extent_order); k++ )
    6.38                      guest_physmap_add_page(d, gpfn + k, mfn + k);
     7.1 --- a/xen/common/page_alloc.c	Fri Jul 20 10:47:11 2007 +0100
     7.2 +++ b/xen/common/page_alloc.c	Fri Jul 20 11:36:36 2007 +0100
     7.3 @@ -30,13 +30,13 @@
     7.4  #include <xen/mm.h>
     7.5  #include <xen/irq.h>
     7.6  #include <xen/softirq.h>
     7.7 -#include <xen/shadow.h>
     7.8  #include <xen/domain_page.h>
     7.9  #include <xen/keyhandler.h>
    7.10  #include <xen/perfc.h>
    7.11  #include <xen/numa.h>
    7.12  #include <xen/nodemask.h>
    7.13  #include <asm/page.h>
    7.14 +#include <asm/flushtlb.h>
    7.15  
    7.16  /*
    7.17   * Comma-separated list of hexadecimal page numbers containing bad bytes.
     8.1 --- a/xen/common/xenoprof.c	Fri Jul 20 10:47:11 2007 +0100
     8.2 +++ b/xen/common/xenoprof.c	Fri Jul 20 11:36:36 2007 +0100
     8.3 @@ -13,7 +13,7 @@
     8.4  #include <xen/guest_access.h>
     8.5  #include <xen/sched.h>
     8.6  #include <public/xenoprof.h>
     8.7 -#include <asm/shadow.h>
     8.8 +#include <xen/paging.h>
     8.9  
    8.10  /* Limit amount of pages used for shared buffer (per domain) */
    8.11  #define MAX_OPROF_SHARED_PAGES 32
    8.12 @@ -397,7 +397,7 @@ static int add_passive_list(XEN_GUEST_HA
    8.13      d->xenoprof->domain_type = XENOPROF_DOMAIN_PASSIVE;
    8.14      passive.nbuf = d->xenoprof->nbuf;
    8.15      passive.bufsize = d->xenoprof->bufsize;
    8.16 -    if ( !shadow_mode_translate(current->domain) )
    8.17 +    if ( !paging_mode_translate(current->domain) )
    8.18          passive.buf_gmaddr = __pa(d->xenoprof->rawbuf);
    8.19      else
    8.20          xenoprof_shared_gmfn_with_guest(
    8.21 @@ -598,7 +598,7 @@ static int xenoprof_op_get_buffer(XEN_GU
    8.22          
    8.23      xenoprof_get_buffer.nbuf = d->xenoprof->nbuf;
    8.24      xenoprof_get_buffer.bufsize = d->xenoprof->bufsize;
    8.25 -    if ( !shadow_mode_translate(d) )
    8.26 +    if ( !paging_mode_translate(d) )
    8.27          xenoprof_get_buffer.buf_gmaddr = __pa(d->xenoprof->rawbuf);
    8.28      else
    8.29          xenoprof_shared_gmfn_with_guest(
     9.1 --- a/xen/include/asm-x86/config.h	Fri Jul 20 10:47:11 2007 +0100
     9.2 +++ b/xen/include/asm-x86/config.h	Fri Jul 20 11:36:36 2007 +0100
     9.3 @@ -17,7 +17,7 @@
     9.4  
     9.5  #define CONFIG_X86 1
     9.6  #define CONFIG_X86_HT 1
     9.7 -#define CONFIG_SHADOW 1
     9.8 +#define CONFIG_PAGING_ASSISTANCE 1
     9.9  #define CONFIG_SMP 1
    9.10  #define CONFIG_X86_LOCAL_APIC 1
    9.11  #define CONFIG_X86_GOOD_APIC 1
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/xen/include/xen/paging.h	Fri Jul 20 11:36:36 2007 +0100
    10.3 @@ -0,0 +1,26 @@
    10.4 +
    10.5 +#ifndef __XEN_PAGING_H__
    10.6 +#define __XEN_PAGING_H__
    10.7 +
    10.8 +#include <xen/config.h>
    10.9 +
   10.10 +#if defined CONFIG_PAGING_ASSISTANCE
   10.11 +
   10.12 +#include <asm/paging.h>
   10.13 +#include <asm/p2m.h>
   10.14 +
   10.15 +#elif defined CONFIG_SHADOW
   10.16 +
   10.17 +#include <asm/shadow.h>
   10.18 +
   10.19 +#define paging_mode_translate(d)  shadow_mode_translate(d)
   10.20 +
   10.21 +#else
   10.22 +
   10.23 +#define paging_mode_translate(d)              (0)
   10.24 +#define guest_physmap_add_page(d, p, m)       ((void)0)
   10.25 +#define guest_physmap_remove_page(d, p, m)    ((void)0)
   10.26 +
   10.27 +#endif
   10.28 +
   10.29 +#endif /* __XEN_PAGING_H__ */
    11.1 --- a/xen/include/xen/shadow.h	Fri Jul 20 10:47:11 2007 +0100
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,23 +0,0 @@
    11.4 -
    11.5 -#ifndef __XEN_SHADOW_H__
    11.6 -#define __XEN_SHADOW_H__
    11.7 -
    11.8 -#include <xen/config.h>
    11.9 -
   11.10 -#ifdef CONFIG_SHADOW
   11.11 -
   11.12 -#include <asm/shadow.h>
   11.13 -
   11.14 -#else
   11.15 -
   11.16 -#define shadow_drop_references(d, p)          ((void)0)
   11.17 -#define shadow_sync_and_drop_references(d, p) ((void)0)
   11.18 -
   11.19 -#define shadow_mode_translate(d)              (0)
   11.20 -
   11.21 -#define guest_physmap_add_page(d, p, m)       ((void)0)
   11.22 -#define guest_physmap_remove_page(d, p, m)    ((void)0)
   11.23 -
   11.24 -#endif
   11.25 -
   11.26 -#endif /* __XEN_SHADOW_H__ */