ia64/xen-unstable

changeset 3135:322f719e79a6

bitkeeper revision 1.1159.196.1 (41a5fefcFQhZEJPIqPpQEw0opKThFw)

Remove MMU_UPDATE_DEBUG stuff.
author kaf24@scramble.cl.cam.ac.uk
date Thu Nov 25 15:49:16 2004 +0000 (2004-11-25)
parents 200d7360c68b
children 5164dd44ced6
files linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h
line diff
     1.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Nov 25 11:45:09 2004 +0000
     1.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Nov 25 15:49:16 2004 +0000
     1.3 @@ -56,62 +56,6 @@ static mmu_update_t update_queue[QUEUE_S
     1.4  unsigned int mmu_update_queue_idx = 0;
     1.5  #define idx mmu_update_queue_idx
     1.6  
     1.7 -#if MMU_UPDATE_DEBUG > 0
     1.8 -page_update_debug_t update_debug_queue[QUEUE_SIZE] = {{0}};
     1.9 -#undef queue_l1_entry_update
    1.10 -#undef queue_l2_entry_update
    1.11 -#endif
    1.12 -#if MMU_UPDATE_DEBUG > 3
    1.13 -static void DEBUG_allow_pt_reads(void)
    1.14 -{
    1.15 -    pte_t *pte;
    1.16 -    mmu_update_t update;
    1.17 -    int i;
    1.18 -    for ( i = idx-1; i >= 0; i-- )
    1.19 -    {
    1.20 -        pte = update_debug_queue[i].ptep;
    1.21 -        if ( pte == NULL ) continue;
    1.22 -        update_debug_queue[i].ptep = NULL;
    1.23 -        update.ptr = virt_to_machine(pte);
    1.24 -        update.val = update_debug_queue[i].pteval;
    1.25 -        HYPERVISOR_mmu_update(&update, 1, NULL);
    1.26 -    }
    1.27 -}
    1.28 -static void DEBUG_disallow_pt_read(unsigned long va)
    1.29 -{
    1.30 -    pte_t *pte;
    1.31 -    pmd_t *pmd;
    1.32 -    pgd_t *pgd;
    1.33 -    unsigned long pteval;
    1.34 -    /*
    1.35 -     * We may fault because of an already outstanding update.
    1.36 -     * That's okay -- it'll get fixed up in the fault handler.
    1.37 -     */
    1.38 -    mmu_update_t update;
    1.39 -    pgd = pgd_offset_k(va);
    1.40 -    pmd = pmd_offset(pgd, va);
    1.41 -    pte = pte_offset_kernel(pmd, va); /* XXXcl */
    1.42 -    update.ptr = virt_to_machine(pte);
    1.43 -    pteval = *(unsigned long *)pte;
    1.44 -    update.val = pteval & ~_PAGE_PRESENT;
    1.45 -    HYPERVISOR_mmu_update(&update, 1, NULL);
    1.46 -    update_debug_queue[idx].ptep = pte;
    1.47 -    update_debug_queue[idx].pteval = pteval;
    1.48 -}
    1.49 -#endif
    1.50 -
    1.51 -#if MMU_UPDATE_DEBUG > 1
    1.52 -#undef queue_pt_switch
    1.53 -#undef queue_tlb_flush
    1.54 -#undef queue_invlpg
    1.55 -#undef queue_pgd_pin
    1.56 -#undef queue_pgd_unpin
    1.57 -#undef queue_pte_pin
    1.58 -#undef queue_pte_unpin
    1.59 -#undef queue_set_ldt
    1.60 -#endif
    1.61 -
    1.62 -
    1.63  /*
    1.64   * MULTICALL_flush_page_update_queue:
    1.65   *   This is a version of the flush which queues as part of a multicall.
    1.66 @@ -123,13 +67,6 @@ void MULTICALL_flush_page_update_queue(v
    1.67      spin_lock_irqsave(&update_lock, flags);
    1.68      if ( (_idx = idx) != 0 ) 
    1.69      {
    1.70 -#if MMU_UPDATE_DEBUG > 1
    1.71 -	    if (idx > 1)
    1.72 -        printk("Flushing %d entries from pt update queue\n", idx);
    1.73 -#endif
    1.74 -#if MMU_UPDATE_DEBUG > 3
    1.75 -        DEBUG_allow_pt_reads();
    1.76 -#endif
    1.77          idx = 0;
    1.78          wmb(); /* Make sure index is cleared first to avoid double updates. */
    1.79          queue_multicall3(__HYPERVISOR_mmu_update, 
    1.80 @@ -143,13 +80,6 @@ void MULTICALL_flush_page_update_queue(v
    1.81  static inline void __flush_page_update_queue(void)
    1.82  {
    1.83      unsigned int _idx = idx;
    1.84 -#if MMU_UPDATE_DEBUG > 1
    1.85 -    if (idx > 1)
    1.86 -    printk("Flushing %d entries from pt update queue\n", idx);
    1.87 -#endif
    1.88 -#if MMU_UPDATE_DEBUG > 3
    1.89 -    DEBUG_allow_pt_reads();
    1.90 -#endif
    1.91      idx = 0;
    1.92      wmb(); /* Make sure index is cleared first to avoid double updates. */
    1.93      if ( unlikely(HYPERVISOR_mmu_update(update_queue, _idx, NULL) < 0) )
    1.94 @@ -183,9 +113,6 @@ void queue_l1_entry_update(pte_t *ptr, u
    1.95  {
    1.96      unsigned long flags;
    1.97      spin_lock_irqsave(&update_lock, flags);
    1.98 -#if MMU_UPDATE_DEBUG > 3
    1.99 -    DEBUG_disallow_pt_read((unsigned long)ptr);
   1.100 -#endif
   1.101      update_queue[idx].ptr = virt_to_machine(ptr);
   1.102      update_queue[idx].val = val;
   1.103      increment_index();
   1.104 @@ -303,9 +230,6 @@ void xen_l1_entry_update(pte_t *ptr, uns
   1.105  {
   1.106      unsigned long flags;
   1.107      spin_lock_irqsave(&update_lock, flags);
   1.108 -#if MMU_UPDATE_DEBUG > 3
   1.109 -    DEBUG_disallow_pt_read((unsigned long)ptr);
   1.110 -#endif
   1.111      update_queue[idx].ptr = virt_to_machine(ptr);
   1.112      update_queue[idx].val = val;
   1.113      increment_index_and_flush();
     2.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h	Thu Nov 25 11:45:09 2004 +0000
     2.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h	Thu Nov 25 15:49:16 2004 +0000
     2.3 @@ -90,16 +90,7 @@ typedef struct { unsigned long pmd; } pm
     2.4  typedef struct { unsigned long pgd; } pgd_t;
     2.5  typedef struct { unsigned long pgprot; } pgprot_t;
     2.6  #define boot_pte_t pte_t /* or would you rather have a typedef */
     2.7 -#if 0				/* XXXcl for MMU_UPDATE_DEBUG */
     2.8 -static inline unsigned long pte_val(pte_t x)
     2.9 -{
    2.10 -	unsigned long ret = x.pte_low;
    2.11 -	if ( (ret & 1) ) ret = machine_to_phys(ret);
    2.12 -	return ret;
    2.13 -}
    2.14 -#else
    2.15  #define pte_val(x)	(((x).pte_low & 1) ? machine_to_phys((x).pte_low) : (x).pte_low)
    2.16 -#endif
    2.17  #define pte_val_ma(x)	((x).pte_low)
    2.18  #define HPAGE_SHIFT	22
    2.19  #endif
     3.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h	Thu Nov 25 11:45:09 2004 +0000
     3.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h	Thu Nov 25 15:49:16 2004 +0000
     3.3 @@ -94,91 +94,6 @@ void xen_pte_pin(unsigned long ptr);
     3.4  void xen_pte_unpin(unsigned long ptr);
     3.5  void xen_set_ldt(unsigned long ptr, unsigned long bytes);
     3.6  void xen_machphys_update(unsigned long mfn, unsigned long pfn);
     3.7 -#define MMU_UPDATE_DEBUG 0
     3.8 -
     3.9 -#if MMU_UPDATE_DEBUG > 0
    3.10 -typedef struct {
    3.11 -    void *ptr;
    3.12 -    unsigned long val, pteval;
    3.13 -    void *ptep;
    3.14 -    int line; char *file;
    3.15 -} page_update_debug_t;
    3.16 -extern page_update_debug_t update_debug_queue[];
    3.17 -#define queue_l1_entry_update(_p,_v) ({                           \
    3.18 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
    3.19 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
    3.20 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
    3.21 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
    3.22 - queue_l1_entry_update((_p),(_v));                                \
    3.23 -})
    3.24 -#define queue_l2_entry_update(_p,_v) ({                           \
    3.25 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
    3.26 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
    3.27 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
    3.28 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
    3.29 - queue_l2_entry_update((_p),(_v));                                \
    3.30 -})
    3.31 -#endif
    3.32 -
    3.33 -#if MMU_UPDATE_DEBUG > 1
    3.34 -#if MMU_UPDATE_DEBUG > 2
    3.35 -#undef queue_l1_entry_update
    3.36 -#define queue_l1_entry_update(_p,_v) ({                           \
    3.37 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
    3.38 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
    3.39 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
    3.40 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
    3.41 - printk("L1 %s %d: %p/%08lx (%08lx -> %08lx)\n", __FILE__, __LINE__,  \
    3.42 -        (_p), virt_to_machine(_p), pte_val(*(_p)),                 \
    3.43 -        (unsigned long)(_v));                                     \
    3.44 - queue_l1_entry_update((_p),(_v));                                \
    3.45 -})
    3.46 -#endif
    3.47 -#undef queue_l2_entry_update
    3.48 -#define queue_l2_entry_update(_p,_v) ({                           \
    3.49 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
    3.50 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
    3.51 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
    3.52 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
    3.53 - printk("L2 %s %d: %p/%08lx (%08lx -> %08lx)\n", __FILE__, __LINE__,  \
    3.54 -        (_p), virt_to_machine(_p), pmd_val(*_p),                  \
    3.55 -        (unsigned long)(_v));                                     \
    3.56 - queue_l2_entry_update((_p),(_v));                                \
    3.57 -})
    3.58 -#define queue_pt_switch(_p) ({                                    \
    3.59 - printk("PTSWITCH %s %d: %08lx\n", __FILE__, __LINE__, (_p));     \
    3.60 - queue_pt_switch(_p);                                             \
    3.61 -})   
    3.62 -#define queue_tlb_flush() ({                                      \
    3.63 - printk("TLB FLUSH %s %d\n", __FILE__, __LINE__);                 \
    3.64 - queue_tlb_flush();                                               \
    3.65 -})   
    3.66 -#define queue_invlpg(_p) ({                                       \
    3.67 - printk("INVLPG %s %d: %08lx\n", __FILE__, __LINE__, (_p));       \
    3.68 - queue_invlpg(_p);                                                \
    3.69 -})   
    3.70 -#define queue_pgd_pin(_p) ({                                      \
    3.71 - printk("PGD PIN %s %d: %08lx/%08lx\n", __FILE__, __LINE__, (_p), \
    3.72 -	phys_to_machine(_p));                                     \
    3.73 - queue_pgd_pin(_p);                                               \
    3.74 -})   
    3.75 -#define queue_pgd_unpin(_p) ({                                    \
    3.76 - printk("PGD UNPIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));    \
    3.77 - queue_pgd_unpin(_p);                                             \
    3.78 -})   
    3.79 -#define queue_pte_pin(_p) ({                                      \
    3.80 - printk("PTE PIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));      \
    3.81 - queue_pte_pin(_p);                                               \
    3.82 -})   
    3.83 -#define queue_pte_unpin(_p) ({                                    \
    3.84 - printk("PTE UNPIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));    \
    3.85 - queue_pte_unpin(_p);                                             \
    3.86 -})   
    3.87 -#define queue_set_ldt(_p,_l) ({                                        \
    3.88 - printk("SETL LDT %s %d: %08lx %d\n", __FILE__, __LINE__, (_p), (_l)); \
    3.89 - queue_set_ldt((_p), (_l));                                            \
    3.90 -})   
    3.91 -#endif
    3.92  
    3.93  void _flush_page_update_queue(void);
    3.94  static inline int flush_page_update_queue(void)