diff options
Diffstat (limited to 'include/asm-x86/paravirt.h')
-rw-r--r-- | include/asm-x86/paravirt.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index ff9a7e4bc3f6..cba612c89e06 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -137,6 +137,7 @@ struct pv_cpu_ops { | |||
137 | 137 | ||
138 | /* MSR, PMC and TSR operations. | 138 | /* MSR, PMC and TSR operations. |
139 | err = 0/-EFAULT. wrmsr returns 0/-EFAULT. */ | 139 | err = 0/-EFAULT. wrmsr returns 0/-EFAULT. */ |
140 | u64 (*read_msr_amd)(unsigned int msr, int *err); | ||
140 | u64 (*read_msr)(unsigned int msr, int *err); | 141 | u64 (*read_msr)(unsigned int msr, int *err); |
141 | int (*write_msr)(unsigned int msr, unsigned low, unsigned high); | 142 | int (*write_msr)(unsigned int msr, unsigned low, unsigned high); |
142 | 143 | ||
@@ -720,6 +721,10 @@ static inline u64 paravirt_read_msr(unsigned msr, int *err) | |||
720 | { | 721 | { |
721 | return PVOP_CALL2(u64, pv_cpu_ops.read_msr, msr, err); | 722 | return PVOP_CALL2(u64, pv_cpu_ops.read_msr, msr, err); |
722 | } | 723 | } |
724 | static inline u64 paravirt_read_msr_amd(unsigned msr, int *err) | ||
725 | { | ||
726 | return PVOP_CALL2(u64, pv_cpu_ops.read_msr_amd, msr, err); | ||
727 | } | ||
723 | static inline int paravirt_write_msr(unsigned msr, unsigned low, unsigned high) | 728 | static inline int paravirt_write_msr(unsigned msr, unsigned low, unsigned high) |
724 | { | 729 | { |
725 | return PVOP_CALL3(int, pv_cpu_ops.write_msr, msr, low, high); | 730 | return PVOP_CALL3(int, pv_cpu_ops.write_msr, msr, low, high); |
@@ -765,6 +770,13 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p) | |||
765 | *p = paravirt_read_msr(msr, &err); | 770 | *p = paravirt_read_msr(msr, &err); |
766 | return err; | 771 | return err; |
767 | } | 772 | } |
773 | static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p) | ||
774 | { | ||
775 | int err; | ||
776 | |||
777 | *p = paravirt_read_msr_amd(msr, &err); | ||
778 | return err; | ||
779 | } | ||
768 | 780 | ||
769 | static inline u64 paravirt_read_tsc(void) | 781 | static inline u64 paravirt_read_tsc(void) |
770 | { | 782 | { |