diff options
author | Alexander Graf <agraf@suse.de> | 2010-01-07 20:58:06 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:49 -0500 |
commit | 021ec9c69f8b7b20f46296cc76cc4cb341b25191 (patch) | |
tree | 304f086761e7c01fb412c8319b89ff8b6fb2dde7 /arch/powerpc/kvm/book3s_64_rmhandlers.S | |
parent | bc90923e27908ef65aa8aaad2f234e18b5273c78 (diff) |
KVM: PPC: Call SLB patching code in interrupt safe manner
Currently we're racy when doing the transition from IR=1 to IR=0, from
the module memory entry code to the real mode SLB switching code.
To work around that I took a look at the RTAS entry code which is faced
with a similar problem and did the same thing:
A small helper in linear mapped memory that does mtmsr with IR=0 and
then RFIs info the actual handler.
Thanks to that trick we can safely take page faults in the entry code
and only need to be really wary of what to do as of the SLB switching
part.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_rmhandlers.S')
-rw-r--r-- | arch/powerpc/kvm/book3s_64_rmhandlers.S | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_64_rmhandlers.S b/arch/powerpc/kvm/book3s_64_rmhandlers.S index 9ad1c2645d6f..e7091c9459a8 100644 --- a/arch/powerpc/kvm/book3s_64_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_64_rmhandlers.S | |||
@@ -140,6 +140,24 @@ kvmppc_handler_lowmem_trampoline: | |||
140 | blr | 140 | blr |
141 | kvmppc_handler_lowmem_trampoline_end: | 141 | kvmppc_handler_lowmem_trampoline_end: |
142 | 142 | ||
143 | /* | ||
144 | * Call a function in real mode | ||
145 | * | ||
146 | * Input Registers: | ||
147 | * | ||
148 | * R3 = function | ||
149 | * R4 = MSR | ||
150 | * R5 = CTR | ||
151 | * | ||
152 | */ | ||
153 | _GLOBAL(kvmppc_rmcall) | ||
154 | mtmsr r4 /* Disable relocation, so mtsrr | ||
155 | doesn't get interrupted */ | ||
156 | mtctr r5 | ||
157 | mtsrr0 r3 | ||
158 | mtsrr1 r4 | ||
159 | RFI | ||
160 | |||
143 | .global kvmppc_trampoline_lowmem | 161 | .global kvmppc_trampoline_lowmem |
144 | kvmppc_trampoline_lowmem: | 162 | kvmppc_trampoline_lowmem: |
145 | .long kvmppc_handler_lowmem_trampoline - _stext | 163 | .long kvmppc_handler_lowmem_trampoline - _stext |