]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen: add field "flags" to cover all internal CDF_XXX
authorPenny Zheng <Penny.Zheng@arm.com>
Tue, 16 Aug 2022 02:36:53 +0000 (10:36 +0800)
committerJulien Grall <jgrall@amazon.com>
Wed, 24 Aug 2022 09:36:20 +0000 (10:36 +0100)
With more and more CDF_xxx internal flags in and to save the space, this
commit introduces a new field "flags" in struct domain to store CDF_*
internal flags directly.

Another new CDF_xxx will be introduced in the next patch.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/domain.c
xen/arch/arm/include/asm/domain.h
xen/common/domain.c
xen/include/xen/sched.h

index 13df91c401e4ea50a170fdecc273a75349059f36..2d6253181a9418d80f6dd31879e8c602b7f86bd5 100644 (file)
@@ -712,8 +712,6 @@ int arch_domain_create(struct domain *d,
     ioreq_domain_init(d);
 #endif
 
-    d->arch.directmap = flags & CDF_directmap;
-
     /* p2m_init relies on some value initialized by the IOMMU subsystem */
     if ( (rc = iommu_domain_init(d, config->iommu_opts)) != 0 )
         goto fail;
index cd9ce19b4b4169647dd052bb457bc000e82307ad..26a8348eed2bcd6aff217b86e3529a554e4e1d84 100644 (file)
@@ -29,7 +29,7 @@ enum domain_type {
 #define is_64bit_domain(d) (0)
 #endif
 
-#define is_domain_direct_mapped(d) (d)->arch.directmap
+#define is_domain_direct_mapped(d) ((d)->cdf & CDF_directmap)
 
 /*
  * Is the domain using the host memory layout?
@@ -104,7 +104,6 @@ struct arch_domain
     void *tee;
 #endif
 
-    bool directmap;
 }  __cacheline_aligned;
 
 struct arch_vcpu
index 618410e3b2576f239ed57407d2cf6f3038a409db..7062393e37970c2f2dc7fb58f1094096e1359436 100644 (file)
@@ -567,6 +567,9 @@ struct domain *domain_create(domid_t domid,
     /* Sort out our idea of is_system_domain(). */
     d->domain_id = domid;
 
+    /* Holding CDF_* internal flags. */
+    d->cdf = flags;
+
     /* Debug sanity. */
     ASSERT(is_system_domain(d) ? config == NULL : config != NULL);
 
index e2b3b6daa3cda6d13d1042f7de3af366f1bb32d4..1cf629e7ec13038676c646a55f51828c5f5e4833 100644 (file)
@@ -596,6 +596,9 @@ struct domain
         struct ioreq_server     *server[MAX_NR_IOREQ_SERVERS];
     } ioreq_server;
 #endif
+
+    /* Holding CDF_* constant. Internal flags for domain creation. */
+    unsigned int cdf;
 };
 
 static inline struct page_list_head *page_to_list(