target/ppc: Add initial flags and helpers for SMT support
commitb769d4c8f4c67e794444a6376b849db2caeeff3e
authorNicholas Piggin <npiggin@gmail.com>
Thu, 22 Jun 2023 09:33:51 +0000 (22 19:33 +1000)
committerCédric Le Goater <clg@kaod.org>
Sun, 25 Jun 2023 20:41:30 +0000 (25 22:41 +0200)
treeb2b3ed3e441d014b07dae3c03e4454a07a36af0d
parent984eda58f20763ffb56b7aff34ad60bdeb118eb1
target/ppc: Add initial flags and helpers for SMT support

TGC SMT emulation needs to know whether it is running with SMT siblings,
to be able to iterate over siblings in a core, and to serialise
threads to access per-core shared SPRs. Add infrastructure to do these
things.

For now the sibling iteration and serialisation are implemented in a
simple but inefficient way. SMT shared state and sibling access is not
too common, and SMT configurations are mainly useful to test system
code, so performance is not to critical.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
[ clg: fix build breakage with clang ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
target/ppc/cpu.h
target/ppc/cpu_init.c
target/ppc/translate.c