From: Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 02/18] firmware: qcom_scm-32: replace open-coded call to __cpuc_flush_dcache_area()
Date: Tue, 04 Aug 2015 11:50:56 -0700 [thread overview]
Message-ID: <55C10990.3090707@codeaurora.org> (raw)
In-Reply-To: <E1ZJhWZ-00043Z-Ft-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
On 07/27/2015 05:28 AM, Russell King wrote:
> Signed-off-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> ---
Thanks!
Reviewed-by: Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> arch/arm/include/asm/cacheflush.h | 17 +++++++++++++++++
> drivers/firmware/qcom_scm-32.c | 4 +---
> 2 files changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
> index c5230a44eeca..d5525bfc7e3e 100644
> --- a/arch/arm/include/asm/cacheflush.h
> +++ b/arch/arm/include/asm/cacheflush.h
> @@ -502,4 +502,21 @@ static inline void set_kernel_text_ro(void) { }
> void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
> void *kaddr, unsigned long len);
>
> +/**
> + * secure_flush_area - ensure coherency across the secure boundary
> + * @addr: virtual address
> + * @size: size of region
> + *
> + * Ensure that the specified area of memory is coherent across the secure
> + * boundary from the non-secure side. This is used when calling secure
> + * firmware where the secure firmware does not ensure coherency.
> + */
> +static inline void secure_flush_area(const void *addr, size_t size)
> +{
> + phys_addr_t phys = __pa(addr);
> +
> + __cpuc_flush_dcache_area((void *)addr, size);
> + outer_flush_range(phys, phys + size);
> +}
> +
> #endif
> diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c
> index 1bd6f9c34331..29e6850665eb 100644
> --- a/drivers/firmware/qcom_scm-32.c
> +++ b/drivers/firmware/qcom_scm-32.c
> @@ -24,7 +24,6 @@
> #include <linux/err.h>
> #include <linux/qcom_scm.h>
>
> -#include <asm/outercache.h>
> #include <asm/cacheflush.h>
>
> #include "qcom_scm.h"
> @@ -219,8 +218,7 @@ static int __qcom_scm_call(const struct qcom_scm_command *cmd)
> * Flush the command buffer so that the secure world sees
> * the correct data.
> */
> - __cpuc_flush_dcache_area((void *)cmd, cmd->len);
> - outer_flush_range(cmd_addr, cmd_addr + cmd->len);
> + secure_flush_area(cmd, cmd->len);
>
> ret = smc(cmd_addr);
> if (ret < 0)
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/18] firmware: qcom_scm-32: replace open-coded call to __cpuc_flush_dcache_area()
Date: Tue, 04 Aug 2015 11:50:56 -0700 [thread overview]
Message-ID: <55C10990.3090707@codeaurora.org> (raw)
In-Reply-To: <E1ZJhWZ-00043Z-Ft@rmk-PC.arm.linux.org.uk>
On 07/27/2015 05:28 AM, Russell King wrote:
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
Thanks!
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
> arch/arm/include/asm/cacheflush.h | 17 +++++++++++++++++
> drivers/firmware/qcom_scm-32.c | 4 +---
> 2 files changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
> index c5230a44eeca..d5525bfc7e3e 100644
> --- a/arch/arm/include/asm/cacheflush.h
> +++ b/arch/arm/include/asm/cacheflush.h
> @@ -502,4 +502,21 @@ static inline void set_kernel_text_ro(void) { }
> void flush_uprobe_xol_access(struct page *page, unsigned long uaddr,
> void *kaddr, unsigned long len);
>
> +/**
> + * secure_flush_area - ensure coherency across the secure boundary
> + * @addr: virtual address
> + * @size: size of region
> + *
> + * Ensure that the specified area of memory is coherent across the secure
> + * boundary from the non-secure side. This is used when calling secure
> + * firmware where the secure firmware does not ensure coherency.
> + */
> +static inline void secure_flush_area(const void *addr, size_t size)
> +{
> + phys_addr_t phys = __pa(addr);
> +
> + __cpuc_flush_dcache_area((void *)addr, size);
> + outer_flush_range(phys, phys + size);
> +}
> +
> #endif
> diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c
> index 1bd6f9c34331..29e6850665eb 100644
> --- a/drivers/firmware/qcom_scm-32.c
> +++ b/drivers/firmware/qcom_scm-32.c
> @@ -24,7 +24,6 @@
> #include <linux/err.h>
> #include <linux/qcom_scm.h>
>
> -#include <asm/outercache.h>
> #include <asm/cacheflush.h>
>
> #include "qcom_scm.h"
> @@ -219,8 +218,7 @@ static int __qcom_scm_call(const struct qcom_scm_command *cmd)
> * Flush the command buffer so that the secure world sees
> * the correct data.
> */
> - __cpuc_flush_dcache_area((void *)cmd, cmd->len);
> - outer_flush_range(cmd_addr, cmd_addr + cmd->len);
> + secure_flush_area(cmd, cmd->len);
>
> ret = smc(cmd_addr);
> if (ret < 0)
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-08-04 18:50 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 12:28 [PATCH 00/18] Clean up exposure of arch-internal code Russell King - ARM Linux
2015-07-27 12:28 ` Russell King - ARM Linux
2015-07-27 12:28 ` [PATCH 02/18] firmware: qcom_scm-32: replace open-coded call to __cpuc_flush_dcache_area() Russell King
2015-07-27 12:28 ` Russell King
[not found] ` <E1ZJhWZ-00043Z-Ft-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2015-08-04 18:48 ` Andy Gross
2015-08-04 18:48 ` Andy Gross
2015-08-04 18:50 ` Stephen Boyd [this message]
2015-08-04 18:50 ` Stephen Boyd
2015-07-27 12:29 ` [PATCH 03/18] iommu: tegra-smmu: fix iova_to_phys() method Russell King
2015-07-27 12:29 ` Russell King
[not found] ` <20150727122824.GH7557-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-07-27 12:28 ` [PATCH 01/18] ARM: reduce visibility of dmac_* functions Russell King
2015-07-27 12:28 ` Russell King
2015-07-27 12:29 ` [PATCH 04/18] iommu: tegra-smmu: fix unmap() method Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 05/18] iommu: tegra-smmu: factor out common pte setting Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 06/18] iommu: tegra-smmu: add iova_pd_index() and iova_pt_index() helpers Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 07/18] iommu: tegra-smmu: fix page table lookup in unmap/iova_to_phys methods Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 08/18] iommu: tegra-smmu: store struct page pointer for page tables Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 09/18] iommu: tegra-smmu: use kcalloc() to allocate counter array Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 10/18] iommu: tegra-smmu: move flush_dcache to tegra-smmu.c Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 11/18] iommu: tegra-smmu: split smmu_flush_ptc() Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 12/18] iommu: tegra-smmu: smmu_flush_ptc() wants device address Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 13/18] iommu: tegra-smmu: convert to use DMA API Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:29 ` [PATCH 14/18] iommu: tegra-smmu: remove PageReserved manipulation Russell King
2015-07-27 12:29 ` Russell King
2015-07-27 12:30 ` [PATCH 15/18] iommu: tegra-smmu: use __GFP_ZERO to allocate zeroed pages Russell King
2015-07-27 12:30 ` Russell King
2015-07-27 12:30 ` [PATCH 16/18] iommu: tegra-smmu: get_use Russell King
2015-07-27 12:30 ` Russell King
[not found] ` <E1ZJhXj-0004CY-DQ-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2015-07-27 14:11 ` Thierry Reding
2015-07-27 14:11 ` Thierry Reding
2015-07-27 12:30 ` [PATCH 17/18] iommu: tegra-smmu: more cleanups Russell King
2015-07-27 12:30 ` Russell King
[not found] ` <E1ZJhXo-0004Ce-Hq-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2015-07-27 14:12 ` Thierry Reding
2015-07-27 14:12 ` Thierry Reding
2015-07-27 12:30 ` [PATCH 18/18] iommu: tegra-smmu: remove cacheflush.h Russell King
2015-07-27 12:30 ` Russell King
[not found] ` <E1ZJhXt-0004Ck-LR-eh5Bv4kxaXIANfyc6IWni62ZND6+EDdj@public.gmane.org>
2015-07-27 14:13 ` Thierry Reding
2015-07-27 14:13 ` Thierry Reding
2015-07-27 13:13 ` [PATCH 00/18] Clean up exposure of arch-internal code Joerg Roedel
2015-07-27 13:13 ` Joerg Roedel
[not found] ` <20150727131313.GM10969-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-07-27 14:45 ` Heiko Stübner
2015-07-27 14:45 ` Heiko Stübner
2015-07-27 14:09 ` Thierry Reding
2015-07-27 14:09 ` Thierry Reding
[not found] ` <20150727140905.GA16858-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-07-27 14:16 ` Russell King - ARM Linux
2015-07-27 14:16 ` Russell King - ARM Linux
[not found] ` <20150727141654.GI7557-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-07-27 14:31 ` Thierry Reding
2015-07-27 14:31 ` Thierry Reding
2015-08-03 11:33 ` Joerg Roedel
2015-08-03 11:33 ` Joerg Roedel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55C10990.3090707@codeaurora.org \
--to=sboyd-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.