All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pu Wen <puwen@hygon.cn>
To: xen-devel@lists.xenproject.org
Cc: "Wei Liu" <wei.liu2@citrix.com>,
	"Suravee Suthikulpanit" <suravee.suthikulpanit@amd.com>,
	"Pu Wen" <puwen@hygon.cn>, "Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Brian Woods" <brian.woods@amd.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v2 03/14] x86/cpu/vpmu: Add Hygon Dhyana and AMD Zen support for vPMU
Date: Thu, 21 Feb 2019 17:50:54 +0800	[thread overview]
Message-ID: <040f45bfbf35ade98027221680777cb96e561c65.1550647742.git.puwen@hygon.cn> (raw)
In-Reply-To: <cover.1550647742.git.puwen@hygon.cn>

The PMU architecture for the Hygon Dhyana CPU is similar to the AMD
family 17h one. So add Hygon Dhyana support in vpmu_arch_initialise
and vpmu_init by using the code path of AMD.

Since current Xen vPMU still not support Zen(0x17), so add both 0x17
and 0x18 support by using the 0x15's case in amd_vpmu_init, for 0x17
and 0x18 have the same performance event select and counter MSRs as
0x15 has.

Signed-off-by: Pu Wen <puwen@hygon.cn>
---
 xen/arch/x86/cpu/vpmu.c     | 2 ++
 xen/arch/x86/cpu/vpmu_amd.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 13da7d0..f679e79 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -459,6 +459,7 @@ static int vpmu_arch_initialise(struct vcpu *v)
     switch ( vendor )
     {
     case X86_VENDOR_AMD:
+    case X86_VENDOR_HYGON:
         ret = svm_vpmu_initialise(v);
         break;
 
@@ -876,6 +877,7 @@ static int __init vpmu_init(void)
     switch ( vendor )
     {
     case X86_VENDOR_AMD:
+    case X86_VENDOR_HYGON:
         if ( amd_vpmu_init() )
            vpmu_mode = XENPMU_MODE_OFF;
         break;
diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
index 5efc39b..c9abe6e 100644
--- a/xen/arch/x86/cpu/vpmu_amd.c
+++ b/xen/arch/x86/cpu/vpmu_amd.c
@@ -545,6 +545,8 @@ int __init amd_vpmu_init(void)
     switch ( current_cpu_data.x86 )
     {
     case 0x15:
+    case 0x17:
+    case 0x18:
         num_counters = F15H_NUM_COUNTERS;
         counters = AMD_F15H_COUNTERS;
         ctrls = AMD_F15H_CTRLS;
-- 
2.7.4


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

  parent reply	other threads:[~2019-02-21  9:52 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21  9:48 [PATCH v2 00/14] Add support for Hygon Dhyana Family 18h processor Pu Wen
2019-02-21  9:48 ` [PATCH v2 01/14] x86/cpu: Create Hygon Dhyana architecture support file Pu Wen
2019-03-14 17:10   ` Jan Beulich
2019-03-15 10:17     ` Pu Wen
2019-03-15 11:17       ` Jan Beulich
2019-03-16  9:57         ` Pu Wen
2019-03-18  8:54           ` Jan Beulich
2019-03-19 12:33             ` Pu Wen
2019-03-19 13:02               ` Jan Beulich
2019-03-19 13:34                 ` Pu Wen
2019-02-21  9:48 ` [PATCH v2 02/14] x86/cpu/mtrr: Add Hygon Dhyana support to get TOP_MEM2 Pu Wen
2019-03-15 12:39   ` Jan Beulich
2019-03-16 10:06     ` Pu Wen
2019-03-18  8:57       ` Jan Beulich
2019-03-18 15:51         ` Pu Wen
2019-03-18 16:51           ` Jan Beulich
2019-02-21  9:50 ` Pu Wen [this message]
2019-03-15 12:41   ` [PATCH v2 03/14] x86/cpu/vpmu: Add Hygon Dhyana and AMD Zen support for vPMU Jan Beulich
2019-03-16 10:11     ` Pu Wen
2019-03-18  8:59       ` Jan Beulich
2019-03-19 11:32         ` Pu Wen
2019-03-19 12:57           ` Jan Beulich
2019-03-19 13:47             ` Pu Wen
2019-03-19 13:57               ` Jan Beulich
2019-03-19 15:22                 ` Pu Wen
2019-02-21  9:51 ` [PATCH v2 04/14] x86/cpu/mce: Add Hygon Dhyana support to the MCA infrastructure Pu Wen
2019-03-15 12:47   ` Jan Beulich
2019-02-21  9:51 ` [PATCH v2 05/14] x86/spec_ctrl: Add Hygon Dhyana to the respective mitigation machinery Pu Wen
2019-03-15 12:47   ` Jan Beulich
2019-02-21  9:51 ` [PATCH v2 06/14] x86/apic: Add Hygon Dhyana support Pu Wen
2019-03-15 12:48   ` Jan Beulich
2019-02-21  9:52 ` [PATCH v2 07/14] x86/acpi: " Pu Wen
2019-03-15 12:49   ` Jan Beulich
2019-02-21  9:52 ` [PATCH v2 08/14] x86/iommu: " Pu Wen
2019-03-15 13:18   ` Jan Beulich
2019-02-21  9:52 ` [PATCH v2 09/14] x86/pv: Add Hygon Dhyana support to emulate MSRs access Pu Wen
2019-03-15 13:23   ` Jan Beulich
2019-02-21  9:53 ` [PATCH v2 10/14] x86/domain: Add Hygon Dhyana support Pu Wen
2019-03-15 13:24   ` Jan Beulich
2019-02-21  9:53 ` [PATCH v2 11/14] x86/domctl: " Pu Wen
2019-03-15 13:28   ` Jan Beulich
2019-03-16 10:14     ` Pu Wen
2019-02-21  9:53 ` [PATCH v2 12/14] x86/traps: " Pu Wen
2019-02-21  9:54 ` [PATCH v2 13/14] x86/cpuid: " Pu Wen
2019-03-15 13:29   ` Jan Beulich
2019-02-21  9:54 ` [PATCH v2 14/14] tools/libxc: " Pu Wen
2019-02-21 16:37 ` [PATCH v2 00/14] Add support for Hygon Dhyana Family 18h processor Wei Liu
2019-02-22  2:30   ` Pu Wen
2019-02-22 13:21     ` Wei Liu
2019-03-15 13:41 ` Jan Beulich
2019-03-16 10:40   ` Pu Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=040f45bfbf35ade98027221680777cb96e561c65.1550647742.git.puwen@hygon.cn \
    --to=puwen@hygon.cn \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=brian.woods@amd.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.