From patchwork Fri Aug 8 17:03:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 35145 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A2C6E2118A for ; Fri, 8 Aug 2014 17:06:05 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id q107sf16087733qgd.7 for ; Fri, 08 Aug 2014 10:06:05 -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:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=sIBodhacCOkhDj76cuUo3NbFgotw4fTcWl8mIAruV8M=; b=im/01vFguHQqVEj1yMpcG+vaMNtBXG5OFhvZpYl5zp/zdporLiVjtI/2TCF2GmZOV8 jpbTPLBICAtkYBnLZT0IGR4CU/RwgxTpiM5X1M4I8hu+fmOeLa5Z9+9hCljtMYqo/poD i9lfqpbpacDHU5l4kAROUThrG9fuyO8jZEvHL6AbaP8n2kTZBQVPm6hq4KQqflm/grPh N4FV44YKLKBrkxtTCgMc70ueojik46L2qvMo0ZE3OIC9DqlDeatML1dXtShzl4FWcZHx BrK59ranLTnaO6ri1Z54jufVvj4yy6JVf7vpeoblO9i8OuB8vM/ykA7KdCaUbUMT1bBB 4ahw== X-Gm-Message-State: ALoCoQmFh/fHaSj5iq7eGVWVQPMCZ1JTDCNFLEsqWtsiO3zYIdPWtfXwci7PusNBSw84St6YH+Kk X-Received: by 10.224.163.69 with SMTP id z5mr13158791qax.8.1407517565503; Fri, 08 Aug 2014 10:06:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.11 with SMTP id y11ls592117qgy.23.gmail; Fri, 08 Aug 2014 10:06:05 -0700 (PDT) X-Received: by 10.52.185.72 with SMTP id fa8mr7617470vdc.4.1407517565432; Fri, 08 Aug 2014 10:06:05 -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 xv9si3091259vdb.0.2014.08.08.10.06.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Aug 2014 10:06:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so8502806vcb.7 for ; Fri, 08 Aug 2014 10:06:05 -0700 (PDT) X-Received: by 10.52.5.40 with SMTP id p8mr7680860vdp.28.1407517565323; Fri, 08 Aug 2014 10:06:05 -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.221.37.5 with SMTP id tc5csp139722vcb; Fri, 8 Aug 2014 10:06:04 -0700 (PDT) X-Received: by 10.182.94.230 with SMTP id df6mr32292409obb.36.1407517564025; Fri, 08 Aug 2014 10:06:04 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id y3si17545368icl.18.2014.08.08.10.06.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 08 Aug 2014 10:06:03 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) 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 1XFnaq-00082p-8V; Fri, 08 Aug 2014 17:04:40 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XFnap-000829-4e for xen-devel@lists.xensource.com; Fri, 08 Aug 2014 17:04:39 +0000 Received: from [193.109.254.147:48651] by server-9.bemta-14.messagelabs.com id 97/5F-31535-62305E35; Fri, 08 Aug 2014 17:04:38 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1407517476!14532111!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22969 invoked from network); 8 Aug 2014 17:04:37 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 8 Aug 2014 17:04:37 -0000 X-IronPort-AV: E=Sophos;i="5.01,825,1400025600"; d="scan'208";a="160114134" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 8 Aug 2014 13:04:35 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XFnag-0001fY-44; Fri, 08 Aug 2014 18:04:30 +0100 From: Stefano Stabellini To: Date: Fri, 8 Aug 2014 18:03:09 +0100 Message-ID: <1407517391-10490-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian.Campbell@citrix.com, Stefano Stabellini , julien.grall@citrix.com, david.vrabel@citrix.com, v1ne2go@gmail.com, linux-arm-kernel@lists.infradead.org Subject: [Xen-devel] [PATCH v4 1/3] xen/arm: introduce XENFEAT_grant_map_identity 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: , 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: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) 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: The flag tells us that the hypervisor maps a grant page to guest physical address == machine address of the page in addition to the normal grant mapping address. It is needed to properly issue cache maintenance operation at the completion of a DMA operation involving a foreign grant. Signed-off-by: Stefano Stabellini Tested-by: Denis Schneider --- Changes in v3: - rename XENFEAT_grant_map_11 to XENFEAT_grant_map_identity. --- arch/arm/xen/enlighten.c | 6 ++++++ include/xen/interface/features.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index b96723e..eef324f 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -262,6 +262,12 @@ static int __init xen_guest_init(void) xen_domain_type = XEN_HVM_DOMAIN; xen_setup_features(); + + if (!xen_feature(XENFEAT_grant_map_identity)) { + pr_warn("Please upgrade your Xen.\n" + "If your platform has any non-coherent DMA devices, they won't work properly.\n"); + } + if (xen_feature(XENFEAT_dom0)) xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED; else diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h index 131a6cc..14334d0 100644 --- a/include/xen/interface/features.h +++ b/include/xen/interface/features.h @@ -53,6 +53,9 @@ /* operation as Dom0 is supported */ #define XENFEAT_dom0 11 +/* Xen also maps grant references at pfn = mfn */ +#define XENFEAT_grant_map_identity 12 + #define XENFEAT_NR_SUBMAPS 1 #endif /* __XEN_PUBLIC_FEATURES_H__ */