Page 1 of 1

model specific registers's realted questions

Posted: Mon Jun 12, 2017 12:32 am
by EladAshkcenazi335
1)what happens when tring to modifiing the Time Stamp Counter or the Performance Counter registers using WRMSR ? , does their bits even change ? , does an exeption is raised ? how can I change their values if I wanted to ?

2)What are the 'MCA Extended State Registers' (index 0x180 - 0x197), are they just another way to access the general perpuse registers?

3)Does modifing the 'mpref' register(Index 0xe7) actually modifing the proccessor's frequency?


Sources:
http://sandpile.org/x86/msr.htm
http://wiki.osdev.org/Model_Specific_Registers

Re: model specific registers's realted questions

Posted: Mon Jun 12, 2017 1:00 am
by Brendan
Hi,
EladAshkcenazi335 wrote:1)what happens when tring to modifiing the Time Stamp Counter or the Performance Counter registers using WRMSR ? , does their bits even change ? , does an exeption is raised ? how can I change their values if I wanted to ?
You'd change their values by writing to them (using the WRMSR instruction).
EladAshkcenazi335 wrote:2)What are the 'MCA Extended State Registers' (index 0x180 - 0x197), are they just another way to access the general perpuse registers?
They would contain the values that were in various registers when a machine check exception occurred (e.g. when the last hardware failure occured) and wouldn't contain the values that are currently in those registers.
EladAshkcenazi335 wrote:3)Does modifing the 'mpref' register(Index 0xe7) actually modifing the proccessor's frequency?
No. For some CPUs (most Intel CPUs?) if you write any value to this MSR the time stamp counter is set to zero (regardless of which value you wrote) and it has no effect on CPU frequency.

Note that all of these are Model Specific Registers, which means that they're model specific, and may not exist and/or may have completely different behaviour on different CPUs.

Also; I'd strongly recommend using Intel's manuals for MSRs on Intel's CPUs and AMD's manuals for MSRs on AMD CPUs; and NOT using recycled information from any other source (sandpile, our wiki) for anything more than a quick introduction.


Cheers,

Brendan

Re: model specific registers's realted questions

Posted: Tue Jun 13, 2017 6:19 am
by EladAshkcenazi335
Thanks Brendan:)