From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: "Alexey Kardashevskiy" <aik@ozlabs.ru>,
qemu-ppc@nongnu.org, "Alexander Graf" <agraf@suse.de>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH v5 3/3] spapr_hcall: add address-translation-mode-on-interrupt resource in H_SET_MODE
Date: Thu, 20 Mar 2014 11:03:29 +1100 [thread overview]
Message-ID: <1395273809-12809-4-git-send-email-aik@ozlabs.ru> (raw)
In-Reply-To: <1395273809-12809-1-git-send-email-aik@ozlabs.ru>
This adds handling of the RESOURCE_ADDR_TRANS_MODE resource from
the H_SET_MODE, for POWER8 (PowerISA 2.07) only.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
hw/ppc/spapr_hcall.c | 26 ++++++++++++++++++++++++++
target-ppc/cpu.h | 2 ++
2 files changed, 28 insertions(+)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index fc5211b..fb23730 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -747,6 +747,32 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, sPAPREnvironment *spapr,
default:
ret = H_UNSUPPORTED_FLAG;
}
+ } else if (resource == H_SET_MODE_RESOURCE_ADDR_TRANS_MODE) {
+ PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
+
+ if (!(pcc->insns_flags2 & PPC2_ISA207S)) {
+ return H_P2;
+ }
+ if (value1) {
+ ret = H_P3;
+ goto out;
+ }
+ if (value2) {
+ ret = H_P4;
+ goto out;
+ }
+ switch (mflags) {
+ case 0:
+ case 2:
+ case 3:
+ CPU_FOREACH(cs) {
+ set_spr(cs, SPR_LPCR, mflags << LPCR_AIL_SH, LPCR_AIL);
+ }
+ return H_SUCCESS;
+
+ default:
+ return H_UNSUPPORTED_FLAG;
+ }
}
out:
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 72cb546..577193a 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -462,6 +462,8 @@ struct ppc_slb_t {
#define MSR_LE 0 /* Little-endian mode 1 hflags */
#define LPCR_ILE (1 << (63-38))
+#define LPCR_AIL 0x01800000 /* Alternate interrupt location */
+#define LPCR_AIL_SH (63-40)
#define msr_sf ((env->msr >> MSR_SF) & 1)
#define msr_isf ((env->msr >> MSR_ISF) & 1)
--
1.8.4.rc4
next prev parent reply other threads:[~2014-03-20 0:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-20 0:03 [Qemu-devel] [PATCH v5 0/3] spapr: fix H_SET_MODE Alexey Kardashevskiy
2014-03-20 0:03 ` [Qemu-devel] [PATCH v5 1/3] target-ppc: introduce powerisa-207-server flag Alexey Kardashevskiy
2014-03-20 0:03 ` [Qemu-devel] [PATCH v5 2/3] spapr_hcall: fix little-endian resource handling in H_SET_MODE Alexey Kardashevskiy
2014-03-20 0:03 ` Alexey Kardashevskiy [this message]
2014-03-20 13:15 ` [Qemu-devel] [PATCH v5 3/3] spapr_hcall: add address-translation-mode-on-interrupt resource " Mike Day
2014-03-20 0:21 ` [Qemu-devel] [PATCH v5 0/3] spapr: fix H_SET_MODE Andreas Färber
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=1395273809-12809-4-git-send-email-aik@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--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).