From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH v5 03/14] xen/passthrough: amd: rename iommu_has_feature into amd_iommu_has_feature Date: Tue, 13 May 2014 16:50:19 +0100 Message-ID: <1399996230-18201-4-git-send-email-julien.grall@linaro.org> References: <1399996230-18201-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WkEyX-0008K7-Ur for xen-devel@lists.xenproject.org; Tue, 13 May 2014 15:50:42 +0000 Received: by mail-ee0-f53.google.com with SMTP id c13so565080eek.12 for ; Tue, 13 May 2014 08:50:40 -0700 (PDT) In-Reply-To: <1399996230-18201-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: ian.campbell@citrix.com, Julien Grall , tim@xen.org, Jan Beulich , Aravind Gopalakrishnan , Suravee Suthikulpanit , stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org This function is AMD specific and the name will clash with a newly function added in the IOMMU framework. Signed-off-by: Julien Grall Acked-by: Ian Campbell Acked-by: Aravind Gopalakrishnan Cc: Suravee Suthikulpanit Cc: Jan Beulich --- 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; -- 1.7.10.4