Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: readMSR should only execute on requested CPU #448

Open
nealsid opened this issue Sep 17, 2022 · 0 comments
Open

macOS: readMSR should only execute on requested CPU #448

nealsid opened this issue Sep 17, 2022 · 0 comments

Comments

@nealsid
Copy link
Contributor

nealsid commented Sep 17, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant