From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wei.liu2@citrix.com>,
"Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH 14/14] xen/gnttab: Minor improvements to arch header files
Date: Wed, 21 Nov 2018 13:21:22 +0000 [thread overview]
Message-ID: <1542806482-24030-15-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1542806482-24030-1-git-send-email-andrew.cooper3@citrix.com>
* 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>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
xen/include/asm-arm/grant_table.h | 6 ++----
xen/include/asm-x86/grant_table.h | 10 +++-------
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
index 816e3c6..051db13 100644
--- a/xen/include/asm-arm/grant_table.h
+++ b/xen/include/asm-arm/grant_table.h
@@ -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) \
diff --git a/xen/include/asm-x86/grant_table.h b/xen/include/asm-x86/grant_table.h
index 4b8c4f9..8b604ed 100644
--- a/xen/include/asm-x86/grant_table.h
+++ b/xen/include/asm-x86/grant_table.h
@@ -17,10 +17,6 @@
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)))
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-11-21 13:21 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 13:21 [PATCH 00/14] XSA-277 followup Andrew Cooper
2018-11-21 13:21 ` [PATCH 01/14] x86/soft-reset: Drop gfn reference after calling get_gfn_query() Andrew Cooper
2018-11-22 14:45 ` Jan Beulich
2018-11-21 13:21 ` [PATCH 02/14] x86/mem-sharing: Don't leave the altp2m lock held when nominating a page Andrew Cooper
2018-11-21 16:56 ` Tamas K Lengyel
2018-11-22 14:46 ` Jan Beulich
2018-11-21 13:21 ` [PATCH 03/14] AMD/IOMMU: Fix multiple reference counting errors Andrew Cooper
2018-11-22 14:51 ` Jan Beulich
2018-11-22 17:46 ` Andrew Cooper
2018-11-23 8:23 ` Jan Beulich
2018-11-23 16:03 ` Andrew Cooper
2018-11-26 9:05 ` Jan Beulich
2019-01-31 15:59 ` Woods, Brian
2018-11-21 13:21 ` [PATCH 04/14] x86/p2m: Fix locking in p2m_altp2m_lazy_copy() Andrew Cooper
2018-11-21 13:59 ` Razvan Cojocaru
2018-11-22 15:01 ` Jan Beulich
2018-12-05 19:53 ` Andrew Cooper
2018-11-21 13:21 ` [PATCH 05/14] x86/p2m: Don't overwrite p2m_altp2m_lazy_copy()'s callers p2m pointer Andrew Cooper
2018-11-21 14:07 ` Razvan Cojocaru
2018-11-22 15:03 ` Jan Beulich
2018-11-21 13:21 ` [PATCH 06/14] x86/hvm: Make the altp2m locking easier to follow Andrew Cooper
2018-11-21 14:43 ` Razvan Cojocaru
2018-11-22 15:08 ` Jan Beulich
2018-11-21 13:21 ` [PATCH 07/14] x86/p2m: Coding style cleanup Andrew Cooper
2018-11-22 15:12 ` Jan Beulich
2018-11-21 13:21 ` [PATCH 08/14] xen/memory: Drop ARM put_gfn() stub Andrew Cooper
2018-11-22 14:07 ` Julien Grall
2018-11-22 15:15 ` Jan Beulich
2018-11-21 13:21 ` [PATCH 09/14] x86/p2m: Switch the two_gfns infrastructure to using gfn_t Andrew Cooper
2018-11-21 17:06 ` Tamas K Lengyel
2018-11-22 15:17 ` Jan Beulich
2018-11-21 13:21 ` [PATCH 10/14] x86/mm: Switch {get, put}_gfn() " Andrew Cooper
2018-11-21 14:48 ` Razvan Cojocaru
2018-11-21 16:12 ` Paul Durrant
2018-11-22 15:34 ` Jan Beulich
2018-11-23 2:58 ` Tian, Kevin
2018-11-26 15:51 ` Woods, Brian
2018-11-21 13:21 ` [PATCH 11/14] xen/mm: Switch mfn_to_virt()/virt_to_mfn() to using mfn_t Andrew Cooper
2018-11-22 14:32 ` Julien Grall
2018-11-22 15:44 ` Jan Beulich
2018-11-22 15:49 ` Andrew Cooper
2018-11-21 13:21 ` [PATCH 12/14] xen/gnttab: Drop gnttab_create_{shared, status}_page() Andrew Cooper
2018-11-22 14:35 ` Julien Grall
2018-11-22 15:47 ` Jan Beulich
2018-11-21 13:21 ` [PATCH 13/14] xen/gnttab: Simplify gnttab_map_frame() Andrew Cooper
2018-11-22 14:36 ` Julien Grall
2018-11-22 15:48 ` Jan Beulich
2018-11-21 13:21 ` Andrew Cooper [this message]
2018-11-22 15:51 ` [PATCH 14/14] xen/gnttab: Minor improvements to arch header files Jan Beulich
2018-11-22 17:56 ` Andrew Cooper
2019-01-30 20:04 ` Julien Grall
2019-01-30 20:05 ` Andrew Cooper
2018-11-21 17:19 ` [PATCH 00/14] XSA-277 followup Tamas K Lengyel
2018-11-21 21:22 ` Andrew Cooper
2018-11-21 22:42 ` Tamas K Lengyel
2018-11-22 0:08 ` Andrew Cooper
2018-11-26 17:48 ` Tamas K Lengyel
2018-11-23 15:46 ` Roger Pau Monné
2019-01-30 18:36 ` Pings for 4.12 " Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1542806482-24030-15-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).