Move IDLE_DOMAIN_ID defn to public header, and change DOMID_INVALID to fix clash.
authorKeir Fraser <keir@xen.org>
Thu, 9 Dec 2010 10:09:59 +0000 (10:09 +0000)
committerKeir Fraser <keir@xen.org>
Thu, 9 Dec 2010 10:09:59 +0000 (10:09 +0000)
Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/ia64/xen/domain.c
xen/arch/x86/debug.c
xen/common/schedule.c
xen/include/public/xen.h
xen/include/xen/sched.h
xen/xsm/flask/hooks.c

index 13ba26bad3aa5b97cbb9b62777e4c2b0513c1aba..271a744e872736358a5bb90ec143756eb28e4eeb 100644 (file)
@@ -373,7 +373,7 @@ static void continue_cpu_idle_loop(void)
 void startup_cpu_idle_loop(void)
 {
        /* Just some sanity to ensure that the scheduler is set up okay. */
-       ASSERT(current->domain->domain_id == IDLE_DOMAIN_ID);
+       ASSERT(is_idle_vcpu(current));
        raise_softirq(SCHEDULE_SOFTIRQ);
 
        continue_cpu_idle_loop();
index 5e5f3cbafac77c877bc232e876a9a7a6e8e253dd..62b5a1544d4831f61bc9c924d123f855600034b6 100644 (file)
@@ -230,7 +230,7 @@ dbg_rw_guest_mem(dbgva_t addr, dbgbyte_t *buf, int len, struct domain *dp,
 }
 
 /* 
- * addr is hypervisor addr if domid == IDLE_DOMAIN_ID, else it's guest addr
+ * addr is hypervisor addr if domid == DOMID_IDLE, else it's guest addr
  * buf is debugger buffer.
  * if toaddr, then addr = buf (write to addr), else buf = addr (rd from guest)
  * pgd3: value of init_mm.pgd[3] in guest. see above.
@@ -241,7 +241,7 @@ dbg_rw_mem(dbgva_t addr, dbgbyte_t *buf, int len, domid_t domid, int toaddr,
            uint64_t pgd3)
 {
     struct domain *dp = get_domain_by_id(domid);
-    int hyp = (domid == IDLE_DOMAIN_ID);
+    int hyp = (domid == DOMID_IDLE);
 
     DBGP2("gmem:addr:%lx buf:%p len:$%d domid:%x toaddr:%x dp:%p\n", 
           addr, buf, len, domid, toaddr, dp);
index a59bf2ff8dc255c4ca8247a3ffb69980ed9baa1b..812b0d1a4f0dacdf969d3f258a56c501240ef1e8 100644 (file)
@@ -1276,7 +1276,7 @@ void __init scheduler_init(void)
     if ( SCHED_OP(&ops, init) )
         panic("scheduler returned error on init\n");
 
-    idle_domain = domain_create(IDLE_DOMAIN_ID, 0, 0);
+    idle_domain = domain_create(DOMID_IDLE, 0, 0);
     BUG_ON(idle_domain == NULL);
     idle_domain->vcpu = idle_vcpu;
     idle_domain->max_vcpus = NR_CPUS;
index 572d98c66c78893f3f8377679dcdb59c75cce579..93c3fe3837043e1f116a30d1af3474680491b062 100644 (file)
@@ -380,8 +380,11 @@ typedef uint16_t domid_t;
  * DOMID_COW is used as the owner of sharable pages */
 #define DOMID_COW  (0x7FF3U)
 
-/* DOMID_INVALID is used to identity invalid domid */
-#define DOMID_INVALID (0x7FFFU)
+/* DOMID_INVALID is used to identify pages with unknown owner. */
+#define DOMID_INVALID (0x7FF4U)
+
+/* Idle domain. */
+#define DOMID_IDLE (0x7FFFU)
 
 /*
  * Send an array of these to HYPERVISOR_mmu_update().
index 2ac43fc4b2b3850fc2492489a6cc8ff6cd844b9d..0ae9acfada87e86a3cc2145557e7753376602eed 100644 (file)
@@ -362,8 +362,7 @@ extern spinlock_t domlist_update_lock;
 extern rcu_read_lock_t domlist_read_lock;
 
 extern struct vcpu *idle_vcpu[NR_CPUS];
-#define IDLE_DOMAIN_ID   (0x7FFFU)
-#define is_idle_domain(d) ((d)->domain_id == IDLE_DOMAIN_ID)
+#define is_idle_domain(d) ((d)->domain_id == DOMID_IDLE)
 #define is_idle_vcpu(v)   (is_idle_domain((v)->domain))
 
 #define DOMAIN_DESTROYED (1<<31) /* assumes atomic_t is >= 32 bits */
index 727eddb989a65b544a48c2a83c1ef520a3211707..cb83b361ed536c99c5b15ff6ae0e437b3aee5466 100644 (file)
@@ -74,7 +74,7 @@ static int flask_domain_alloc_security(struct domain *d)
 
     dsec->d = d;
 
-    if ( d->domain_id == IDLE_DOMAIN_ID )
+    if ( is_idle_domain(d) )
     {
         dsec->sid = SECINITSID_XEN;
         dsec->create_sid = SECINITSID_DOM0;