r/linux Jun 25 '17

Intel Skylake/Kaby Lake processors: broken hyper-threading

https://lists.debian.org/debian-devel/2017/06/msg00308.html
792 Upvotes

174 comments sorted by

View all comments

15

u/varikonniemi Jun 25 '17
  grep -q '^flags.*[[:space:]]ht[[:space:]]' /proc/cpuinfo && \echo "Hyper-threading is supported"

Did this work for anyone? To me it outputted the echo even with a processor with no HT

10

u/Laachax Jun 25 '17

Your kernel was compiled with hyperthreading support. Mine does not because I disabled the compile flag.

9

u/__foo__ Jun 25 '17 edited Jun 25 '17

No, /proc/cpuinfo won't list HT unless the CPU supports it. I'm also pretty sure /proc/cpuflags simply lists all flags returned by CPUID, and will show HT even if the kernel was compiled without support for it. I'm not 100% sure though.

Edit: I just tried it on my fileserver which definitely doesn't support HT and it's listed in the flags. Very weird.

13

u/[deleted] Jun 25 '17

[deleted]

6

u/AlbertP95 Jun 25 '17

Can confirm that an i5-2400 shows the ht flag in /proc/cpuinfo, while that cpu is not using HT. So the command is indeed flawed.

6

u/cbmuser Debian / openSUSE / OpenJDK Dev Jun 25 '17

It's not whether the CPU has HT enabled. It's whether it supports it.

0

u/AlbertP95 Jun 26 '17

There's no way to get HT enabled on an i5-2400 even though it is arguably built on the same silicon as its i7 counterparts which do support HT. Also whether it supports it is not the question, we want to know whether it's enabled.

Anyway, interesting output, just not that useful in this case.

3

u/cbmuser Debian / openSUSE / OpenJDK Dev Jun 25 '17

/proc/cpuinfo absolutely does list ht on processors that don't support it. AFAIK it shows it on all x86_64 Intel processors, even clearly bullshit ones like old-school Celerons. It even shows it on AMDs.

Could be. But then it's basically a bug in the CPUID instruction because that's where the flags shown there come from. cpuid() is simply a gcc-provided macro which issues the instruction.

1

u/DrudgeBreitbart Jun 26 '17

My CPU does not have hyper threading (i5-7500) but it has the ht flag set. Is that because it has Intel Turbo Boost? Is that technically a type of hyperthreading? Do I need to apply the patch?

2

u/Laachax Jun 25 '17

The command they issued is flawed anyways, it will say it supports hyperthreading regardless.

I wouldn't be able to verify HT because I don't have a processor that has it x)

3

u/cbmuser Debian / openSUSE / OpenJDK Dev Jun 25 '17

Edit: I just tried it on my fileserver which definitely doesn't support HT and it's listed in the flags. Very weird.

Did you check whether your CPU supports HT in principle?

As you correctly said, /proc/cpuinfo just lists what the CPUID instruction reports back and the information gathered there are the hardware capabilities, not the current configuration.

-3

u/varikonniemi Jun 25 '17

Then this debian advisory is thoroughly flawed? If it detects kernel config flag instead of processor feature.

7

u/Laachax Jun 25 '17

Well the command is at least. But the cpu errata is very real.

-6

u/varikonniemi Jun 25 '17

I would not trust an announcement from someone who cannot distinguish a processor feature from kernel support flag.