]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/viridian: get rid of the magic numbers in CPUID leaves 1 and 2
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 22 Mar 2017 11:03:54 +0000 (12:03 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 22 Mar 2017 11:03:54 +0000 (12:03 +0100)
The numbers correspond to ASCII characters so just use appropriate
character strings directly.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/viridian.c

index a71f9281aeeed7306a6016d1c720e18db71fe8b6..0155c1ff626ce4d723cc7aa6a0253def819e7b8c 100644 (file)
@@ -119,14 +119,16 @@ void cpuid_viridian_leaves(const struct vcpu *v, uint32_t leaf,
     switch ( leaf )
     {
     case 0:
+        /* See section 2.4.1 of the specification */
         res->a = 0x40000006; /* Maximum leaf */
-        res->b = 0x7263694d; /* Magic numbers  */
-        res->c = 0x666F736F;
-        res->d = 0x76482074;
+        memcpy(&res->b, "Micr", 4);
+        memcpy(&res->c, "osof", 4);
+        memcpy(&res->d, "t Hv", 4);
         break;
 
     case 1:
-        res->a = 0x31237648; /* Version number */
+        /* See section 2.4.2 of the specification */
+        memcpy(&res->a, "Hv#1", 4);
         break;
 
     case 2: