[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/45] ppc: restrict the use of the rfi instruction
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 02/45] ppc: restrict the use of the rfi instruction |
Date: |
Fri, 23 Sep 2016 17:14:38 +1000 |
From: Benjamin Herrenschmidt <address@hidden>
Power ISA 2.x has deleted the rfi instruction and rfid shoud be used
instead on cpus following this instruction set or later.
This will raise an invalid exception when rfi is used on such
processors: Book3S 64-bit processors.
Signed-off-by: Benjamin Herrenschmidt <address@hidden>
Reviewed-by: David Gibson <address@hidden>
[clg: the required fix in openbios, commit b747b6acc272 ('ppc: use
rfid when running under a CPU from the 970 family.'), is now
merged in qemu under commit 5cebd885d0d2 ('Update OpenBIOS
images to b747b6a built from submodule.') ]
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target-ppc/translate.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 618334a..f01ce1e 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3585,10 +3585,13 @@ static void gen_rfi(DisasContext *ctx)
#if defined(CONFIG_USER_ONLY)
GEN_PRIV;
#else
- /* FIXME: This instruction doesn't exist anymore on 64-bit server
- * processors compliant with arch 2.x, we should remove it there,
- * but we need to fix OpenBIOS not to use it on 970 first
+ /* This instruction doesn't exist anymore on 64-bit server
+ * processors compliant with arch 2.x
*/
+ if (ctx->insns_flags & PPC_SEGMENT_64B) {
+ gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL);
+ return;
+ }
/* Restore CPU state */
CHK_SV;
gen_update_cfar(ctx, ctx->nip - 4);
--
2.7.4
- [Qemu-devel] [PULL 00/45] ppc-for-2.8 queue 20160923, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 02/45] ppc: restrict the use of the rfi instruction,
David Gibson <=
- [Qemu-devel] [PULL 03/45] target-ppc: add vector insert instructions, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 01/45] MAINTAINERS: Add some missing ppc-related files, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 04/45] target-ppc: add vector extract instructions, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 12/45] MAINTAINERS: add sPAPR tests, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 16/45] adb.c: prevent NO_KEY value from going to guest, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 17/45] spapr_drc: convert to trace framework instead of DPRINTF, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 15/45] adb.c: correct several key assignments, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 13/45] adb-keys.h: initial commit, David Gibson, 2016/09/23
- [Qemu-devel] [PULL 09/45] qtest: replace strtoXX() by qemu_strtoXX(), David Gibson, 2016/09/23
- [Qemu-devel] [PULL 20/45] spapr_llan: convert to trace framework instead of DPRINTF, David Gibson, 2016/09/23