ia64/xen-unstable

changeset 6143:ab3813d38b20

Remove the BUG() from HYPERVISOR_update_va_mapping and change all the appropriate callers to wrap in BUG_ON()

Signed-off-by: ian@xensource.com
author iap10@freefall.cl.cam.ac.uk
date Fri Aug 12 16:05:37 2005 +0000 (2005-08-12)
parents 822566f5cfdd
children 4995d5f167c9 424166f4f3cf
files linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Aug 11 22:18:27 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Fri Aug 12 16:05:37 2005 +0000
     1.3 @@ -286,8 +286,8 @@ void xen_contig_memory(unsigned long vst
     1.4          pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
     1.5          pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
     1.6          mfn = pte_mfn(*pte);
     1.7 -        HYPERVISOR_update_va_mapping(
     1.8 -            vstart + (i*PAGE_SIZE), __pte_ma(0), 0);
     1.9 +        BUG_ON(HYPERVISOR_update_va_mapping(
    1.10 +            vstart + (i*PAGE_SIZE), __pte_ma(0), 0));
    1.11          phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
    1.12              INVALID_P2M_ENTRY;
    1.13          BUG_ON(HYPERVISOR_dom_mem_op(
    1.14 @@ -300,9 +300,9 @@ void xen_contig_memory(unsigned long vst
    1.15  
    1.16      /* 3. Map the new extent in place of old pages. */
    1.17      for (i = 0; i < (1<<order); i++) {
    1.18 -        HYPERVISOR_update_va_mapping(
    1.19 +        BUG_ON(HYPERVISOR_update_va_mapping(
    1.20              vstart + (i*PAGE_SIZE),
    1.21 -            __pte_ma(((mfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL), 0);
    1.22 +            __pte_ma(((mfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL), 0));
    1.23          xen_machphys_update(mfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
    1.24          phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn+i;
    1.25      }
    1.26 @@ -345,7 +345,8 @@ unsigned long allocate_empty_lowmem_regi
    1.27  #ifdef CONFIG_X86_64
    1.28          xen_l1_entry_update(pte, __pte(0));
    1.29  #else
    1.30 -        HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE), __pte_ma(0), 0);
    1.31 +        BUG_ON(HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE), 
    1.32 +					    __pte_ma(0), 0));
    1.33  #endif
    1.34          phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
    1.35              INVALID_P2M_ENTRY;
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Thu Aug 11 22:18:27 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Fri Aug 12 16:05:37 2005 +0000
     2.3 @@ -222,8 +222,8 @@ void pte_free(struct page *pte)
     2.4  	unsigned long va = (unsigned long)__va(page_to_pfn(pte)<<PAGE_SHIFT);
     2.5  
     2.6  	if (!pte_write(*virt_to_ptep(va)))
     2.7 -		HYPERVISOR_update_va_mapping(
     2.8 -			va, pfn_pte(page_to_pfn(pte), PAGE_KERNEL), 0);
     2.9 +		BUG_ON(HYPERVISOR_update_va_mapping(
    2.10 +			va, pfn_pte(page_to_pfn(pte), PAGE_KERNEL), 0));
    2.11  
    2.12  	ClearPageForeign(pte);
    2.13  	set_page_count(pte, 1);
    2.14 @@ -355,10 +355,10 @@ void pgd_free(pgd_t *pgd)
    2.15  
    2.16  	if (!pte_write(*ptep)) {
    2.17  		xen_pgd_unpin(__pa(pgd));
    2.18 -		HYPERVISOR_update_va_mapping(
    2.19 +		BUG_ON(HYPERVISOR_update_va_mapping(
    2.20  			(unsigned long)pgd,
    2.21  			pfn_pte(virt_to_phys(pgd)>>PAGE_SHIFT, PAGE_KERNEL),
    2.22 -			0);
    2.23 +			0));
    2.24  	}
    2.25  
    2.26  	/* in the PAE case user pgd entries are overwritten before usage */
    2.27 @@ -451,9 +451,9 @@ static inline void mm_walk_set_prot(void
    2.28  
    2.29  	if (PageHighMem(page))
    2.30  		return;
    2.31 -	HYPERVISOR_update_va_mapping(
    2.32 +	BUG_ON(HYPERVISOR_update_va_mapping(
    2.33  		(unsigned long)__va(pfn << PAGE_SHIFT),
    2.34 -		pfn_pte(pfn, flags), 0);
    2.35 +		pfn_pte(pfn, flags), 0));
    2.36  }
    2.37  
    2.38  static void mm_walk(struct mm_struct *mm, pgprot_t flags)
    2.39 @@ -492,10 +492,10 @@ void mm_pin(struct mm_struct *mm)
    2.40      spin_lock(&mm->page_table_lock);
    2.41  
    2.42      mm_walk(mm, PAGE_KERNEL_RO);
    2.43 -    HYPERVISOR_update_va_mapping(
    2.44 +    BUG_ON(HYPERVISOR_update_va_mapping(
    2.45          (unsigned long)mm->pgd,
    2.46          pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL_RO),
    2.47 -        UVMF_TLB_FLUSH);
    2.48 +        UVMF_TLB_FLUSH));
    2.49      xen_pgd_pin(__pa(mm->pgd));
    2.50      mm->context.pinned = 1;
    2.51      spin_lock(&mm_unpinned_lock);
    2.52 @@ -510,9 +510,9 @@ void mm_unpin(struct mm_struct *mm)
    2.53      spin_lock(&mm->page_table_lock);
    2.54  
    2.55      xen_pgd_unpin(__pa(mm->pgd));
    2.56 -    HYPERVISOR_update_va_mapping(
    2.57 +    BUG_ON(HYPERVISOR_update_va_mapping(
    2.58          (unsigned long)mm->pgd,
    2.59 -        pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL), 0);
    2.60 +        pfn_pte(virt_to_phys(mm->pgd)>>PAGE_SHIFT, PAGE_KERNEL), 0));
    2.61      mm_walk(mm, PAGE_KERNEL);
    2.62      xen_tlb_flush();
    2.63      mm->context.pinned = 0;
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Thu Aug 11 22:18:27 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Fri Aug 12 16:05:37 2005 +0000
     3.3 @@ -211,11 +211,11 @@ static void balloon_process(void *unused
     3.4              /* Link back into the page tables if it's not a highmem page. */
     3.5              if ( pfn < max_low_pfn )
     3.6              {
     3.7 -                HYPERVISOR_update_va_mapping(
     3.8 +                BUG_ON(HYPERVISOR_update_va_mapping(
     3.9                      (unsigned long)__va(pfn << PAGE_SHIFT),
    3.10                      __pte_ma((mfn_list[i] << PAGE_SHIFT) |
    3.11                               pgprot_val(PAGE_KERNEL)),
    3.12 -                    0);
    3.13 +                    0));
    3.14              }
    3.15  
    3.16              /* Finally, relinquish the memory back to the system allocator. */
    3.17 @@ -249,8 +249,8 @@ static void balloon_process(void *unused
    3.18              {
    3.19                  v = phys_to_virt(pfn << PAGE_SHIFT);
    3.20                  scrub_pages(v, 1);
    3.21 -                HYPERVISOR_update_va_mapping(
    3.22 -                    (unsigned long)v, __pte_ma(0), 0);
    3.23 +                BUG_ON(HYPERVISOR_update_va_mapping(
    3.24 +                    (unsigned long)v, __pte_ma(0), 0));
    3.25              }
    3.26  #ifdef CONFIG_XEN_SCRUB_PAGES
    3.27              else
     4.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h	Thu Aug 11 22:18:27 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h	Fri Aug 12 16:05:37 2005 +0000
     4.3 @@ -386,13 +386,6 @@ HYPERVISOR_update_va_mapping(
     4.4  	  "4" (flags)
     4.5  	: "memory" );
     4.6  
     4.7 -    if ( unlikely(ret < 0) )
     4.8 -    {
     4.9 -        printk(KERN_ALERT "Failed update VA mapping: %08lx, %08lx, %08lx\n",
    4.10 -               va, (new_val).pte_low, flags);
    4.11 -        BUG();
    4.12 -    }
    4.13 -
    4.14      return ret;
    4.15  }
    4.16  
     5.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Thu Aug 11 22:18:27 2005 +0000
     5.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Fri Aug 12 16:05:37 2005 +0000
     5.3 @@ -497,7 +497,7 @@ extern inline pte_t pte_modify(pte_t pte
     5.4  	do {								  \
     5.5  		if (__dirty) {						  \
     5.6  		        if ( likely((__vma)->vm_mm == current->mm) ) {    \
     5.7 -			    HYPERVISOR_update_va_mapping((__address), (__entry), UVMF_INVLPG|UVMF_MULTI|(unsigned long)((__vma)->vm_mm->cpu_vm_mask.bits)); \
     5.8 +			    BUG_ON(HYPERVISOR_update_va_mapping((__address), (__entry), UVMF_INVLPG|UVMF_MULTI|(unsigned long)((__vma)->vm_mm->cpu_vm_mask.bits))); \
     5.9  			} else {                                          \
    5.10                              xen_l1_entry_update((__ptep), (__entry)); \
    5.11  			    flush_tlb_page((__vma), (__address));         \