ia64/xen-unstable

changeset 2614:7087c7a9ca76

bitkeeper revision 1.1159.104.1 (41653d6dCE2APmichNXySKc2JKpDbA)

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