xen/arm: Remove the variable dom0_11_mapping and open-code the value
authorJulien Grall <julien.grall@arm.com>
Mon, 2 Jul 2018 16:19:04 +0000 (17:19 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 11 Jul 2018 19:17:41 +0000 (12:17 -0700)
Dom0 (aka hardware domain on Arm) is always direct mapped. Rather than
using a global variable to store a const, directly open-code it or
replace the use with is_domain_direct_mapped(...) macros.

This will also help a follow-up patch to move all domain_build.c in
init.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain_build.c
xen/include/asm-arm/domain.h

index 11cdf0509148aa02e357aef5e53300399bcd18fe..3c414c7f7361203b1c9c661146848adb72b605ca 100644 (file)
@@ -28,8 +28,6 @@
 static unsigned int __initdata opt_dom0_max_vcpus;
 integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
 
-int dom0_11_mapping = 1;
-
 static u64 __initdata dom0_mem;
 
 static int __init parse_dom0_mem(const char *s)
@@ -261,7 +259,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo)
      * TODO: Implement memory bank allocation when DOM0 is not direct
      * mapped
      */
-    BUG_ON(!dom0_11_mapping);
+    BUG_ON(!is_domain_direct_mapped(d));
 
     printk("Allocating 1:1 mappings totalling %ldMB for dom0:\n",
            /* Don't want format this as PRIpaddr (16 digit hex) */
index 7ba6528a7498c7e93dca382b327d7d55ae13f44d..280c3951fd8190d1d04dfb0bb1d6f4e9f51e3bbf 100644 (file)
@@ -31,8 +31,8 @@ enum domain_type {
 #define is_64bit_domain(d) (0)
 #endif
 
-extern int dom0_11_mapping;
-#define is_domain_direct_mapped(d) ((d) == hardware_domain && dom0_11_mapping)
+/* The hardware domain has always its memory direct mapped. */
+#define is_domain_direct_mapped(d) ((d) == hardware_domain)
 
 struct vtimer {
         struct vcpu *v;