From patchwork Tue Apr 22 13:14:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 28805 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D0813203AC for ; Tue, 22 Apr 2014 13:16:24 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id pa12sf26064976veb.8 for ; Tue, 22 Apr 2014 06:16:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=xhZube7u3hK/1pm7GL0IZAFbneL4/4HYpSQ9IN0ay0A=; b=ihqi3+Ay5KaMNdpQZQOON56yd4jCAmt2b4M9Mm9CAFUNb7aA2Gs2p7HGuJIQp1xpH+ 3RpzhyaMkao6F0/wjgh7FdCuNIq4wcMeFYxg2o/AQPFfZPqRZq2qmSTVbX1dMDpuDmWd MaakURyMg0YxiKL9Je/nAL1EBCEuWEPW0/xGg0QAx/HYDccqFjCZM1p4v6xn0AgWiCLC 4U3xrCejTgInMuFJKXXZnWtosX9lTwt11hGg+6p6nN+Qsg2KnKDKeB6eYi8bvoU04OzI ZKiUIZgl5eBNZ3SnMIsb+M6cmq1h3aO+sVdOONWWn0GGO23LVxmI6iwKIX6s1Ahxwyfo dpMA== X-Gm-Message-State: ALoCoQmuaxtkvlGD7QFsu6kJAZ0p5zLI5zN1XN95tKBcGmM5pgZn//BNBe4ZL22a2GcuQeRQQ6ZA X-Received: by 10.58.196.209 with SMTP id io17mr22743131vec.7.1398172584473; Tue, 22 Apr 2014 06:16:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.197 with SMTP id s63ls80383qga.39.gmail; Tue, 22 Apr 2014 06:16:24 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr37339319vcb.0.1398172584239; Tue, 22 Apr 2014 06:16:24 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id sc7si6871666vdc.49.2014.04.22.06.16.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 06:16:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lc6so2551203vcb.35 for ; Tue, 22 Apr 2014 06:16:24 -0700 (PDT) X-Received: by 10.220.44.20 with SMTP id y20mr35509vce.60.1398172584149; Tue, 22 Apr 2014 06:16:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp23856vcb; Tue, 22 Apr 2014 06:16:23 -0700 (PDT) X-Received: by 10.224.114.130 with SMTP id e2mr47384372qaq.53.1398172583666; Tue, 22 Apr 2014 06:16:23 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id m17si7400063qgd.169.2014.04.22.06.16.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 22 Apr 2014 06:16:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WcaXL-0005vn-F4; Tue, 22 Apr 2014 13:14:59 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WcaXF-0005rW-Ao for xen-devel@lists.xenproject.org; Tue, 22 Apr 2014 13:14:55 +0000 Received: from [85.158.143.35:34184] by server-1.bemta-4.messagelabs.com id BC/9D-09853-C4B66535; Tue, 22 Apr 2014 13:14:52 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-11.tower-21.messagelabs.com!1398172491!259541!1 X-Originating-IP: [74.125.83.54] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6103 invoked from network); 22 Apr 2014 13:14:51 -0000 Received: from mail-ee0-f54.google.com (HELO mail-ee0-f54.google.com) (74.125.83.54) by server-11.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 22 Apr 2014 13:14:51 -0000 Received: by mail-ee0-f54.google.com with SMTP id d49so4703224eek.27 for ; Tue, 22 Apr 2014 06:14:51 -0700 (PDT) X-Received: by 10.15.36.136 with SMTP id i8mr2162551eev.113.1398172491682; Tue, 22 Apr 2014 06:14:51 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id 45sm112969867eeh.9.2014.04.22.06.14.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Apr 2014 06:14:51 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 22 Apr 2014 14:14:21 +0100 Message-Id: <1398172475-27873-8-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398172475-27873-1-git-send-email-julien.grall@linaro.org> References: <1398172475-27873-1-git-send-email-julien.grall@linaro.org> Cc: ian.campbell@citrix.com, Julien Grall , tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , Suravee Suthikulpanit Subject: [Xen-devel] [PATCH v4 07/21] xen/passthrough: amd: rename iommu_has_feature into amd_iommu_has_feature X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: This function is AMD specific and the name will clash with a newly function added in the IOMMU framework. Signed-off-by: Julien Grall Cc: Suravee Suthikulpanit Cc: Jan Beulich Reviewed-by: Ian Campbell Acked-by: Aravind Gopalakrishnan --- 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;