qemu-e2k/target
Greg Kurz fa200c95f7 target/ppc: Enable "decrement and test CTR" version of bcctr
Even if all ISAs up to v3 indeed mention:

    If the "decrement and test CTR" option is specified (BO2=0), the
    instruction form is invalid.

The UMs of all existing 64-bit server class processors say:

    If BO[2] = 0, the contents of CTR (before any update) are used as the
    target address and for the test of the contents of CTR to resolve the
    branch. The contents of the CTR are then decremented and written back
    to the CTR.

The linux kernel has spectre v2 mitigation code that relies on a
BO[2] = 0 variant of bcctr, which is now activated by default on
spapr, even with TCG. This causes linux guests to panic with
the default machine type under TCG.

Since any CPU model can provide its own behaviour for invalid forms,
we could possibly introduce a new instruction flag to handle this.
In practice, since the behaviour is shared by all 64-bit server
processors starting with 970 up to POWER9, let's reuse the
PPC_SEGMENT_64B flag. Caveat: this may have to be fixed later if
POWER10 introduces a different behaviour.

The existing behaviour of throwing a program interrupt is kept for
all other CPU models.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <155327782604.1283071.10640596307206921951.stgit@bahia.lan>
Tested-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-03-29 10:22:22 +11:00
..
alpha avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
arm target/arm: Set SIMDMISC and FPMISC for 32-bit -cpu max 2019-03-26 12:53:26 +00:00
cris avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
hppa trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
i386 * Kconfig improvements (msi_nonbroken, imply for default PCI devices) 2019-03-28 09:18:53 +00:00
lm32
m68k target/m68k: Fix LGPL information in the file headers 2019-01-30 14:20:13 +01:00
microblaze target/microblaze: Add props enabling exceptions on failed bus accesses 2019-01-22 03:17:34 -08:00
mips trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
moxie target/moxie: Fix LGPL information in the file headers 2019-02-06 15:46:11 +01:00
nios2
openrisc target/openrisc: Fix LGPL version number 2019-01-30 11:01:36 +01:00
ppc target/ppc: Enable "decrement and test CTR" version of bcctr 2019-03-29 10:22:22 +11:00
riscv target/riscv: Fix wrong expanding for c.fswsp 2019-03-26 03:17:30 -07:00
s390x trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
sh4
sparc trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
tilegx avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
tricore tricore: fixed RCR_CADDN instruction 2019-03-08 10:00:59 +01:00
unicore32 target/unicore32: remove tlb_flush from uc32_init_fn 2018-10-18 18:58:10 -07:00
xtensa target/xtensa: don't announce exit simcall 2019-03-23 14:41:48 -07:00