From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
To: qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org, david@gibson.dropbear.id.au,
agraf@suse.de, sjitindarsingh@gmail.com
Subject: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: Stop parsing pvr list in H_CAS when exact match found
Date: Mon, 13 Feb 2017 14:30:27 +1100 [thread overview]
Message-ID: <1486956627-11123-1-git-send-email-sjitindarsingh@gmail.com> (raw)
The pvr-list passed in H_Client_Architecture_Support is used to
communicate the supported pvrs of the client program. When an
exact match is found you are allowed to stop parsing the list and continue
the boot process.
Currently while explicit_match is set when we find an exact match, we still
set a compat mode based on best_compat irrespective of whether an exact
match was found or not. This is wrong since it means we can only ever run
in an architected state, not a raw state since we always set a compat mode.
We are basically ignoring the case were we find an exact match.
Fix the code to stop parsing the pvr list when an exact match is found.
This means that best_compat will always be zero in the case of an exact
match which means we will not set a compat mode an thus run in raw mode,
which is the desired functionality when we have an exact match.
Fixes: 152ef803ceb1 ("pseries: Rewrite CAS PVR compatibility logic")
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
---
hw/ppc/spapr_hcall.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 590105a..215c385 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1028,6 +1028,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,
if ((cpu->env.spr[SPR_PVR] & pvr_mask) == (pvr & pvr_mask)) {
explicit_match = true;
+ break;
} else {
if (ppc_check_compat(cpu, pvr, best_compat, max_compat)) {
best_compat = pvr;
--
2.5.5
next reply other threads:[~2017-02-13 3:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 3:30 Suraj Jitindar Singh [this message]
2017-02-13 4:10 ` [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: Stop parsing pvr list in H_CAS when exact match found David Gibson
2017-02-13 23:23 ` Suraj Jitindar Singh
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=1486956627-11123-1-git-send-email-sjitindarsingh@gmail.com \
--to=sjitindarsingh@gmail.com \
--cc=agraf@suse.de \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).