* I need help understanding how to locate implementation of rdmsr_safe_regs() in the linux kernel
@ 2015-07-09 15:08 Marty
2015-07-10 18:17 ` Ender Dai
0 siblings, 1 reply; 3+ messages in thread
From: Marty @ 2015-07-09 15:08 UTC (permalink / raw)
To: kernelnewbies
I am presently working with Model Specific Registers and have been studying
the kernel module implementation found in arch/x86/kernel/msr.c. I am
attempting to understand what the implementation of the
msr_ioctl(X86_IOC_RDMSR_REGS)
<http://lxr.free-electrons.com/source/arch/x86/kernel/msr.c?v=3.8#L124>
call is doing.
msr_ioctl(X86_IOC_RDMSR_REGS) calls rdmsr_safe_regs_on_cpu()
<http://lxr.free-electrons.com/source/arch/x86/lib/msr-smp.c#L242>
(arch/x86/lib/msr-smp.c, line 180) which sets up __rdmsr_safe_regs_on_cpu
<http://lxr.free-electrons.com/source/arch/x86/lib/msr-smp.c#L228>()
(arch/x86/lib/msr-smp.c, line 166) as a callback function to perform the
actual work. This callback function then calls rdmsr_safe_regs().
I am unable to find the implementation for rdmsr_safe_regs(). lxr
<http://lxr.free-electrons.com/ident?i=rdmsr_safe_regs> only mentions
references and a prototype definition.
I've also manually grepped through the entire kernel source tree and have
not been able to find where rdmsr_safe_regs is defined.
I have poked around online, but have so far not been able to generate the
correct query to find an answer.
Can someone point me to the right documentation where I can figure this
out?
Thanks,
Marty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150709/a08eccbc/attachment-0001.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* I need help understanding how to locate implementation of rdmsr_safe_regs() in the linux kernel
2015-07-09 15:08 I need help understanding how to locate implementation of rdmsr_safe_regs() in the linux kernel Marty
@ 2015-07-10 18:17 ` Ender Dai
2015-07-10 18:46 ` Marty
0 siblings, 1 reply; 3+ messages in thread
From: Ender Dai @ 2015-07-10 18:17 UTC (permalink / raw)
To: kernelnewbies
On Thu, Jul 09, 2015 at 08:08:21AM -0700, Marty wrote:
> I am unable to find the implementation for rdmsr_safe_regs(). lxr
> <http://lxr.free-electrons.com/ident?i=rdmsr_safe_regs> only mentions
> references and a prototype definition.
>
> I've also manually grepped through the entire kernel source tree and have
> not been able to find where rdmsr_safe_regs is defined.
Try http://lxr.free-electrons.com/source/arch/x86/lib/msr-reg.S
If I can not grep out the definition of a function by its name, I will
try to grep with part of its name again, because most likely it is
created by a macro. In your case, I tried "grep safe_regs" under
arch/x86/ and got what you need.
^ permalink raw reply [flat|nested] 3+ messages in thread
* I need help understanding how to locate implementation of rdmsr_safe_regs() in the linux kernel
2015-07-10 18:17 ` Ender Dai
@ 2015-07-10 18:46 ` Marty
0 siblings, 0 replies; 3+ messages in thread
From: Marty @ 2015-07-10 18:46 UTC (permalink / raw)
To: kernelnewbies
Thanks for the public response (and to those who responded to me
privately). I did not think about macro definitions and will definitely
add that to my 'grep list' when finding things in the future.
Thanks again,
Marty
On Fri, Jul 10, 2015 at 11:17 AM, Ender Dai <ender.dai@gmail.com> wrote:
> On Thu, Jul 09, 2015 at 08:08:21AM -0700, Marty wrote:
> > I am unable to find the implementation for rdmsr_safe_regs(). lxr
> > <http://lxr.free-electrons.com/ident?i=rdmsr_safe_regs> only mentions
> > references and a prototype definition.
> >
> > I've also manually grepped through the entire kernel source tree and have
> > not been able to find where rdmsr_safe_regs is defined.
>
> Try http://lxr.free-electrons.com/source/arch/x86/lib/msr-reg.S
>
> If I can not grep out the definition of a function by its name, I will
> try to grep with part of its name again, because most likely it is
> created by a macro. In your case, I tried "grep safe_regs" under
> arch/x86/ and got what you need.
>
--
-marty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150710/406be700/attachment.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-10 18:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-09 15:08 I need help understanding how to locate implementation of rdmsr_safe_regs() in the linux kernel Marty
2015-07-10 18:17 ` Ender Dai
2015-07-10 18:46 ` Marty
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.