Home
last modified time | relevance | path

Searched hist:fa200c95 (Results 1 – 1 of 1) sorted by relevance

/openbmc/qemu/target/ppc/
H A Dtranslate.cfa200c95 Fri Mar 22 13:03:46 CDT 2019 Greg Kurz <groug@kaod.org> 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>