When compiling for X86 platforms there are errors related to includes.
Add basic support for X86 platform.
Signed-off-by: Luca Miccio <206497@studenti.unimore.it>
#include <asm/page.h>
#include <asm/numa.h>
#include <asm/flushtlb.h>
-#include <asm/coloring.h>
#ifdef CONFIG_X86
#include <asm/guest.h>
#include <asm/p2m.h>
{
unsigned long nr_pages = 0;
- C_DEBUG("Allocating 0x%lx for buddy allocator starting from: 0x%lx\n",
+ printk(XENLOG_INFO "Allocating 0x%lx for buddy allocator starting from: 0x%lx\n",
buddy_required_size, pfn_to_paddr(r->s));
init_heap_pages(mfn_to_page(_mfn(r->s)),
(buddy_required_size >> PAGE_SHIFT));
r->s += (buddy_required_size >> PAGE_SHIFT);
nr_pages = (r->e - r->s);
- C_DEBUG("COLORED: Init heap pages from 0x%lx with size: 0x%lx\n",
+ printk(XENLOG_INFO "COLORED: Init heap pages from 0x%lx with size: 0x%lx\n",
pfn_to_paddr(r->s), nr_pages*PAGE_SIZE);
if( !init_col_heap_pages(mfn_to_page(_mfn(r->s)), nr_pages) )
init_heap_pages(mfn_to_page(_mfn(r->s)), nr_pages);
}
else
{
- C_DEBUG("COLORED: Init heap pages from 0x%lx with size: 0x%lx\n",
+ printk(XENLOG_INFO "COLORED: Init heap pages from 0x%lx with size: 0x%lx\n",
pfn_to_paddr(r->s),(r->e - r->s)*PAGE_SIZE);
if( !init_col_heap_pages(mfn_to_page(_mfn(r->s)), r->e - r->s) )
init_heap_pages(mfn_to_page(_mfn(r->s)), r->e - r->s);
#include <xen/types.h>
#include <xen/vmap.h>
#include <asm/page.h>
-#include <asm/coloring.h>
static DEFINE_SPINLOCK(vm_lock);
static void *__read_mostly vm_base[VMAP_REGION_NR];
void coloring_dump_info(struct domain *d);
-/* Colored allocator functions */
-bool init_col_heap_pages(struct page_info *pg, unsigned long nr_pages);
-struct page_info *alloc_col_domheap_page(
- struct domain *d, unsigned int memflags);
-void free_col_heap_page(struct page_info *pg);
-
#else /* !CONFIG_COLORING */
#define XEN_COLOR_MAP_SIZE (_end - _start)
return true;
}
-static inline bool init_col_heap_pages(
- struct page_info *pg, unsigned long nr_pages)
-{
- return false;
-}
-
-static inline struct page_info *alloc_col_domheap_page(
- struct domain *d, unsigned int memflags)
-{
- return NULL;
-}
-
static inline uint64_t get_max_colors(void)
{
return 0;
}
-static inline void free_col_heap_page(struct page_info *pg)
-{
- return;
-}
-
static inline void coloring_dump_info(struct domain *d)
{
return;
/* When in use as a shadow, next shadow in this hash chain. */
__pdx_t next_shadow;
};
+
+ /* Is page managed by the cache-colored allocator? */
+ bool colored;
};
#undef __pdx_t
int offline_page(mfn_t mfn, int broken, uint32_t *status);
int query_page_offline(mfn_t mfn, uint32_t *status);
+/* Colored suballocator. */
+#ifdef CONFIG_COLORING
+bool init_col_heap_pages(struct page_info *pg, unsigned long nr_pages);
+struct page_info *alloc_col_domheap_page(
+ struct domain *d, unsigned int memflags);
+void free_col_heap_page(struct page_info *pg);
+#else
+static inline bool init_col_heap_pages(
+ struct page_info *pg, unsigned long nr_pages)
+{
+ return false;
+}
+
+static inline struct page_info *alloc_col_domheap_page(
+ struct domain *d, unsigned int memflags)
+{
+ return NULL;
+}
+
+static inline void free_col_heap_page(struct page_info *pg)
+{
+ return;
+}
+#endif
+
void heap_init_late(void);
int assign_pages(