[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] tools/libxc: Add Hygon Dhyana support



commit eb0520cb9165ab91d87efcb8a1a5a11c0f6ec979
Author:     Pu Wen <puwen@xxxxxxxx>
AuthorDate: Thu Apr 4 21:48:13 2019 +0800
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Jun 6 15:28:21 2019 +0100

    tools/libxc: Add Hygon Dhyana support
    
    Add Hygon Dhyana support to caculate the cpuid policies for creating PV
    or HVM guest by using the code path of AMD.
    
    Signed-off-by: Pu Wen <puwen@xxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    [Rebase over 0cd074144cb "x86/cpu: Renumber X86_VENDOR_* to form a bitmap"]
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 tools/libxc/xc_cpuid_x86.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 71e1ee7544..b829336082 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -556,7 +556,7 @@ static void xc_cpuid_hvm_policy(const struct 
cpuid_domain_info *info,
         break;
     }
 
-    if ( info->vendor == X86_VENDOR_AMD )
+    if ( info->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON) )
         amd_xc_cpuid_policy(info, input, regs);
     else
         intel_xc_cpuid_policy(info, input, regs);
@@ -618,7 +618,7 @@ static void xc_cpuid_pv_policy(const struct 
cpuid_domain_info *info,
 
     case 0x80000000:
     {
-        unsigned int max = info->vendor == X86_VENDOR_AMD
+        unsigned int max = (info->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON))
             ? DEF_MAX_AMDEXT : DEF_MAX_INTELEXT;
 
         if ( regs[0] > max )
@@ -724,7 +724,7 @@ static void sanitise_featureset(struct cpuid_domain_info 
*info)
         if ( !info->pv64 )
         {
             clear_bit(X86_FEATURE_LM, info->featureset);
-            if ( info->vendor != X86_VENDOR_AMD )
+            if ( !(info->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
                 clear_bit(X86_FEATURE_SYSCALL, info->featureset);
         }
 
@@ -775,7 +775,7 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid,
     input[0] = 0x80000000;
     cpuid(input, regs);
 
-    if ( info.vendor == X86_VENDOR_AMD )
+    if ( info.vendor == X86_VENDOR_AMD || info.vendor == X86_VENDOR_HYGON )
         ext_max = (regs[0] <= DEF_MAX_AMDEXT) ? regs[0] : DEF_MAX_AMDEXT;
     else
         ext_max = (regs[0] <= DEF_MAX_INTELEXT) ? regs[0] : DEF_MAX_INTELEXT;
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.