[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] x86: get_page_from_gfn() should not return misleading type
It is not impossible that the page owner is dom_io. While no current caller cares about this case, let's nevertheless return an appropriate type even in that case. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -479,9 +479,9 @@ static inline struct page_info *get_page if ( paging_mode_translate(d) ) return get_page_from_gfn_p2m(d, p2m_get_hostp2m(d), gfn, t, NULL, q); - /* Non-translated guests see 1-1 RAM mappings everywhere */ - if (t) - *t = p2m_ram_rw; + /* Non-translated guests see 1-1 RAM / MMIO mappings everywhere */ + if ( t ) + *t = likely(d != dom_io) ? p2m_ram_rw : p2m_mmio_direct; page = __mfn_to_page(gfn); return mfn_valid(_mfn(gfn)) && get_page(page, d) ? page : NULL; } Attachment:
x86-gpfg-type.patch _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |