From: Dulloor <dulloor@gmail.com>
To: xen-devel@lists.xensource.com
Subject: [vNUMA v2][PATCH 2/8] public interface
Date: Sun, 1 Aug 2010 15:02:13 -0700 [thread overview]
Message-ID: <AANLkTimSDabceF5sFwHK3N6a0X1eYiFqaF6BgGhbVcj6@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimK3KCFz8K7ETcJtOVe9kSCXnhN0BKnrFKkvwMd@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
Interface definition. Structure that will be shared with hvmloader (with HVMs)
and directly with the VMs (with PV).
-dulloor
Signed-off-by : Dulloor <dulloor@gmail.com>
[-- Attachment #2: xen-02-numa-public-interface.patch --]
[-- Type: text/x-patch, Size: 5310 bytes --]
vNUMA : public interface
diff --git a/xen/include/public/arch-x86/dom_numa.h b/xen/include/public/arch-x86/dom_numa.h
new file mode 100644
--- /dev/null
+++ b/xen/include/public/arch-x86/dom_numa.h
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * dom_numa.h
+ *
+ * Guest NUMA common structures.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author : Dulloor Rao
+ */
+#ifndef __XEN_PUBLIC_DOM_NUMA_X86_H__
+#define __XEN_PUBLIC_DOM_NUMA_X86_H__
+
+#define XEN_MAX_VCPUS 128
+
+/* vnodes are 1GB-aligned */
+#define XEN_MIN_VNODE_SHIFT (30)
+#define XEN_INVALID_NODE (0xFF)
+
+struct xen_vnode_info {
+ uint8_t mnode_id; /* physical node vnode is allocated from */
+ uint32_t start; /* start of the vnode range (in pages) */
+ uint32_t end; /* end of the vnode range (in pages) */
+};
+
+/* version : Interface version */
+#define XEN_DOM_NUMA_INTERFACE_VERSION 0x01
+
+/* type : On NUMA platforms, the VM memory could be distributed across
+ * nodes in different ways.
+ */
+#define XEN_DOM_NUMA_CONFINE 0x01 /* Non-NUMA VM confined to a node */
+#define XEN_DOM_NUMA_SPLIT 0x02 /* NUMA VM split across nodes */
+#define XEN_DOM_NUMA_STRIPE 0x03 /* Non-NUMA VM striped across nodes */
+#define XEN_DOM_NUMA_DONTCARE 0x04 /* Ad-hoc allocation */
+
+/* xen_domain_numa_info :
+ * For PV VMs, this is the NUMA enlightenment structure.
+ * For HVMs, this structure is shared with the domain builder (hvmloader).
+ * Size of data[] depends on nr_vnodes and nr_vcpus.
+ */
+
+/* Macros to access data structures in dynamic data[] field.
+ * nr_vcpus and nr_vnodes must be initialized in the xen_domain_numa_info
+ * structure before calling these macros. */
+#define NUMA_INFO_SIZE(pinfo) \
+ (sizeof(*pinfo) \
+ + pinfo->nr_vnodes*sizeof(struct xen_vnode_info) \
+ + pinfo->nr_vcpus*sizeof(uint8_t) \
+ + pinfo->nr_vnodes*pinfo->nr_vnodes*sizeof(uint8_t))
+
+#define NUMA_INFO_VNODE_INFO(pinfo) \
+ (struct xen_vnode_info *)((uint8_t *)pinfo + sizeof(*pinfo))
+
+#define NUMA_INFO_VCPU_TO_VNODE(pinfo) \
+ (uint8_t *)((uint8_t *)NUMA_INFO_VNODE_INFO(pinfo) \
+ + pinfo->nr_vnodes*sizeof(struct xen_vnode_info))
+
+#define NUMA_INFO_VNODE_DISTANCE(pinfo) \
+ (uint8_t *)((uint8_t *)NUMA_INFO_VCPU_TO_VNODE(pinfo) \
+ + pinfo->nr_vcpus*sizeof(uint8_t))
+
+struct xen_domain_numa_info {
+ uint8_t version; /* Interface version */
+ uint8_t type; /* VM memory allocation scheme (see above) */
+
+ uint8_t nr_vcpus;
+ uint8_t nr_vnodes;
+ /* data[] has the following entries :
+ * //Only (nr_vnodes) entries are filled, each sizeof(struct xen_vnode_info)
+ * struct xen_vnode_info vnode_info[nr_vnodes];
+ * //Only (nr_vcpus) entries are filled, each sizeof(uint8_t)
+ * uint8_t vcpu_to_vnode[nr_vcpus];
+ * //Only (nr_vnodes*nr_vnodes) entries are filled, each sizeof(uint8_t)
+ * uint8_t vnode_distance[nr_vnodes*nr_vnodes];
+ */
+ uint8_t data[0];
+};
+
+#endif
diff --git a/xen/include/public/dom_numa.h b/xen/include/public/dom_numa.h
new file mode 100644
--- /dev/null
+++ b/xen/include/public/dom_numa.h
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * dom_numa.h
+ *
+ * Guest NUMA common structures.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author : Dulloor Rao
+ */
+
+#ifndef __XEN_PUBLIC_DOM_NUMA_H
+#define __XEN_PUBLIC_DOM_NUMA_H
+
+#if defined(__i386__) || defined(__x86_64__)
+#include "./arch-x86/dom_numa.h"
+#else
+#error "unsupported architecture"
+#endif
+
+
+#endif
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2010-08-01 22:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1BEA8649F0C00540AB2811D7922ECB6C9338B4CC@orsmsx507.amr.corp.intel.com>
2010-07-02 23:54 ` [XEN][vNUMA][PATCH 3/9] public interface Dulloor
2010-07-05 7:39 ` Keir Fraser
2010-07-05 8:52 ` Dulloor
2010-07-05 10:23 ` Keir Fraser
2010-07-06 5:57 ` Dulloor
2010-07-06 12:57 ` Keir Fraser
2010-07-06 17:52 ` Dulloor
2010-08-01 22:02 ` Dulloor [this message]
2010-08-03 12:40 ` [vNUMA v2][PATCH 2/8] " Andre Przywara
2010-08-03 15:24 ` Dulloor
2010-08-03 13:37 ` Andre Przywara
2010-08-03 14:10 ` Keir Fraser
2010-08-03 15:43 ` Dulloor
2010-08-03 15:52 ` Keir Fraser
2010-08-03 17:24 ` Dulloor
2010-08-03 19:52 ` Keir Fraser
2010-08-03 20:32 ` Dulloor
2010-08-03 21:55 ` Andre Przywara
2010-08-04 5:27 ` Keir Fraser
2010-08-04 5:48 ` Dulloor
2010-08-04 7:01 ` Andre Przywara
2010-08-04 8:45 ` Keir Fraser
2010-08-04 13:34 ` Dan Magenheimer
2010-08-03 21:35 ` Andre Przywara
2010-08-03 15:54 ` Keir Fraser
2010-08-03 15:32 ` Dulloor
2010-08-03 21:21 ` Andre Przywara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimSDabceF5sFwHK3N6a0X1eYiFqaF6BgGhbVcj6@mail.gmail.com \
--to=dulloor@gmail.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).