summaryrefslogtreecommitdiff
path: root/virt/kvm
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2019-02-25 10:36:00 -0600
committerTom Zanussi <tom.zanussi@linux.intel.com>2019-02-25 10:36:00 -0600
commit679b895eb684a95bdd2ba74085e9d1a8dd4cc4ea (patch)
tree2819e863662e86d2bdcd1eef415aab2097aebdc1 /virt/kvm
parent9bf18d89ce46a3156a13e078dfcf5cc0a23daf7d (diff)
parent383e9b61f85cc8e5f1fcb1493d95f826a2fa736e (diff)
downloadlinux-rt-679b895eb684a95bdd2ba74085e9d1a8dd4cc4ea.tar.gz
Merge tag 'v4.14.99' into v4.14-rt
This is the 4.14.99 stable release Conflicts: kernel/locking/rtmutex.c
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/arm/mmio.c11
-rw-r--r--virt/kvm/kvm_main.c6
2 files changed, 10 insertions, 7 deletions
diff --git a/virt/kvm/arm/mmio.c b/virt/kvm/arm/mmio.c
index dac7ceb1a677..08443a15e6be 100644
--- a/virt/kvm/arm/mmio.c
+++ b/virt/kvm/arm/mmio.c
@@ -117,6 +117,12 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run)
vcpu_set_reg(vcpu, vcpu->arch.mmio_decode.rt, data);
}
+ /*
+ * The MMIO instruction is emulated and should not be re-executed
+ * in the guest.
+ */
+ kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
+
return 0;
}
@@ -144,11 +150,6 @@ static int decode_hsr(struct kvm_vcpu *vcpu, bool *is_write, int *len)
vcpu->arch.mmio_decode.sign_extend = sign_extend;
vcpu->arch.mmio_decode.rt = rt;
- /*
- * The MMIO instruction is emulated and should not be re-executed
- * in the guest.
- */
- kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
return 0;
}
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4f35f0dfe681..9b79818758dc 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1962,7 +1962,8 @@ int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
EXPORT_SYMBOL_GPL(kvm_gfn_to_hva_cache_init);
int kvm_write_guest_offset_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
- void *data, int offset, unsigned long len)
+ void *data, unsigned int offset,
+ unsigned long len)
{
struct kvm_memslots *slots = kvm_memslots(kvm);
int r;
@@ -2911,8 +2912,10 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
if (ops->init)
ops->init(dev);
+ kvm_get_kvm(kvm);
ret = anon_inode_getfd(ops->name, &kvm_device_fops, dev, O_RDWR | O_CLOEXEC);
if (ret < 0) {
+ kvm_put_kvm(kvm);
mutex_lock(&kvm->lock);
list_del(&dev->vm_node);
mutex_unlock(&kvm->lock);
@@ -2920,7 +2923,6 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
return ret;
}
- kvm_get_kvm(kvm);
cd->fd = ret;
return 0;
}