diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2012-07-17 09:54:11 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-07-19 20:15:25 -0400 |
commit | 903816fa4d016e20ec71a1a97700cfcdda115580 (patch) | |
tree | c7208520a6de2f0170ce181517d3ea9479eb2eb7 /virt | |
parent | 86fde74cf5b829627b37ca86322acfdd99b524b8 (diff) |
KVM: using get_fault_pfn to get the fault pfn
Using get_fault_pfn to cleanup the code
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index e2b1a159e5df..0fbbf2d21603 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -103,8 +103,8 @@ static bool largepages_enabled = true; | |||
103 | static struct page *hwpoison_page; | 103 | static struct page *hwpoison_page; |
104 | static pfn_t hwpoison_pfn; | 104 | static pfn_t hwpoison_pfn; |
105 | 105 | ||
106 | struct page *fault_page; | 106 | static struct page *fault_page; |
107 | pfn_t fault_pfn; | 107 | static pfn_t fault_pfn; |
108 | 108 | ||
109 | inline int kvm_is_mmio_pfn(pfn_t pfn) | 109 | inline int kvm_is_mmio_pfn(pfn_t pfn) |
110 | { | 110 | { |
@@ -949,12 +949,6 @@ int is_hwpoison_pfn(pfn_t pfn) | |||
949 | } | 949 | } |
950 | EXPORT_SYMBOL_GPL(is_hwpoison_pfn); | 950 | EXPORT_SYMBOL_GPL(is_hwpoison_pfn); |
951 | 951 | ||
952 | int is_fault_pfn(pfn_t pfn) | ||
953 | { | ||
954 | return pfn == fault_pfn; | ||
955 | } | ||
956 | EXPORT_SYMBOL_GPL(is_fault_pfn); | ||
957 | |||
958 | int is_noslot_pfn(pfn_t pfn) | 952 | int is_noslot_pfn(pfn_t pfn) |
959 | { | 953 | { |
960 | return pfn == bad_pfn; | 954 | return pfn == bad_pfn; |
@@ -1038,11 +1032,12 @@ unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn) | |||
1038 | } | 1032 | } |
1039 | EXPORT_SYMBOL_GPL(gfn_to_hva); | 1033 | EXPORT_SYMBOL_GPL(gfn_to_hva); |
1040 | 1034 | ||
1041 | static pfn_t get_fault_pfn(void) | 1035 | pfn_t get_fault_pfn(void) |
1042 | { | 1036 | { |
1043 | get_page(fault_page); | 1037 | get_page(fault_page); |
1044 | return fault_pfn; | 1038 | return fault_pfn; |
1045 | } | 1039 | } |
1040 | EXPORT_SYMBOL_GPL(get_fault_pfn); | ||
1046 | 1041 | ||
1047 | int get_user_page_nowait(struct task_struct *tsk, struct mm_struct *mm, | 1042 | int get_user_page_nowait(struct task_struct *tsk, struct mm_struct *mm, |
1048 | unsigned long start, int write, struct page **page) | 1043 | unsigned long start, int write, struct page **page) |