ia64/xen-unstable

changeset 11212:ca9f3a7b1b03

[XEN] Remove shadow2 dependencies from common code.
Disable debugtrace functionality even in debug builds:
it's currently only used by shadow2 maintainers.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Aug 18 17:59:26 2006 +0100 (2006-08-18)
parents a658663ab2d0
children 1818ea221bfe
files xen/arch/x86/shadow2-common.c xen/arch/x86/shadow2.c xen/common/keyhandler.c xen/common/memory.c xen/drivers/char/console.c xen/include/xen/lib.h
line diff
     1.1 --- a/xen/arch/x86/shadow2-common.c	Fri Aug 18 16:20:45 2006 +0100
     1.2 +++ b/xen/arch/x86/shadow2-common.c	Fri Aug 18 17:59:26 2006 +0100
     1.3 @@ -32,6 +32,7 @@
     1.4  #include <xen/irq.h>
     1.5  #include <xen/domain_page.h>
     1.6  #include <xen/guest_access.h>
     1.7 +#include <xen/keyhandler.h>
     1.8  #include <asm/event.h>
     1.9  #include <asm/page.h>
    1.10  #include <asm/current.h>
    1.11 @@ -41,7 +42,22 @@
    1.12  
    1.13  #if SHADOW2_AUDIT
    1.14  int shadow2_audit_enable = 0;
    1.15 -#endif
    1.16 +
    1.17 +static void shadow2_audit_key(unsigned char key)
    1.18 +{
    1.19 +    shadow2_audit_enable = !shadow2_audit_enable;
    1.20 +    printk("%s shadow2_audit_enable=%d\n",
    1.21 +           __func__, shadow2_audit_enable);
    1.22 +}
    1.23 +
    1.24 +static int __init shadow2_audit_key_init(void)
    1.25 +{
    1.26 +    register_keyhandler(
    1.27 +        'O', shadow2_audit_key,  "toggle shadow2 audits");
    1.28 +    return 0;
    1.29 +}
    1.30 +__initcall(shadow2_audit_key_init);
    1.31 +#endif /* SHADOW2_AUDIT */
    1.32  
    1.33  static void sh2_free_log_dirty_bitmap(struct domain *d);
    1.34  
     2.1 --- a/xen/arch/x86/shadow2.c	Fri Aug 18 16:20:45 2006 +0100
     2.2 +++ b/xen/arch/x86/shadow2.c	Fri Aug 18 17:59:26 2006 +0100
     2.3 @@ -111,7 +111,7 @@ typedef enum {
     2.4      ft_demand_write = FETCH_TYPE_DEMAND | FETCH_TYPE_WRITE,
     2.5  } fetch_type_t;
     2.6  
     2.7 -#ifndef NDEBUG
     2.8 +#ifdef DEBUG_TRACE_DUMP
     2.9  static char *fetch_type_names[] = {
    2.10      [ft_prefetch]     "prefetch",
    2.11      [ft_demand_read]  "demand read",
     3.1 --- a/xen/common/keyhandler.c	Fri Aug 18 16:20:45 2006 +0100
     3.2 +++ b/xen/common/keyhandler.c	Fri Aug 18 17:59:26 2006 +0100
     3.3 @@ -255,22 +255,6 @@ static void do_debug_key(unsigned char k
     3.4                               bit. */
     3.5  }
     3.6  
     3.7 -#ifndef NDEBUG
     3.8 -static void debugtrace_key(unsigned char key)
     3.9 -{
    3.10 -    debugtrace_toggle();
    3.11 -}
    3.12 -
    3.13 -static void shadow2_audit_key(unsigned char key)
    3.14 -{
    3.15 -    extern int shadow2_audit_enable;
    3.16 -
    3.17 -    shadow2_audit_enable = !shadow2_audit_enable;
    3.18 -    printk("%s shadow2_audit_enable=%d\n",
    3.19 -           __func__, shadow2_audit_enable);
    3.20 -}
    3.21 -#endif
    3.22 -
    3.23  void initialize_keytable(void)
    3.24  {
    3.25      open_softirq(KEYPRESS_SOFTIRQ, keypress_softirq);
    3.26 @@ -289,13 +273,6 @@ void initialize_keytable(void)
    3.27      register_keyhandler(
    3.28          't', read_clocks, "display multi-cpu clock info");
    3.29  
    3.30 -#ifndef NDEBUG
    3.31 -    register_keyhandler(
    3.32 -        'O', shadow2_audit_key,  "toggle shadow2 audits");
    3.33 -    register_keyhandler(
    3.34 -        'T', debugtrace_key, "toggle debugtrace to console/buffer");
    3.35 -#endif
    3.36 -
    3.37  #ifdef PERF_COUNTERS
    3.38      register_keyhandler(
    3.39          'p', perfc_printall, "print performance counters");
     4.1 --- a/xen/common/memory.c	Fri Aug 18 16:20:45 2006 +0100
     4.2 +++ b/xen/common/memory.c	Fri Aug 18 17:59:26 2006 +0100
     4.3 @@ -126,11 +126,6 @@ populate_physmap(
     4.4              for ( j = 0; j < (1 << extent_order); j++ )
     4.5                  guest_physmap_add_page(d, gpfn + j, mfn + j);
     4.6          }
     4.7 -        else if ( unlikely(shadow2_mode_translate(d)) )
     4.8 -        {
     4.9 -            for ( j = 0; j < (1 << extent_order); j++ )
    4.10 -                shadow2_guest_physmap_add_page(d, gpfn + j, mfn + j);
    4.11 -        }
    4.12          else
    4.13          {
    4.14              for ( j = 0; j < (1 << extent_order); j++ )
    4.15 @@ -184,7 +179,7 @@ guest_remove_page(
    4.16                  (unsigned long)page->count_info, page->u.inuse.type_info);
    4.17      }
    4.18  
    4.19 -    shadow2_guest_physmap_remove_page(d, gmfn, mfn);
    4.20 +    guest_physmap_remove_page(d, gmfn, mfn);
    4.21  
    4.22      put_page(page);
    4.23  
    4.24 @@ -255,7 +250,7 @@ translate_gpfn_list(
    4.25      if ( (d = find_domain_by_id(op.domid)) == NULL )
    4.26          return -ESRCH;
    4.27  
    4.28 -    if ( !(shadow_mode_translate(d) || shadow2_mode_translate(d)) )
    4.29 +    if ( !shadow_mode_translate(d) )
    4.30      {
    4.31          put_domain(d);
    4.32          return -EINVAL;
     5.1 --- a/xen/drivers/char/console.c	Fri Aug 18 16:20:45 2006 +0100
     5.2 +++ b/xen/drivers/char/console.c	Fri Aug 18 17:59:26 2006 +0100
     5.3 @@ -427,7 +427,7 @@ int console_getc(void)
     5.4   * **************************************************************
     5.5   */
     5.6  
     5.7 -#ifndef NDEBUG
     5.8 +#ifdef DEBUG_TRACE_DUMP
     5.9  
    5.10  /* Send output direct to console, or buffer it? */
    5.11  static volatile int debugtrace_send_to_console;
    5.12 @@ -459,7 +459,7 @@ static void debugtrace_dump_worker(void)
    5.13      printk("debugtrace_dump() finished\n");
    5.14  }
    5.15  
    5.16 -void debugtrace_toggle(void)
    5.17 +static void debugtrace_toggle(void)
    5.18  {
    5.19      unsigned long flags;
    5.20  
    5.21 @@ -536,6 +536,11 @@ void debugtrace_printk(const char *fmt, 
    5.22      spin_unlock_irqrestore(&debugtrace_lock, flags);
    5.23  }
    5.24  
    5.25 +static void debugtrace_key(unsigned char key)
    5.26 +{
    5.27 +    debugtrace_toggle();
    5.28 +}
    5.29 +
    5.30  static int __init debugtrace_init(void)
    5.31  {
    5.32      int order;
    5.33 @@ -557,6 +562,9 @@ static int __init debugtrace_init(void)
    5.34  
    5.35      debugtrace_bytes = bytes;
    5.36  
    5.37 +    register_keyhandler(
    5.38 +        'T', debugtrace_key, "toggle debugtrace to console/buffer");
    5.39 +
    5.40      return 0;
    5.41  }
    5.42  __initcall(debugtrace_init);
     6.1 --- a/xen/include/xen/lib.h	Fri Aug 18 16:20:45 2006 +0100
     6.2 +++ b/xen/include/xen/lib.h	Fri Aug 18 17:59:26 2006 +0100
     6.3 @@ -40,8 +40,8 @@ struct domain;
     6.4  
     6.5  void cmdline_parse(char *cmdline);
     6.6  
     6.7 -#ifndef NDEBUG
     6.8 -extern void debugtrace_toggle(void);
     6.9 +/*#define DEBUG_TRACE_DUMP*/
    6.10 +#ifdef DEBUG_TRACE_DUMP
    6.11  extern void debugtrace_dump(void);
    6.12  extern void debugtrace_printk(const char *fmt, ...);
    6.13  #else