* [PATCH 1/9] tmem: Public interface for tmem
@ 2009-02-06 0:40 Dan Magenheimer
2009-02-06 8:46 ` Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: Dan Magenheimer @ 2009-02-06 0:40 UTC (permalink / raw)
To: Xen-Devel (E-mail)
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
[1] Public interface for tmem
[-- Attachment #2: tmem-xen-1.patch --]
[-- Type: application/octet-stream, Size: 2638 bytes --]
diff -r c8962b24fb50 xen/include/public/xen.h
--- a/xen/include/public/xen.h Fri Jan 30 11:12:57 2009 +0900
+++ b/xen/include/public/xen.h Thu Feb 05 13:58:35 2009 -0700
@@ -91,6 +91,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
#define __HYPERVISOR_sysctl 35
#define __HYPERVISOR_domctl 36
#define __HYPERVISOR_kexec_op 37
+#define __HYPERVISOR_tmem_op 38
/* Architecture-specific hypercall definitions. */
#define __HYPERVISOR_arch_0 48
@@ -324,6 +325,73 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
#define VMASST_TYPE_pae_extended_cr3 3
#define MAX_VMASST_TYPE 3
+
+/*
+ * Commands to HYPERVISOR_tmem_op().
+ */
+#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 TMEMC_THAW 0
+#define TMEMC_FREEZE 1
+#define TMEMC_DESTROY 2
+#define TMEMC_LIST 3
+#define TMEMC_SET_WEIGHT 4
+#define TMEMC_SET_CAP 5
+#define TMEMC_SET_COMPRESS 6
+
+#define TMEM_POOL_PERSIST 1
+#define TMEM_POOL_SHARED 2
+
+#define EFROZEN 1000
+
+#define TMEM_POOL_PAGESIZE_SHIFT 4
+#define TMEM_POOL_PAGESIZE_MASK 0xf
+#define TMEM_POOL_VERSION_SHIFT 24
+#define TMEM_POOL_VERSION_MASK 0xff
+
+#ifndef __ASSEMBLY__
+typedef XEN_GUEST_HANDLE(void) tmem_cli_mfn_t;
+typedef XEN_GUEST_HANDLE(char) tmem_cli_va_t;
+struct tmem_op {
+ uint32_t cmd;
+ int32_t pool_id; /* private > 0; shared < 0; 0 is invalid */
+ union {
+ struct { /* for cmd == TMEM_NEW_POOL */
+ uint64_t uuid[2];
+ uint32_t flags;
+ };
+ struct { /* for cmd == TMEM_CONTROL */
+ uint32_t subop;
+ uint32_t cli_id;
+ uint32_t arg1;
+ uint32_t arg2;
+ tmem_cli_va_t buf;
+ };
+ struct {
+ uint64_t object;
+ uint32_t index;
+ uint32_t tmem_offset;
+ uint32_t pfn_offset;
+ uint32_t len;
+ tmem_cli_mfn_t cmfn; /* client machine page frame */
+ };
+ };
+};
+typedef struct tmem_op tmem_op_t;
+DEFINE_XEN_GUEST_HANDLE(tmem_op_t);
+typedef XEN_GUEST_HANDLE(tmem_op_t) tmem_cli_op_t;
+
+#endif
#ifndef __ASSEMBLY__
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/9] tmem: Public interface for tmem
2009-02-06 0:40 [PATCH 1/9] tmem: Public interface for tmem Dan Magenheimer
@ 2009-02-06 8:46 ` Jan Beulich
2009-02-06 14:08 ` Dan Magenheimer
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2009-02-06 8:46 UTC (permalink / raw)
To: Dan Magenheimer; +Cc: xen-devel
>>> Dan Magenheimer <dan.magenheimer@oracle.com> 06.02.09 01:40 >>>
>[1] Public interface for tmem
Couldn't the whole second hunk rather go in a separate header?
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 1/9] tmem: Public interface for tmem
2009-02-06 8:46 ` Jan Beulich
@ 2009-02-06 14:08 ` Dan Magenheimer
2009-02-06 14:30 ` Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: Dan Magenheimer @ 2009-02-06 14:08 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel
Thanks for the feedback!
> Couldn't the whole second hunk rather go in a separate header?
Are you referring to the constants and the data structure?
All of these are used by both xen and a guest and must
be identical, thus the placement in public/xen.h. Are there
other header files which are guaranteed to be shared between
xen and a (linux) guest?
Thanks,
Dan
> -----Original Message-----
> From: Jan Beulich [mailto:jbeulich@novell.com]
> Sent: Friday, February 06, 2009 1:47 AM
> To: Dan Magenheimer
> Cc: xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH 1/9] tmem: Public interface for tmem
>
>
> >>> Dan Magenheimer <dan.magenheimer@oracle.com> 06.02.09 01:40 >>>
> >[1] Public interface for tmem
>
> Couldn't the whole second hunk rather go in a separate header?
>
> Jan
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 1/9] tmem: Public interface for tmem
2009-02-06 14:08 ` Dan Magenheimer
@ 2009-02-06 14:30 ` Jan Beulich
0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2009-02-06 14:30 UTC (permalink / raw)
To: Dan Magenheimer; +Cc: xen-devel
>>> Dan Magenheimer <dan.magenheimer@oracle.com> 06.02.09 15:08 >>>
>> Couldn't the whole second hunk rather go in a separate header?
>
>Are you referring to the constants and the data structure?
>All of these are used by both xen and a guest and must
>be identical, thus the placement in public/xen.h. Are there
>other header files which are guaranteed to be shared between
>xen and a (linux) guest?
All headers in xen/include/public/. You could create a new one, or (less
ideal) put it in xen/include/public/memory.h.
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-02-06 14:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-06 0:40 [PATCH 1/9] tmem: Public interface for tmem Dan Magenheimer
2009-02-06 8:46 ` Jan Beulich
2009-02-06 14:08 ` Dan Magenheimer
2009-02-06 14:30 ` Jan Beulich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.