From patchwork Thu Dec 15 11:26:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 9475857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5DC04607EE for ; Thu, 15 Dec 2016 11:29:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D36028756 for ; Thu, 15 Dec 2016 11:29:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EE762875A; Thu, 15 Dec 2016 11:29:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 11AB328756 for ; Thu, 15 Dec 2016 11:28:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHUBa-0007qd-CR; Thu, 15 Dec 2016 11:26:54 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHUBZ-0007po-7U for xen-devel@lists.xen.org; Thu, 15 Dec 2016 11:26:53 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id A7/03-22326-CFD72585; Thu, 15 Dec 2016 11:26:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDIsWRWlGSWpSXmKPExsXiVRvkrPunNij C4O9WZoslHxezODB6HN39mymAMYo1My8pvyKBNWPOy16Wgve8Fae6TrE3MN7l6mLk4hASmMgo sbT7FBOIwyLwkkXi8OwmdhBHQqCfVeL/l2lADieQEyOx4s1qKLtCYvW9JlYQW0hAXeL0ux1sE KOmMUkc7TgAlmATMJHY++cBE4gtIiAtce3zZUYQm1nAV+LmzuNgcWEBV4k9i7uAbA6g1aoSy+ 6Jg4R5BTwkpq+6ywixS07i5rlOZhCbU8BT4tbv94wQez0krk/cwTaBUWABI8MqRo3i1KKy1CJ dIzO9pKLM9IyS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYzA0GIAgh2MZxYEHmKU5GBSEuU9 ZBQUIcSXlJ9SmZFYnBFfVJqTWnyIUYaDQ0mC92MNUE6wKDU9tSItMwcY5DBpCQ4eJRFeYWCgC /EWFyTmFmemQ6ROMVpyTHu2+CkTx7pTS4Dkjs41T5mEWPLy81KlxHmZQBoEQBoySvPgxsEi8R KjrJQwLyPQgUI8BalFuZklqPKvGMU5GJWEeXeDXMWTmVcCt/UV0EFMQAeJLvEHOagkESEl1cA YvME4OnVfR/ss/09nDBo2Xp7VNfnSFZZ/d8NkXiwJrS27l3e+yu6DRscq5cVrNtvyc7YlmLd8 MXdP+ZkxpadT4MrpxKDb9QmRS3YWLT23oWNL17ny8hcbb3Vkv9r4g9tKfP4W3kifvzLFJ/4k/ Z0zM1uzdvG9SO5PD787fnx/uH6fzN6DX/lfK7EUZyQaajEXFScCAMK+E2i/AgAA X-Env-Sender: edgar.iglesias@gmail.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1481801211!77217343!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 38708 invoked from network); 15 Dec 2016 11:26:52 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-16.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 15 Dec 2016 11:26:52 -0000 Received: by mail-wm0-f67.google.com with SMTP id u144so5809215wmu.0 for ; Thu, 15 Dec 2016 03:26:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mu3kIgvYwB/ag6ggdRoWFWiis3r0Rysq7Pm3cAJ535E=; b=THDFxm60cVPc8DWUHgzrfeIZ01TND9+9pf8UXqQ9IzBIQTWlFsF+REvb8J/zdK+uLo S91jyMMzKs1ptDWSweUrHrL+e9m4sHEEk2rRSFf6Hs2cvNa8jbAMvVC72KEWATG7vU5I xLl7pF1Kcf0u2q0lw6r1E0cyQhKnFujcCMwQnH9oA7mUVaInaW7u0YLy+eIYVS+DWM9h X8Mft5slGWWtaAZ/05aYyHqjr/k/4aMylSa4Z8yB+dkMeNbROvhmIFH5JgPHGeD+1Z4i PxN7prcklTsFSk06NJPAj2itODfAUvTHtJvVaU6pvktPdz9QTcfTNSTzx2gtexZpzMLZ OJAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mu3kIgvYwB/ag6ggdRoWFWiis3r0Rysq7Pm3cAJ535E=; b=F+hgeRLz21ZXj4+COjV/EZ3VdOrnlnf/V9MqEvkM0YiMJ4YonVHZtZ8BJD8qArx7l+ oZiEo54XCJa43jn6PZnOWbiJ1AQ36qSDtp2/XB0yQFQHRojAqCq141nlqD27s/qBLP5I U3IhDsod/MKJjFCMFom92HUryH0Qi6Un+VmmDQE/ikydzqtnTeLSbeRRixEdLtNtUu4B nrqHob5+pdbekHhf4ZB1deNxuHi88h810RGalhBS8kh11tLHqoGCidtqFLxRIA2y5Znd /74fYIx5tfSQXT8zFWnEZkeTlMp4QoWxI9ce8GgNugX4QCGvg5aJvf+jBbFP+Lg8AsU/ yPLQ== X-Gm-Message-State: AKaTC03a/z9t2oMHsL1Ur6Z+tg9rqJ9AcqBTfOgNzNNQtGAQlw8olqft70AzceZf8romaA== X-Received: by 10.25.215.199 with SMTP id q68mr273668lfi.47.1481801211426; Thu, 15 Dec 2016 03:26:51 -0800 (PST) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id m67sm367498lfi.4.2016.12.15.03.26.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Dec 2016 03:26:50 -0800 (PST) From: "Edgar E. Iglesias" To: xen-devel@lists.xen.org Date: Thu, 15 Dec 2016 12:26:48 +0100 Message-Id: <1481801208-27758-2-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481801208-27758-1-git-send-email-edgar.iglesias@gmail.com> References: <1481801208-27758-1-git-send-email-edgar.iglesias@gmail.com> Cc: edgar.iglesias@xilinx.com, julien.grall@arm.com, sstabellini@kernel.org Subject: [Xen-devel] [PATCH v1 1/1] xen/arm: Map mmio-sram nodes as cached memory X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Relax the mapping of mmio-sram nodes that do not set the no-memory-wc property to cached normal memory. Rationale: Allthough on chip memories are relatively fast compared to off-chip memories, large OCMs are still significantly slower than L1 caches. Depending on the memory, either cached or uncached may make most sense. Also, dom0 may like to use the memory in a cache-coherent way to avoid SW managed coherency. By mapping it cached at S2, we let dom0 select cacheability via S1 mappings. Signed-off-by: Edgar E. Iglesias --- xen/arch/arm/domain_build.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 07b868d..3a7c1ee 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -56,8 +56,20 @@ static const struct dt_device_match dev_map_attrs[] __initconst = .data = (void *) (uintptr_t) p2m_mmio_direct_dev, }, { + /* + * Allthough on chip memories are relatively fast compared to + * off-chip memories, large OCMs are still significantly slower + * than L1 caches. Depending on the memory, either cached or + * uncached may make most sense. + * + * Also, dom0 may like to use the memory in a cache-coherent + * way to avoid SW managed coherency. + * + * By mapping it cached at S2, we let dom0 select cacheability + * via S1 mappings. + */ __DT_MATCH_COMPATIBLE("mmio-sram"), - .data = (void *) (uintptr_t) p2m_mmio_direct_nc, + .data = (void *) (uintptr_t) p2m_mmio_direct_c, }, { /* sentinel */ }, };