diff mbox

[Xen-devel,v4,07/21] xen/passthrough: amd: rename iommu_has_feature into amd_iommu_has_feature

Message ID 1398172475-27873-8-git-send-email-julien.grall@linaro.org
State Superseded, archived
Headers show

Commit Message

Julien Grall April 22, 2014, 1:14 p.m. UTC
This function is AMD specific and the name will clash with a newly function
added in the IOMMU framework.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/amd/iommu_detect.c    |    2 +-
 xen/drivers/passthrough/amd/iommu_init.c      |   16 ++++++++--------
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

Comments

Ian Campbell April 28, 2014, 1:56 p.m. UTC | #1
On Tue, 2014-04-22 at 14:14 +0100, Julien Grall wrote:
> This function is AMD specific and the name will clash with a newly function
> added in the IOMMU framework.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Cc: Jan Beulich <jbeulich@suse.com>

Seems reasonable to me FWIW

Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Julien Grall April 28, 2014, 4:38 p.m. UTC | #2
Hello Sherry and Suravee,

Can one of you ack this change in the AMD IOMMU drivers?

Regards,

On 04/22/2014 02:14 PM, Julien Grall wrote:
> This function is AMD specific and the name will clash with a newly function
> added in the IOMMU framework.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> ---
>  xen/drivers/passthrough/amd/iommu_detect.c    |    2 +-
>  xen/drivers/passthrough/amd/iommu_init.c      |   16 ++++++++--------
>  xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    2 +-
>  3 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/xen/drivers/passthrough/amd/iommu_detect.c b/xen/drivers/passthrough/amd/iommu_detect.c
> index be1b761..98e5cc2 100644
> --- a/xen/drivers/passthrough/amd/iommu_detect.c
> +++ b/xen/drivers/passthrough/amd/iommu_detect.c
> @@ -95,7 +95,7 @@ void __init get_iommu_features(struct amd_iommu *iommu)
>  
>      while ( feature_str[i] )
>      {
> -        if ( iommu_has_feature(iommu, i) )
> +        if ( amd_iommu_has_feature(iommu, i) )
>              printk( " %s\n", feature_str[i]);
>          i++;
>      }
> diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
> index 6ae44d9..b2f74ef 100644
> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -884,7 +884,7 @@ static void enable_iommu(struct amd_iommu *iommu)
>      register_iommu_event_log_in_mmio_space(iommu);
>      register_iommu_exclusion_range(iommu);
>  
> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>          register_iommu_ppr_log_in_mmio_space(iommu);
>  
>      desc = irq_to_desc(iommu->msi.irq);
> @@ -898,15 +898,15 @@ static void enable_iommu(struct amd_iommu *iommu)
>      set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_ENABLED);
>      set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
>  
> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>          set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
>  
> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
>          set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_ENABLED);
>  
>      set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
>  
> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
>          amd_iommu_flush_all_caches(iommu);
>  
>      iommu->enabled = 1;
> @@ -1009,7 +1009,7 @@ static int __init amd_iommu_init_one(struct amd_iommu *iommu)
>      if ( allocate_event_log(iommu) == NULL )
>          goto error_out;
>  
> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>          if ( allocate_ppr_log(iommu) == NULL )
>              goto error_out;
>  
> @@ -1283,10 +1283,10 @@ static void disable_iommu(struct amd_iommu *iommu)
>      set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_DISABLED);
>      set_iommu_event_log_control(iommu, IOMMU_CONTROL_DISABLED);
>  
> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>          set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_DISABLED);
>  
> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
>          set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_DISABLED);
>  
>      set_iommu_translation_control(iommu, IOMMU_CONTROL_DISABLED);
> @@ -1356,7 +1356,7 @@ void amd_iommu_resume(void)
>      }
>  
>      /* flush all cache entries after iommu re-enabled */
> -    if ( !iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
> +    if ( !amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
>      {
>          invalidate_all_devices();
>          invalidate_all_domain_pages();
> diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
> index b5abc8f..cf43e29 100644
> --- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
> +++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
> @@ -210,7 +210,7 @@ static inline int iommu_has_cap(struct amd_iommu *iommu, uint32_t bit)
>      return !!(iommu->cap.header & (1u << bit));
>  }
>  
> -static inline int iommu_has_feature(struct amd_iommu *iommu, uint32_t bit)
> +static inline int amd_iommu_has_feature(struct amd_iommu *iommu, uint32_t bit)
>  {
>      if ( !iommu_has_cap(iommu, PCI_CAP_EFRSUP_SHIFT) )
>          return 0;
>
Julien Grall May 2, 2014, 1:11 p.m. UTC | #3
(Adding Aravind)

Ping?

On 04/28/2014 05:38 PM, Julien Grall wrote:
> Hello Sherry and Suravee,
> 
> Can one of you ack this change in the AMD IOMMU drivers?
> 
> Regards,
> 
> On 04/22/2014 02:14 PM, Julien Grall wrote:
>> This function is AMD specific and the name will clash with a newly function
>> added in the IOMMU framework.
>>
>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>> Cc: Jan Beulich <jbeulich@suse.com>
>> ---
>>  xen/drivers/passthrough/amd/iommu_detect.c    |    2 +-
>>  xen/drivers/passthrough/amd/iommu_init.c      |   16 ++++++++--------
>>  xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    2 +-
>>  3 files changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/xen/drivers/passthrough/amd/iommu_detect.c b/xen/drivers/passthrough/amd/iommu_detect.c
>> index be1b761..98e5cc2 100644
>> --- a/xen/drivers/passthrough/amd/iommu_detect.c
>> +++ b/xen/drivers/passthrough/amd/iommu_detect.c
>> @@ -95,7 +95,7 @@ void __init get_iommu_features(struct amd_iommu *iommu)
>>  
>>      while ( feature_str[i] )
>>      {
>> -        if ( iommu_has_feature(iommu, i) )
>> +        if ( amd_iommu_has_feature(iommu, i) )
>>              printk( " %s\n", feature_str[i]);
>>          i++;
>>      }
>> diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
>> index 6ae44d9..b2f74ef 100644
>> --- a/xen/drivers/passthrough/amd/iommu_init.c
>> +++ b/xen/drivers/passthrough/amd/iommu_init.c
>> @@ -884,7 +884,7 @@ static void enable_iommu(struct amd_iommu *iommu)
>>      register_iommu_event_log_in_mmio_space(iommu);
>>      register_iommu_exclusion_range(iommu);
>>  
>> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>>          register_iommu_ppr_log_in_mmio_space(iommu);
>>  
>>      desc = irq_to_desc(iommu->msi.irq);
>> @@ -898,15 +898,15 @@ static void enable_iommu(struct amd_iommu *iommu)
>>      set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_ENABLED);
>>      set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
>>  
>> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>>          set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
>>  
>> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
>> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
>>          set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_ENABLED);
>>  
>>      set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
>>  
>> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
>> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
>>          amd_iommu_flush_all_caches(iommu);
>>  
>>      iommu->enabled = 1;
>> @@ -1009,7 +1009,7 @@ static int __init amd_iommu_init_one(struct amd_iommu *iommu)
>>      if ( allocate_event_log(iommu) == NULL )
>>          goto error_out;
>>  
>> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>>          if ( allocate_ppr_log(iommu) == NULL )
>>              goto error_out;
>>  
>> @@ -1283,10 +1283,10 @@ static void disable_iommu(struct amd_iommu *iommu)
>>      set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_DISABLED);
>>      set_iommu_event_log_control(iommu, IOMMU_CONTROL_DISABLED);
>>  
>> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
>>          set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_DISABLED);
>>  
>> -    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
>> +    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
>>          set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_DISABLED);
>>  
>>      set_iommu_translation_control(iommu, IOMMU_CONTROL_DISABLED);
>> @@ -1356,7 +1356,7 @@ void amd_iommu_resume(void)
>>      }
>>  
>>      /* flush all cache entries after iommu re-enabled */
>> -    if ( !iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
>> +    if ( !amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
>>      {
>>          invalidate_all_devices();
>>          invalidate_all_domain_pages();
>> diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
>> index b5abc8f..cf43e29 100644
>> --- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
>> +++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
>> @@ -210,7 +210,7 @@ static inline int iommu_has_cap(struct amd_iommu *iommu, uint32_t bit)
>>      return !!(iommu->cap.header & (1u << bit));
>>  }
>>  
>> -static inline int iommu_has_feature(struct amd_iommu *iommu, uint32_t bit)
>> +static inline int amd_iommu_has_feature(struct amd_iommu *iommu, uint32_t bit)
>>  {
>>      if ( !iommu_has_cap(iommu, PCI_CAP_EFRSUP_SHIFT) )
>>          return 0;
>>
> 
>
Aravind Gopalakrishnan May 2, 2014, 4:35 p.m. UTC | #4
On 5/2/2014 8:11 AM, Julien Grall wrote:
> (Adding Aravind)
>
> Ping?
>
> On 04/28/2014 05:38 PM, Julien Grall wrote:
>> Hello Sherry and Suravee,
>>
>> Can one of you ack this change in the AMD IOMMU drivers?
>>
>> Regards,
>>
>> On 04/22/2014 02:14 PM, Julien Grall wrote:
>>> This function is AMD specific and the name will clash with a newly function
>>> added in the IOMMU framework.
>>>
>>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>>> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
>>> Cc: Jan Beulich <jbeulich@suse.com>
>>> ---
>>>   xen/drivers/passthrough/amd/iommu_detect.c    |    2 +-
>>>   xen/drivers/passthrough/amd/iommu_init.c      |   16 ++++++++--------
>>>   xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    2 +-
>>>   3 files changed, 10 insertions(+), 10 deletions(-)
>>>
>>>


Acked-by: Aravind Gopalakrishnan<Aravind.Gopalakrishnan@amd.com>

Thanks,
-Aravind.
diff mbox

Patch

diff --git a/xen/drivers/passthrough/amd/iommu_detect.c b/xen/drivers/passthrough/amd/iommu_detect.c
index be1b761..98e5cc2 100644
--- a/xen/drivers/passthrough/amd/iommu_detect.c
+++ b/xen/drivers/passthrough/amd/iommu_detect.c
@@ -95,7 +95,7 @@  void __init get_iommu_features(struct amd_iommu *iommu)
 
     while ( feature_str[i] )
     {
-        if ( iommu_has_feature(iommu, i) )
+        if ( amd_iommu_has_feature(iommu, i) )
             printk( " %s\n", feature_str[i]);
         i++;
     }
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 6ae44d9..b2f74ef 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -884,7 +884,7 @@  static void enable_iommu(struct amd_iommu *iommu)
     register_iommu_event_log_in_mmio_space(iommu);
     register_iommu_exclusion_range(iommu);
 
-    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         register_iommu_ppr_log_in_mmio_space(iommu);
 
     desc = irq_to_desc(iommu->msi.irq);
@@ -898,15 +898,15 @@  static void enable_iommu(struct amd_iommu *iommu)
     set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_ENABLED);
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
 
-    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_ENABLED);
 
-    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
+    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
         set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_ENABLED);
 
     set_iommu_translation_control(iommu, IOMMU_CONTROL_ENABLED);
 
-    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
+    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
         amd_iommu_flush_all_caches(iommu);
 
     iommu->enabled = 1;
@@ -1009,7 +1009,7 @@  static int __init amd_iommu_init_one(struct amd_iommu *iommu)
     if ( allocate_event_log(iommu) == NULL )
         goto error_out;
 
-    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         if ( allocate_ppr_log(iommu) == NULL )
             goto error_out;
 
@@ -1283,10 +1283,10 @@  static void disable_iommu(struct amd_iommu *iommu)
     set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_DISABLED);
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_DISABLED);
 
-    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
+    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_PPRSUP_SHIFT) )
         set_iommu_ppr_log_control(iommu, IOMMU_CONTROL_DISABLED);
 
-    if ( iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
+    if ( amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_GTSUP_SHIFT) )
         set_iommu_guest_translation_control(iommu, IOMMU_CONTROL_DISABLED);
 
     set_iommu_translation_control(iommu, IOMMU_CONTROL_DISABLED);
@@ -1356,7 +1356,7 @@  void amd_iommu_resume(void)
     }
 
     /* flush all cache entries after iommu re-enabled */
-    if ( !iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
+    if ( !amd_iommu_has_feature(iommu, IOMMU_EXT_FEATURE_IASUP_SHIFT) )
     {
         invalidate_all_devices();
         invalidate_all_domain_pages();
diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
index b5abc8f..cf43e29 100644
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -210,7 +210,7 @@  static inline int iommu_has_cap(struct amd_iommu *iommu, uint32_t bit)
     return !!(iommu->cap.header & (1u << bit));
 }
 
-static inline int iommu_has_feature(struct amd_iommu *iommu, uint32_t bit)
+static inline int amd_iommu_has_feature(struct amd_iommu *iommu, uint32_t bit)
 {
     if ( !iommu_has_cap(iommu, PCI_CAP_EFRSUP_SHIFT) )
         return 0;