VirtualBox

Ticket #11168 (new defect)

Opened 18 months ago

Last modified 17 months ago

CPU MSRs do not return correct values

Reported by: apianti Owned by:
Priority: major Component: VMM
Version: VirtualBox 4.2.4 Keywords:
Cc: Guest type: all
Host type: all

Description

I am currently testing an EFI application, the problem is that CPU MSRs such as IA32_PERF_STATUS(MSR_PERF_STATUS) and MSR_PLATFORM_INFO return incorrect, often insane values, causing the application to crash the virtual machine. IA32_PERF_STATUS always returns zero. MSR_PLATFORM_INFO returns maximum and minimum multipliers lower than the CPU can even provide. For me it returns a value of four for both, even though the TSC runs at a multiplier of 33, and Intel Sandy/Ivy bridge/Nehalem CPUs can't operate below multiplier sixteen. I have tried in multiple hosts including Windows 7, multiple flavors of Linux, and Mac OS X Lion and Mountain Lion, all provide incorrect values.

Change History

comment:1 Changed 18 months ago by apianti

Oops Nehalem cpus can't operate below multiplier seven.

comment:2 Changed 18 months ago by Andre.Ziegler

use VMWare or Hyper-V. I have the same issue with xperf in a Win8 guest:

https://www.virtualbox.org/ticket/10754

comment:3 Changed 18 months ago by apianti

Unfortunately that is not a solution as they are not free, and I'm just trying to test without having to restart constantly. I don't see why they don't all return the multiplier at which the TSC increments. There's no need to actually speedstep or turbo I just would like it to return valid values.

comment:4 Changed 18 months ago by Andre.Ziegler

VMware player is free for personal usage.

comment:5 Changed 18 months ago by frank

I see no problem in improving the implementation of these two MSR registers. The current implementation just uses some fixed values which are apparently not the best choice, see here and here. The case is different for other MSR registers (the ones Andre has in mind IIRC).

comment:6 follow-up: ↓ 7 Changed 18 months ago by apianti

VMWare player as far as I can see does not allow booting from anything but a hard disk, it also doesn't support booting from EFI as I have tried booting from my iso under all guests. Also this is not for personal usage. The problem is that these registers are different based upon which CPU is being used. IA32_PERF_STATUS(15:0) should be equal to the current p-state value, I don't understand why it's being set to 1000... As for u8Multiplier it's always set to 4 for some reason, why is it not set to the actual value of MSR_PLATFORM_INFO(15:8) or IA32_PERF_STATUS(44:40), which is max bus ratio, depending on the CPU model?

comment:7 in reply to: ↑ 6 Changed 17 months ago by frank

Replying to apianti:

The problem is that these registers are different based upon which CPU is being used. IA32_PERF_STATUS(15:0) should be equal to the current p-state value, I don't understand why it's being set to 1000... As for u8Multiplier it's always set to 4 for some reason, why is it not set to the actual value of MSR_PLATFORM_INFO(15:8) or IA32_PERF_STATUS(44:40), which is max bus ratio, depending on the CPU model?

Almost always it does not make sense to mirror the exact host state into the guest. The fixed-coded values for u8Multiplier are just some default values which worked for some purposes. As I said, the implementation can be improved.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use