summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-10-17 16:04:47 +0200
committerGleb Natapov <gleb@redhat.com>2013-10-17 16:41:49 +0200
commit13acfd5715144518232d8e29acf7c76ef1b089d8 (patch)
tree093c4311a737210bbdd3d1919f8193cb5f017241 /virt
parentMerge tag 'kvm-arm-for-3.13-1' of git://git.linaro.org/people/cdall/linux-kvm... (diff)
parentMerge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux (diff)
downloadlinux-13acfd5715144518232d8e29acf7c76ef1b089d8.tar.xz
linux-13acfd5715144518232d8e29acf7c76ef1b089d8.zip
Powerpc KVM work is based on a commit after rc4.
Merging master into next to satisfy the dependencies. Conflicts: arch/arm/kvm/reset.c
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index d469114aff09..0d20c320a33d 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1065,10 +1065,12 @@ EXPORT_SYMBOL_GPL(gfn_to_hva);
unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable)
{
struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn);
- if (writable)
+ unsigned long hva = __gfn_to_hva_many(slot, gfn, NULL, false);
+
+ if (!kvm_is_error_hva(hva) && writable)
*writable = !memslot_is_readonly(slot);
- return __gfn_to_hva_many(gfn_to_memslot(kvm, gfn), gfn, NULL, false);
+ return hva;
}
static int kvm_read_hva(void *data, void __user *hva, int len)