mirror of https://github.com/xqemu/xqemu.git
spapr: Pass PowerPCCPU to spapr_hypercall()
Needed for changing the hypercall handlers' argument type to PowerPCCPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
1b14670a38
commit
aa100fa4c9
|
@ -584,7 +584,7 @@ static void emulate_spapr_hypercall(PowerPCCPU *cpu)
|
||||||
hcall_dprintf("Hypercall made with MSR[PR]=1\n");
|
hcall_dprintf("Hypercall made with MSR[PR]=1\n");
|
||||||
env->gpr[3] = H_PRIVILEGE;
|
env->gpr[3] = H_PRIVILEGE;
|
||||||
} else {
|
} else {
|
||||||
env->gpr[3] = spapr_hypercall(env, env->gpr[3], &env->gpr[4]);
|
env->gpr[3] = spapr_hypercall(cpu, env->gpr[3], &env->gpr[4]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -291,7 +291,7 @@ typedef target_ulong (*spapr_hcall_fn)(CPUPPCState *env, sPAPREnvironment *spapr
|
||||||
target_ulong *args);
|
target_ulong *args);
|
||||||
|
|
||||||
void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn);
|
void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn);
|
||||||
target_ulong spapr_hypercall(CPUPPCState *env, target_ulong opcode,
|
target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode,
|
||||||
target_ulong *args);
|
target_ulong *args);
|
||||||
|
|
||||||
int spapr_allocate_irq(int hint, bool lsi);
|
int spapr_allocate_irq(int hint, bool lsi);
|
||||||
|
|
|
@ -679,9 +679,11 @@ void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn)
|
||||||
*slot = fn;
|
*slot = fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
target_ulong spapr_hypercall(CPUPPCState *env, target_ulong opcode,
|
target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode,
|
||||||
target_ulong *args)
|
target_ulong *args)
|
||||||
{
|
{
|
||||||
|
CPUPPCState *env = &cpu->env;
|
||||||
|
|
||||||
if ((opcode <= MAX_HCALL_OPCODE)
|
if ((opcode <= MAX_HCALL_OPCODE)
|
||||||
&& ((opcode & 0x3) == 0)) {
|
&& ((opcode & 0x3) == 0)) {
|
||||||
spapr_hcall_fn fn = papr_hypercall_table[opcode / 4];
|
spapr_hcall_fn fn = papr_hypercall_table[opcode / 4];
|
||||||
|
|
|
@ -817,7 +817,8 @@ int kvm_arch_handle_exit(CPUPPCState *env, struct kvm_run *run)
|
||||||
#ifdef CONFIG_PSERIES
|
#ifdef CONFIG_PSERIES
|
||||||
case KVM_EXIT_PAPR_HCALL:
|
case KVM_EXIT_PAPR_HCALL:
|
||||||
dprintf("handle PAPR hypercall\n");
|
dprintf("handle PAPR hypercall\n");
|
||||||
run->papr_hcall.ret = spapr_hypercall(env, run->papr_hcall.nr,
|
run->papr_hcall.ret = spapr_hypercall(ppc_env_get_cpu(env),
|
||||||
|
run->papr_hcall.nr,
|
||||||
run->papr_hcall.args);
|
run->papr_hcall.args);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue