VirtualBox

Opened 11 years ago

Closed 9 years ago

#11168 closed defect (fixed)

CPU MSRs do not return correct values

Reported by: apianti Owned by:
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 (8)

comment:1 by apianti, 11 years ago

Oops Nehalem cpus can't operate below multiplier seven.

comment:2 by Andre.Ziegler, 11 years ago

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

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

comment:3 by apianti, 11 years ago

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 by Andre.Ziegler, 11 years ago

VMware player is free for personal usage.

comment:5 by Frank Mehnert, 11 years ago

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 by apianti, 11 years ago

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?

in reply to:  6 comment:7 by Frank Mehnert, 11 years ago

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.

comment:8 by Frank Mehnert, 9 years ago

Resolution: fixed
Status: newclosed

I think we did what is appropriate in VBox 4.3.x.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use