From nobody Thu Mar 28 12:27:05 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=hygon.cn ARC-Seal: i=1; a=rsa-sha256; t=1560344182; cv=none; d=zoho.com; s=zohoarc; b=Dcc7SRylBLIkepKigEZcjxWvMSzv6onJ3AjqT92+NuiVUTjzsem+KMhnWvQAiqzNMgU/RJw1ppAdE93wwY35MAQGvpfb2Yhos32VBb981U6wOKQ4CtLEn+SqlVbjWCzg+DKH4YMHfkTyz/sgDH9WEoy0MvRIvjmtZPurPgliy9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560344182; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=gCmXA80E1rybPjv34fY1H2M81tKwGOOSrPvW2ISX8tA=; b=R2pnNbGPGoP3NmOgRgOMPtzmWc9o3J7ucsGGKvMnxY6TMIwjtG837ZcZld4/9zYHGjMq2df+b/+wiomZPTumVKSpCzr7hZRcxuO5Z3NRuPQioNR28lMN6lS8TTAM1EQABAk/2R6uNeLGgP2rP0sCbCNwy+NJkKZrH/FzSmnZYvU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560344182596135.34166578514646; Wed, 12 Jun 2019 05:56:22 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hb2mH-0008H9-Iz; Wed, 12 Jun 2019 12:54:57 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hb2mG-0008H4-Cy for xen-devel@lists.xenproject.org; Wed, 12 Jun 2019 12:54:56 +0000 Received: from spam2.hygon.cn (unknown [110.188.70.11]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 4194a564-8d11-11e9-85db-d71cbe48ed62; Wed, 12 Jun 2019 12:54:48 +0000 (UTC) Received: from MK-FE.hygon.cn ([172.23.18.61]) by spam2.hygon.cn with ESMTP id x5CCsNeK054980; Wed, 12 Jun 2019 20:54:23 +0800 (GMT-8) (envelope-from puwen@hygon.cn) Received: from cncheex01.Hygon.cn ([172.23.18.10]) by MK-FE.hygon.cn with ESMTP id x5CCsIti048429; Wed, 12 Jun 2019 20:54:18 +0800 (GMT-8) (envelope-from puwen@hygon.cn) Received: from pw-vbox.hygon.cn (172.23.18.44) by cncheex01.Hygon.cn (172.23.18.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1466.3; Wed, 12 Jun 2019 20:54:22 +0800 X-Inumbo-ID: 4194a564-8d11-11e9-85db-d71cbe48ed62 From: Pu Wen To: Date: Wed, 12 Jun 2019 20:53:58 +0800 Message-ID: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [172.23.18.44] X-ClientProxiedBy: cncheex02.Hygon.cn (172.23.18.12) To cncheex01.Hygon.cn (172.23.18.10) X-MAIL: spam2.hygon.cn x5CCsNeK054980 X-DNSRBL: Subject: [Xen-devel] [PATCH v6] x86/acpi: Add Hygon Dhyana support X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Pu Wen , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Jan Beulich , Andrew Cooper Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Add Hygon Dhyana support to the acpi cpufreq and cpuidle subsystems by using the code path of AMD. [Rebase over 0cd07414 "x86/cpu: Renumber X86_VENDOR_* to form a bitmap"] Signed-off-by: Pu Wen Acked-by: Jan Beulich --- xen/arch/x86/acpi/cpu_idle.c | 3 ++- xen/arch/x86/acpi/cpufreq/cpufreq.c | 8 +++++--- xen/arch/x86/acpi/cpufreq/powernow.c | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c index 8846722..5931928 100644 --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -802,7 +802,8 @@ void acpi_dead_idle(void) __mwait(cx->address, 0); } } - else if ( current_cpu_data.x86_vendor =3D=3D X86_VENDOR_AMD && + else if ( (current_cpu_data.x86_vendor & + (X86_VENDOR_AMD | X86_VENDOR_HYGON)) && cx->entry_method =3D=3D ACPI_CSTATE_EM_SYSIO ) { /* Intel prefers not to use SYSIO */ diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufre= q/cpufreq.c index f4e13e1..7086d1a 100644 --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c @@ -649,7 +649,8 @@ static int __init cpufreq_driver_init(void) (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_INTEL)) ret =3D cpufreq_register_driver(&acpi_cpufreq_driver); else if ((cpufreq_controller =3D=3D FREQCTL_xen) && - (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_AMD)) + (boot_cpu_data.x86_vendor & + (X86_VENDOR_AMD | X86_VENDOR_HYGON))) ret =3D powernow_register_driver(); =20 return ret; @@ -660,8 +661,9 @@ int cpufreq_cpu_init(unsigned int cpuid) { int ret; =20 - /* Currently we only handle Intel and AMD processor */ - if ( boot_cpu_data.x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_AMD) ) + /* Currently we only handle Intel, AMD and Hygon processor */ + if ( boot_cpu_data.x86_vendor & + (X86_VENDOR_INTEL | X86_VENDOR_AMD | X86_VENDOR_HYGON) ) ret =3D cpufreq_add_cpu(cpuid); else ret =3D -EFAULT; diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufr= eq/powernow.c index 025b37d..72ab6a1 100644 --- a/xen/arch/x86/acpi/cpufreq/powernow.c +++ b/xen/arch/x86/acpi/cpufreq/powernow.c @@ -360,7 +360,7 @@ unsigned int __init powernow_register_driver() =20 for_each_online_cpu(i) { struct cpuinfo_x86 *c =3D &cpu_data[i]; - if (c->x86_vendor !=3D X86_VENDOR_AMD) + if (!(c->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON))) ret =3D -ENODEV; else { --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel