Very short advice: If you want to use Ryzen 5000 series and your BIOS version is P1.10 or lower, I suggest you to upgrade BIOS before installing Qubes OS and before configuring the BIOS.
## Short story After some research, I decided to update BIOS. While ASRock advertises this MoBo to be comptabile with Ryzen 5000 series (see https://www.asrock.com/mb/AMD/B550%20Phantom%20Gaming%204ac/index.asp#Specification ), this seems to be a half-truth. According to their changelog at https://www.asrock.com/mb/AMD/B550%20Phantom%20Gaming%204ac/index.asp#BIOS , the BIOS 1.20 description contains "Support AMD Ryzen™ 5000 Series processors". So, with versions 1.00 and 1.10, you are probably out of luck. What the BIOS change resolved: * the rdrand issue with dnf * the USB issues with my trackball. One-time issues with the new BIOS version: * When you flash the BIOS, it resets the settings, so you lose IOMMU etc. until you configure it again. * It has probably changed the PCI identifiers, which has caused weird freezes when starting a VM with a PCI device assigned. Fortunatelly, in my temporary setup, no VM with any PCI device was configured to start on boot. If this was not my case, I would probably end up with non-bootable system and hard debugging... Not resolved: suspend/resume issues. Symptoms remain the same, including , regardless the smt configuration. Changed: /proc/cpuinfo - at least added rdrand. ## Long story about rdrand (You probably don't need to read this to make this MoBo working, but you might be interested for any other reason.) I've googled for the rdrand issue. Aside from many irelevant results (AMD's and Intel's issues with bad randomness or Google treating "Xen" in phrase with "AMD" as typo), I've learnt something: 1. The source that writes those errors is probably this: https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/src/c%2B%2B11/random.cc 2. Found the Intel's documentation of the _rdrand32_step instruction (well, intristic function) https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rdrand32_step via https://doc.rust-lang.org/core/arch/x86_64/fn._rdrand32_step.html . So, the instruction can sometimes just fail without any apparent reason, and libstdc++ tries 100 times until it fails. 3. I've tried a code that tests _rdrand32_step (adjusted version of testing program from https://arstechnica.com/gadgets/2019/10/how-a-months-old-amd-microcode-bug-destroyed-my-weekend/ ), see the attachment. It seems to always fail in both Dom0 and DomU. 4. Interesting finding: qubes-dom0-update works well, even though it runs dnf. I've tried to adjust the command to find the minimal difference that causes the command to fail/succeed: $ sudo dnf update --installroot / Error: random_device: rdrand failed $ sudo dnf update --installroot /var/lib/qubes/dom0-updates Last metadata expiration check: 0:44:30 ago on Sat Mar 6 16:25:06 2021. Dependencies resolved. Nothing to do. Complete! 5. Since this seems to be related to a CPU instruction which seems to be affected by microcode/BIOS, I've decided to update the BIOS. Which seems to have been the way to go, see above. Regards, Vít Šesták 'v6ak' On Saturday, March 6, 2021 at 12:57:31 AM UTC+1 sv...@svensemmler.org wrote: > On 3/5/21 5:48 PM, Vít Šesták wrote: > > Well, I have to correct the claim about rdrand in Fedora 33: It does not > > resolve the issue. The issue is a bit random, but it still appears. > > Hi Vít, > > just keep posting your findings to this thread, which is linked from > your HCL report. So others looking at your report will then find this > thread and see all the additional information you provide. > > I hope you'll be able to figure it out! > > Cheers, > /Sven > > -- > public key: https://www.svensemmler.org/0x8F541FB6.asc > fingerprint: D7CA F2DB 658D 89BC 08D6 A7AA DA6E 167B 8F54 1FB6 > > -- You received this message because you are subscribed to the Google Groups "qubes-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to qubes-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/aed35ee1-097d-4558-bd00-82b3af4a5fddn%40googlegroups.com.
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 Jason A. Donenfeld <ja...@zx2c4.com>. All Rights Reserved. * * Compile: `gcc -o test-rdrand -O3 -mrdrnd -std=gnu99 test-rdrand.c` */ #include <stdio.h> #include <stdint.h> #include <immintrin.h> int main(int argc, char *argv[]) { for (int j, i = 0; i < 20; ++i) { for (j = 0; j < 10000; ++j) { uint32_t val = 0; if (__builtin_ia32_rdrand32_step(&val)) { printf("RDRAND() = 0x%08x\n", val); break; }else{ printf("!"); } } if (j == 10000) { puts("RDRAND() = FAIL"); return 1; } } return 0; }