summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuraj Jitindar Singh2019-11-28 14:46:56 +0100
committerDavid Gibson2019-12-17 00:39:48 +0100
commit32d0f0d8de37519bcaa720c41f0f693b66016f1b (patch)
treed2c96d88ead142f7c9e126e2118e8eebb814c617
parenttarget/ppc: Work [S]PURR implementation and add HV support (diff)
downloadqemu-32d0f0d8de37519bcaa720c41f0f693b66016f1b.tar.gz
qemu-32d0f0d8de37519bcaa720c41f0f693b66016f1b.tar.xz
qemu-32d0f0d8de37519bcaa720c41f0f693b66016f1b.zip
target/ppc: Add SPR ASDR
The Access Segment Descriptor Register (ASDR) provides information about the storage element when taking a hypervisor storage interrupt. When performing nested radix address translation, this is normally the guest real address. This register is present on POWER9 processors and later. Implement the ADSR, note read and write access is limited to the hypervisor. Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20191128134700.16091-4-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--target/ppc/cpu.h1
-rw-r--r--target/ppc/translate_init.inc.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index da44cc8809..e99850c3ae 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1778,6 +1778,7 @@ typedef PowerPCCPU ArchCPU;
#define SPR_MPC_MD_DBRAM1 (0x32A)
#define SPR_RCPU_L2U_RA3 (0x32B)
#define SPR_TAR (0x32F)
+#define SPR_ASDR (0x330)
#define SPR_IC (0x350)
#define SPR_VTB (0x351)
#define SPR_MMCRC (0x353)
diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index c5e4d45569..c850a9d065 100644
--- a/target/ppc/translate_init.inc.c
+++ b/target/ppc/translate_init.inc.c
@@ -8295,6 +8295,12 @@ static void gen_spr_power9_mmu(CPUPPCState *env)
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, &spr_write_ptcr,
KVM_REG_PPC_PTCR, 0x00000000);
+ /* Address Segment Descriptor Register */
+ spr_register_hv(env, SPR_ASDR, "ASDR",
+ SPR_NOACCESS, SPR_NOACCESS,
+ SPR_NOACCESS, SPR_NOACCESS,
+ &spr_read_generic, &spr_write_generic,
+ 0x0000000000000000);
#endif
}