direct-io.hg

changeset 7396:9b51e7637676

Clean up debug tracing in mm and mm audit code.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Oct 16 17:25:15 2005 +0100 (2005-10-16)
parents f535708469ee
children fa0faada967b
files tools/libxc/xc_linux_restore.c xen/arch/x86/audit.c xen/arch/x86/mm.c
line diff
     1.1 --- a/tools/libxc/xc_linux_restore.c	Sun Oct 16 12:34:37 2005 +0100
     1.2 +++ b/tools/libxc/xc_linux_restore.c	Sun Oct 16 17:25:15 2005 +0100
     1.3 @@ -43,6 +43,8 @@ read_exact(int fd, void *buf, size_t cou
     1.4  
     1.5      while (r < count) {
     1.6          s = read(fd, &b[r], count - r);
     1.7 +        if ((s == -1) && (errno == EINTR))
     1.8 +            continue;
     1.9          if (s <= 0)
    1.10              break;
    1.11          r += s;
     2.1 --- a/xen/arch/x86/audit.c	Sun Oct 16 12:34:37 2005 +0100
     2.2 +++ b/xen/arch/x86/audit.c	Sun Oct 16 17:25:15 2005 +0100
     2.3 @@ -516,16 +516,6 @@ int audit_adjust_pgtables(struct domain 
     2.4                                     d->domain_id, mfn, page->u.inuse.type_info);
     2.5                              errors++;
     2.6                          }
     2.7 -
     2.8 -                        if ( (page->u.inuse.type_info & PGT_pinned) != PGT_pinned )
     2.9 -                        {
    2.10 -                            if ( !VM_ASSIST(d, VMASST_TYPE_writable_pagetables) )
    2.11 -                            {
    2.12 -                                printk("Audit %d: L1 mfn=%lx not pinned t=%"
    2.13 -				       PRtype_info "\n",
    2.14 -                                       d->domain_id, mfn, page->u.inuse.type_info);
    2.15 -                            }
    2.16 -                        }
    2.17                      }
    2.18                  }
    2.19                  
     3.1 --- a/xen/arch/x86/mm.c	Sun Oct 16 12:34:37 2005 +0100
     3.2 +++ b/xen/arch/x86/mm.c	Sun Oct 16 17:25:15 2005 +0100
     3.3 @@ -366,9 +366,6 @@ static int get_page_and_type_from_pagenr
     3.4  
     3.5      if ( unlikely(!get_page_type(page, type)) )
     3.6      {
     3.7 -        if ( (type & PGT_type_mask) != PGT_l1_page_table )
     3.8 -            MEM_LOG("Bad page type for pfn %lx (%" PRtype_info ")", 
     3.9 -                    page_nr, page->u.inuse.type_info);
    3.10          put_page(page);
    3.11          return 0;
    3.12      }
    3.13 @@ -438,6 +435,7 @@ get_page_from_l1e(
    3.14  {
    3.15      unsigned long mfn = l1e_get_pfn(l1e);
    3.16      struct pfn_info *page = &frame_table[mfn];
    3.17 +    int okay;
    3.18      extern int domain_iomem_in_pfn(struct domain *d, unsigned long pfn);
    3.19  
    3.20      if ( !(l1e_get_flags(l1e) & _PAGE_PRESENT) )
    3.21 @@ -470,9 +468,17 @@ get_page_from_l1e(
    3.22          d = dom_io;
    3.23      }
    3.24  
    3.25 -    return ((l1e_get_flags(l1e) & _PAGE_RW) ?
    3.26 +    okay = ((l1e_get_flags(l1e) & _PAGE_RW) ?
    3.27              get_page_and_type(page, d, PGT_writable_page) :
    3.28              get_page(page, d));
    3.29 +    if ( !okay )
    3.30 +    {
    3.31 +        MEM_LOG("Error getting mfn %lx (pfn %lx) from L1 entry %" PRIpte
    3.32 +                " for dom%d",
    3.33 +                mfn, get_pfn_from_mfn(mfn), l1e_get_intpte(l1e), d->domain_id);
    3.34 +    }
    3.35 +
    3.36 +    return okay;
    3.37  }
    3.38  
    3.39  
    3.40 @@ -682,6 +688,7 @@ static int alloc_l1_table(struct pfn_inf
    3.41      return 1;
    3.42  
    3.43   fail:
    3.44 +    MEM_LOG("Failure in alloc_l1_table: entry %d", i);
    3.45      while ( i-- > 0 )
    3.46          if ( is_guest_l1_slot(i) )
    3.47              put_page_from_l1e(pl1e[i], d);
    3.48 @@ -841,6 +848,7 @@ static int alloc_l2_table(struct pfn_inf
    3.49      return 1;
    3.50  
    3.51   fail:
    3.52 +    MEM_LOG("Failure in alloc_l2_table: entry %d", i);
    3.53      while ( i-- > 0 )
    3.54          if ( is_guest_l2_slot(type, i) )
    3.55              put_page_from_l2e(pl2e[i], pfn);
    3.56 @@ -1453,7 +1461,7 @@ int get_page_type(struct pfn_info *page,
    3.57                      if ( ((x & PGT_type_mask) != PGT_l2_page_table) ||
    3.58                           ((type & PGT_type_mask) != PGT_l1_page_table) )
    3.59                          MEM_LOG("Bad type (saw %" PRtype_info
    3.60 -                                "!= exp %" PRtype_info ") "
    3.61 +                                " != exp %" PRtype_info ") "
    3.62                                  "for mfn %lx (pfn %lx)",
    3.63                                  x, type, page_to_pfn(page),
    3.64                                  get_pfn_from_mfn(page_to_pfn(page)));
    3.65 @@ -1494,11 +1502,10 @@ int get_page_type(struct pfn_info *page,
    3.66          /* Try to validate page type; drop the new reference on failure. */
    3.67          if ( unlikely(!alloc_page_type(page, type)) )
    3.68          {
    3.69 -            MEM_LOG("Error while validating pfn %lx for type %" PRtype_info "."
    3.70 -                    " caf=%08x taf=%" PRtype_info,
    3.71 -                    page_to_pfn(page), type,
    3.72 -                    page->count_info,
    3.73 -                    page->u.inuse.type_info);
    3.74 +            MEM_LOG("Error while validating mfn %lx (pfn %lx) for type %"
    3.75 +                    PRtype_info ": caf=%08x taf=%" PRtype_info,
    3.76 +                    page_to_pfn(page), get_pfn_from_mfn(page_to_pfn(page)),
    3.77 +                    type, page->count_info, page->u.inuse.type_info);
    3.78              /* Noone else can get a reference. We hold the only ref. */
    3.79              page->u.inuse.type_info = 0;
    3.80              return 0;