VirtualBox

Opened 4 years ago

Last modified 17 months ago

#19595 reopened defect

memtest86 8.3 freezes

Reported by: Artem S. Tashkinov Owned by:
Component: other Version: VirtualBox 6.1.8
Keywords: Cc:
Guest type: other Host type: Linux

Description

https://www.memtest86.com/download.htm

doesn't work in VirtualBox 6.1.8 - it freezes on start on

Retrieving CPU MSR data...

I've tried playing with various VBox settings - nothing helps.

Attachments (2)

VirtualBox_MemTest86+.png (1.0 KB ) - added by Artem S. Tashkinov 4 years ago.
VBox.log (89.2 KB ) - added by Artem S. Tashkinov 4 years ago.

Download all attachments as: .zip

Change History (14)

by Artem S. Tashkinov, 4 years ago

Attachment: VirtualBox_MemTest86+.png added

comment:1 by Artem S. Tashkinov, 4 years ago

The last lines in a log are:

00:00:00.937120 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=00007ff32dcbd000 w=1024 h=768 bpp=32 cbLine=0x1000 flags=0x0 origin=0,0
00:00:01.009120 PS2K: Selected scan set 2
00:00:01.021112 AHCI#0: Reset the HBA
00:00:01.078901 EFI: VBoxDbg> loadimage64 '.efi' 0x7dd04000 LB 0x13aca0
00:00:01.144815 GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen 0 to 800x600
00:00:01.146501 GUI: 2D video acceleration is disabled
00:00:01.146546 GUI: HID LEDs sync is not supported on this platform
00:00:01.151735 GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=0, Machine-state=5

i.e. nothing interesting.

comment:2 by aeichner, 4 years ago

Resolution: invalid
Status: newclosed

Please attach a full VBox.log and reopen

comment:3 by Artem S. Tashkinov, 4 years ago

Resolution: invalid
Status: closedreopened

by Artem S. Tashkinov, 4 years ago

Attachment: VBox.log added

comment:4 by Artem S. Tashkinov, 4 years ago

The disk image was made by running:

VBoxManage convertfromraw memtest86-usb.img memtest86.vmdk --format VMDK

Changing various system VM settings including OS, CPU options, CPUs number, IOAPIC doesn't help.

comment:5 by Artem S. Tashkinov, 4 years ago

Now I'm running VBox 6.1.12 and using MemTest86 8.4 free edition: https://www.memtest86.com/downloads/memtest86-usb.zip

comment:6 by Artem S. Tashkinov, 4 years ago

Reproducible in Version 6.1.14 r140239 (Qt5.14.2) as well.

comment:7 by aeichner, 4 years ago

memtest is executing an rdmsr instruction for an MSR which is not existing for the selected CPU profile. This raises a #GP(0) exception which is not expected sending memtest into an error loop. They seem to assume that certain MSRs exist based on maybe CPUID values (they don't seem to expect that memtest can be run in a VM which has a stripped down CPU model).

Trunk contains a Ryzen 1800X profile which adds this MSR and with that memtest works, you could try it from here. Whether we include the profile into the next 6.1 maintenance release is being discussed but memtest should probably handling non existing MSRs properly in the first place. :)

comment:8 by Artem S. Tashkinov, 3 years ago

Great many thanks for a solution but I'm curious how to use the said profile - to be honest it's the first time I've heard about CPU profiles. Is this a new feature? Am I missing something? ;-)

comment:9 by Artem S. Tashkinov, 3 years ago

A reply from a MemTest86 developer:

MSR are part of all modern CPUs. What this means is that Virtual box fails to correct emulate whatever real CPU it is they are trying to emulate. Doesn't make sense to emulate just some of the CPUs instructions/ registers (in my opinion this is asking for random expected crashes). i.e. their CPU profile is wrong.

https://forums.passmark.com/memtest86/48686-msr-reading-bug-in-memtest86-for-virtual-machines

comment:10 by aeichner, 3 years ago

CPU profiles are used to present a more precise model of the host CPU to the guest, see the database we have in trunk here. By default the profile matching the host CPU the closest is selected (for 6.1 where the Ryzen profile does not exist VBox selects a "AMD FX-8150 Eight-Core" CPU iirc).

The response of the memtest86 developer does not take into account that we don't emulate the CPU (what qemu without kvm or bochs are doing) but virtualize the real one so that the host and guest can share it. What this means is that we can't just pass through all available MSRs of the host CPU to the guest or it might mess up some internal state leading to host crashes. VirtualBox also can't emulate all existing MSRs for all possible CPUs because modern CPUs have thousands of those many of which are poorly documented or not documented at all by the vendor. Thatswhy VBox exposes only MSRs which are safe because they are emulated and pretends the other MSRs don't exist and throws a #GP(0) instead of ignoring reads or writes to them which can lead to weird mishbehavior inside the guest as well. This is a common technique in virtualization not only for MSRs but also when exposing features through cpuid, features which are not supported are stripped from what is presented to the guest.

comment:11 by Artem S. Tashkinov, 3 years ago

Memtest86 developers have added a workaround specifically for VirtualBox which I guess will be available in a new version. This ticket might be closed if VirtualBox developers don't intend to resolve it.

comment:12 by Artem S. Tashkinov, 17 months ago

This bug report can be closed as upstream has added a workaround specifically for VBox.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use