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:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:msr_write

Proto:static ssize_t msr_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
const char __user *buf
size_tcount
loff_t *ppos
76  __user * tmp = buf
78  reg = ppos
79  cpu = iminor(file_inode(file))
80  err = 0
81  bytes = 0
83  err = security_locked_down(LOCKDOWN_MSR)
84  If err Then Return err
87  If count % 8 Then Return -EINVAL
90  When count cycle
91  If copy_from_user( & data, tmp, 8) Then
92  err = -EFAULT
93  Break
95  err = wrmsr_safe_on_cpu(cpu, reg, data[0], data[1])
96  If err Then Break
98  tmp += 2
99  bytes += 8
102  Return If bytes Then bytes Else err