# Intel TSX in gentoo

## boerns

Hi,

I did not find a direct Page with infos on Intel TSX and gentoo linux.

Because I am using kernel 3.18.3 an my new haswell i5 computer and newest gentoo

I already have glibc 2.19.x

Is there tsx automatically actvated? How can I check? How can I deactivate?

Is there a use-flag or kernel-paramater for grub?

Greetings

Alexander

----------

## Roman_Gruber

lets assume you use a bios with the tsx disabled bc your bios was updated from your mainboard manufacturer

Or lets assume intel has already disabled tsx in the microcode update. and you use one of these below already.

[I] sys-apps/microcode-ctl

     Available versions:  1.23 (~)1.26 (~)1.27 {selinux}

     Installed versions:  1.27(17:01:27 24.01.2015)(-selinux)

     Homepage:            https://fedorahosted.org/microcode_ctl/

     Description:         Intel processor microcode update utility

[I] sys-apps/microcode-data

     Available versions:  20140430 (~)20140624 (~)20140913

     Installed versions:  20140913(20:01:48 19.09.2014)

     Homepage:            http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=24290

     Description:         Intel IA32 microcode update data

if not it is time to install and use microcode. and i assume you need some special cpuflags in your make.conf to enable tsx in the first place.

to come back to your question. it is a bios microcode or userspace microcode issue in the first place. microcode of your cpu can be updated by your bios or later in userspace via these tools

----------

## asturm

In theory, a recent enough kernel and glibc will give you TSX support, then it is up to the individual applications to make use of it.

In practise, TSX was disabled in microcode on Haswell (and maybe even Broadwell, I'm not sure) due to critical error: http://techreport.com/news/26911/errata-prompts-intel-to-disable-tsx-in-haswell-early-broadwell-cpus

----------

## ScottESanDiego

There's some ugliness with libpthread using TSX if it's available, even if the microcode update has removed it.  So, you'll get "something" using libc+libpthread early in the boot sequence and seeing TSX is available, microcode_ctl will remove the TSX CPU function, but libpthread will continue to use it.  You'll see programs crashing with illegal instruction.  :Sad: 

I think the only workaround is to update the microcode early (which means using an initrd, and enabling the early options in the kernel).

I'd like to be told I'm wrong though.

----------

## boerns

As far as i understand the newst kernel updates the microcode itself?

genkernel tells me that the kernel is doing this.

----------

## Roman_Gruber

nope.

the userspace has to update the microcode. therefore you need those tools afaik. or you need a bios which does this for you. means the bios need to be up to date and i doubt it is usually. therefore intel provides such a tool in the first place because bios are "usually" buggy, not well mentained... off topic ...

----------

## boerns

Ok, I now have microcode update running with iniramfs like described here:

https://fitzcarraldoblog.wordpress.com/2014/11/06/updating-intel-cpu-microcode-from-gentoo-linux/

this at the moment is disabling TSX.

Thanks for the info.

----------

