diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-12 06:43:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-12 06:43:21 -0400 |
commit | acbaa41a780490c791492c41144c774c04875af1 (patch) | |
tree | 31f1f046875eb071e2aed031e5d9d1584742314f /include/asm-x86/paravirt.h | |
parent | 8d89adf44cf750e49691ba5b744b2ad77a05e997 (diff) | |
parent | fd048088306656824958e7783ffcee27e241b361 (diff) |
Merge branch 'linus' into x86/quirks
Conflicts:
arch/x86/kernel/early-quirks.c
Diffstat (limited to 'include/asm-x86/paravirt.h')
-rw-r--r-- | include/asm-x86/paravirt.h | 67 |
1 files changed, 30 insertions, 37 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index fbbde93f12d6..d7d358a43996 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __ASM_PARAVIRT_H | 1 | #ifndef ASM_X86__PARAVIRT_H |
2 | #define __ASM_PARAVIRT_H | 2 | #define ASM_X86__PARAVIRT_H |
3 | /* Various instructions on x86 need to be replaced for | 3 | /* Various instructions on x86 need to be replaced for |
4 | * para-virtualization: those hooks are defined here. */ | 4 | * para-virtualization: those hooks are defined here. */ |
5 | 5 | ||
@@ -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 | ||
@@ -200,12 +201,6 @@ struct pv_irq_ops { | |||
200 | 201 | ||
201 | struct pv_apic_ops { | 202 | struct pv_apic_ops { |
202 | #ifdef CONFIG_X86_LOCAL_APIC | 203 | #ifdef CONFIG_X86_LOCAL_APIC |
203 | /* | ||
204 | * Direct APIC operations, principally for VMI. Ideally | ||
205 | * these shouldn't be in this interface. | ||
206 | */ | ||
207 | void (*apic_write)(unsigned long reg, u32 v); | ||
208 | u32 (*apic_read)(unsigned long reg); | ||
209 | void (*setup_boot_clock)(void); | 204 | void (*setup_boot_clock)(void); |
210 | void (*setup_secondary_clock)(void); | 205 | void (*setup_secondary_clock)(void); |
211 | 206 | ||
@@ -257,13 +252,13 @@ struct pv_mmu_ops { | |||
257 | * Hooks for allocating/releasing pagetable pages when they're | 252 | * Hooks for allocating/releasing pagetable pages when they're |
258 | * attached to a pagetable | 253 | * attached to a pagetable |
259 | */ | 254 | */ |
260 | void (*alloc_pte)(struct mm_struct *mm, u32 pfn); | 255 | void (*alloc_pte)(struct mm_struct *mm, unsigned long pfn); |
261 | void (*alloc_pmd)(struct mm_struct *mm, u32 pfn); | 256 | void (*alloc_pmd)(struct mm_struct *mm, unsigned long pfn); |
262 | void (*alloc_pmd_clone)(u32 pfn, u32 clonepfn, u32 start, u32 count); | 257 | void (*alloc_pmd_clone)(unsigned long pfn, unsigned long clonepfn, unsigned long start, unsigned long count); |
263 | void (*alloc_pud)(struct mm_struct *mm, u32 pfn); | 258 | void (*alloc_pud)(struct mm_struct *mm, unsigned long pfn); |
264 | void (*release_pte)(u32 pfn); | 259 | void (*release_pte)(unsigned long pfn); |
265 | void (*release_pmd)(u32 pfn); | 260 | void (*release_pmd)(unsigned long pfn); |
266 | void (*release_pud)(u32 pfn); | 261 | void (*release_pud)(unsigned long pfn); |
267 | 262 | ||
268 | /* Pagetable manipulation functions */ | 263 | /* Pagetable manipulation functions */ |
269 | void (*set_pte)(pte_t *ptep, pte_t pteval); | 264 | void (*set_pte)(pte_t *ptep, pte_t pteval); |
@@ -726,6 +721,10 @@ static inline u64 paravirt_read_msr(unsigned msr, int *err) | |||
726 | { | 721 | { |
727 | return PVOP_CALL2(u64, pv_cpu_ops.read_msr, msr, err); | 722 | return PVOP_CALL2(u64, pv_cpu_ops.read_msr, msr, err); |
728 | } | 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 | } | ||
729 | 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) |
730 | { | 729 | { |
731 | 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); |
@@ -771,6 +770,13 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p) | |||
771 | *p = paravirt_read_msr(msr, &err); | 770 | *p = paravirt_read_msr(msr, &err); |
772 | return err; | 771 | return err; |
773 | } | 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 | } | ||
774 | 780 | ||
775 | static inline u64 paravirt_read_tsc(void) | 781 | static inline u64 paravirt_read_tsc(void) |
776 | { | 782 | { |
@@ -898,19 +904,6 @@ static inline void slow_down_io(void) | |||
898 | } | 904 | } |
899 | 905 | ||
900 | #ifdef CONFIG_X86_LOCAL_APIC | 906 | #ifdef CONFIG_X86_LOCAL_APIC |
901 | /* | ||
902 | * Basic functions accessing APICs. | ||
903 | */ | ||
904 | static inline void apic_write(unsigned long reg, u32 v) | ||
905 | { | ||
906 | PVOP_VCALL2(pv_apic_ops.apic_write, reg, v); | ||
907 | } | ||
908 | |||
909 | static inline u32 apic_read(unsigned long reg) | ||
910 | { | ||
911 | return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg); | ||
912 | } | ||
913 | |||
914 | static inline void setup_boot_clock(void) | 907 | static inline void setup_boot_clock(void) |
915 | { | 908 | { |
916 | PVOP_VCALL0(pv_apic_ops.setup_boot_clock); | 909 | PVOP_VCALL0(pv_apic_ops.setup_boot_clock); |
@@ -993,35 +986,35 @@ static inline void paravirt_pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
993 | PVOP_VCALL2(pv_mmu_ops.pgd_free, mm, pgd); | 986 | PVOP_VCALL2(pv_mmu_ops.pgd_free, mm, pgd); |
994 | } | 987 | } |
995 | 988 | ||
996 | static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned pfn) | 989 | static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned long pfn) |
997 | { | 990 | { |
998 | PVOP_VCALL2(pv_mmu_ops.alloc_pte, mm, pfn); | 991 | PVOP_VCALL2(pv_mmu_ops.alloc_pte, mm, pfn); |
999 | } | 992 | } |
1000 | static inline void paravirt_release_pte(unsigned pfn) | 993 | static inline void paravirt_release_pte(unsigned long pfn) |
1001 | { | 994 | { |
1002 | PVOP_VCALL1(pv_mmu_ops.release_pte, pfn); | 995 | PVOP_VCALL1(pv_mmu_ops.release_pte, pfn); |
1003 | } | 996 | } |
1004 | 997 | ||
1005 | static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned pfn) | 998 | static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned long pfn) |
1006 | { | 999 | { |
1007 | PVOP_VCALL2(pv_mmu_ops.alloc_pmd, mm, pfn); | 1000 | PVOP_VCALL2(pv_mmu_ops.alloc_pmd, mm, pfn); |
1008 | } | 1001 | } |
1009 | 1002 | ||
1010 | static inline void paravirt_alloc_pmd_clone(unsigned pfn, unsigned clonepfn, | 1003 | static inline void paravirt_alloc_pmd_clone(unsigned long pfn, unsigned long clonepfn, |
1011 | unsigned start, unsigned count) | 1004 | unsigned long start, unsigned long count) |
1012 | { | 1005 | { |
1013 | PVOP_VCALL4(pv_mmu_ops.alloc_pmd_clone, pfn, clonepfn, start, count); | 1006 | PVOP_VCALL4(pv_mmu_ops.alloc_pmd_clone, pfn, clonepfn, start, count); |
1014 | } | 1007 | } |
1015 | static inline void paravirt_release_pmd(unsigned pfn) | 1008 | static inline void paravirt_release_pmd(unsigned long pfn) |
1016 | { | 1009 | { |
1017 | PVOP_VCALL1(pv_mmu_ops.release_pmd, pfn); | 1010 | PVOP_VCALL1(pv_mmu_ops.release_pmd, pfn); |
1018 | } | 1011 | } |
1019 | 1012 | ||
1020 | static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned pfn) | 1013 | static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned long pfn) |
1021 | { | 1014 | { |
1022 | PVOP_VCALL2(pv_mmu_ops.alloc_pud, mm, pfn); | 1015 | PVOP_VCALL2(pv_mmu_ops.alloc_pud, mm, pfn); |
1023 | } | 1016 | } |
1024 | static inline void paravirt_release_pud(unsigned pfn) | 1017 | static inline void paravirt_release_pud(unsigned long pfn) |
1025 | { | 1018 | { |
1026 | PVOP_VCALL1(pv_mmu_ops.release_pud, pfn); | 1019 | PVOP_VCALL1(pv_mmu_ops.release_pud, pfn); |
1027 | } | 1020 | } |
@@ -1634,4 +1627,4 @@ static inline unsigned long __raw_local_irq_save(void) | |||
1634 | 1627 | ||
1635 | #endif /* __ASSEMBLY__ */ | 1628 | #endif /* __ASSEMBLY__ */ |
1636 | #endif /* CONFIG_PARAVIRT */ | 1629 | #endif /* CONFIG_PARAVIRT */ |
1637 | #endif /* __ASM_PARAVIRT_H */ | 1630 | #endif /* ASM_X86__PARAVIRT_H */ |