Consider kernel patch for AMD CPUID masking feature
AMD CPUs have two MSRs (MSRC001_1004 and MSRC001_1005) [1] that allow resetting bits in the 0x1 and 0x8000_0001 CPUID leaves. If this capability were exposed by the kernel, we would be able to mask off problematic cpuid bits (like rdrand - see #3315) as we currently do on Intel CPUs.
Unfortunately, I don't currently have time to push such a patch through upstream submission, but leaving this issue here for any discussion or for somebody else to pick this up.
[1] https://developer.amd.com/wordpress/media/2017/11/54945_PPR_Family_17h_Models_00h-0Fh.pdf
I mocked up an appropriate patch here: https://gist.github.com/Keno/bd5b118ffaeca44267db9130853e920a. It's mostly untested, but should provide a starting point if anyone wants to pick this up in the future.