From patchwork Fri Aug 1 14:56:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 34709 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 263D5202A1 for ; Fri, 1 Aug 2014 14:59:03 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id eu11sf28416101pac.11 for ; Fri, 01 Aug 2014 07:59:02 -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:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=rAwi2ZAN2GODrLpWNPPlJ4EzjlX9EjxBEq6cf+rh34o=; b=RFPwftlq+3ZdQRaGj8CctEPRo0k0RGvIT0/sDgVD+v9mHPS3au00rEtCTq0W8ZjFVD nx/Vb9oLwTd0cKzK58smCuyBb77/J+INeQ+EUOAHbeVoTZUFATk1bGPUQUFq6tx3/wqQ NGnKDy5SjFcPD0bibzvzxzSS3E9aqwkzfAUKeUTEIfaIWUc7uK4mceotCHLRmzepBy+h cHNuZEhuysWlbm/U4XKpVUniyNk8pI457c9sEWHiwldQUsmAdjk0sUkfg2CpxeFTpJmH D2515JAUEbCNqFMY6hZtIqkOmZ4oJSdC5ByVBgvqXtnkSUUcUFnommzY6p1m3JkJ01vk hWBQ== X-Gm-Message-State: ALoCoQkauGnZ36qyWYv3WpcgUAOIHO52k/NhCNGpz+OxwvTWR1UeiWo/eZ8w5ZJzt3SkRJ/UamKG X-Received: by 10.66.151.140 with SMTP id uq12mr2442739pab.23.1406905142444; Fri, 01 Aug 2014 07:59:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.6 with SMTP id q6ls1363996qgq.49.gmail; Fri, 01 Aug 2014 07:59:02 -0700 (PDT) X-Received: by 10.220.116.196 with SMTP id n4mr7047419vcq.6.1406905142273; Fri, 01 Aug 2014 07:59:02 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id yk8si7466899vdc.22.2014.08.01.07.59.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Aug 2014 07:59:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id le20so6709442vcb.0 for ; Fri, 01 Aug 2014 07:59:02 -0700 (PDT) X-Received: by 10.52.244.81 with SMTP id xe17mr5811245vdc.24.1406905142188; Fri, 01 Aug 2014 07:59:02 -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 tc5csp117420vcb; Fri, 1 Aug 2014 07:59:01 -0700 (PDT) X-Received: by 10.70.54.102 with SMTP id i6mr6832094pdp.25.1406905141149; Fri, 01 Aug 2014 07:59:01 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id iy2si3871741pbb.257.2014.08.01.07.59.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Aug 2014 07:59:01 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XDEHR-0008Ft-CF; Fri, 01 Aug 2014 14:58:01 +0000 Received: from smtp.citrix.com ([66.165.176.89]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XDEHP-00084a-1N for linux-arm-kernel@lists.infradead.org; Fri, 01 Aug 2014 14:57:59 +0000 X-IronPort-AV: E=Sophos;i="5.01,780,1400025600"; d="scan'208";a="157911333" 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, 1 Aug 2014 10:57:37 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XDEGy-00053m-8o; Fri, 01 Aug 2014 15:57:32 +0100 From: Stefano Stabellini To: Subject: [PATCH v3 1/3] xen/arm: introduce XENFEAT_grant_map_identity Date: Fri, 1 Aug 2014 15:56:22 +0100 Message-ID: <1406904984-16068-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140801_075759_266378_E725A446 X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.7 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [66.165.176.89 listed in list.dnswl.org] -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [66.165.176.89 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Ian.Campbell@citrix.com, Stefano Stabellini , julien.grall@citrix.com, david.vrabel@citrix.com, v1ne2go@gmail.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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.169 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 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__ */