Re: [Xen-devel] [PATCH 14/14] xen/gnttab: Minor improvements to arch header files

2019-01-30 Thread Andrew Cooper
On 30/01/2019 20:04, Julien Grall wrote:
> Hi Andrew,
>
> On 11/22/18 5:56 PM, Andrew Cooper wrote:
>> On 21/11/2018 13:21, Andrew Cooper wrote:
>>>   * Use XFREE() when appropriate
>>>   * Drop stale comments and unnecessary brackets
>>>   * Fold asm constraints
>>>
>>> No functional change.
>>>
>>> Signed-off-by: Andrew Cooper 
>>> ---
>>> CC: Jan Beulich 
>>> CC: Wei Liu 
>>> CC: Roger Pau Monné 
>>> ---
>>>   xen/include/asm-arm/grant_table.h |  6 ++
>>>   xen/include/asm-x86/grant_table.h | 10 +++---
>>
>> CC'ing ARM maintainers.  I'm sorry for missing you out originally - I
>> folded two separate patches and forgot to adjust the CC list.
>
> Sorry it fell through the cracks.
>
> Acked-by: Julien Grall 

No problem.  Thanks.

~Andrew

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH 14/14] xen/gnttab: Minor improvements to arch header files

2019-01-30 Thread Julien Grall

Hi Andrew,

On 11/22/18 5:56 PM, Andrew Cooper wrote:

On 21/11/2018 13:21, Andrew Cooper wrote:

  * Use XFREE() when appropriate
  * Drop stale comments and unnecessary brackets
  * Fold asm constraints

No functional change.

Signed-off-by: Andrew Cooper 
---
CC: Jan Beulich 
CC: Wei Liu 
CC: Roger Pau Monné 
---
  xen/include/asm-arm/grant_table.h |  6 ++
  xen/include/asm-x86/grant_table.h | 10 +++---


CC'ing ARM maintainers.  I'm sorry for missing you out originally - I
folded two separate patches and forgot to adjust the CC list.


Sorry it fell through the cracks.

Acked-by: Julien Grall 

Cheers,

--
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH 14/14] xen/gnttab: Minor improvements to arch header files

2018-11-22 Thread Andrew Cooper
On 21/11/2018 13:21, Andrew Cooper wrote:
>  * Use XFREE() when appropriate
>  * Drop stale comments and unnecessary brackets
>  * Fold asm constraints
>
> No functional change.
>
> Signed-off-by: Andrew Cooper 
> ---
> CC: Jan Beulich 
> CC: Wei Liu 
> CC: Roger Pau Monné 
> ---
>  xen/include/asm-arm/grant_table.h |  6 ++
>  xen/include/asm-x86/grant_table.h | 10 +++---

CC'ing ARM maintainers.  I'm sorry for missing you out originally - I
folded two separate patches and forgot to adjust the CC list.

~Andrew

>  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)))
>  


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH 14/14] xen/gnttab: Minor improvements to arch header files

2018-11-22 Thread Jan Beulich
 >>> On 21.11.18 at 14:21,  wrote:
> * Use XFREE() when appropriate
>  * Drop stale comments and unnecessary brackets
>  * Fold asm constraints
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper 

Reviewed-by: Jan Beulich 



___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PATCH 14/14] xen/gnttab: Minor improvements to arch header files

2018-11-21 Thread Andrew Cooper
 * Use XFREE() when appropriate
 * Drop stale comments and unnecessary brackets
 * Fold asm constraints

No functional change.

Signed-off-by: Andrew Cooper 
---
CC: Jan Beulich 
CC: Wei Liu 
CC: Roger Pau Monné 
---
 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