From: Haiying Wang <Haiying.Wang@freescale.com>
To: <joro@8bytes.org>, <iommu@lists.linux-foundation.org>,
<linuxppc-dev@lists.ozlabs.org>
Cc: Varun Sethi <Varun.Sethi@freescale.com>
Subject: [PATCH] iommu/fsl_pamu: use physical cpu index to find the matched cpu nodes
Date: Thu, 14 Nov 2013 14:30:40 -0500 [thread overview]
Message-ID: <1384457440.2144.15.camel@haiying-laptop> (raw)
In the case we miss to bring up some cpus, we need to make sure we can
find the correct cpu nodes in the device tree based on the given logical
cpu index from the caller.
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
---
drivers/iommu/fsl_pamu.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index cba0498..a9ab57b 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -539,6 +539,7 @@ u32 get_stash_id(u32 stash_dest_hint, u32 vcpu)
u32 cache_level;
int len, found = 0;
int i;
+ u32 cpuid = get_hard_smp_processor_id(vcpu);
/* Fastpath, exit early if L3/CPC cache is target for stashing */
if (stash_dest_hint == PAMU_ATTR_CACHE_L3) {
@@ -559,7 +560,7 @@ u32 get_stash_id(u32 stash_dest_hint, u32 vcpu)
for_each_node_by_type(node, "cpu") {
prop = of_get_property(node, "reg", &len);
for (i = 0; i < len / sizeof(u32); i++) {
- if (be32_to_cpup(&prop[i]) == vcpu) {
+ if (be32_to_cpup(&prop[i]) == cpuid) {
found = 1;
goto found_cpu_node;
}
--
1.7.3.1.50.g1e633
next reply other threads:[~2013-11-14 19:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 19:30 Haiying Wang [this message]
2013-11-14 22:10 ` [PATCH] iommu/fsl_pamu: use physical cpu index to find the matched cpu nodes Scott Wood
2013-11-15 3:16 ` Varun Sethi
2013-11-18 19:37 ` Scott Wood
2013-11-19 2:42 ` Varun Sethi
2013-11-19 3:04 ` Scott Wood
2013-11-19 3:09 ` Varun Sethi
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=1384457440.2144.15.camel@haiying-laptop \
--to=haiying.wang@freescale.com \
--cc=Varun.Sethi@freescale.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox