ia64/xen-unstable

changeset 2616:c3493b09c749

bitkeeper revision 1.1159.1.215 (41656000_dCY7Pwm2j0Bv3bn8xKomg)

Fix ptwr debugging.
author kaf24@freefall.cl.cam.ac.uk
date Thu Oct 07 15:25:52 2004 +0000 (2004-10-07)
parents 08b44506fd8f
children 215824d97bfc f00a106e5d16
files xen/arch/x86/memory.c
line diff
     1.1 --- a/xen/arch/x86/memory.c	Thu Oct 07 12:58:57 2004 +0000
     1.2 +++ b/xen/arch/x86/memory.c	Thu Oct 07 15:25:52 2004 +0000
     1.3 @@ -1632,10 +1632,11 @@ ptwr_info_t ptwr_info[NR_CPUS] =
     1.4  
     1.5  #ifdef VERBOSE
     1.6  int ptwr_debug = 0x0;
     1.7 -#define PTWR_PRINTK(x) if ( unlikely(ptwr_debug) ) printk x
     1.8 +#define PTWR_PRINTK(_f, _a...) \
     1.9 + do { if ( unlikely(ptwr_debug) ) printk( _f , ## _a ); } while ( 0 )
    1.10  #define PTWR_PRINT_WHICH (which ? 'I' : 'A')
    1.11  #else
    1.12 -#define PTWR_PRINTK(w, x)
    1.13 +#define PTWR_PRINTK(_f, _a...) ((void)0)
    1.14  #endif
    1.15  
    1.16  void ptwr_flush(const int which)
    1.17 @@ -1654,8 +1655,8 @@ void ptwr_flush(const int which)
    1.18          MEM_LOG("ptwr: Could not read pte at %p\n", ptep);
    1.19          domain_crash();
    1.20      }
    1.21 -    PTWR_PRINTK(("[%c] disconnected_l1va at %p is %08lx\n",
    1.22 -                 PTWR_PRINT_WHICH, ptep, pte));
    1.23 +    PTWR_PRINTK("[%c] disconnected_l1va at %p is %08lx\n",
    1.24 +                PTWR_PRINT_WHICH, ptep, pte);
    1.25      pte &= ~_PAGE_RW;
    1.26  
    1.27      if ( unlikely(current->mm.shadow_mode) ) {
    1.28 @@ -1670,8 +1671,8 @@ void ptwr_flush(const int which)
    1.29          domain_crash();
    1.30      }
    1.31      __flush_tlb_one(l1va);
    1.32 -    PTWR_PRINTK(("[%c] disconnected_l1va at %p now %08lx\n",
    1.33 -                 PTWR_PRINT_WHICH, ptep, pte));
    1.34 +    PTWR_PRINTK("[%c] disconnected_l1va at %p now %08lx\n",
    1.35 +                PTWR_PRINT_WHICH, ptep, pte);
    1.36  
    1.37      pl1e = ptwr_info[cpu].ptinfo[which].pl1e;
    1.38      for ( i = 0; i < ENTRIES_PER_L1_PAGETABLE; i++ ) {
    1.39 @@ -1736,8 +1737,8 @@ int ptwr_do_page_fault(unsigned long add
    1.40      int which;
    1.41  
    1.42  #if 0
    1.43 -    PTWR_PRINTK(("get user %p for va %08lx\n",
    1.44 -                 &linear_pg_table[addr>>PAGE_SHIFT], addr));
    1.45 +    PTWR_PRINTK("get user %p for va %08lx\n",
    1.46 +                &linear_pg_table[addr>>PAGE_SHIFT], addr);
    1.47  #endif
    1.48  
    1.49      /* Testing for page_present in the L2 avoids lots of unncessary fixups */
    1.50 @@ -1751,8 +1752,8 @@ int ptwr_do_page_fault(unsigned long add
    1.51  
    1.52          pfn = pte >> PAGE_SHIFT;
    1.53  #if 0
    1.54 -        PTWR_PRINTK(("check pte %08lx = pfn %08lx for va %08lx\n",
    1.55 -                     pte, pfn, addr));
    1.56 +        PTWR_PRINTK("check pte %08lx = pfn %08lx for va %08lx\n",
    1.57 +                    pte, pfn, addr);
    1.58  #endif
    1.59          page = &frame_table[pfn];
    1.60          if ( (page->u.inuse.type_info & PGT_type_mask) == PGT_l1_page_table )
    1.61 @@ -1768,9 +1769,9 @@ int ptwr_do_page_fault(unsigned long add
    1.62              which = (l2_pgentry_val(*pl2e) >> PAGE_SHIFT != pfn) ?
    1.63                  PTWR_PT_INACTIVE : PTWR_PT_ACTIVE;
    1.64  
    1.65 -            PTWR_PRINTK(("[%c] page_fault on l1 pt at va %08lx, pt for %08x, "
    1.66 -                         "pt for %08x, pfn %08lx\n", PTWR_PRINT_WHICH,
    1.67 -                         addr, va_mask << L2_PAGETABLE_SHIFT, pfn));
    1.68 +            PTWR_PRINTK("[%c] page_fault on l1 pt at va %08lx, pt for %08x, "
    1.69 +                        "pt for %08x, pfn %08lx\n", PTWR_PRINT_WHICH,
    1.70 +                        addr, va_mask << L2_PAGETABLE_SHIFT, pfn);
    1.71  
    1.72              if ( ptwr_info[cpu].ptinfo[which].l1va )
    1.73                  ptwr_flush(which);
    1.74 @@ -1795,8 +1796,8 @@ int ptwr_do_page_fault(unsigned long add
    1.75  
    1.76              /* make pt page writable */
    1.77              pte |= _PAGE_RW;
    1.78 -            PTWR_PRINTK(("[%c] update %p pte to %08lx\n", PTWR_PRINT_WHICH,
    1.79 -                         &linear_pg_table[addr>>PAGE_SHIFT], pte));
    1.80 +            PTWR_PRINTK("[%c] update %p pte to %08lx\n", PTWR_PRINT_WHICH,
    1.81 +                        &linear_pg_table[addr>>PAGE_SHIFT], pte);
    1.82              if ( unlikely(__put_user(pte, (unsigned long *)
    1.83                                       &linear_pg_table[addr>>PAGE_SHIFT])) ) {
    1.84                  MEM_LOG("ptwr: Could not update pte at %p\n", (unsigned long *)