panic: pmap_page_protect: illegal for unmanaged page

Simon 'corecode' Schubert corecode at
Fri Jan 11 04:03:06 PST 2008

Matthew Dillon wrote:
:device memory has pages of type PG_FICTITIOUS, but pmap_remove_all() complains:
:        /*      
:         * XXX this makes pmap_page_protect(NONE) illegal for non-managed
:         * pages!
:         */
    The comment itself is correct in that fictitious pages are not managed
    by PV lists, so its impossible for pmap_remove_all() to function on
    a fictitiuos page.  pmap_remove_all() is typically called to remove
    user mappings of pages undergoing write I/O to prevent the pages from
    being modified by userland while the I/O is in progress.

    If there is a code path calling that function on fictitious pages we
    have to examine and fix it (and the 'fix' might be as you suggest, just
    ignoring it for such pages).  I don't think its possible to put fictitious
    pages under PV management due to the physical-to-virtual translations
    that might be needed in that codepath... device pages tend to be at
    physical addresses that just don't work with the way the translation code
    was written.
It happens if you call msync() with an argument of MS_INVALIDATE.

So you suggest to simply return?

What I wonder is, will *any* page of a OBJT_DEVICE not be PG_FICTITIOUS?  In other words:  shouldn't we simply avoid the whole invalidate code path for OBJT_DEVICE objects?

I'm quite confused about the intentions of this, anyways:

from vm_map_clean:
                       int clean_only = 
                               (object->type == OBJT_DEVICE) ? FALSE : TRUE;
                       switch(current->maptype) {
                       case VM_MAPTYPE_NORMAL:
                                   OFF_TO_IDX(offset + size + PAGE_MASK),

Obviously OBJT_DEVICE is special cased, and it seems that somebody explicitly wanted that OBJT_DEVICE mappings will be completely destroyed on this call.

But then, down this code path, pmap_remove_all() will panic on PG_FICTITOUS pages.  Interesting enough, pmap_clearbit() will simply ignore PG_FICTITIOUS pages.  I think I'll try the same for pmap_remove_all() now.

Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |      Against  HTML   \
Dude 2c 2 the max   !       Mail + News   / \

More information about the Bugs mailing list