mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86/domctl: Add Hygon Dhyana support
Add Hygon Dhyana support to update cpuid info for creating PV guest.
Signed-off-by: Pu Wen <puwen@hygon.cn>
Acked-by: Jan Beulich <jbeulich@suse.com>
[Rebase over 0cd074144c "x86/cpu: Renumber X86_VENDOR_* to form a bitmap"]
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
c8604e3e60
commit
87ca6a2a3b
1 file changed
+8
-3
@@ -176,6 +176,7 @@ static int update_domain_cpuid_info(struct domain *d,
|
||||
break;
|
||||
|
||||
case X86_VENDOR_AMD:
|
||||
case X86_VENDOR_HYGON:
|
||||
mask &= ((uint64_t)ecx << 32) | edx;
|
||||
|
||||
/*
|
||||
@@ -220,7 +221,7 @@ static int update_domain_cpuid_info(struct domain *d,
|
||||
uint32_t eax = ctl->eax;
|
||||
uint32_t ebx = p->feat._7b0;
|
||||
|
||||
if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD )
|
||||
if ( boot_cpu_data.x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON) )
|
||||
mask &= ((uint64_t)eax << 32) | ebx;
|
||||
|
||||
d->arch.pv.cpuidmasks->_7ab0 = mask;
|
||||
@@ -281,8 +282,11 @@ static int update_domain_cpuid_info(struct domain *d,
|
||||
if ( cpu_has_cmp_legacy )
|
||||
ecx |= cpufeat_mask(X86_FEATURE_CMP_LEGACY);
|
||||
|
||||
/* If not emulating AMD, clear the duplicated features in e1d. */
|
||||
if ( p->x86_vendor != X86_VENDOR_AMD )
|
||||
/*
|
||||
* If not emulating AMD or Hygon, clear the duplicated features
|
||||
* in e1d.
|
||||
*/
|
||||
if ( !(p->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
|
||||
edx &= ~CPUID_COMMON_1D_FEATURES;
|
||||
|
||||
switch ( boot_cpu_data.x86_vendor )
|
||||
@@ -292,6 +296,7 @@ static int update_domain_cpuid_info(struct domain *d,
|
||||
break;
|
||||
|
||||
case X86_VENDOR_AMD:
|
||||
case X86_VENDOR_HYGON:
|
||||
mask &= ((uint64_t)ecx << 32) | edx;
|
||||
|
||||
/*
|
||||
|
||||