]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
xen/gnttab: Minor improvements to arch header files
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 24 Oct 2018 09:47:45 +0000 (10:47 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 Mar 2019 18:40:24 +0000 (18:40 +0000)
 * Use XFREE() when appropriate
 * Drop stale comments and unnecessary brackets
 * Fold asm constraints

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/include/asm-arm/grant_table.h
xen/include/asm-x86/grant_table.h

index 816e3c6d6834b391704ea0d46daf5553f9676884..051db1362b007db7f81eb00132409ee2c666f775 100644 (file)
@@ -54,10 +54,8 @@ void gnttab_mark_dirty(struct domain *d, mfn_t mfn);
 
 #define gnttab_destroy_arch(gt)                                          \
     do {                                                                 \
-        xfree((gt)->arch.shared_gfn);                                    \
-        (gt)->arch.shared_gfn = NULL;                                    \
-        xfree((gt)->arch.status_gfn);                                    \
-        (gt)->arch.status_gfn = NULL;                                    \
+        XFREE((gt)->arch.shared_gfn);                                    \
+        XFREE((gt)->arch.status_gfn);                                    \
     } while ( 0 )
 
 #define gnttab_set_frame_gfn(gt, st, idx, gfn)                           \
index 4b8c4f916009884a5a4f1035d4f020d133ff99d0..8b604ed51f612f222b5acc76c126e69ac3451a87 100644 (file)
 struct grant_table_arch {
 };
 
-/*
- * Caller must own caller's BIGLOCK, is responsible for flushing the TLB, and
- * must hold a reference to the page.
- */
 static inline int create_grant_host_mapping(uint64_t addr, mfn_t frame,
                                             unsigned int flags,
                                             unsigned int cache_flags)
@@ -62,7 +58,7 @@ static inline int replace_grant_host_mapping(uint64_t addr, mfn_t frame,
 #define gnttab_status_gmfn(d, t, i)                     \
     (mfn_to_gmfn(d, gnttab_status_mfn(t, i)))
 
-#define gnttab_mark_dirty(d, f) paging_mark_dirty((d), f)
+#define gnttab_mark_dirty(d, f) paging_mark_dirty(d, f)
 
 static inline void gnttab_clear_flag(unsigned int nr, uint16_t *st)
 {
@@ -70,10 +66,10 @@ static inline void gnttab_clear_flag(unsigned int nr, uint16_t *st)
      * Note that this cannot be clear_bit(), as the access must be
      * confined to the specified 2 bytes.
      */
-    asm volatile ("lock btrw %w1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
+    asm volatile ("lock btrw %w1,%0" : "+m" (*st) : "Ir" (nr));
 }
 
-/* Foreign mappings of HHVM-guest pages do not modify the type count. */
+/* Foreign mappings of HVM-guest pages do not modify the type count. */
 #define gnttab_host_mapping_get_page_type(ro, ld, rd)   \
     (!(ro) && (((ld) == (rd)) || !paging_mode_external(rd)))