|
@@ -315,6 +315,15 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
|
|
|
memcpy(gebase + offset, mips32_GuestException,
|
|
|
mips32_GuestExceptionEnd - mips32_GuestException);
|
|
|
|
|
|
+#ifdef MODULE
|
|
|
+ offset += mips32_GuestExceptionEnd - mips32_GuestException;
|
|
|
+ memcpy(gebase + offset, (char *)__kvm_mips_vcpu_run,
|
|
|
+ __kvm_mips_vcpu_run_end - (char *)__kvm_mips_vcpu_run);
|
|
|
+ vcpu->arch.vcpu_run = gebase + offset;
|
|
|
+#else
|
|
|
+ vcpu->arch.vcpu_run = __kvm_mips_vcpu_run;
|
|
|
+#endif
|
|
|
+
|
|
|
/* Invalidate the icache for these ranges */
|
|
|
local_flush_icache_range((unsigned long)gebase,
|
|
|
(unsigned long)gebase + ALIGN(size, PAGE_SIZE));
|
|
@@ -404,7 +413,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
|
|
|
/* Disable hardware page table walking while in guest */
|
|
|
htw_stop();
|
|
|
|
|
|
- r = __kvm_mips_vcpu_run(run, vcpu);
|
|
|
+ r = vcpu->arch.vcpu_run(run, vcpu);
|
|
|
|
|
|
/* Re-enable HTW before enabling interrupts */
|
|
|
htw_start();
|