[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86: get_page_from_gfn() should not return misleading type
commit 44f270dfc1e2ac17fd82051b1b7968d4a21c755a Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Mon Jun 12 09:29:45 2017 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Mon Jun 12 09:29:45 2017 +0200 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> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/include/asm-x86/p2m.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h index 408f7da..e736609 100644 --- 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_from_gfn( 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; } -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |