macOS: readMSR should only execute on requested CPU
- Dominant language
- C++
- Stars
- 3.3k
- Forks
- 528
- Avg merge
- 1h 40m
- Merged PRs (30d)
- 2
Description
Right now readMSR executes code on all CPUs to read an MSR, and filters out results that do not match the requested cpu inside PcmMsr::readMSR():
```
mp_rendezvous_no_intrs(cpuReadMSR, (void*)idatas);
```
We can change this to something like this:
```
mp_cpus_call(cpu_to_cpumask(idatas->cpu_num),
ASYNC,
cpuReadMsr,
(void*)idatas);
```
One thing I am not sure of is mp_rendezvous has a comment indicating it is exported for use by KEXTs, but this is not the case for mp_cpus_call. mp_cpus_call will also disable interrupts while the requested function is being executed, which is the same as the behavior today, but may not be necessary for reading an MSR.
Contributor guide
Assessment
This issue has not been assessed yet.