]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
xen/arm: rename guest_cpuinfo in domain_cpuinfo
authorBertrand Marquis <bertrand.marquis@arm.com>
Mon, 12 Jun 2023 13:00:46 +0000 (15:00 +0200)
committerJulien Grall <julien@xen.org>
Mon, 12 Jun 2023 21:34:13 +0000 (22:34 +0100)
Rename the guest_cpuinfo structure to domain_cpuinfo as it is not only
used for guests but also for dom0 so domain is a more suitable name.

While there also rename the create_guest_cpuinfo function to
create_domain_cpuinfo to be coherent and fix comments accordingly.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
xen/arch/arm/arm64/vsysreg.c
xen/arch/arm/cpufeature.c
xen/arch/arm/include/asm/cpufeature.h
xen/arch/arm/vcpreg.c

index fe31f7b3827f19ecf940379d956e12c9375c7134..b5d54c569b33aeba0f57bb58727c2b298ad647ff 100644 (file)
@@ -76,7 +76,7 @@ TVM_REG(CONTEXTIDR_EL1)
     case HSR_SYSREG_##reg:                                              \
     {                                                                   \
         return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr,   \
-                                  1, guest_cpuinfo.field.bits[offset]); \
+                                  1, domain_cpuinfo.field.bits[offset]); \
     }
 
 void do_sysreg(struct cpu_user_regs *regs,
@@ -300,7 +300,7 @@ void do_sysreg(struct cpu_user_regs *regs,
 
     case HSR_SYSREG_ID_AA64PFR0_EL1:
     {
-        register_t guest_reg_value = guest_cpuinfo.pfr64.bits[0];
+        register_t guest_reg_value = domain_cpuinfo.pfr64.bits[0];
 
         if ( is_sve_domain(v->domain) )
         {
@@ -336,7 +336,7 @@ void do_sysreg(struct cpu_user_regs *regs,
          * When the guest has the SVE feature enabled, the whole id_aa64zfr0_el1
          * needs to be exposed.
          */
-        register_t guest_reg_value = guest_cpuinfo.zfr64.bits[0];
+        register_t guest_reg_value = domain_cpuinfo.zfr64.bits[0];
 
         if ( is_sve_domain(v->domain) )
             guest_reg_value = system_cpuinfo.zfr64.bits[0];
index b53e1a977601f1486cf9f35673225062a26fcbe1..f43d5cb338d02ecad7743c60157fd7f60abe34a5 100644 (file)
@@ -14,7 +14,7 @@
 
 DECLARE_BITMAP(cpu_hwcaps, ARM_NCAPS);
 
-struct cpuinfo_arm __read_mostly guest_cpuinfo;
+struct cpuinfo_arm __read_mostly domain_cpuinfo;
 
 #ifdef CONFIG_ARM_64
 static bool has_sb_instruction(const struct arm_cpu_capabilities *entry)
@@ -190,46 +190,46 @@ void identify_cpu(struct cpuinfo_arm *c)
 
 /*
  * This function is creating a cpuinfo structure with values modified to mask
- * all cpu features that should not be published to guest.
- * The created structure is then used to provide ID registers values to guests.
+ * all cpu features that should not be published to domains.
+ * The created structure is then used to provide ID registers values to domains.
  */
-static int __init create_guest_cpuinfo(void)
+static int __init create_domain_cpuinfo(void)
 {
-    /* Use the sanitized cpuinfo as initial guest cpuinfo */
-    guest_cpuinfo = system_cpuinfo;
+    /* Use the sanitized cpuinfo as initial domain cpuinfo */
+    domain_cpuinfo = system_cpuinfo;
 
 #ifdef CONFIG_ARM_64
     /* Hide MPAM support as xen does not support it */
-    guest_cpuinfo.pfr64.mpam = 0;
-    guest_cpuinfo.pfr64.mpam_frac = 0;
+    domain_cpuinfo.pfr64.mpam = 0;
+    domain_cpuinfo.pfr64.mpam_frac = 0;
 
     /* Hide SVE by default */
-    guest_cpuinfo.pfr64.sve = 0;
-    guest_cpuinfo.zfr64.bits[0] = 0;
+    domain_cpuinfo.pfr64.sve = 0;
+    domain_cpuinfo.zfr64.bits[0] = 0;
 
     /* Hide MTE support as Xen does not support it */
-    guest_cpuinfo.pfr64.mte = 0;
+    domain_cpuinfo.pfr64.mte = 0;
 
     /* Hide PAC support as Xen does not support it */
-    guest_cpuinfo.isa64.apa = 0;
-    guest_cpuinfo.isa64.api = 0;
-    guest_cpuinfo.isa64.gpa = 0;
-    guest_cpuinfo.isa64.gpi = 0;
+    domain_cpuinfo.isa64.apa = 0;
+    domain_cpuinfo.isa64.api = 0;
+    domain_cpuinfo.isa64.gpa = 0;
+    domain_cpuinfo.isa64.gpi = 0;
 #endif
 
     /* Hide AMU support */
 #ifdef CONFIG_ARM_64
-    guest_cpuinfo.pfr64.amu = 0;
+    domain_cpuinfo.pfr64.amu = 0;
 #endif
-    guest_cpuinfo.pfr32.amu = 0;
+    domain_cpuinfo.pfr32.amu = 0;
 
     /* Hide RAS support as Xen does not support it */
 #ifdef CONFIG_ARM_64
-    guest_cpuinfo.pfr64.ras = 0;
-    guest_cpuinfo.pfr64.ras_frac = 0;
+    domain_cpuinfo.pfr64.ras = 0;
+    domain_cpuinfo.pfr64.ras_frac = 0;
 #endif
-    guest_cpuinfo.pfr32.ras = 0;
-    guest_cpuinfo.pfr32.ras_frac = 0;
+    domain_cpuinfo.pfr32.ras = 0;
+    domain_cpuinfo.pfr32.ras_frac = 0;
 
     return 0;
 }
@@ -237,7 +237,7 @@ static int __init create_guest_cpuinfo(void)
  * This function needs to be run after all smp are started to have
  * cpuinfo structures for all cores.
  */
-__initcall(create_guest_cpuinfo);
+__initcall(create_domain_cpuinfo);
 
 /*
  * Local variables:
index 03fe684b4d366303457942c4469b6eec5c7ee53d..894f278a4a5a374ecc7f162a104a7ac516fb94ac 100644 (file)
@@ -461,7 +461,7 @@ static inline void update_system_features(const struct cpuinfo_arm *cpuinfo)
 extern struct cpuinfo_arm cpu_data[];
 #define current_cpu_data cpu_data[smp_processor_id()]
 
-extern struct cpuinfo_arm guest_cpuinfo;
+extern struct cpuinfo_arm domain_cpuinfo;
 
 #endif /* __ASSEMBLY__ */
 
index 4adfc0a68d0ee705c8b1cf958259e9ed2afafdb1..39aeda9dab6219665a5bbcc4c114a7b45823a709 100644 (file)
@@ -169,7 +169,7 @@ TVM_REG32(CONTEXTIDR, CONTEXTIDR_EL1)
     case HSR_CPREG32(reg):                                          \
     {                                                               \
         return handle_ro_read_val(regs, regidx, cp32.read, hsr, 1,  \
-                                  guest_cpuinfo.field.bits[offset]);\
+                                  domain_cpuinfo.field.bits[offset]);\
     }
 
 /* helper to define cases for all registers for one CRm value */