Skip to content

Commit

Permalink
KVM: introduce KVM_HVA_ERR_RO_BAD
Browse files Browse the repository at this point in the history
In the later patch, it indicates failure when we try to get a writable
hva from the readonly memslot

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Xiao Guangrong authored and Avi Kivity committed Aug 22, 2012
1 parent ca3a490 commit 7068d09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ static inline bool is_invalid_pfn(pfn_t pfn)
return !is_noslot_pfn(pfn) && is_error_pfn(pfn);
}

#define KVM_HVA_ERR_BAD (PAGE_OFFSET)
#define KVM_HVA_ERR_BAD (PAGE_OFFSET)
#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE)

static inline bool kvm_is_error_hva(unsigned long addr)
{
return addr == PAGE_OFFSET;
return addr >= PAGE_OFFSET;
}

#define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT))
Expand Down

0 comments on commit 7068d09

Please sign in to comment.