x86: fix off-by-one in is_xen_fixed_mfn()

__2M_rwdata_end marks the first byte after the Xen image, not its last
byte. Subtract 1 to obtain the upper bound to compare against. (Note
that instead switching from <= to < is less desirable, as in principle
__pa() might return rubbish for addresses outside of the Xen image.)

Since the & needs to be dropped from the line in question, also drop it
from the adjacent one.

Reported-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 9633929824
master date: 2019-10-25 10:38:58 +0200
This commit is contained in:
Jan Beulich committed 2019-11-25 16:17:14 +01:00
1 parent 41d85cbeaf
commit 0b1e97d77f
1 file changed
+2 -2
+2 -2
View File
@@ -295,8 +295,8 @@ struct page_info
#define is_xen_heap_mfn(mfn) \
(__mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(_mfn(mfn))))
#define is_xen_fixed_mfn(mfn) \
((((mfn) << PAGE_SHIFT) >= __pa(&_stext)) && \
(((mfn) << PAGE_SHIFT) <= __pa(&__2M_rwdata_end)))
((((mfn) << PAGE_SHIFT) >= __pa(_stext)) && \
(((mfn) << PAGE_SHIFT) <= __pa(__2M_rwdata_end - 1)))
#define PRtype_info "016lx"/* should only be used for printk's */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.