On 17/05/16 22:50, Ed Swierk wrote: > I added some more instrumentation and discovered that the result of > xen_count_remap_pages() (0x85dea) is one less than the actual number > of pages remapped by xen_set_identity_and_remap() (0x85deb). > > The two functions differ in their handling of a xen_e820_map entry > whose size is not a multiple of the page size. The entry starting at > 0x68000 has size 0x33400. xen_count_remap_pages() rounds up when > computing the end_pfn (to 0x9c), while xen_set_identity_and_remap() > rounds down (to 0x9b). Thus xen_count_remap_pages() counts the > remapped space following the entry as one page smaller than the other > function does. Could you please test the attached patch? It follows your idea of the combined function, but is using a function pointer instead of a flag. The patch is based on 4.6, but I believe it should just work on 4.4. Juergen