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

[Xen-devel] [PATCH v2 08/17] x86/apic: add modern APIC support for Hygon



Hygon processors use modern APIC, so just return in modern_apic() and
sync_Arb_IDs(). And should break in switch case in detect_init_API().

Signed-off-by: Pu Wen <puwen@xxxxxxxx>
---
 arch/x86/kernel/apic/apic.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 2aabd4c..d8b7ac1 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -223,6 +223,11 @@ static int modern_apic(void)
        if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
            boot_cpu_data.x86 >= 0xf)
                return 1;
+
+       /* Hygon systems use modern APIC */
+       if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
+               return 1;
+
        return lapic_get_version() >= 0x14;
 }
 
@@ -1207,9 +1212,11 @@ void __init sync_Arb_IDs(void)
 {
        /*
         * Unsupported on P4 - see Intel Dev. Manual Vol. 3, Ch. 8.6.1 And not
-        * needed on AMD.
+        * needed on AMD or Hygon.
         */
-       if (modern_apic() || boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+       if (modern_apic() ||
+           boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
+           boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
                return;
 
        /*
@@ -1908,6 +1915,8 @@ static int __init detect_init_APIC(void)
                    (boot_cpu_data.x86 >= 15))
                        break;
                goto no_apic;
+       case X86_VENDOR_HYGON:
+               break;
        case X86_VENDOR_INTEL:
                if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 ||
                    (boot_cpu_data.x86 == 5 && boot_cpu_has(X86_FEATURE_APIC)))
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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