Re: [gentoo-user] which microcode gets loaded?

2018-05-14 Thread David Haller
Hello,

On Mon, 14 May 2018, tu...@posteo.de wrote:
[..]
>cat /proc/cpuinfo (from one of the six cores):
>processor  : 4
>vendor_id  : AuthenticAMD
>cpu family : 16
  ^^ decimal = 10h(ex)
>model  : 10
>model name : AMD Phenom(tm) II X6 1090T Processor
[..]
>from linux-firmware (related lines):
>/lib/firmware/amd-ucode/microcode_amd.bin
>/lib/firmware/amd-ucode/microcode_amd_fam15h.bin
>/lib/firmware/amd-ucode/microcode_amd_fam16h.bin  ***
>/lib/firmware/amd-ucode/microcode_amd_fam17h.bin
>
>(***) I think, these microcodes do I need...

Nope. You need microcode_amd.bin, if any. Go into the git-repo for
sys-kernel/linux-firmware[1] and you'll find that the non-versioned
microcode_amd.bin is for fam10h - fam14h.

HTH,
-dnh

[1] https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git

-- 
I love deadlines. I like the whooshing sound they make as they fly by.
   -- Douglas Adams



Re: [gentoo-user] which microcode gets loaded?

2018-05-14 Thread Rich Freeman
On Mon, May 14, 2018 at 10:46 AM Corbin Bird  wrote:

> No Spectre/Meltdown fixes in these files, apparently.


As far as I'm aware AMD has not directly released any public microcode
fixes to address spectre (AMD is not vulnerable to meltdown).  They've
apparently given something to motherboard manufacturers, who may or may not
be putting microcode updates into firmware updates.

I think I already commented recently that I'm not particularly happy with
AMD's level of documentation around their microcode, or the way they
release updates.

As far as I'm aware linux-firmware hasn't received any spectre-related AMD
microcode updates.  There may be important non-spectre-related updates in
there, however.  I couldn't tell you for sure because I can't find any
clear documentation as to what the AMD microcode updates in linux-firmware
actually do.

-- 
Rich



Re: [gentoo-user] which microcode gets loaded?

2018-05-14 Thread Corbin Bird
On 05/13/2018 10:39 PM, tu...@posteo.de wrote:

> Hi,
>
> from a previous thread I learned which micorcode file needs
> to be loaded for the "fight against Spectre and Melddown"...
>
> Now two question came up for me:
> 1.) WIth this particular micorcode loaded: Do I need to activate
> the Spectre/Meldtown fix in the kernel itsself?
> 2.) Which microcode file gets loaded?
>
> cat /proc/cpuinfo (from one of the six cores):
> processor : 4
> vendor_id : AuthenticAMD
> cpu family: 16
> model : 10
> model name: AMD Phenom(tm) II X6 1090T Processor
> stepping  : 0
> microcode : 0x1bf
> cpu MHz   : 1755.530
> cache size: 512 KB
> physical id   : 0
> siblings  : 6
> core id   : 4
> cpu cores : 6
> apicid: 4
> initial apicid: 4
> fpu   : yes
> fpu_exception : yes
> cpuid level   : 6
> wp: yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
> pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb 
> rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid 
> extd_apicid aperfmperf pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic 
> cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt cpb 
> hw_pstate vmmcall npt lbrv svm_lock nrip_save pausefilter
> bugs  : tlb_mmatch apic_c1e fxsave_leak sysret_ss_attrs null_seg 
> amd_e400 spectre_v1 spectre_v2
> bogomips  : 7224.41
> TLB size  : 1024 4K pages
> clflush size  : 64
> cache_alignment   : 64
> address sizes : 48 bits physical, 48 bits virtual
> power management: ts ttp tm stc 100mhzsteps hwpstate cpb
>
>
> from dmesg (microcode-related lines):
> [1.517265] microcode: CPU0: patch_level=0x01bf
> [1.517367] microcode: CPU1: patch_level=0x01bf
> [1.517450] microcode: CPU2: patch_level=0x01bf
> [1.517538] microcode: CPU3: patch_level=0x01bf
> [1.517628] microcode: CPU4: patch_level=0x01bf
> [1.517716] microcode: CPU5: patch_level=0x01bf
> [1.517824] microcode: Microcode Update Driver: v2.2.
>
> from linux-firmware (related lines):
> /lib/firmware/amd-ucode/microcode_amd.bin
> /lib/firmware/amd-ucode/microcode_amd_fam15h.bin
> /lib/firmware/amd-ucode/microcode_amd.bin.asc
> /lib/firmware/amd-ucode/microcode_amd_fam16h.bin  ***
> /lib/firmware/amd-ucode/microcode_amd_fam17h.bin
> /lib/firmware/amd-ucode/microcode_amd_fam16h.bin.asc  ***
> /lib/firmware/amd-ucode/microcode_amd_fam15h.bin.asc
>
> (***) I think, these microcodes do I need...
>
> Thanks for any help in advance!
> Cheers
>  Meino
>
>
>
>
>
.

No Spectre/Meltdown fixes in these files, apparently.

Simple experiment(s) to confirm the ucode file to use : ( repetitive, but 
simple )

Build a kernel with NO ucode, boot, note the patch_level.
Build a kernel with microcode_amd.bin ucode ONLY, boot, note the patch_level.
Build a kernel with microcode_amd_fam15h ucode ONLY, boot, note the patch_level.
Build a kernel with microcode_amd_fam16h ucode ONLY, boot, note the patch_level.
Build a kernel with microcode_amd_fam17h ucode ONLY, boot, note the patch_level.

Results :
When I did this on a Phenom II 980 x4, the only time the patch level changed 
was with "microcode_amd.bin" ucode.  
When I do this on a FX-9590, the only time the patch level changes is when 
"microcode_amd_fam15h.bin" ucode is used.

Corbin





Re: [gentoo-user] which microcode gets loaded?

2018-05-13 Thread Adam Carter
>
> Now two question came up for me:
>> 1.) WIth this particular micorcode loaded: Do I need to activate
>> the Spectre/Meldtown fix in the kernel itsself?
>>
>
> AFAIK there are no fixes that rely on microcode in the kernel yet. The
> non-microcode dependent fixes need to be enabled.
>
>
To clarify - this statement is AMD specific. Not sure about Intel.


Re: [gentoo-user] which microcode gets loaded?

2018-05-13 Thread Adam Carter
On Mon, May 14, 2018 at 1:39 PM,  wrote:

> Hi,
>
> from a previous thread I learned which micorcode file needs
> to be loaded for the "fight against Spectre and Melddown"...
>
> Now two question came up for me:
> 1.) WIth this particular micorcode loaded: Do I need to activate
> the Spectre/Meldtown fix in the kernel itsself?
>

AFAIK there are no fixes that rely on microcode in the kernel yet. The
non-microcode dependent fixes need to be enabled.


> 2.) Which microcode file gets loaded?
>
> cat /proc/cpuinfo (from one of the six cores):
> processor   : 4
> vendor_id   : AuthenticAMD
> cpu family  : 16
> model   : 10
> model name  : AMD Phenom(tm) II X6 1090T Processor
> stepping: 0
> microcode   : 0x1bf
> cpu MHz : 1755.530
> cache size  : 512 KB
> physical id : 0
> siblings: 6
> core id : 4
> cpu cores   : 6



> 
>
> from linux-firmware (related lines):
> /lib/firmware/amd-ucode/microcode_amd.bin
> /lib/firmware/amd-ucode/microcode_amd_fam15h.bin
> /lib/firmware/amd-ucode/microcode_amd.bin.asc
> /lib/firmware/amd-ucode/microcode_amd_fam16h.bin  ***
> /lib/firmware/amd-ucode/microcode_amd_fam17h.bin
> /lib/firmware/amd-ucode/microcode_amd_fam16h.bin.asc  ***
> /lib/firmware/amd-ucode/microcode_amd_fam15h.bin.asc
>

gcc man page says fam15 is bulldozer and your CPU is pre-bulldozer so you
dont even need that one.

Do you use barcelona aka fam10 for the march CFLAG in make.conf?

Rgs,
Adam


[gentoo-user] which microcode gets loaded?

2018-05-13 Thread tuxic
Hi,

from a previous thread I learned which micorcode file needs
to be loaded for the "fight against Spectre and Melddown"...

Now two question came up for me:
1.) WIth this particular micorcode loaded: Do I need to activate
the Spectre/Meldtown fix in the kernel itsself?
2.) Which microcode file gets loaded?

cat /proc/cpuinfo (from one of the six cores):
processor   : 4
vendor_id   : AuthenticAMD
cpu family  : 16
model   : 10
model name  : AMD Phenom(tm) II X6 1090T Processor
stepping: 0
microcode   : 0x1bf
cpu MHz : 1755.530
cache size  : 512 KB
physical id : 0
siblings: 6
core id : 4
cpu cores   : 6
apicid  : 4
initial apicid  : 4
fpu : yes
fpu_exception   : yes
cpuid level : 6
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb 
rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid 
extd_apicid aperfmperf pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic 
cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt cpb 
hw_pstate vmmcall npt lbrv svm_lock nrip_save pausefilter
bugs: tlb_mmatch apic_c1e fxsave_leak sysret_ss_attrs null_seg 
amd_e400 spectre_v1 spectre_v2
bogomips: 7224.41
TLB size: 1024 4K pages
clflush size: 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate cpb


from dmesg (microcode-related lines):
[1.517265] microcode: CPU0: patch_level=0x01bf
[1.517367] microcode: CPU1: patch_level=0x01bf
[1.517450] microcode: CPU2: patch_level=0x01bf
[1.517538] microcode: CPU3: patch_level=0x01bf
[1.517628] microcode: CPU4: patch_level=0x01bf
[1.517716] microcode: CPU5: patch_level=0x01bf
[1.517824] microcode: Microcode Update Driver: v2.2.

from linux-firmware (related lines):
/lib/firmware/amd-ucode/microcode_amd.bin
/lib/firmware/amd-ucode/microcode_amd_fam15h.bin
/lib/firmware/amd-ucode/microcode_amd.bin.asc
/lib/firmware/amd-ucode/microcode_amd_fam16h.bin  ***
/lib/firmware/amd-ucode/microcode_amd_fam17h.bin
/lib/firmware/amd-ucode/microcode_amd_fam16h.bin.asc  ***
/lib/firmware/amd-ucode/microcode_amd_fam15h.bin.asc

(***) I think, these microcodes do I need...

Thanks for any help in advance!
Cheers
 Meino