Commit 24d1a6e6 authored by James Hogan's avatar James Hogan Committed by Ralf Baechle

MIPS: KVM: Use __local_flush_icache_user_range()

Convert KVM dynamic translation of guest instructions to flush icache
for guest mapped addresses using the new
__local_flush_icache_user_range() API to allow the more generic
flush_icache_range() to be changed to work on kernel addresses only.
Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14155/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent d99a043a
...@@ -45,8 +45,8 @@ static int kvm_mips_trans_replace(struct kvm_vcpu *vcpu, u32 *opc, ...@@ -45,8 +45,8 @@ static int kvm_mips_trans_replace(struct kvm_vcpu *vcpu, u32 *opc,
} else if (KVM_GUEST_KSEGX((unsigned long) opc) == KVM_GUEST_KSEG23) { } else if (KVM_GUEST_KSEGX((unsigned long) opc) == KVM_GUEST_KSEG23) {
local_irq_save(flags); local_irq_save(flags);
memcpy((void *)opc, (void *)&replace, sizeof(u32)); memcpy((void *)opc, (void *)&replace, sizeof(u32));
local_flush_icache_range((unsigned long)opc, __local_flush_icache_user_range((unsigned long)opc,
(unsigned long)opc + 32); (unsigned long)opc + 32);
local_irq_restore(flags); local_irq_restore(flags);
} else { } else {
kvm_err("%s: Invalid address: %p\n", __func__, opc); kvm_err("%s: Invalid address: %p\n", __func__, opc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment