Skip to content

powerpc: Enable ILE on pSeries without H_MODE_SET

Alexander Graf linuxppc-dev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4powerpc: Add global exports for all interrupt vectorsarch/powerpc/kernel/exceptions-64s.S+5 -00 replies
2/4powerpc: Add relocation code for fixupsarch/powerpc/include/asm/cputable.h arch/powerpc/lib/feature-fixups.c+24 -00 replies
3/4powerpc: Add hack to make ppc64le work on hosts without ILEarch/powerpc/kernel/Makefile arch/powerpc/kernel/fake_ile.S arch/powerpc/kernel/vmlinux.lds.S +1 more+168 -00 replies
4/4powerpc: Don't return to BE mode when we are already therearch/powerpc/platforms/pseries/setup.c+10 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] powerpc: Enable ILE on pSeries without H_MODE_SET

Howdy,

There are a few machines out there that would be pretty ppc64le capable if only it wasn't for the hypervisor that's running on them.

The problem is that we need to run in ILE (interrupts delivered in little endian) mode to run our normal interrupt vectors. The hypercall to enable this mode is not available on PowerVM.

However, we can try to be smart here. Instead of configuring the hypervisor to run interrupts in little endian mode, we can just bring ourselves back to little endian on every interrupt.

We do this by patching every interrupt handler with a "branch" instruction at the beginning which jumps into a tiny helper that turns on MSR.LE and resumes the interrupt handler.

This is not the most smart thing to do performance wise, but it does have a really nice side effect: We do not impact hypervisors that do support H_SET_MODE. This is important, as we want to be as fast as possible on machines that are supposed to run Little Endian guests.

As a tiny side effect we also clobber CFAR in every interrupt, rendering the whole thing pretty useless. So we don't get nice and shiny perf and debugging helps. Oh well.

Given that the alternatives to all of this would either be

a) Not run at all or
b) Incur performance penalties for "good" systems or
c) Add significant maintenance burden on us

I'm quite convinced this is the way we want to go.

Enjoy,

Alex

Alexander Graf (4):
powerpc: Add global exports for all interrupt vectors
powerpc: Add relocation code for fixups
powerpc: Add hack to make ppc64le work on hosts without ILE
powerpc: Don't return to BE mode when we are already there

 arch/powerpc/include/asm/cputable.h    |   2 +
 arch/powerpc/kernel/Makefile           |   3 +
 arch/powerpc/kernel/exceptions-64s.S   |   5 ++
 arch/powerpc/kernel/fake_ile.S         | 101 +++++++++++++++++++++++++++++++++
 arch/powerpc/kernel/vmlinux.lds.S      |  14 +++++
 arch/powerpc/lib/feature-fixups.c      |  22 +++++++
 arch/powerpc/platforms/pseries/setup.c |  61 +++++++++++++++++++-
 7 files changed, 207 insertions(+), 1 deletion(-)
 create mode 100644 arch/powerpc/kernel/fake_ile.S
Signature · 1 line
1.8.1.4