Skip to contentSkip to conversation

Possible bug in Xen

DISCUSSION Joe Tretter 2 participants 9 messages Dec 18, 2023 – Jan 2, 2024

lore
Share & tools
lore
#0 lore raw

Hello,

I discussed the below problem with the QubesOS team on Github (https://github.com/QubesOS/qubes-issues/issues/4493) and they suggest that this seems to be a problem with Xen, and suggested that I post it to this e-mail address.

I have problems restoring backups in QubesOS release 4.1.2 on one of my machines.
Other users reported the issue too, but no QubesOS developer seemed to be able to reproduce it, therefore nothing happened for a while and the assumption has been that it's some sort of hardware problem.

I analyzed the problem down to the "scrypt" tool (https://www.tarsnap.com/scrypt.html) falsely complaining that the password would be wrong. I proceeded and re-compiled the "scrypt" tool in it's latest version and found that the self-tests show intermittent erratic behavior.

This issue only happens with QubesOS/Xen Kernel, if I boot into a kernel without Xen, the problem can't be observed. The problem can only be observed on one of my machines which is a Dell Inspiron 5675 with an AMD Ryzen 7 1700 Eight-Core Processor.

I hope you can help with this issue.

*With Xen - self test fails intermittently*

*Without Xen - self test succeeds*

Regards

~Joe

#1 lore raw
Quoted 19 lines · Joe Tretter

Hello,

I discussed the below problem with the QubesOS team on Github
(https://github.com/QubesOS/qubes-issues/issues/4493) and they suggest that this seems to be a problem with Xen, and suggested that I post it to this e-mail address.

I have problems restoring backups in QubesOS release 4.1.2 on one of my machines.
Other users reported the issue too, but no QubesOS developer seemed to be able to reproduce it, therefore nothing happened for a while and the assumption has been that it's some sort of hardware problem.

I analyzed the problem down to the "scrypt" tool
(https://www.tarsnap.com/scrypt.html) falsely complaining that the password would be wrong.
I proceeded and re-compiled the "scrypt" tool in it's latest version and found that the self-tests show intermittent erratic behavior.

Quoted 6 lines

This issue only happens with QubesOS/Xen Kernel, if I boot into a kernel without Xen, the problem can't be observed.
The problem can only be observed on one of my machines which is a Dell Inspiron 5675 with an AMD Ryzen 7 1700 Eight-Core Processor.

I hope you can help with this issue.

So the issue is specific to your AMD Zen1 system, and only when Xen is in the mix.

Can you try booting Xen with spec-ctrl=eager-fpu and see if that changes the behaviour ?

~Andrew

#3 lore raw
In reply to Joe Tretter
Quoted 9 lines · Joe Tretter

Hi Andrew,

I have tried it with your suggested command line, and it "feels" like it makes the issue occur less often (but one never knows with sparse intermittent issues).
The first time I ran my test, it took 23 minutes before the error occurred.
However, I picked that when running two processes simultaneously, the issue occurs reasonably fast.

Do you mean running the unit tests twice simultaneously?  Or something else.

Quoted 6 lines

I have, however, not been able to verify during runtime that the parameter really arrived in Xen because /proc/cmdline didn't show the Xen parameters. But I have taken a screen shot of what I have done to submit the parameter.

Quoted 6 lines

If you tell me how I can view the boot options in a running system to be certain the option has is effective, I'm happy to run the test again.

Side remark: To make reasonably sure the issue really only happens with Xen, I have re-verified that without Xen the issue does not exist, even with two instances for more than 1.5 hours.

Running xl info in dom0 will tell you various things, one of which is xen_cmdline.  This is the command line that Xen is currently booted with.

~Andrew

#4 lore raw

Hi Andrew.

Yes, running the scrypt unit test twice simultaneously made the error occur faster. This time, this wasn't required because it failed straight away - the boot parameter is present:

Regards

~Joe

Quoted 27 lines · Andrew Cooper
Quoted 9 lines · Joe Tretter

Hi Andrew,

I have tried it with your suggested command line, and it "feels" like it makes the issue occur less often (but one never knows with sparse intermittent issues).
The first time I ran my test, it took 23 minutes before the error occurred.
However, I picked that when running two processes simultaneously, the issue occurs reasonably fast.

Do you mean running the unit tests twice simultaneously?  Or something else.

Quoted 11 lines

I have, however, not been able to verify during runtime that the parameter really arrived in Xen because /proc/cmdline didn't show the Xen parameters. But I have taken a screen shot of what I have done to submit the parameter.

If you tell me how I can view the boot options in a running system to be certain the option has is effective, I'm happy to run the test again.

Side remark: To make reasonably sure the issue really only happens with Xen, I have re-verified that without Xen the issue does not exist, even with two instances for more than 1.5 hours.

Running xl info in dom0 will tell you various things, one of which is xen_cmdline.  This is the command line that Xen is currently booted with.

~Andrew

#2 lore raw
In reply to Andrew Cooper

Hi Andrew,

I have tried it with your suggested command line, and it "feels" like it makes the issue occur less often (but one never knows with sparse intermittent issues). The first time I ran my test, it took 23 minutes before the error occurred.
However, I picked that when running two processes simultaneously, the issue occurs reasonably fast.

I have, however, not been able to verify during runtime that the parameter really arrived in Xen because /proc/cmdline didn't show the Xen parameters. But I have taken a screen shot of what I have done to submit the parameter.

If you tell me how I can view the boot options in a running system to be certain the option has is effective, I'm happy to run the test again.

Side remark: To make reasonably sure the issue really only happens with Xen, I have re-verified that without Xen the issue does not exist, even with two instances for more than 1.5 hours.

Regards

~Joe

Quoted 33 lines · Andrew Cooper
Quoted 19 lines · Joe Tretter

Hello,

I discussed the below problem with the QubesOS team on Github
(https://github.com/QubesOS/qubes-issues/issues/4493) and they suggest that this seems to be a problem with Xen, and suggested that I post it to this e-mail address.

I have problems restoring backups in QubesOS release 4.1.2 on one of my machines.
Other users reported the issue too, but no QubesOS developer seemed to be able to reproduce it, therefore nothing happened for a while and the assumption has been that it's some sort of hardware problem.

I analyzed the problem down to the "scrypt" tool
(https://www.tarsnap.com/scrypt.html) falsely complaining that the password would be wrong.
I proceeded and re-compiled the "scrypt" tool in it's latest version and found that the self-tests show intermittent erratic behavior.

Quoted 6 lines

This issue only happens with QubesOS/Xen Kernel, if I boot into a kernel without Xen, the problem can't be observed.
The problem can only be observed on one of my machines which is a Dell Inspiron 5675 with an AMD Ryzen 7 1700 Eight-Core Processor.

I hope you can help with this issue.

So the issue is specific to your AMD Zen1 system, and only when Xen is in the mix.

Can you try booting Xen with spec-ctrl=eager-fpu and see if that changes the behaviour ?

~Andrew

#5 lore raw
In reply to Joe Tretter
Quoted 6 lines · Joe Tretter

Hi Andrew.

Yes, running the scrypt unit test twice simultaneously made the error occur faster.
This time, this wasn't required because it failed straight away - the boot parameter is present:

Is it always the same test which fails, or is it random?

Looking at https://github.com/Tarsnap/scrypt it's only a trivial piece of userspace crypto.

The fact that running multiple instances makes it fail more easily points towards some kind of register handling issue, but the fact that it repros only under Xen, and even with eager-fpu (which isn't the default on AMD, sadly), is weird.

Looking at the scrypt source, it has alternative routines for the AESNI and SHANI instruction groups.  However, because it's a Zen1, we don't have a useful way of filtering visible for PV dom0 userspace.

First of all, can you get the exact CPU model and microcode version. head /proc/cpuinfo will be enough.  But while you're at it, can you include xl dmesg too just in case there's something obvious showing up there too.

Thanks,

~Andrew

#6 lore raw
Quoted 1 line · Andrew Cooper

Is it always the same test which fails, or is it random?

Which test fails seems to be random (see attached screenshot).

Quoted 8 lines

Looking athttps://github.com/Tarsnap/scrypt it's only a trivial piece of userspace crypto.

The fact that running multiple instances makes it fail more easily points towards some kind of register handling issue, but the fact that it repros only under Xen, and even with eager-fpu (which isn't the default on AMD, sadly), is weird.

Quoted 9 lines

Looking at the scrypt source, it has alternative routines for the AESNI and SHANI instruction groups.  However, because it's a Zen1, we don't have a useful way of filtering visible for PV dom0 userspace.

First of all, can you get the exact CPU model and microcode version. head /proc/cpuinfo will be enough.  But while you're at it, can you include xl dmesg too just in case there's something obvious showing up there too.

I have attachted text files with the (full) cpuinfo and the dmesg.

Thanks

~Joe

processor : 0
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 7 1700 Eight-Core Processor
stepping : 1
microcode : 0x8001129
cpu MHz : 2994.408
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rdseed adx clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat
bugs : null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 5988.74
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 7 1700 Eight-Core Processor
stepping : 1
microcode : 0x8001129
cpu MHz : 2994.408
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rdseed adx clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat
bugs : null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 5988.74
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:

processor : 2
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 7 1700 Eight-Core Processor
stepping : 1
microcode : 0x8001129
cpu MHz : 2994.408
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rdseed adx clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat
bugs : null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 5988.74
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:

processor : 3
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 7 1700 Eight-Core Processor
stepping : 1
microcode : 0x8001129
cpu MHz : 2994.408
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rdseed adx clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat
bugs : null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 5988.74
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:

processor : 4
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 7 1700 Eight-Core Processor
stepping : 1
microcode : 0x8001129
cpu MHz : 2994.408
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rdseed adx clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat
bugs : null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 5988.74
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:

processor : 5
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 7 1700 Eight-Core Processor
stepping : 1
microcode : 0x8001129
cpu MHz : 2994.408
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rdseed adx clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat
bugs : null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 5988.74
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:

processor : 6
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 7 1700 Eight-Core Processor
stepping : 1
microcode : 0x8001129
cpu MHz : 2994.408
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rdseed adx clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat
bugs : null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 5988.74
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:

processor : 7
vendor_id : AuthenticAMD
cpu family : 23
model : 1
model name : AMD Ryzen 7 1700 Eight-Core Processor
stepping : 1
microcode : 0x8001129
cpu MHz : 2994.408
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae mce cx8 apic mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy abm sse4a misalignsse 3dnowprefetch bpext ssbd vmmcall fsgsbase bmi1 avx2 bmi2 rdseed adx clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat
bugs : null_seg spectre_v1 spectre_v2 spec_store_bypass retbleed smt_rsb srso div0
bogomips : 5988.74
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management:

(XEN) Built-in command line: ept=exec-sp spec-ctrl=unpriv-mmio
(XEN) parameter "no-real-mode" unknown!
Xen 4.14.6
(XEN) Xen version 4.14.6 (mockbuild@[unknown]) (gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)) debug=n Tue Nov 14 00:00:00 UTC 2023
(XEN) Latest ChangeSet:
(XEN) Bootloader: GRUB 2.04
(XEN) Command line: placeholder console=none dom0_mem=min:1024M dom0_mem=max:4096M ucode=scan smt=off gnttab_max_frames=2048 gnttab_max_maptrack_frames=4096 no-real-mode edd=off (XEN) Xen image load base address: 0xdac00000
(XEN) Video information:
(XEN) VGA is graphics mode 3440x1440, 32 bpp
(XEN) Disc information:
(XEN) Found 0 MBR signatures
(XEN) Found 1 EDD information structures
(XEN) EFI RAM map:

(XEN)  [0000000000000000, 0000000000086fff] (usable)
(XEN)  [0000000000087000, 00000000000bffff] (reserved)
(XEN)  [0000000000100000, 0000000009cfffff] (usable)
(XEN)  [0000000009d00000, 0000000009ffffff] (reserved)
(XEN)  [000000000a000000, 00000000bc678fff] (usable)
(XEN)  [00000000bc679000, 00000000bd778fff] (reserved)
(XEN)  [00000000bd779000, 00000000db98efff] (usable)
(XEN)  [00000000db98f000, 00000000ddb8efff] (reserved)
(XEN)  [00000000ddb8f000, 00000000dfb8efff] (ACPI NVS)
(XEN)  [00000000dfb8f000, 00000000dfbfefff] (ACPI data)
(XEN)  [00000000dfbff000, 00000000dfbfffff] (usable)
(XEN)  [00000000dfc00000, 00000000dfffffff] (reserved)
(XEN)  [00000000f8000000, 00000000fbffffff] (reserved)
(XEN)  [00000000fec00000, 00000000fec00fff] (reserved)
(XEN)  [00000000fec10000, 00000000fec10fff] (reserved)
(XEN)  [00000000fed80000, 00000000fed80fff] (reserved)
(XEN)  [00000000fee00000, 00000000fee00fff] (reserved)
(XEN)  [00000000ff000000, 00000000ffffffff] (reserved)
(XEN)  [0000000100000000, 000000081effffff] (usable)
(XEN) ACPI: RSDP DFBFE014, 0024 (r2 DELL  )
(XEN) ACPI: XSDT DFBDB188, 0114 (r1 DELL    WN09           1       1000013)
(XEN) ACPI: FACP DFBE2000, 010C (r5 DELL    WN09           1 ASL     40000)
(XEN) ACPI: DSDT DFBDA000, 03B9 (r1 DELL    WN09       40000 ASL     40000)
(XEN) ACPI: FACS DF6E2000, 0040
(XEN) ACPI: SSDT DFBF5000, 8C4C (r2 DELL    WN09           2 ACPI    40000)
(XEN) ACPI: UEFI DFBF4000, 0236 (r1 DELL    WN09           1 ASL     40000)
(XEN) ACPI: UEFI DFBF3000, 0042 (r1 DELL    WN09           0 ASL     40000)
(XEN) ACPI: MSDM DFBF2000, 0055 (r3 DELL    WN09           1 ASL     40000)
(XEN) ACPI: SSDT DFBF1000, 00FC (r1 DELL    WN09           1 ACPI    40000)
(XEN) ACPI: SSDT DFBEB000, 0D75 (r1 DELL    WN09           1 ACPI    40000)
(XEN) ACPI: SSDT DFBEA000, 0024 (r1 DELL    WN09        1000 ACPI    40000)
(XEN) ACPI: SSDT DFBE7000, 20E4 (r1 DELL    WN09           1 ACPI    40000)
(XEN) ACPI: CRAT DFBE6000, 0F50 (r1 DELL    WN09           1 ASL     40000)
(XEN) ACPI: CDIT DFBE5000, 0029 (r1 DELL    WN09           1 ASL     40000)
(XEN) ACPI: ASF! DFBE4000, 00A5 (r32 DELL    WN09           1 ASL     40000)
(XEN) ACPI: BOOT DFBE3000, 0028 (r1 DELL    WN09           1 ASL     40000)
(XEN) ACPI: HPET DFBE1000, 0038 (r1 DELL    WN09           1 ASL     40000)
(XEN) ACPI: APIC DFBE0000, 0138 (r3 DELL    WN09           1 ASL     40000)
(XEN) ACPI: MCFG DFBDF000, 003C (r1 DELL    WN09           1 ASL     40000)
(XEN) ACPI: WDAT DFBDE000, 017C (r1 DELL    WN09           1 ASL     40000)
(XEN) ACPI: WDRT DFBDD000, 0047 (r1 DELL    WN09           0 ASL     40000)
(XEN) ACPI: WSMT DFBDC000, 0028 (r1 DELL    WN09           1 ASL     40000)
(XEN) ACPI: SSDT DFBEC000, 4B3A (r1 DELL    WN09           1 ACPI    40000)
(XEN) ACPI: SSDT DFBD9000, 046D (r1 DELL    WN09        1000 ACPI    40000)
(XEN) ACPI: TPM2 DFBD8000, 0034 (r3 DELL    WN09           2 ASL     40000)
(XEN) ACPI: IVRS DFBD7000, 00D0 (r2 DELL    WN09           1 ASL     40000)
(XEN) ACPI: SSDT DFBD6000, 00F8 (r1 DELL    WN09        1000 ACPI    40000)
(XEN) ACPI: SSDT DFBD5000, 02E2 (r1 DELL    WN09        1000 ACPI    40000)
(XEN) ACPI: SSDT DFBD4000, 0B6C (r1 DELL    WN09           1 ACPI    40000)
(XEN) ACPI: SSDT DFBD3000, 0159 (r1 DELL    WN09           1 ACPI    40000)
(XEN) ACPI: SSDT DFBD1000, 1664 (r1 DELL    WN09           1 ACPI    40000)
(XEN) ACPI: FPDT DFBD0000, 0044 (r1 DELL    WN09           2 ASL     40000)
(XEN) ACPI: BGRT DFBCF000, 0038 (r1 DELL    WN09           1 ASL     40000)

(XEN) System RAM: 32661MB (33444956kB)
(XEN) Domain heap initialised
(XEN) ACPI: 32/64X FACS address mismatch in FADT - df6e2000/0000000000000000, using 32 (XEN) IOAPIC[0]: apic_id 32, version 33, address 0xfec00000, GSI 0-23 (XEN) IOAPIC[1]: apic_id 33, version 33, address 0xfec01000, GSI 24-55 (XEN) Enabling APIC mode: Phys. Using 2 I/O APICs
(XEN) CPU0: 1550 ... 3000 MHz
(XEN) xstate: size: 0x340 and states: 0x7
(XEN) Speculative mitigation facilities:

(XEN)   Hardware hints:
(XEN)   Hardware features:
(XEN)   Compiled-in support: INDIRECT_THUNK
(XEN)   Xen settings: BTI-Thunk RETPOLINE, SPEC_CTRL: No, Other: DIV BRANCH_HARDEN
(XEN)   Support for HVM VMs: RSB
(XEN)   Support for PV VMs: None
(XEN)   XPTI (64-bit PV only): Dom0 disabled, DomU disabled (without PCID)
(XEN)   PV L1TF shadowing: Dom0 disabled, DomU disabled

(XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2) (XEN) Initializing Credit2 scheduler
(XEN) Platform timer is 14.318MHz HPET
(XEN) Detected 2994.374 MHz processor.
(XEN) Unknown cachability for MFNs 0xa0-0xbf (XEN) Unknown cachability for MFNs 0xdfc00-0xdffff (XEN) AMD-Vi: IOMMU Extended Features:
(XEN) - Peripheral Page Service Request
(XEN) - NX bit
(XEN) - Invalidate All Command
(XEN) - Guest APIC
(XEN) - Performance Counters
(XEN) - Host Address Translation Size: 0x2
(XEN) - Guest Address Translation Size: 0
(XEN) - Guest CR3 Root Table Level: 0x1
(XEN) - Maximum PASID: 0xf
(XEN) - SMI Filter Register: 0x1
(XEN) - SMI Filter Register Count: 0x2
(XEN) - Guest Virtual APIC Modes: 0x1
(XEN) - Dual PPR Log: 0x2
(XEN) - Dual Event Log: 0x2
(XEN) - User / Supervisor Page Protection
(XEN) - Device Table Segmentation: 0x3
(XEN) - PPR Log Overflow Early Warning
(XEN) - PPR Automatic Response
(XEN) - Memory Access Routing and Control: 0x1 (XEN) - Block StopMark Message
(XEN) - Performance Optimization
(XEN) - MSI Capability MMIO Access
(XEN) - Guest I/O Protection
(XEN) - Host Access
(XEN) - Enhanced PPR Handling
(XEN) - Attribute Forward
(XEN) - VM Table Size: 0
(XEN) AMD-Vi: IOMMU 0 Enabled.
(XEN) I/O virtualisation enabled
(XEN) - Dom0 mode: Relaxed
(XEN) Interrupt remapping enabled
(XEN) ENABLING IO-APIC IRQs
(XEN) -> Using new ACK method
(XEN) Allocated console ring of 32 KiB.
(XEN) HVM: ASIDs enabled.
(XEN) SVM: Supported advanced features:

(XEN)  - Nested Page Tables (NPT)
(XEN)  - Last Branch Record (LBR) Virtualisation
(XEN)  - Next-RIP Saved on #VMEXIT
(XEN)  - VMCB Clean Bits
(XEN)  - DecodeAssists
(XEN)  - Virtual VMLOAD/VMSAVE
(XEN)  - Virtual GIF
(XEN)  - Pause-Intercept Filter
(XEN)  - Pause-Intercept Filter Threshold
(XEN)  - TSC Rate MSR

(XEN) HVM: SVM enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB
(XEN) Brought up 8 CPUs
(XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
(XEN) xenoprof: Initialization failed. AMD processor family 23 is not supported (XEN) Dom0 has maximum 1096 PIRQs
(XEN) Xen kernel: 64-bit, lsb, compat32
(XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x5000000 (XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN) Dom0 alloc.: 0000000538000000->0000000540000000 (1007412 pages to be allocated)
(XEN) Init. ramdisk: 000000081cf34000->000000081efff127
(XEN) VIRTUAL MEMORY ARRANGEMENT:

(XEN)  Loaded kernel: ffffffff81000000->ffffffff85000000
(XEN)  Init. ramdisk: 0000000000000000->0000000000000000
(XEN)  Phys-Mach map: 0000008000000000->0000008000800000
(XEN)  Start info:    ffffffff85000000->ffffffff850004b8
(XEN)  Xenstore ring: 0000000000000000->0000000000000000
(XEN)  Console ring:  0000000000000000->0000000000000000
(XEN)  Page tables:   ffffffff85001000->ffffffff8502e000
(XEN)  Boot stack:    ffffffff8502e000->ffffffff8502f000
(XEN)  TOTAL:         ffffffff80000000->ffffffff85400000
(XEN)  ENTRY ADDRESS: ffffffff835411c0

(XEN) Dom0 has maximum 8 VCPUs
(XEN) Initial low memory virq threshold set at 0x4000 pages. (XEN) Scrubbing Free RAM in background
(XEN) Std. Loglevel: Errors and warnings
(XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings) (XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input) (XEN) Freed 596kB init memory

#7 lore raw
Quoted 15 lines · Joe Tretter
Quoted 1 line · Andrew Cooper

Is it always the same test which fails, or is it random?

Which test fails seems to be random (see attached screenshot).

Quoted 12 lines

Looking at https://github.com/Tarsnap/scrypt it's only a trivial piece of userspace crypto.

The fact that running multiple instances makes it fail more easily points towards some kind of register handling issue, but the fact that it repros only under Xen, and even with eager-fpu (which isn't the default on AMD, sadly), is weird.

Looking at the scrypt source, it has alternative routines for the AESNI and SHANI instruction groups.  However, because it's a Zen1, we don't have a useful way of filtering visible for PV dom0 userspace.

Quoted 6 lines
Quoted 5 lines

First of all, can you get the exact CPU model and microcode version. head /proc/cpuinfo will be enough.  But while you're at it, can you include xl dmesg too just in case there's something obvious showing up there too.

I have attachted text files with the (full) cpuinfo and the dmesg.

microcode    : 0x8001129

That's 0x08001129 when not rendered brokenly, and the up-to-date version is 0x08001138 (which itself dates from 2019).

If you can, get a firmware update.  Given that it's a Dell, there's a good chance it's already on LFVS/fwupd.  This is definitely the preferred option.

If not, and you're willing to experiment in definitely unsupported territory, then move /lib/firmware/amd-ucode/microcode_amd_fam17h.bin sideways in dom0, and replace it with the attached SummitRidge-08001138 file (it's important to still be named microcode_amd_fam17h.bin in the end), then rebuild the initrd and reboot.

You already have ucode=scan on Xen's command line, so after the reboot you should see some messages about updating microcode too.

Irritatingly, AMD don't put client microcode into linux-firmware, but there are various collections of blobs found in the wild online.  I've picked the one which I think is right for your CPU, and packaged it it appropriately for Xen.

Anyway, I'm not sure if this will fix anything, but life is too short to be debugging stuff like this on out-of-date firmware/ucode.

~Andrew

#8 lore raw

Happy New Year! I think it's time I send you an update:
I have spent a considerable amount of time trying to get the latest firmware working, but I find a way that does the job. When I replaced the file with yours, the machine directly restarts on application of the firmware.
All ways I have tried either result in the firmware not being considered or the machine rebooting on application. The machine is dual boot with Archlinux and on Archlinux, I have the latest firmware running.
I have reached out to the Qubes people for help getting the latest firmware working. I'll let you know when I succeed with that.

~Joe

Quoted 50 lines · Andrew Cooper
Quoted 15 lines · Joe Tretter
Quoted 1 line · Andrew Cooper

Is it always the same test which fails, or is it random?

Which test fails seems to be random (see attached screenshot).

Quoted 12 lines

Looking athttps://github.com/Tarsnap/scrypt it's only a trivial piece of userspace crypto.

The fact that running multiple instances makes it fail more easily points towards some kind of register handling issue, but the fact that it repros only under Xen, and even with eager-fpu (which isn't the default on AMD, sadly), is weird.

Looking at the scrypt source, it has alternative routines for the AESNI and SHANI instruction groups.  However, because it's a Zen1, we don't have a useful way of filtering visible for PV dom0 userspace.

Quoted 6 lines
Quoted 5 lines

First of all, can you get the exact CPU model and microcode version. head /proc/cpuinfo will be enough.  But while you're at it, can you include xl dmesg too just in case there's something obvious showing up there too.

I have attachted text files with the (full) cpuinfo and the dmesg.

microcode    : 0x8001129

That's 0x08001129 when not rendered brokenly, and the up-to-date version is 0x08001138 (which itself dates from 2019).

If you can, get a firmware update.  Given that it's a Dell, there's a good chance it's already on LFVS/fwupd.  This is definitely the preferred option.

If not, and you're willing to experiment in definitely unsupported territory, then move /lib/firmware/amd-ucode/microcode_amd_fam17h.bin sideways in dom0, and replace it with the attached SummitRidge-08001138 file (it's important to still be named microcode_amd_fam17h.bin in the end), then rebuild the initrd and reboot.

You already have ucode=scan on Xen's command line, so after the reboot you should see some messages about updating microcode too.

Irritatingly, AMD don't put client microcode into linux-firmware, but there are various collections of blobs found in the wild online.  I've picked the one which I think is right for your CPU, and packaged it it appropriately for Xen.

Anyway, I'm not sure if this will fix anything, but life is too short to be debugging stuff like this on out-of-date firmware/ucode.

~Andrew