From patchwork Tue Jul 8 15:53:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 33239 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6053C2070A for ; Tue, 8 Jul 2014 15:56:09 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id id10sf20680569vcb.11 for ; Tue, 08 Jul 2014 08:56:09 -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=2BnQfOscFbIDHAFswCQ7pe7QthRhGO7504HQsHrX7wU=; b=XYwhpxWi+vRnXxXy9bcImYq86rpkbrZBcRxj0v/SPK8MKv0AKDUrRHeYDhk/9+aFs9 V2QbjwI0BGxAI+8ndd6I5SguvMAW+rHW+Mt3nfI4JWuhDE+EOVorDFp+90i2Nve0nzJD DHZOE6PTXmK9BYnWhp7sQpx4KHpn2zTRSAgxiV/gWvX5obs+/Zc2bPARjMEbth+2cwqd EyuCn30FZuhi4+IOPjgvqZw5l2frYGrNyKWqNeTAHJJieE0L767ri/zbA8lsOTE93OuL VcwvlbhEELQdTMetaXC+tXW5VTxS4iWFaKTG3OMa1ry/1Fh9exW23/BuV5W+lJgU/h17 zJvg== X-Gm-Message-State: ALoCoQkiIHx4+lhAYaPsuSpJ9dfZFjzwyxMTOtf6CHJ1NtIe/xa9ddqn4nYWS9qvli+oB9AwmbXe X-Received: by 10.236.124.100 with SMTP id w64mr9000663yhh.57.1404834969180; Tue, 08 Jul 2014 08:56:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.198 with SMTP id m64ls2265228qge.39.gmail; Tue, 08 Jul 2014 08:56:09 -0700 (PDT) X-Received: by 10.58.178.2 with SMTP id cu2mr316186vec.70.1404834969085; Tue, 08 Jul 2014 08:56:09 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id hw3si125209vdb.67.2014.07.08.08.56.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 08:56:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id lf12so5676544vcb.32 for ; Tue, 08 Jul 2014 08:56:09 -0700 (PDT) X-Received: by 10.52.246.101 with SMTP id xv5mr933265vdc.73.1404834969008; Tue, 08 Jul 2014 08:56:09 -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 tc5csp782055vcb; Tue, 8 Jul 2014 08:56:08 -0700 (PDT) X-Received: by 10.52.69.133 with SMTP id e5mr947149vdu.66.1404834968702; Tue, 08 Jul 2014 08:56:08 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ua6si20342084vcb.14.2014.07.08.08.56.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 08:56:08 -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 1X4Xib-0002Cz-Du; Tue, 08 Jul 2014 15:54:09 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X4XiZ-0002Cb-68 for xen-devel@lists.xensource.com; Tue, 08 Jul 2014 15:54:07 +0000 Received: from [193.109.254.147:47463] by server-10.bemta-14.messagelabs.com id 4C/CC-01431-E141CB35; Tue, 08 Jul 2014 15:54:06 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1404834844!16175343!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 5762 invoked from network); 8 Jul 2014 15:54:05 -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 Jul 2014 15:54:05 -0000 X-IronPort-AV: E=Sophos;i="5.01,625,1400025600"; d="scan'208";a="150609957" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 08 Jul 2014 15:54:05 +0000 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; Tue, 8 Jul 2014 11:54:03 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1X4XiQ-0000M3-Jj; Tue, 08 Jul 2014 16:53:58 +0100 From: Stefano Stabellini To: Date: Tue, 8 Jul 2014 16:53:14 +0100 Message-ID: <1404834794-16055-2-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: julien.grall@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [RFC PATCH 2/2] xen/arm: introduce XENFEAT_grant_map_11 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.173 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 specifies that the hypervisor maps a grant page to guest physical address == machine address of the page in addition to the normal grant mapping address. Frontends are allowed to map the same page multiple times using multiple grant references. On the backend side it can be difficult to find out the physical address corresponding to a particular machine address, especially at the completation of a dma operation. To simplify address translations, we introduce a second mapping of the grant at physical address == machine address so that dom0 can issue cache maintenance operations without having to find the pfn. On ARM enable the flag and this behaviour by default if the domain is directly mapped. Signed-off-by: Stefano Stabellini --- xen/common/kernel.c | 4 ++++ xen/include/asm-arm/grant_table.h | 3 +-- xen/include/public/features.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 7e83353..556ad14 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -325,6 +325,10 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) break; } #endif +#ifdef CONFIG_ARM + if ( is_domain_direct_mapped(d) ) + fi.submap |= 1U << XENFEAT_grant_map_11; +#endif break; default: return -EINVAL; diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h index eac8a70..91ba230 100644 --- a/xen/include/asm-arm/grant_table.h +++ b/xen/include/asm-arm/grant_table.h @@ -33,8 +33,7 @@ static inline int replace_grant_supported(void) ( ((i >= nr_grant_frames(d->grant_table)) && \ (i < max_nr_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i])) -#define gnttab_need_iommu_mapping(d) \ - (is_domain_direct_mapped(d) && need_iommu(d)) +#define gnttab_need_iommu_mapping(d) (is_domain_direct_mapped(d)) #endif /* __ASM_GRANT_TABLE_H__ */ /* diff --git a/xen/include/public/features.h b/xen/include/public/features.h index a149aa6..95b87fd 100644 --- a/xen/include/public/features.h +++ b/xen/include/public/features.h @@ -94,6 +94,9 @@ /* operation as Dom0 is supported */ #define XENFEAT_dom0 11 +/* Xen also maps grant references at pfn = mfn */ +#define XENFEAT_grant_map_11 12 + #define XENFEAT_NR_SUBMAPS 1 #endif /* __XEN_PUBLIC_FEATURES_H__ */