ia64/xen-unstable

changeset 16145:d994e6d3136d

x86: Reduce logging about get_page_type() failures.

We shouldn't log if the cause could be a recursive-mapping attempt --
we expect a get_page_type() failure in that case.

Based on a patch maintained for NetBSD.

Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Wed Oct 17 11:17:53 2007 +0100 (2007-10-17)
parents 76bf1fcaf01d
children b4278beaf354
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Oct 17 11:12:32 2007 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Wed Oct 17 11:17:53 2007 +0100
     1.3 @@ -1771,13 +1771,20 @@ int get_page_type(struct page_info *page
     1.4          }
     1.5          else if ( unlikely((x & (PGT_type_mask|PGT_pae_xen_l2)) != type) )
     1.6          {
     1.7 -            if ( ((x & PGT_type_mask) != PGT_l2_page_table) ||
     1.8 -                 (type != PGT_l1_page_table) )
     1.9 -                MEM_LOG("Bad type (saw %" PRtype_info
    1.10 -                        " != exp %" PRtype_info ") "
    1.11 -                        "for mfn %lx (pfn %lx)",
    1.12 -                        x, type, page_to_mfn(page),
    1.13 -                        get_gpfn_from_mfn(page_to_mfn(page)));
    1.14 +            /* Don't log failure if it could be a recursive-mapping attempt. */
    1.15 +            if ( ((x & PGT_type_mask) == PGT_l2_page_table) &&
    1.16 +                 (type == PGT_l1_page_table) )
    1.17 +                return 0;
    1.18 +            if ( ((x & PGT_type_mask) == PGT_l3_page_table) &&
    1.19 +                 (type == PGT_l2_page_table) )
    1.20 +                return 0;
    1.21 +            if ( ((x & PGT_type_mask) == PGT_l4_page_table) &&
    1.22 +                 (type == PGT_l3_page_table) )
    1.23 +                return 0;
    1.24 +            MEM_LOG("Bad type (saw %" PRtype_info " != exp %" PRtype_info ") "
    1.25 +                    "for mfn %lx (pfn %lx)",
    1.26 +                    x, type, page_to_mfn(page),
    1.27 +                    get_gpfn_from_mfn(page_to_mfn(page)));
    1.28              return 0;
    1.29          }
    1.30          else if ( unlikely(!(x & PGT_validated)) )