qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yang Chuanlong <yangchuanlong@huawei.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v1] target/arm/arm-powerctl: mask the cpuid with affinity bits when get cpu
Date: Mon, 29 Apr 2019 14:48:30 +0800	[thread overview]
Message-ID: <20190429064830.12213-1-yangchuanlong@huawei.com> (raw)

Currently, the cpuid passed from the device tree may still contain
non-affinity fields, which will cause arm_set_cpu_on failure.
Therefore, we mask the cpuid with affinity fields here to
improve qemu compatibility.

Signed-off-by: Yang Chuanlong <yangchuanlong@huawei.com>
---
 target/arm/arm-powerctl.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
index f77a950db6..ef9fec0b4d 100644
--- a/target/arm/arm-powerctl.c
+++ b/target/arm/arm-powerctl.c
@@ -31,7 +31,13 @@ CPUState *arm_get_cpu_by_id(uint64_t id)
 {
     CPUState *cpu;
 
-    DPRINTF("cpu %" PRId64 "\n", id);
+#ifdef TARGET_AARCH64
+    id &= ARM64_AFFINITY_MASK;
+#else
+    id &= ARM32_AFFINITY_MASK;
+#endif
+
+    DPRINTF("cpu %" PRId64 " after mask affinity\n", id);
 
     CPU_FOREACH(cpu) {
         ARMCPU *armcpu = ARM_CPU(cpu);
-- 
2.21.0

WARNING: multiple messages have this Message-ID (diff)
From: Yang Chuanlong <yangchuanlong@huawei.com>
To: <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH v1] target/arm/arm-powerctl: mask the cpuid with affinity bits when get cpu
Date: Mon, 29 Apr 2019 14:48:30 +0800	[thread overview]
Message-ID: <20190429064830.12213-1-yangchuanlong@huawei.com> (raw)
Message-ID: <20190429064830.G3HLd-Lm-iStqvhFQLQlpycqr3klGkIsm1zfMjH3r1c@z> (raw)

Currently, the cpuid passed from the device tree may still contain
non-affinity fields, which will cause arm_set_cpu_on failure.
Therefore, we mask the cpuid with affinity fields here to
improve qemu compatibility.

Signed-off-by: Yang Chuanlong <yangchuanlong@huawei.com>
---
 target/arm/arm-powerctl.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c
index f77a950db6..ef9fec0b4d 100644
--- a/target/arm/arm-powerctl.c
+++ b/target/arm/arm-powerctl.c
@@ -31,7 +31,13 @@ CPUState *arm_get_cpu_by_id(uint64_t id)
 {
     CPUState *cpu;
 
-    DPRINTF("cpu %" PRId64 "\n", id);
+#ifdef TARGET_AARCH64
+    id &= ARM64_AFFINITY_MASK;
+#else
+    id &= ARM32_AFFINITY_MASK;
+#endif
+
+    DPRINTF("cpu %" PRId64 " after mask affinity\n", id);
 
     CPU_FOREACH(cpu) {
         ARMCPU *armcpu = ARM_CPU(cpu);
-- 
2.21.0



             reply	other threads:[~2019-04-29  6:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  6:48 Yang Chuanlong [this message]
2019-04-29  6:48 ` [Qemu-devel] [PATCH v1] target/arm/arm-powerctl: mask the cpuid with affinity bits when get cpu Yang Chuanlong
2019-05-01  1:05 ` no-reply
2019-05-01  1:05   ` no-reply
  -- strict thread matches above, loose matches on Subject: below --
2019-04-30  3:12 Yang Chuanlong
2019-04-30  3:12 ` Yang Chuanlong
2019-04-30 12:05 ` Peter Maydell
2019-04-30 12:05   ` Peter Maydell
2019-05-01 18:37 ` no-reply
2019-05-01 18:37   ` no-reply
2019-05-01 18:57 ` no-reply
2019-05-01 18:57   ` no-reply

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=20190429064830.12213-1-yangchuanlong@huawei.com \
    --to=yangchuanlong@huawei.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).