Skip to content

Commit 950e950

Browse files
Xiao Guangrongavikivity
authored andcommitted
KVM: introduce KVM_PFN_ERR_BAD
Then, remove get_bad_pfn Signed-off-by: Xiao Guangrong <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent e6c1502 commit 950e950

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

include/linux/kvm_host.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
#define KVM_PFN_ERR_FAULT (-EFAULT)
5252
#define KVM_PFN_ERR_HWPOISON (-EHWPOISON)
53+
#define KVM_PFN_ERR_BAD (-ENOENT)
5354

5455
/*
5556
* vcpu->requests bit members

virt/kvm/kvm_main.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -934,11 +934,6 @@ int is_error_pfn(pfn_t pfn)
934934
}
935935
EXPORT_SYMBOL_GPL(is_error_pfn);
936936

937-
static pfn_t get_bad_pfn(void)
938-
{
939-
return -ENOENT;
940-
}
941-
942937
int is_noslot_pfn(pfn_t pfn)
943938
{
944939
return pfn == -ENOENT;
@@ -1143,7 +1138,7 @@ static pfn_t __gfn_to_pfn(struct kvm *kvm, gfn_t gfn, bool atomic, bool *async,
11431138

11441139
addr = gfn_to_hva(kvm, gfn);
11451140
if (kvm_is_error_hva(addr))
1146-
return get_bad_pfn();
1141+
return KVM_PFN_ERR_BAD;
11471142

11481143
return hva_to_pfn(addr, atomic, async, write_fault, writable);
11491144
}

0 commit comments

Comments
 (0)