aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-10-21 05:03:36 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:52:55 -0500
commit60395224d94945544f1f9dce5566981844bf0e77 (patch)
treed86339167d7bfbd5c62bc85c27679c0b8639a2e4 /drivers/kvm/kvm_main.c
parente00c8cf29b9798eb9918469b0cce1766e0ae40d7 (diff)
KVM: Add a might_sleep() annotation to gfn_to_page()
This will help trap accesses to guest memory in atomic context. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index a6e3165043d1..453e98e251da 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -993,6 +993,8 @@ struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn)
993 struct page *page[1]; 993 struct page *page[1];
994 int npages; 994 int npages;
995 995
996 might_sleep();
997
996 gfn = unalias_gfn(kvm, gfn); 998 gfn = unalias_gfn(kvm, gfn);
997 slot = __gfn_to_memslot(kvm, gfn); 999 slot = __gfn_to_memslot(kvm, gfn);
998 if (!slot) { 1000 if (!slot) {