From: Alexander Graf <agraf@suse.de>
To: linuxppc-dev@lists.ozlabs.org
Cc: Dinar Valeev <dvaleev@suse.com>, Anton Blanchard <anton@samba.org>
Subject: [PATCH 0/4] powerpc: Enable ILE on pSeries without H_MODE_SET
Date: Mon, 23 Dec 2013 02:24:41 +0100 [thread overview]
Message-ID: <1387761885-39599-1-git-send-email-agraf@suse.de> (raw)
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
--
1.8.1.4
next reply other threads:[~2013-12-23 1:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-23 1:24 Alexander Graf [this message]
2013-12-23 1:24 ` [PATCH 1/4] powerpc: Add global exports for all interrupt vectors Alexander Graf
2013-12-23 1:24 ` [PATCH 2/4] powerpc: Add relocation code for fixups Alexander Graf
2013-12-23 1:24 ` [PATCH 3/4] powerpc: Add hack to make ppc64le work on hosts without ILE Alexander Graf
2013-12-23 1:24 ` [PATCH 4/4] powerpc: Don't return to BE mode when we are already there Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387761885-39599-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=anton@samba.org \
--cc=dvaleev@suse.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).