Skip to content

Commit

Permalink
ppc: Add stub implementation of TRIG SPRs
Browse files Browse the repository at this point in the history
Linux sets these to control cache flush behaviour on Power9. Supervisor
and hypervisor are allowed to write, and reads are noops.

Add implementations to avoid noisy messages when booting Linux under the
pseries machine with guest_errors enabled.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
  • Loading branch information
shenki authored and legoater committed Sep 4, 2023
1 parent 011dd5e commit 639ebe0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions target/ppc/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,9 @@ void ppc_compat_add_property(Object *obj, const char *name,
#define SPR_PSSCR (0x357)
#define SPR_440_INV0 (0x370)
#define SPR_440_INV1 (0x371)
#define SPR_TRIG1 (0x371)
#define SPR_440_INV2 (0x372)
#define SPR_TRIG2 (0x372)
#define SPR_440_INV3 (0x373)
#define SPR_440_ITV0 (0x374)
#define SPR_440_ITV1 (0x375)
Expand Down
10 changes: 10 additions & 0 deletions target/ppc/cpu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -5660,6 +5660,16 @@ static void register_power_common_book4_sprs(CPUPPCState *env)
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_tfmr, &spr_write_tfmr,
0x00000000);
spr_register_hv(env, SPR_TRIG1, "TRIG1",
SPR_NOACCESS, SPR_NOACCESS,
&spr_access_nop, &spr_write_generic,
&spr_access_nop, &spr_write_generic,
0x00000000);
spr_register_hv(env, SPR_TRIG2, "TRIG2",
SPR_NOACCESS, SPR_NOACCESS,
&spr_access_nop, &spr_write_generic,
&spr_access_nop, &spr_write_generic,
0x00000000);
#endif
}

Expand Down

0 comments on commit 639ebe0

Please sign in to comment.