diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-10-14 05:22:46 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:21:39 -0500 |
commit | af585b921e5d1e919947c4b1164b59507fe7cd7b (patch) | |
tree | d0d4cc753d4d58934c5986733d7340fe69e523de /virt/kvm/async_pf.h | |
parent | 010c520e20413dfd567d568aba2b7238acd37e33 (diff) |
KVM: Halt vcpu if page it tries to access is swapped out
If a guest accesses swapped out memory do not swap it in from vcpu thread
context. Schedule work to do swapping and put vcpu into halted state
instead.
Interrupts will still be delivered to the guest and if interrupt will
cause reschedule guest will continue to run another task.
[avi: remove call to get_user_pages_noio(), nacked by Linus; this
makes everything synchrnous again]
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/async_pf.h')
-rw-r--r-- | virt/kvm/async_pf.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/virt/kvm/async_pf.h b/virt/kvm/async_pf.h new file mode 100644 index 000000000000..e7ef6447cb82 --- /dev/null +++ b/virt/kvm/async_pf.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * kvm asynchronous fault support | ||
3 | * | ||
4 | * Copyright 2010 Red Hat, Inc. | ||
5 | * | ||
6 | * Author: | ||
7 | * Gleb Natapov <gleb@redhat.com> | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of version 2 of the GNU General Public License | ||
11 | * as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software Foundation, | ||
20 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | ||
21 | */ | ||
22 | |||
23 | #ifndef __KVM_ASYNC_PF_H__ | ||
24 | #define __KVM_ASYNC_PF_H__ | ||
25 | |||
26 | #ifdef CONFIG_KVM_ASYNC_PF | ||
27 | int kvm_async_pf_init(void); | ||
28 | void kvm_async_pf_deinit(void); | ||
29 | void kvm_async_pf_vcpu_init(struct kvm_vcpu *vcpu); | ||
30 | #else | ||
31 | #define kvm_async_pf_init() (0) | ||
32 | #define kvm_async_pf_deinit() do{}while(0) | ||
33 | #define kvm_async_pf_vcpu_init(C) do{}while(0) | ||
34 | #endif | ||
35 | |||
36 | #endif | ||