linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] Add support for Hygon's Dhyana Family 18h processor
@ 2018-06-09 13:20 Pu Wen
  2018-06-13 20:51 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Pu Wen @ 2018-06-09 13:20 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86, thomas.lendacky, peterz, tony.luck, bp,
	pbonzini, rkrcmar, boris.ostrovsky, jgross, rjw, lenb,
	viresh.kumar, mchehab, trenn, shuah, zhangpanyong
  Cc: linux-kernel, linux-arch, linux-x86_64, linux-pci, linux-acpi,
	linux-edac, linux-pm, kvm, xen-devel, Pu Wen

As a new x86 CPU Vendor, Chengdu Haiguang IC Design Co., Ltd (Hygon)
is a Joint Venture between AMD and Haiguang Information Technology Co.,
Ltd., and aims at providing high performance x86 processor for China
server market.

The first generation Hygon's processor(Dhyana) originates from AMD
technology and shares most of the architecture with AMD's family 17h,
but with different CPU Vendor ID("HygonGenuine")/PCIE Device Vendor ID
(0x1D94)/Family series number(Family 18h).

To enable the support of Linux kernel to Hygon's CPU, we added a new
vendor type (X86_VENDOR_HYGON, with value of 9) in arch/x86/include/
asm/processor.h, and shared most of kernel support codes with AMD
family 17h.

These patches have been applied and tested successfully in Hygon's
Dhyana SoC silicon. Also tested on AMD's EPYC (Family 17h) processor
works fine and makes no harm to existing codes.

Thanks.

Pu Wen (11):
  x86/cpu: Add support for Hygon's Dhyana Family 18h processor
  x86/pci: Add support for Hygon's Dhyana Family 18h processor
  x86/cpu/bug: Add support for Hygon's Dhyana Family 18h processor
  x86/perf: Add support for Hygon's Dhyana Family 18h processor
  x86/mce: Add support for Hygon's Dhyana Family 18h processor
  x86/kvm: Add support for Hygon's Dhyana Family 18h processor
  x86/xen: Add support for Hygon's Dhyana Family 18h processor
  driver/acpi: Add support for Hygon's Dhyana Family 18h processor
  driver/cpufreq: Add support for Hygon's Dhyana Family 18h processor
  driver/edac: Add support for Hygon's Dhyana Family 18h processor
  tools/cpupower: Add support for Hygon's Dhyana Family 18h processor

 arch/x86/events/amd/core.c                         | 10 ++++++++
 arch/x86/events/amd/uncore.c                       |  7 ++---
 arch/x86/events/core.c                             |  1 +
 arch/x86/include/asm/kvm_emulate.h                 |  4 +++
 arch/x86/include/asm/nospec-branch.h               |  4 +--
 arch/x86/include/asm/processor.h                   |  3 ++-
 arch/x86/include/asm/virtext.h                     |  5 ++--
 arch/x86/kernel/alternative.c                      |  4 +++
 arch/x86/kernel/amd_nb.c                           | 11 +++++++-
 arch/x86/kernel/apic/apic.c                        | 13 ++++++++--
 arch/x86/kernel/cpu/amd.c                          | 14 +++++++++-
 arch/x86/kernel/cpu/bugs.c                         | 30 ++++++++++++----------
 arch/x86/kernel/cpu/common.c                       |  1 +
 arch/x86/kernel/cpu/intel_cacheinfo.c              |  9 ++++---
 arch/x86/kernel/cpu/mcheck/mce-severity.c          |  3 ++-
 arch/x86/kernel/cpu/mcheck/mce.c                   | 16 +++++++++---
 arch/x86/kernel/cpu/mtrr/cleanup.c                 |  3 ++-
 arch/x86/kernel/cpu/mtrr/generic.c                 |  3 ++-
 arch/x86/kernel/cpu/mtrr/main.c                    |  2 +-
 arch/x86/kernel/cpu/perfctr-watchdog.c             |  2 ++
 arch/x86/kernel/smpboot.c                          |  4 ++-
 arch/x86/kvm/emulate.c                             |  8 +++++-
 arch/x86/pci/amd_bus.c                             |  6 +++--
 arch/x86/pci/irq.c                                 |  1 +
 arch/x86/xen/pmu.c                                 | 12 ++++++---
 drivers/acpi/acpi_pad.c                            |  1 +
 drivers/acpi/processor_idle.c                      |  1 +
 drivers/cpufreq/acpi-cpufreq.c                     |  5 +++-
 drivers/cpufreq/amd_freq_sensitivity.c             |  9 +++++--
 drivers/edac/amd64_edac.c                          | 20 ++++++++++++++-
 drivers/edac/amd64_edac.h                          |  4 +++
 drivers/edac/mce_amd.c                             |  4 ++-
 include/linux/pci_ids.h                            |  2 ++
 tools/power/cpupower/utils/cpufreq-info.c          |  6 +++--
 tools/power/cpupower/utils/helpers/cpuid.c         |  6 +++--
 tools/power/cpupower/utils/helpers/helpers.h       |  2 +-
 .../cpupower/utils/idle_monitor/mperf_monitor.c    |  3 ++-
 37 files changed, 183 insertions(+), 56 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 00/11] Add support for Hygon's Dhyana Family 18h processor
  2018-06-09 13:20 [PATCH 00/11] Add support for Hygon's Dhyana Family 18h processor Pu Wen
@ 2018-06-13 20:51 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2018-06-13 20:51 UTC (permalink / raw)
  To: Pu Wen
  Cc: tglx, mingo, hpa, x86, thomas.lendacky, peterz, tony.luck,
	pbonzini, rkrcmar, boris.ostrovsky, jgross, rjw, lenb,
	viresh.kumar, mchehab, trenn, shuah, zhangpanyong, linux-kernel,
	linux-arch, linux-x86_64, linux-pci, linux-acpi, linux-edac,
	linux-pm, kvm, xen-devel

On Sat, Jun 09, 2018 at 09:20:10PM +0800, Pu Wen wrote:
> As a new x86 CPU Vendor, Chengdu Haiguang IC Design Co., Ltd (Hygon)
> is a Joint Venture between AMD and Haiguang Information Technology Co.,
> Ltd., and aims at providing high performance x86 processor for China
> server market.
> 
> The first generation Hygon's processor(Dhyana) originates from AMD
> technology and shares most of the architecture with AMD's family 17h,
> but with different CPU Vendor ID("HygonGenuine")/PCIE Device Vendor ID
> (0x1D94)/Family series number(Family 18h).
> 
> To enable the support of Linux kernel to Hygon's CPU, we added a new
> vendor type (X86_VENDOR_HYGON, with value of 9) in arch/x86/include/
> asm/processor.h, and shared most of kernel support codes with AMD
> family 17h.
> 
> These patches have been applied and tested successfully in Hygon's
> Dhyana SoC silicon. Also tested on AMD's EPYC (Family 17h) processor
> works fine and makes no harm to existing codes.

Well, I don't like this diffstat:

 37 files changed, 183 insertions(+), 56 deletions(-)

which adds a lot of code checking this new vendor. But then it adds in
the AMD paths and I don't see it being any different from an AMD CPU. So
it does the same a Zen does but then it is Hygon.

So I'd prefer to *not* sprinkle those X86_VENDOR_HYGON checks everywhere
but simply have the vendor be X86_VENDOR_AMD and only the user-visible
reporting to show that it is Hygon. Because to the kernel it is an AMD
CPU - only the superficial attributes are something else. Oh well, and
PCI device IDs but that's like another CPU revision.

Thx.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-13 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-09 13:20 [PATCH 00/11] Add support for Hygon's Dhyana Family 18h processor Pu Wen
2018-06-13 20:51 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).