Define basic structures to be used by both host side and guest side. Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx> --- arch/x86/kvm/tmem/tmem.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 62 insertions(+), 0 deletions(-) create mode 100644 arch/x86/kvm/tmem/tmem.h diff --git a/arch/x86/kvm/tmem/tmem.h b/arch/x86/kvm/tmem/tmem.h new file mode 100644 index 0000000..a6f0032 --- /dev/null +++ b/arch/x86/kvm/tmem/tmem.h @@ -0,0 +1,62 @@ +#ifndef _KVM_TMEM_H_ +#define _KVM_TMEM_H_ + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/kvm_types.h> + +#define TMEM_CONTROL 0 +#define TMEM_NEW_POOL 1 +#define TMEM_DESTROY_POOL 2 +#define TMEM_NEW_PAGE 3 +#define TMEM_PUT_PAGE 4 +#define TMEM_GET_PAGE 5 +#define TMEM_FLUSH_PAGE 6 +#define TMEM_FLUSH_OBJECT 7 +#define TMEM_READ 8 +#define TMEM_WRITE 9 +#define TMEM_XCHG 10 + +#define TMEM_POOL_PERSIST 1 +#define TMEM_POOL_SHARED 2 +#define TMEM_POOL_PAGESIZE_SHIFT 4 +#define TMEM_VERSION_SHIFT 24 + +#define TMEM_SPEC_VERSION 1 + +struct tmem_pool_uuid { + __u64 uuid_lo; + __u64 uuid_hi; +}; + +struct tmem_oid { + __u64 oid[3]; +}; + +struct tmem_kvm_op { + __u32 cmd; + __s32 pool_id; + __u16 cli_id; + union { + struct { /* for cmd == TMEM_NEW_POOL */ + __u64 uuid[2]; + __u32 flags; + } new; + struct { + struct tmem_oid oid; + __u32 index; + __u32 tmem_offset; + __u32 pfn_offset; + __u32 len; + gfn_t gfn; /* guest machine page frame */ + } gen; + } u; +}; + +#define TMEM_POOL_PRIVATE_UUID { 0, 0 } + +/* flags for tmem_ops.new_pool */ +#define TMEM_POOL_PERSIST 1 +#define TMEM_POOL_SHARED 2 + +#endif /* _KVM_TMEM_H_ */ -- 1.7.8.6 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html