powerpc/64: Fix update forms of loads and stores to write 64-bit EA

When a 64-bit processor is executing in 32-bit mode, the update forms
of load and store instructions are required by the architecture to
write the full 64-bit effective address into the RA register, though
only the bottom 32 bits are used to address memory.  Currently,
the instruction emulation code writes the truncated address to the
RA register.  This fixes it by keeping the full 64-bit EA in the
instruction_op structure, truncating the address in emulate_step()
where it is used to address memory, rather than in the address
computations in analyse_instr().

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Paul Mackerras
2017-08-30 14:12:28 +10:00
committed by Michael Ellerman
parent 350779a29f
commit d120cdbce6
2 changed files with 58 additions and 55 deletions

View File

@@ -25,7 +25,7 @@ struct pt_regs;
enum instruction_type {
COMPUTE, /* arith/logical/CR op, etc. */
LOAD,
LOAD, /* load and store types need to be contiguous */
LOAD_MULTI,
LOAD_FP,
LOAD_VMX,
@@ -52,6 +52,8 @@ enum instruction_type {
#define INSTR_TYPE_MASK 0x1f
#define OP_IS_LOAD_STORE(type) (LOAD <= (type) && (type) <= STCX)
/* Compute flags, ORed in with type */
#define SETREG 0x20
#define SETCC 0x40