diff options
author | Alexander Graf <agraf@suse.de> | 2013-12-16 14:10:20 +0100 |
---|---|---|
committer | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-12-17 11:01:46 +0530 |
commit | dd53579ae82bed0654dd3e4b3052ef2cac58b5f4 (patch) | |
tree | a21b15355998f71e143f42ecd5775e96f7499c6c /slof | |
parent | 69c6fc492ca1f9855643d5be5c96b8e19b8f20f8 (diff) | |
download | SLOF-dd53579ae82bed0654dd3e4b3052ef2cac58b5f4.zip SLOF-dd53579ae82bed0654dd3e4b3052ef2cac58b5f4.tar.gz SLOF-dd53579ae82bed0654dd3e4b3052ef2cac58b5f4.tar.bz2 |
Work around missing sc 1 traps on pHyp
When running a pseries guest in PR KVM on top of pHyp, sc 1 instructions
are handled directly by pHyp, so we don't get to see them.
That means we need to get inventive. Invent a new instruction that behaves
like sc 1, but really is a reserved instruction that traps. This instruction
can be used by KVM to emulate sc 1 behavior.
This patch adds the SLOF support for it. With this, SLOF detects whether
it's running on such a broken setup and if so patches itself to execute
the fake sc 1 instruction instead of the real one.
Furthermore, we also hook into "quiesce" which Linux calls when it boots.
This gives us the chance to also patch Linux when it boots up, so it uses
the fake sc 1 too.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'slof')
-rw-r--r-- | slof/ofw.S | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -45,5 +45,15 @@ ld r3, 0(r3) std r3, XVECT_M_HANDLER(0) +#ifdef BROKEN_SC1 + /* Patch potentially broken sc 1 instructions */ + lis r3, _slof_text@h + ori r3, r3, _slof_text@l + lis r4, _slof_text_end@h + ori r4, r4, _slof_text_end@l + li r5, 0 + bl .patch_broken_sc1 +#endif + /* GO! */ ba 0x100 |