[PATCH v4 2/3] KVM: add converters between pfn_t and kvm_pfn_t

From: Haozhong Zhang
Date: Fri Nov 03 2017 - 01:54:05 EST


Signed-off-by: Haozhong Zhang <haozhong.zhang@xxxxxxxxx>
---
include/linux/kvm_host.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 6882538eda32..caf6f7a6bdb2 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -27,6 +27,7 @@
#include <linux/irqbypass.h>
#include <linux/swait.h>
#include <linux/refcount.h>
+#include <linux/pfn_t.h>
#include <asm/signal.h>

#include <linux/kvm.h>
@@ -67,6 +68,9 @@
#define KVM_PFN_ERR_HWPOISON (KVM_PFN_ERR_MASK + 1)
#define KVM_PFN_ERR_RO_FAULT (KVM_PFN_ERR_MASK + 2)

+#define pfn_t_to_kvm_pfn_t(x) pfn_t_to_pfn(x)
+#define kvm_pfn_t_to_pfn_t(x) pfn_to_pfn_t((x) & ~KVM_PFN_ERR_NOSLOT_MASK)
+
/*
* error pfns indicate that the gfn is in slot but faild to
* translate it to pfn on host.
--
2.14.1