Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\msr.c Create Date:2022-07-28 08:18:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:msr_ioctl

Proto:static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg)

Type:long

Parameter:

TypeParameterName
struct file *file
unsigned intioc
unsigned longarg
107  __user * uregs = arg
109  cpu = iminor(file_inode(file))
113  Case ioc == X86_IOC_RDMSR_REGS
114  If Not (f_mode & le is open for reading ) Then
115  err = -EBADF
116  Break
118  If copy_from_user( & regs, uregs, size of regs ) Then
119  err = -EFAULT
120  Break
122  err = rdmsr_safe_regs_on_cpu(cpu, regs)
123  If err Then Break
125  If copy_to_user(uregs, & regs, size of regs ) Then err = -EFAULT
127  Break
129  Case ioc == X86_IOC_WRMSR_REGS
130  If Not (f_mode & le is open for writing ) Then
131  err = -EBADF
132  Break
134  If copy_from_user( & regs, uregs, size of regs ) Then
135  err = -EFAULT
136  Break
138  err = security_locked_down(LOCKDOWN_MSR)
139  If err Then Break
141  err = wrmsr_safe_regs_on_cpu(cpu, regs)
142  If err Then Break
144  If copy_to_user(uregs, & regs, size of regs ) Then err = -EFAULT
146  Break
148  Default
149  err = -ENOTTY
150  Break
153  Return err