Skip to content

Commit

Permalink
PPC: ePAPR: Fix hypercall on LE guest
Browse files Browse the repository at this point in the history
We get an array of instructions from the hypervisor via device tree that
we write into a buffer that gets executed whenever we want to make an
ePAPR compliant hypercall.

However, the hypervisor passes us these instructions in BE order which
we have to manually convert to LE when we want to run them in LE mode.

With this fixup in place, I can successfully run LE kernels with KVM
PV enabled on PR KVM.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
  • Loading branch information
Alexander Graf authored and Scott Wood committed May 22, 2014
1 parent 1be62c6 commit 8cb5978
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/powerpc/kernel/epapr_paravirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ static int __init early_init_dt_scan_epapr(unsigned long node,
return -1;

for (i = 0; i < (len / 4); i++) {
patch_instruction(epapr_hypercall_start + i, insts[i]);
u32 inst = be32_to_cpu(insts[i]);
patch_instruction(epapr_hypercall_start + i, inst);
#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
patch_instruction(epapr_ev_idle_start + i, insts[i]);
patch_instruction(epapr_ev_idle_start + i, inst);
#endif
}

Expand Down

0 comments on commit 8cb5978

Please sign in to comment.