From 2388222e98462fdbbe44f3e091b2b79d80956a9a Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 24 Jun 2019 21:29:31 +0200 Subject: update dependencies Ran a `go get -u` and bumped K8s deps to 1.15.0. Signed-off-by: Valentin Rothberg --- vendor/github.com/klauspost/cpuid/README.md | 2 ++ vendor/github.com/klauspost/cpuid/cpuid.go | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/klauspost/cpuid') diff --git a/vendor/github.com/klauspost/cpuid/README.md b/vendor/github.com/klauspost/cpuid/README.md index b2b6bee87..a7fb41fbe 100644 --- a/vendor/github.com/klauspost/cpuid/README.md +++ b/vendor/github.com/klauspost/cpuid/README.md @@ -83,6 +83,8 @@ Package home: https://github.com/klauspost/cpuid * **MSVM** (Microsoft Hyper-V or Windows Virtual PC) * **VMware** * **XenHVM** +* **Bhyve** +* **Hygon** # installing diff --git a/vendor/github.com/klauspost/cpuid/cpuid.go b/vendor/github.com/klauspost/cpuid/cpuid.go index 60c681bed..db9591321 100644 --- a/vendor/github.com/klauspost/cpuid/cpuid.go +++ b/vendor/github.com/klauspost/cpuid/cpuid.go @@ -26,6 +26,8 @@ const ( MSVM // Microsoft Hyper-V or Windows Virtual PC VMware XenHVM + Bhyve + Hygon ) const ( @@ -472,6 +474,11 @@ func (c CPUInfo) AMD() bool { return c.VendorID == AMD } +// Hygon returns true if vendor is recognized as Hygon +func (c CPUInfo) Hygon() bool { + return c.VendorID == Hygon +} + // Transmeta returns true if vendor is recognized as Transmeta func (c CPUInfo) Transmeta() bool { return c.VendorID == Transmeta @@ -527,7 +534,7 @@ func (c CPUInfo) LogicalCPU() int { // have many false negatives. func (c CPUInfo) VM() bool { switch c.VendorID { - case MSVM, KVM, VMware, XenHVM: + case MSVM, KVM, VMware, XenHVM, Bhyve: return true } return false @@ -625,7 +632,7 @@ func logicalCores() int { } _, b, _, _ := cpuidex(0xb, 1) return int(b & 0xffff) - case AMD: + case AMD, Hygon: _, b, _, _ := cpuid(1) return int((b >> 16) & 0xff) default: @@ -647,7 +654,7 @@ func physicalCores() int { switch vendorID() { case Intel: return logicalCores() / threadsPerCore() - case AMD: + case AMD, Hygon: if maxExtendedFunction() >= 0x80000008 { _, _, c, _ := cpuid(0x80000008) return int(c&0xff) + 1 @@ -670,6 +677,8 @@ var vendorMapping = map[string]Vendor{ "Microsoft Hv": MSVM, "VMwareVMware": VMware, "XenVMMXenVMM": XenHVM, + "bhyve bhyve ": Bhyve, + "HygonGenuine": Hygon, } func vendorID() Vendor { @@ -742,7 +751,7 @@ func (c *CPUInfo) cacheSize() { c.Cache.L3 = size } } - case AMD: + case AMD, Hygon: // Untested. if maxExtendedFunction() < 0x80000005 { return -- cgit v1.2.3-54-g00ecf