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,73 @@ +/****************************************************************************** + * 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__ + +/* struct xc_cpumask : static structure */ +#define XEN_CPUMASK_BITS_PER_BYTE 8 +#define XEN_CPUMASK_BITS_TO_BYTES(bits) \ + (((bits)+XEN_CPUMASK_BITS_PER_BYTE-1)/XEN_CPUMASK_BITS_PER_BYTE) + +#define XEN_MAX_VCPUS 128 +#define XEN_CPUMASK_DECLARE_BITMAP(name,bits) \ + uint8_t name[XEN_CPUMASK_BITS_TO_BYTES(bits)] +struct xen_cpumask{ XEN_CPUMASK_DECLARE_BITMAP(bits, XEN_MAX_VCPUS); }; +#define XEN_CPUMASK_BITMAP(maskp) ((maskp)->bits) + +#define XEN_MAX_VNODES 4 + +/* vnodes are 1GB-aligned */ +#define XEN_MIN_VNODE_SHIFT (30) + +struct xen_vnode_info { + uint8_t vnode_id; + uint8_t mnode_id; + uint32_t nr_pages; + struct xen_cpumask vcpu_mask; /* vnode_to_vcpumask */ +}; + +#define XEN_DOM_NUMA_INTERFACE_VERSION 0x01 + +#define XEN_DOM_NUMA_CONFINE 0x01 +#define XEN_DOM_NUMA_SPLIT 0x02 +#define XEN_DOM_NUMA_STRIPE 0x03 +#define XEN_DOM_NUMA_DONTCARE 0x04 + +struct xen_domain_numa_info { + uint8_t version; + uint8_t type; + + uint8_t nr_vcpus; + uint8_t nr_vnodes; + + /* XXX: hvm_info_table uses 32-bit for high_mem_pgend, + * so we should be fine 32-bits too*/ + uint32_t nr_pages; + /* Only (nr_vnodes) entries are filled */ + struct xen_vnode_info vnode_info[XEN_MAX_VNODES]; + /* Only (nr_vnodes*nr_vnodes) entries are filled */ + uint8_t vnode_distance[XEN_MAX_VNODES*XEN_MAX_VNODES]; +}; + +#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