[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [XEN] Remove shadow2 dependencies from common code.
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxx # Node ID ca9f3a7b1b0397addd5f3a65f2257b1c1731c7b0 # Parent a658663ab2d0756f673a93f639d57569e7c66aa9 [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@xxxxxxxxxxxxx> --- xen/arch/x86/shadow2-common.c | 18 +++++++++++++++++- xen/arch/x86/shadow2.c | 2 +- xen/common/keyhandler.c | 23 ----------------------- xen/common/memory.c | 9 ++------- xen/drivers/char/console.c | 12 ++++++++++-- xen/include/xen/lib.h | 4 ++-- 6 files changed, 32 insertions(+), 36 deletions(-) diff -r a658663ab2d0 -r ca9f3a7b1b03 xen/arch/x86/shadow2-common.c --- a/xen/arch/x86/shadow2-common.c Fri Aug 18 16:20:45 2006 +0100 +++ b/xen/arch/x86/shadow2-common.c Fri Aug 18 17:59:26 2006 +0100 @@ -32,6 +32,7 @@ #include <xen/irq.h> #include <xen/domain_page.h> #include <xen/guest_access.h> +#include <xen/keyhandler.h> #include <asm/event.h> #include <asm/page.h> #include <asm/current.h> @@ -41,7 +42,22 @@ #if SHADOW2_AUDIT int shadow2_audit_enable = 0; -#endif + +static void shadow2_audit_key(unsigned char key) +{ + shadow2_audit_enable = !shadow2_audit_enable; + printk("%s shadow2_audit_enable=%d\n", + __func__, shadow2_audit_enable); +} + +static int __init shadow2_audit_key_init(void) +{ + register_keyhandler( + 'O', shadow2_audit_key, "toggle shadow2 audits"); + return 0; +} +__initcall(shadow2_audit_key_init); +#endif /* SHADOW2_AUDIT */ static void sh2_free_log_dirty_bitmap(struct domain *d); diff -r a658663ab2d0 -r ca9f3a7b1b03 xen/arch/x86/shadow2.c --- a/xen/arch/x86/shadow2.c Fri Aug 18 16:20:45 2006 +0100 +++ b/xen/arch/x86/shadow2.c Fri Aug 18 17:59:26 2006 +0100 @@ -111,7 +111,7 @@ typedef enum { ft_demand_write = FETCH_TYPE_DEMAND | FETCH_TYPE_WRITE, } fetch_type_t; -#ifndef NDEBUG +#ifdef DEBUG_TRACE_DUMP static char *fetch_type_names[] = { [ft_prefetch] "prefetch", [ft_demand_read] "demand read", diff -r a658663ab2d0 -r ca9f3a7b1b03 xen/common/keyhandler.c --- a/xen/common/keyhandler.c Fri Aug 18 16:20:45 2006 +0100 +++ b/xen/common/keyhandler.c Fri Aug 18 17:59:26 2006 +0100 @@ -255,22 +255,6 @@ static void do_debug_key(unsigned char k bit. */ } -#ifndef NDEBUG -static void debugtrace_key(unsigned char key) -{ - debugtrace_toggle(); -} - -static void shadow2_audit_key(unsigned char key) -{ - extern int shadow2_audit_enable; - - shadow2_audit_enable = !shadow2_audit_enable; - printk("%s shadow2_audit_enable=%d\n", - __func__, shadow2_audit_enable); -} -#endif - void initialize_keytable(void) { open_softirq(KEYPRESS_SOFTIRQ, keypress_softirq); @@ -288,13 +272,6 @@ void initialize_keytable(void) register_keyhandler( 't', read_clocks, "display multi-cpu clock info"); - -#ifndef NDEBUG - register_keyhandler( - 'O', shadow2_audit_key, "toggle shadow2 audits"); - register_keyhandler( - 'T', debugtrace_key, "toggle debugtrace to console/buffer"); -#endif #ifdef PERF_COUNTERS register_keyhandler( diff -r a658663ab2d0 -r ca9f3a7b1b03 xen/common/memory.c --- a/xen/common/memory.c Fri Aug 18 16:20:45 2006 +0100 +++ b/xen/common/memory.c Fri Aug 18 17:59:26 2006 +0100 @@ -126,11 +126,6 @@ populate_physmap( for ( j = 0; j < (1 << extent_order); j++ ) guest_physmap_add_page(d, gpfn + j, mfn + j); } - else if ( unlikely(shadow2_mode_translate(d)) ) - { - for ( j = 0; j < (1 << extent_order); j++ ) - shadow2_guest_physmap_add_page(d, gpfn + j, mfn + j); - } else { for ( j = 0; j < (1 << extent_order); j++ ) @@ -184,7 +179,7 @@ guest_remove_page( (unsigned long)page->count_info, page->u.inuse.type_info); } - shadow2_guest_physmap_remove_page(d, gmfn, mfn); + guest_physmap_remove_page(d, gmfn, mfn); put_page(page); @@ -255,7 +250,7 @@ translate_gpfn_list( if ( (d = find_domain_by_id(op.domid)) == NULL ) return -ESRCH; - if ( !(shadow_mode_translate(d) || shadow2_mode_translate(d)) ) + if ( !shadow_mode_translate(d) ) { put_domain(d); return -EINVAL; diff -r a658663ab2d0 -r ca9f3a7b1b03 xen/drivers/char/console.c --- a/xen/drivers/char/console.c Fri Aug 18 16:20:45 2006 +0100 +++ b/xen/drivers/char/console.c Fri Aug 18 17:59:26 2006 +0100 @@ -427,7 +427,7 @@ int console_getc(void) * ************************************************************** */ -#ifndef NDEBUG +#ifdef DEBUG_TRACE_DUMP /* Send output direct to console, or buffer it? */ static volatile int debugtrace_send_to_console; @@ -459,7 +459,7 @@ static void debugtrace_dump_worker(void) printk("debugtrace_dump() finished\n"); } -void debugtrace_toggle(void) +static void debugtrace_toggle(void) { unsigned long flags; @@ -536,6 +536,11 @@ void debugtrace_printk(const char *fmt, spin_unlock_irqrestore(&debugtrace_lock, flags); } +static void debugtrace_key(unsigned char key) +{ + debugtrace_toggle(); +} + static int __init debugtrace_init(void) { int order; @@ -556,6 +561,9 @@ static int __init debugtrace_init(void) memset(debugtrace_buf, '\0', bytes); debugtrace_bytes = bytes; + + register_keyhandler( + 'T', debugtrace_key, "toggle debugtrace to console/buffer"); return 0; } diff -r a658663ab2d0 -r ca9f3a7b1b03 xen/include/xen/lib.h --- a/xen/include/xen/lib.h Fri Aug 18 16:20:45 2006 +0100 +++ b/xen/include/xen/lib.h Fri Aug 18 17:59:26 2006 +0100 @@ -40,8 +40,8 @@ struct domain; void cmdline_parse(char *cmdline); -#ifndef NDEBUG -extern void debugtrace_toggle(void); +/*#define DEBUG_TRACE_DUMP*/ +#ifdef DEBUG_TRACE_DUMP extern void debugtrace_dump(void); extern void debugtrace_printk(const char *fmt, ...); #else _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |