Skip to content

Commit

Permalink
target/ppc: remove ppc_store_lpcr from CONFIG_USER_ONLY builds
Browse files Browse the repository at this point in the history
Writes to LPCR are hypervisor privileged.

Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20221011204829.1641124-27-matheus.ferst@eldorado.org.br>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
  • Loading branch information
mferst authored and danielhb committed Oct 28, 2022
1 parent 022b712 commit 6a8e818
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions target/ppc/cpu.c
Expand Up @@ -73,6 +73,7 @@ void ppc_store_msr(CPUPPCState *env, target_ulong value)
hreg_store_msr(env, value, 0);
}

#if !defined(CONFIG_USER_ONLY)
void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val)
{
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
Expand All @@ -82,6 +83,7 @@ void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val)
/* The gtse bit affects hflags */
hreg_compute_hflags(env);
}
#endif

static inline void fpscr_set_rounding_mode(CPUPPCState *env)
{
Expand Down
2 changes: 1 addition & 1 deletion target/ppc/cpu.h
Expand Up @@ -1370,9 +1370,9 @@ void ppc_translate_init(void);

#if !defined(CONFIG_USER_ONLY)
void ppc_store_sdr1(CPUPPCState *env, target_ulong value);
void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val);
#endif /* !defined(CONFIG_USER_ONLY) */
void ppc_store_msr(CPUPPCState *env, target_ulong value);
void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val);

void ppc_cpu_list(void);

Expand Down

0 comments on commit 6a8e818

Please sign in to comment.