qemu-e2k/target/ppc
Greg Kurz c11dc15d3a target/ppc: Introduce ppc_interrupts_little_endian()
PowerPC CPUs use big endian by default but starting with POWER7,
server grade CPUs use the ILE bit of the LPCR special purpose
register to decide on the endianness to use when handling
interrupts. This gives a clue to QEMU on the endianness the
guest kernel is running, which is needed when generating an
ELF dump of the guest or when delivering an FWNMI machine
check interrupt.

Commit 382d2db62b ("target-ppc: Introduce callback for interrupt
endianness") added a class method to PowerPCCPUClass to modelize
this : default implementation returns a fixed "big endian" value,
while POWER7 and newer do the LPCR_ILE check. This is suboptimal
as it forces to implement the method for every new CPU family, and
it is very unlikely that this will ever be different than what we
have today.

We basically only have three cases to consider:
a) CPU doesn't have an LPCR => big endian
b) CPU has an LPCR but doesn't support the ILE bit => big endian
c) CPU has an LPCR and supports the ILE bit => little or big endian

Instead of class methods, introduce an inline helper that checks the
ILE bit in the LPCR_MASK to decide on the outcome. The new helper
words little endian instead of big endian. This allows to drop a !
operator in ppc_cpu_do_fwnmi_machine_check().

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20210622140926.677618-2-groug@kaod.org>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-07-09 10:38:18 +10:00
..
translate target/ppc: Move cmp/cmpi/cmpl/cmpli to decodetree 2021-06-03 18:10:31 +10:00
arch_dump.c target/ppc: Introduce ppc_interrupts_little_endian() 2021-07-09 10:38:18 +10:00
compat.c powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
cpu_init.c target/ppc: removed all mentions to PPC_DUMP_CPU 2021-06-03 18:10:31 +10:00
cpu-models.c powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
cpu-models.h powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
cpu-param.h
cpu-qom.h target/ppc: Add POWER10 exception model 2021-05-04 13:12:46 +10:00
cpu.c target/ppc: overhauled and moved logic of storing fpscr 2021-06-03 18:10:31 +10:00
cpu.h target/ppc: Introduce ppc_interrupts_little_endian() 2021-07-09 10:38:18 +10:00
dfp_helper.c powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
excp_helper.c target/ppc: Introduce ppc_interrupts_little_endian() 2021-07-09 10:38:18 +10:00
fpu_helper.c target/ppc: overhauled and moved logic of storing fpscr 2021-06-03 18:10:31 +10:00
gdbstub.c target/ppc: overhauled and moved logic of storing fpscr 2021-06-03 18:10:31 +10:00
helper_regs.c target/ppc: Validate hflags with CONFIG_DEBUG_TCG 2021-05-04 11:41:25 +10:00
helper_regs.h target/ppc: Remove env->immu_idx and env->dmmu_idx 2021-05-04 11:41:25 +10:00
helper.h tcg: Combine dh_is_64bit and dh_is_signed to dh_typecode 2021-06-19 08:51:11 -07:00
insn32.decode target/ppc: Move cmp/cmpi/cmpl/cmpli to decodetree 2021-06-03 18:10:31 +10:00
insn64.decode target/ppc: Implement prefixed integer store instructions 2021-06-03 18:10:31 +10:00
int_helper.c target/ppc: Implement cfuged instruction 2021-06-03 18:10:31 +10:00
internal.h target/ppc: removed all mentions to PPC_DUMP_CPU 2021-06-03 18:10:31 +10:00
kvm_ppc.h spapr: Add PEF based confidential guest support 2021-02-08 16:57:38 +11:00
kvm-stub.c
kvm.c target/ppc/kvm: Cache timebase frequency 2021-03-31 11:10:50 +11:00
machine.c target/ppc: updated vscr manipulation in machine.c 2021-05-19 10:30:28 +10:00
mem_helper.c target/ppc: Remove env->immu_idx and env->dmmu_idx 2021-05-04 11:41:25 +10:00
meson.build target/ppc: Add infrastructure for prefixed insns 2021-06-03 18:10:31 +10:00
mfrom_table_gen.c
mfrom_table.c.inc
misc_helper.c target/ppc: fold ppc_store_ptcr into it's only caller 2021-06-03 13:22:06 +10:00
mmu_helper.c target/ppc: added ifdefs around TCG-only code 2021-06-03 13:22:06 +10:00
mmu-book3s-v3.c powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
mmu-book3s-v3.h powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
mmu-hash32.c target/ppc: removed unnecessary inclusion of helper-proto.h 2021-06-03 13:22:06 +10:00
mmu-hash32.h
mmu-hash64.c target/ppc: added ifdefs around TCG-only code 2021-06-03 13:22:06 +10:00
mmu-hash64.h target/ppc: moved ppc_store_lpcr to misc_helper.c 2021-05-19 10:30:28 +10:00
mmu-radix64.c target/ppc: removed unnecessary inclusion of helper-proto.h 2021-06-03 13:22:06 +10:00
mmu-radix64.h
monitor.c hmp: Pass monitor to mon_get_cpu_env() 2020-11-13 12:45:51 +00:00
spr_tcg.h target/ppc: isolated cpu init from translation logic 2021-05-19 10:30:28 +10:00
tcg-stub.c target/ppc: created tcg-stub.c file 2021-06-03 13:22:06 +10:00
timebase_helper.c powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h
translate.c target/ppc: fix single-step exception regression 2021-06-03 18:10:31 +10:00
user_only_helper.c powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00