mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
target-ppc: Implement "compat" CPU option
This adds basic support for the "compat" CPU option. By specifying the compat property, the user can manually switch guest CPU mode from "raw" to "architected". This defines feature disable bits which are not used yet as, for example, PowerISA 2.07 says if 2.06 mode is selected, the TM bit does not matter - transactional memory (TM) will be disabled because 2.06 does not define it at all. The same is true for VSX and 2.05 mode. So just setting a mode must be ok. This does not change the existing behavior as the actual compatibility mode support is coming in next patches. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> [agraf: fix compilation on 32bit hosts] Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
833d46685d
commit
6d9412ea81
4 changed files with 61 additions and 0 deletions
|
@ -1122,6 +1122,7 @@ void ppc_store_sdr1 (CPUPPCState *env, target_ulong value);
|
|||
void ppc_store_msr (CPUPPCState *env, target_ulong value);
|
||||
|
||||
void ppc_cpu_list (FILE *f, fprintf_function cpu_fprintf);
|
||||
int ppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version);
|
||||
|
||||
/* Time-base and decrementer management */
|
||||
#ifndef NO_CPU_IO_DEFS
|
||||
|
@ -1338,6 +1339,7 @@ static inline int cpu_mmu_index (CPUPPCState *env)
|
|||
#define SPR_LPCR (0x13E)
|
||||
#define SPR_BOOKE_DVC2 (0x13F)
|
||||
#define SPR_BOOKE_TSR (0x150)
|
||||
#define SPR_PCR (0x152)
|
||||
#define SPR_BOOKE_TCR (0x154)
|
||||
#define SPR_BOOKE_TLB0PS (0x158)
|
||||
#define SPR_BOOKE_TLB1PS (0x159)
|
||||
|
@ -2061,6 +2063,15 @@ enum {
|
|||
PPC_INTERRUPT_PERFM, /* Performance monitor interrupt */
|
||||
};
|
||||
|
||||
/* Processor Compatibility mask (PCR) */
|
||||
enum {
|
||||
PCR_COMPAT_2_05 = 1ull << (63-62),
|
||||
PCR_COMPAT_2_06 = 1ull << (63-61),
|
||||
PCR_VEC_DIS = 1ull << (63-0), /* Vec. disable (bit NA since POWER8) */
|
||||
PCR_VSX_DIS = 1ull << (63-1), /* VSX disable (bit NA since POWER8) */
|
||||
PCR_TM_DIS = 1ull << (63-2), /* Trans. memory disable (POWER8) */
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline target_ulong cpu_read_xer(CPUPPCState *env)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue