AMD Ryzen IRETQ / SMT bug details (DFBSD commit) reddit / BSD ---------------------------------------------------------------------- BumpitySnook · 2017-08-14 03:27 Hope this might be interesting to other BSD users! I realize it's not 100% on topic for this sub, but maybe there is some overlap. I have been following the Ryzen launch with some fascination myself. I'm eager for real competition in the desktop CPU market again. ---------------------------------------------------------------------- [deleted] · 2017-08-14 03:33 [deleted] ---------------------------------------------------------------------- [deleted] · 2017-08-14 03:34 windows, netbsd and openbsd already already have a redzone between user and kernel for security reasons ---------------------------------------------------------------------- [deleted] · 2017-08-14 04:00 certainly makes me biased against amd. having the bug is ok - manufacture is hard. they shouldve found it after production and it sounds like it can be worked around in microcode, but they needed user reports and took a while to even acknowledge a problem exists - when its recognized by just booting an OS. and they still have no fix. ---------------------------------------------------------------------- BumpitySnook · 2017-08-14 04:02 Not sure what you mean. The x86 architecture provides an effective redzone between what FreeBSD (and I think Dragonfly, given its history) use for VM_MAXUSER_ADDRESS on amd64 in the form of the address space hole. From vmparam.h: * Virtual addresses of things. Derived from the page directory and * page table indexes from pmap.h for precision. * * 0x0000000000000000 - 0x00007fffffffffff user map * 0x0000800000000000 - 0xffff7fffffffffff does not exist (hole) * 0xffff800000000000 - 0xffff804020100fff recursive page table (512GB slot) * 0xffff804020101000 - 0xfffff7ffffffffff unused * 0xfffff80000000000 - 0xfffffbffffffffff 4TB direct map * 0xfffffc0000000000 - 0xfffffdffffffffff unused * 0xfffffe0000000000 - 0xffffffffffffffff 2TB kernel map * * Within the kernel map: * * 0xffffffff80000000 KERNBASE The problem is that Ryzen has issues prefetching in valid addresses near the address space hold (0x00007ffffffff000-0x00007fffffffffff). ---------------------------------------------------------------------- BumpitySnook · 2017-08-14 04:04 That's all fair criticism. ---------------------------------------------------------------------- [deleted] · 2017-08-14 05:13 hmm, don't have much of an x86 clue, whoever did that seemed to think its possible. maybe it's not ---------------------------------------------------------------------- BumpitySnook · 2017-08-14 05:35 It seems that NetBSD added that redzone because they stored their page tables directly following the max user address. FreeBSD (and probably Dragonfly as well) doesn't store their page tables there. http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/amd64/include/vmparam .h?rev=1.38&content-type=text/x-cvsweb-markup FreeBSD moved the kernel, as well as the page tables, into negative (or high, depending on how you look at it) address space on amd64 back in this commit from 2003 https://svnweb.freebsd.org/base?view=revision&revision=115251 ---------------------------------------------------------------------- ydna_eissua · 2017-08-14 11:50 You could make the same argument to be biased against Intel. Skylake and Kabylake have a hyperthreading bug. The bug was discovered a whole generation later. It was thankfully fixed in a microcode update. We need to treat CPUs like software, there will be bugs, they won't all be caught before you buy them. And you need to patch your shit.