ia64/xen-unstable

changeset 3138:b835d903239c

bitkeeper revision 1.1159.187.14 (41a60a94xRo19V0VSKpxKYHUxJL14Q)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xen-2.0-testing.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
author kaf24@scramble.cl.cam.ac.uk
date Thu Nov 25 16:38:44 2004 +0000 (2004-11-25)
parents f92f84310af3 5164dd44ced6
children b013a6b30d9e
files linux-2.4.28-xen-sparse/arch/xen/mm/fault.c 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.4.28-xen-sparse/arch/xen/mm/fault.c	Thu Nov 25 16:28:18 2004 +0000
     1.2 +++ b/linux-2.4.28-xen-sparse/arch/xen/mm/fault.c	Thu Nov 25 16:38:44 2004 +0000
     1.3 @@ -84,27 +84,6 @@ asmlinkage void do_page_fault(struct pt_
     1.4          error_code &= 3;
     1.5          error_code |= (regs->xcs & 2) << 1;
     1.6  
     1.7 -#if MMU_UPDATE_DEBUG > 0
     1.8 -        if ( (error_code == 0) && (address >= TASK_SIZE) )
     1.9 -        {
    1.10 -            unsigned long paddr = __pa(address);
    1.11 -            int i;
    1.12 -            for ( i = 0; i < mmu_update_queue_idx; i++ )
    1.13 -            {
    1.14 -                if ( update_debug_queue[i].ptr == paddr )
    1.15 -                {
    1.16 -                    printk("XXX now(EIP=%08lx:ptr=%08lx) "
    1.17 -                           "then(%s/%d:p/v=%08lx/%08lx)\n",
    1.18 -                           regs->eip, address,
    1.19 -                           update_debug_queue[i].file,
    1.20 -                           update_debug_queue[i].line,
    1.21 -                           update_debug_queue[i].ptr,
    1.22 -                           update_debug_queue[i].val);
    1.23 -                }
    1.24 -            }
    1.25 -        }
    1.26 -#endif
    1.27 -
    1.28  	if ( flush_page_update_queue() != 0 )
    1.29  		return;
    1.30  
     2.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Nov 25 16:28:18 2004 +0000
     2.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Nov 25 16:38:44 2004 +0000
     2.3 @@ -56,62 +56,6 @@ static mmu_update_t update_queue[QUEUE_S
     2.4  unsigned int mmu_update_queue_idx = 0;
     2.5  #define idx mmu_update_queue_idx
     2.6  
     2.7 -#if MMU_UPDATE_DEBUG > 0
     2.8 -page_update_debug_t update_debug_queue[QUEUE_SIZE] = {{0}};
     2.9 -#undef queue_l1_entry_update
    2.10 -#undef queue_l2_entry_update
    2.11 -#endif
    2.12 -#if MMU_UPDATE_DEBUG > 3
    2.13 -static void DEBUG_allow_pt_reads(void)
    2.14 -{
    2.15 -    pte_t *pte;
    2.16 -    mmu_update_t update;
    2.17 -    int i;
    2.18 -    for ( i = idx-1; i >= 0; i-- )
    2.19 -    {
    2.20 -        pte = update_debug_queue[i].ptep;
    2.21 -        if ( pte == NULL ) continue;
    2.22 -        update_debug_queue[i].ptep = NULL;
    2.23 -        update.ptr = virt_to_machine(pte);
    2.24 -        update.val = update_debug_queue[i].pteval;
    2.25 -        HYPERVISOR_mmu_update(&update, 1, NULL);
    2.26 -    }
    2.27 -}
    2.28 -static void DEBUG_disallow_pt_read(unsigned long va)
    2.29 -{
    2.30 -    pte_t *pte;
    2.31 -    pmd_t *pmd;
    2.32 -    pgd_t *pgd;
    2.33 -    unsigned long pteval;
    2.34 -    /*
    2.35 -     * We may fault because of an already outstanding update.
    2.36 -     * That's okay -- it'll get fixed up in the fault handler.
    2.37 -     */
    2.38 -    mmu_update_t update;
    2.39 -    pgd = pgd_offset_k(va);
    2.40 -    pmd = pmd_offset(pgd, va);
    2.41 -    pte = pte_offset_kernel(pmd, va); /* XXXcl */
    2.42 -    update.ptr = virt_to_machine(pte);
    2.43 -    pteval = *(unsigned long *)pte;
    2.44 -    update.val = pteval & ~_PAGE_PRESENT;
    2.45 -    HYPERVISOR_mmu_update(&update, 1, NULL);
    2.46 -    update_debug_queue[idx].ptep = pte;
    2.47 -    update_debug_queue[idx].pteval = pteval;
    2.48 -}
    2.49 -#endif
    2.50 -
    2.51 -#if MMU_UPDATE_DEBUG > 1
    2.52 -#undef queue_pt_switch
    2.53 -#undef queue_tlb_flush
    2.54 -#undef queue_invlpg
    2.55 -#undef queue_pgd_pin
    2.56 -#undef queue_pgd_unpin
    2.57 -#undef queue_pte_pin
    2.58 -#undef queue_pte_unpin
    2.59 -#undef queue_set_ldt
    2.60 -#endif
    2.61 -
    2.62 -
    2.63  /*
    2.64   * MULTICALL_flush_page_update_queue:
    2.65   *   This is a version of the flush which queues as part of a multicall.
    2.66 @@ -123,13 +67,6 @@ void MULTICALL_flush_page_update_queue(v
    2.67      spin_lock_irqsave(&update_lock, flags);
    2.68      if ( (_idx = idx) != 0 ) 
    2.69      {
    2.70 -#if MMU_UPDATE_DEBUG > 1
    2.71 -	    if (idx > 1)
    2.72 -        printk("Flushing %d entries from pt update queue\n", idx);
    2.73 -#endif
    2.74 -#if MMU_UPDATE_DEBUG > 3
    2.75 -        DEBUG_allow_pt_reads();
    2.76 -#endif
    2.77          idx = 0;
    2.78          wmb(); /* Make sure index is cleared first to avoid double updates. */
    2.79          queue_multicall3(__HYPERVISOR_mmu_update, 
    2.80 @@ -143,13 +80,6 @@ void MULTICALL_flush_page_update_queue(v
    2.81  static inline void __flush_page_update_queue(void)
    2.82  {
    2.83      unsigned int _idx = idx;
    2.84 -#if MMU_UPDATE_DEBUG > 1
    2.85 -    if (idx > 1)
    2.86 -    printk("Flushing %d entries from pt update queue\n", idx);
    2.87 -#endif
    2.88 -#if MMU_UPDATE_DEBUG > 3
    2.89 -    DEBUG_allow_pt_reads();
    2.90 -#endif
    2.91      idx = 0;
    2.92      wmb(); /* Make sure index is cleared first to avoid double updates. */
    2.93      if ( unlikely(HYPERVISOR_mmu_update(update_queue, _idx, NULL) < 0) )
    2.94 @@ -183,9 +113,6 @@ void queue_l1_entry_update(pte_t *ptr, u
    2.95  {
    2.96      unsigned long flags;
    2.97      spin_lock_irqsave(&update_lock, flags);
    2.98 -#if MMU_UPDATE_DEBUG > 3
    2.99 -    DEBUG_disallow_pt_read((unsigned long)ptr);
   2.100 -#endif
   2.101      update_queue[idx].ptr = virt_to_machine(ptr);
   2.102      update_queue[idx].val = val;
   2.103      increment_index();
   2.104 @@ -303,9 +230,6 @@ void xen_l1_entry_update(pte_t *ptr, uns
   2.105  {
   2.106      unsigned long flags;
   2.107      spin_lock_irqsave(&update_lock, flags);
   2.108 -#if MMU_UPDATE_DEBUG > 3
   2.109 -    DEBUG_disallow_pt_read((unsigned long)ptr);
   2.110 -#endif
   2.111      update_queue[idx].ptr = virt_to_machine(ptr);
   2.112      update_queue[idx].val = val;
   2.113      increment_index_and_flush();
     3.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h	Thu Nov 25 16:28:18 2004 +0000
     3.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h	Thu Nov 25 16:38:44 2004 +0000
     3.3 @@ -90,16 +90,7 @@ typedef struct { unsigned long pmd; } pm
     3.4  typedef struct { unsigned long pgd; } pgd_t;
     3.5  typedef struct { unsigned long pgprot; } pgprot_t;
     3.6  #define boot_pte_t pte_t /* or would you rather have a typedef */
     3.7 -#if 0				/* XXXcl for MMU_UPDATE_DEBUG */
     3.8 -static inline unsigned long pte_val(pte_t x)
     3.9 -{
    3.10 -	unsigned long ret = x.pte_low;
    3.11 -	if ( (ret & 1) ) ret = machine_to_phys(ret);
    3.12 -	return ret;
    3.13 -}
    3.14 -#else
    3.15  #define pte_val(x)	(((x).pte_low & 1) ? machine_to_phys((x).pte_low) : (x).pte_low)
    3.16 -#endif
    3.17  #define pte_val_ma(x)	((x).pte_low)
    3.18  #define HPAGE_SHIFT	22
    3.19  #endif
     4.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h	Thu Nov 25 16:28:18 2004 +0000
     4.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h	Thu Nov 25 16:38:44 2004 +0000
     4.3 @@ -94,91 +94,6 @@ void xen_pte_pin(unsigned long ptr);
     4.4  void xen_pte_unpin(unsigned long ptr);
     4.5  void xen_set_ldt(unsigned long ptr, unsigned long bytes);
     4.6  void xen_machphys_update(unsigned long mfn, unsigned long pfn);
     4.7 -#define MMU_UPDATE_DEBUG 0
     4.8 -
     4.9 -#if MMU_UPDATE_DEBUG > 0
    4.10 -typedef struct {
    4.11 -    void *ptr;
    4.12 -    unsigned long val, pteval;
    4.13 -    void *ptep;
    4.14 -    int line; char *file;
    4.15 -} page_update_debug_t;
    4.16 -extern page_update_debug_t update_debug_queue[];
    4.17 -#define queue_l1_entry_update(_p,_v) ({                           \
    4.18 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
    4.19 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
    4.20 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
    4.21 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
    4.22 - queue_l1_entry_update((_p),(_v));                                \
    4.23 -})
    4.24 -#define queue_l2_entry_update(_p,_v) ({                           \
    4.25 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
    4.26 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
    4.27 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
    4.28 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
    4.29 - queue_l2_entry_update((_p),(_v));                                \
    4.30 -})
    4.31 -#endif
    4.32 -
    4.33 -#if MMU_UPDATE_DEBUG > 1
    4.34 -#if MMU_UPDATE_DEBUG > 2
    4.35 -#undef queue_l1_entry_update
    4.36 -#define queue_l1_entry_update(_p,_v) ({                           \
    4.37 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
    4.38 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
    4.39 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
    4.40 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
    4.41 - printk("L1 %s %d: %p/%08lx (%08lx -> %08lx)\n", __FILE__, __LINE__,  \
    4.42 -        (_p), virt_to_machine(_p), pte_val(*(_p)),                 \
    4.43 -        (unsigned long)(_v));                                     \
    4.44 - queue_l1_entry_update((_p),(_v));                                \
    4.45 -})
    4.46 -#endif
    4.47 -#undef queue_l2_entry_update
    4.48 -#define queue_l2_entry_update(_p,_v) ({                           \
    4.49 - update_debug_queue[mmu_update_queue_idx].ptr  = (_p);             \
    4.50 - update_debug_queue[mmu_update_queue_idx].val  = (_v);             \
    4.51 - update_debug_queue[mmu_update_queue_idx].line = __LINE__;         \
    4.52 - update_debug_queue[mmu_update_queue_idx].file = __FILE__;         \
    4.53 - printk("L2 %s %d: %p/%08lx (%08lx -> %08lx)\n", __FILE__, __LINE__,  \
    4.54 -        (_p), virt_to_machine(_p), pmd_val(*_p),                  \
    4.55 -        (unsigned long)(_v));                                     \
    4.56 - queue_l2_entry_update((_p),(_v));                                \
    4.57 -})
    4.58 -#define queue_pt_switch(_p) ({                                    \
    4.59 - printk("PTSWITCH %s %d: %08lx\n", __FILE__, __LINE__, (_p));     \
    4.60 - queue_pt_switch(_p);                                             \
    4.61 -})   
    4.62 -#define queue_tlb_flush() ({                                      \
    4.63 - printk("TLB FLUSH %s %d\n", __FILE__, __LINE__);                 \
    4.64 - queue_tlb_flush();                                               \
    4.65 -})   
    4.66 -#define queue_invlpg(_p) ({                                       \
    4.67 - printk("INVLPG %s %d: %08lx\n", __FILE__, __LINE__, (_p));       \
    4.68 - queue_invlpg(_p);                                                \
    4.69 -})   
    4.70 -#define queue_pgd_pin(_p) ({                                      \
    4.71 - printk("PGD PIN %s %d: %08lx/%08lx\n", __FILE__, __LINE__, (_p), \
    4.72 -	phys_to_machine(_p));                                     \
    4.73 - queue_pgd_pin(_p);                                               \
    4.74 -})   
    4.75 -#define queue_pgd_unpin(_p) ({                                    \
    4.76 - printk("PGD UNPIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));    \
    4.77 - queue_pgd_unpin(_p);                                             \
    4.78 -})   
    4.79 -#define queue_pte_pin(_p) ({                                      \
    4.80 - printk("PTE PIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));      \
    4.81 - queue_pte_pin(_p);                                               \
    4.82 -})   
    4.83 -#define queue_pte_unpin(_p) ({                                    \
    4.84 - printk("PTE UNPIN %s %d: %08lx\n", __FILE__, __LINE__, (_p));    \
    4.85 - queue_pte_unpin(_p);                                             \
    4.86 -})   
    4.87 -#define queue_set_ldt(_p,_l) ({                                        \
    4.88 - printk("SETL LDT %s %d: %08lx %d\n", __FILE__, __LINE__, (_p), (_l)); \
    4.89 - queue_set_ldt((_p), (_l));                                            \
    4.90 -})   
    4.91 -#endif
    4.92  
    4.93  void _flush_page_update_queue(void);
    4.94  static inline int flush_page_update_queue(void)