gnttab/ARM: properly implement gnttab_create_status_page()
authorJan Beulich <jbeulich@suse.com>
Thu, 16 Aug 2018 07:30:59 +0000 (09:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 16 Aug 2018 07:30:59 +0000 (09:30 +0200)
Prevent the "BUG_ON(page_get_owner(pg) != d)" in
gnttab_unpopulate_status_frames() from triggering.

Reported-by: 王磊 <lei19.wang@samsung.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/grant_table.h

index 756c6be2d67bd91ae233d2e017031266ecd775a1..5113b9156c4f1442676518ecbf5d9b2a7dd56dd9 100644 (file)
@@ -21,7 +21,6 @@ int create_grant_host_mapping(unsigned long gpaddr, mfn_t mfn,
 int replace_grant_host_mapping(unsigned long gpaddr, mfn_t mfn,
                                unsigned long new_gpaddr, unsigned int flags);
 void gnttab_mark_dirty(struct domain *d, mfn_t mfn);
-#define gnttab_create_status_page(d, t, i) do {} while (0)
 #define gnttab_release_host_mappings(domain) 1
 
 /*
@@ -80,6 +79,12 @@ static inline unsigned int gnttab_dom0_max(void)
             virt_to_page((char *)(t)->shared_raw[i]), d, SHARE_rw);      \
     } while ( 0 )
 
+#define gnttab_create_status_page(d, t, i)                               \
+    do {                                                                 \
+        share_xen_page_with_guest(                                       \
+            virt_to_page((char *)(t)->status[i]), d, SHARE_rw);          \
+    } while ( 0 )
+
 #define gnttab_shared_gmfn(d, t, i)                                      \
     gfn_x(((i) >= nr_grant_frames(t)) ? INVALID_GFN : (t)->arch.shared_gfn[i])