#include <xen/libfdt/libfdt.h>
#include <asm/setup.h>
-struct domain *dom_xen, *dom_io, *dom_cow;
-
/* Override macros from asm/page.h to make them work with mfn_t */
#undef virt_to_mfn
#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
invalidate_icache();
}
-void __init arch_init_memory(void)
-{
- /*
- * Initialise our DOMID_XEN domain.
- * Any Xen-heap pages that we will allow to be mapped will have
- * their domain field set to dom_xen.
- */
- dom_xen = domain_create(DOMID_XEN, NULL, false);
- BUG_ON(IS_ERR(dom_xen));
-
- /*
- * Initialise our DOMID_IO domain.
- * This domain owns I/O pages that are within the range of the page_info
- * array. Mappings occur at the priv of the caller.
- */
- dom_io = domain_create(DOMID_IO, NULL, false);
- BUG_ON(IS_ERR(dom_io));
-
- /*
- * Initialise our COW domain.
- * This domain owns sharable pages.
- */
- dom_cow = domain_create(DOMID_COW, NULL, false);
- BUG_ON(IS_ERR(dom_cow));
-}
-
static inline lpae_t pte_of_xenaddr(vaddr_t va)
{
paddr_t ma = va + phys_offset;
rcu_init();
- arch_init_memory();
+ setup_system_domains();
local_irq_enable();
local_abort_enable();
paddr_t __read_mostly mem_hotplug;
-/* Private domain structs for DOMID_XEN and DOMID_IO. */
-struct domain *dom_xen, *dom_io, *dom_cow;
-
/* Frame table size in pages. */
unsigned long max_page;
unsigned long total_pages;
~(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED |
_PAGE_DIRTY | _PAGE_AVAIL | _PAGE_AVAIL_HIGH | _PAGE_NX);
- /*
- * Initialise our DOMID_XEN domain.
- * Any Xen-heap pages that we will allow to be mapped will have
- * their domain field set to dom_xen.
- * Hidden PCI devices will also be associated with this domain
- * (but be [partly] controlled by Dom0 nevertheless).
- */
- dom_xen = domain_create(DOMID_XEN, NULL, false);
- BUG_ON(IS_ERR(dom_xen));
-
- /*
- * Initialise our DOMID_IO domain.
- * This domain owns I/O pages that are within the range of the page_info
- * array. Mappings occur at the priv of the caller.
- */
- dom_io = domain_create(DOMID_IO, NULL, false);
- BUG_ON(IS_ERR(dom_io));
-
- /*
- * Initialise our COW domain.
- * This domain owns sharable pages.
- */
- dom_cow = domain_create(DOMID_COW, NULL, false);
- BUG_ON(IS_ERR(dom_cow));
-
/*
* First 1MB of RAM is historically marked as I/O.
* Note that apart from IO Xen also uses the low 1MB to store the AP boot
mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
RANGESETF_prettyprint_hex);
+ setup_system_domains();
+
acpi_boot_init();
if ( smp_found_config )
integer_param("hardware_dom", hardware_domid);
#endif
+/* Private domain structs for DOMID_XEN, DOMID_IO, etc. */
+struct domain *__read_mostly dom_xen;
+struct domain *__read_mostly dom_io;
+struct domain *__read_mostly dom_cow;
+
struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
vcpu_info_t dummy_vcpu_info;
return ERR_PTR(err);
}
+void __init setup_system_domains(void)
+{
+ /*
+ * Initialise our DOMID_XEN domain.
+ * Any Xen-heap pages that we will allow to be mapped will have
+ * their domain field set to dom_xen.
+ * Hidden PCI devices will also be associated with this domain
+ * (but be [partly] controlled by Dom0 nevertheless).
+ */
+ dom_xen = domain_create(DOMID_XEN, NULL, false);
+ if ( IS_ERR(dom_xen) )
+ panic("Failed to create d[XEN]: %ld\n", PTR_ERR(dom_xen));
+
+ /*
+ * Initialise our DOMID_IO domain.
+ * This domain owns I/O pages that are within the range of the page_info
+ * array. Mappings occur at the priv of the caller.
+ */
+ dom_io = domain_create(DOMID_IO, NULL, false);
+ if ( IS_ERR(dom_io) )
+ panic("Failed to create d[IO]: %ld\n", PTR_ERR(dom_io));
+
+ /*
+ * Initialise our COW domain.
+ * This domain owns sharable pages.
+ */
+ dom_cow = domain_create(DOMID_COW, NULL, false);
+ if ( IS_ERR(dom_cow) )
+ panic("Failed to create d[COW]: %ld\n", PTR_ERR(dom_cow));
+}
void domain_update_node_affinity(struct domain *d)
{
unsigned long domain_get_maximum_gpfn(struct domain *d);
-extern struct domain *dom_xen, *dom_io, *dom_cow;
-
#define memguard_guard_stack(_p) ((void)0)
#define memguard_guard_range(_p,_l) ((void)0)
#define memguard_unguard_range(_p,_l) ((void)0)
extern domid_t max_init_domid;
-void arch_init_memory(void);
-
void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
size_t estimate_efi_size(int mem_nr_banks);
unsigned long domain_get_maximum_gpfn(struct domain *d);
-extern struct domain *dom_xen, *dom_io, *dom_cow; /* for vmcoreinfo */
-
/* Definition of an mm lock: spinlock with extra fields for debugging */
typedef struct mm_lock {
spinlock_t lock;
int vcpu_reset(struct vcpu *);
int vcpu_up(struct vcpu *v);
+void setup_system_domains(void);
+
struct xen_domctl_getdomaininfo;
void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);
void arch_get_domain_info(const struct domain *d,
#define MAX_ORDER 20 /* 2^20 contiguous pages */
#endif
+/* Private domain structs for DOMID_XEN, DOMID_IO, etc. */
+extern struct domain *dom_xen, *dom_io, *dom_cow;
+
#define page_list_entry list_head
#include <asm/mm.h>