Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158694
b: refs/heads/master
c: 0cc0213
h: refs/heads/master
v: v3
  • Loading branch information
H. Peter Anvin committed Aug 31, 2009
1 parent 621c15c commit 99d1b63
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79c5dca3619d6ae15815eec14cd7a43db5f38b47
refs/heads/master: 0cc0213e73af5963eca259c84876937c20689dbd
4 changes: 2 additions & 2 deletions trunk/arch/x86/include/asm/msr.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
".previous\n\t"
_ASM_EXTABLE(2b, 3b)
: [err] "=r" (*err), EAX_EDX_RET(val, low, high)
: "c" (msr), [fault] "i" (-EFAULT));
: "c" (msr), [fault] "i" (-EIO));
return EAX_EDX_VAL(val, low, high);
}

Expand All @@ -90,7 +90,7 @@ notrace static inline int native_write_msr_safe(unsigned int msr,
_ASM_EXTABLE(2b, 3b)
: [err] "=a" (err)
: "c" (msr), "0" (low), "d" (high),
[fault] "i" (-EFAULT)
[fault] "i" (-EIO)
: "memory");
return err;
}
Expand Down
10 changes: 2 additions & 8 deletions trunk/arch/x86/kernel/msr.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ static ssize_t msr_read(struct file *file, char __user *buf,

for (; count; count -= 8) {
err = rdmsr_safe_on_cpu(cpu, reg, &data[0], &data[1]);
if (err) {
if (err == -EFAULT) /* Fix idiotic error code */
err = -EIO;
if (err)
break;
}
if (copy_to_user(tmp, &data, 8)) {
err = -EFAULT;
break;
Expand Down Expand Up @@ -115,11 +112,8 @@ static ssize_t msr_write(struct file *file, const char __user *buf,
break;
}
err = wrmsr_safe_on_cpu(cpu, reg, data[0], data[1]);
if (err) {
if (err == -EFAULT) /* Fix idiotic error code */
err = -EIO;
if (err)
break;
}
tmp += 2;
bytes += 8;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
set:
base = ((u64)high << 32) | low;
if (HYPERVISOR_set_segment_base(which, base) != 0)
ret = -EFAULT;
ret = -EIO;
break;
#endif

Expand Down

0 comments on commit 99d1b63

Please sign in to comment.