diff options
author | Russ Anderson <rja@sgi.com> | 2008-11-05 23:13:44 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-11-05 23:30:20 -0500 |
commit | e8929c8a6acbecbd629b8e3f2d1a2546ec4ebdfc (patch) | |
tree | aa6d3ed8f4624a59c34be3b0c93f52bd0bc40016 | |
parent | 64ccf2f9a70a06ba56cd8cedfa610b4e77181587 (diff) |
x86: uv: Add UV memory protection bios call
Add UV bios call to change memory protections.
Signed-off-by: Russ Anderson <rja@sgi.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/include/asm/uv/bios.h | 10 | ||||
-rw-r--r-- | arch/x86/kernel/bios_uv.c | 8 |
2 files changed, 17 insertions, 1 deletions
diff --git a/arch/x86/include/asm/uv/bios.h b/arch/x86/include/asm/uv/bios.h index 58105c5b0b4e..a301a56d4157 100644 --- a/arch/x86/include/asm/uv/bios.h +++ b/arch/x86/include/asm/uv/bios.h | |||
@@ -34,7 +34,8 @@ enum uv_bios_cmd { | |||
34 | UV_BIOS_GET_SN_INFO, | 34 | UV_BIOS_GET_SN_INFO, |
35 | UV_BIOS_FREQ_BASE, | 35 | UV_BIOS_FREQ_BASE, |
36 | UV_BIOS_WATCHLIST_ALLOC, | 36 | UV_BIOS_WATCHLIST_ALLOC, |
37 | UV_BIOS_WATCHLIST_FREE | 37 | UV_BIOS_WATCHLIST_FREE, |
38 | UV_BIOS_MEMPROTECT | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | /* | 41 | /* |
@@ -82,6 +83,12 @@ union uv_watchlist_u { | |||
82 | }; | 83 | }; |
83 | }; | 84 | }; |
84 | 85 | ||
86 | enum uv_memprotect { | ||
87 | UV_MEMPROT_RESTRICT_ACCESS, | ||
88 | UV_MEMPROT_ALLOW_AMO, | ||
89 | UV_MEMPROT_ALLOW_RW | ||
90 | }; | ||
91 | |||
85 | /* | 92 | /* |
86 | * bios calls have 6 parameters | 93 | * bios calls have 6 parameters |
87 | */ | 94 | */ |
@@ -94,6 +101,7 @@ extern s64 uv_bios_freq_base(u64, u64 *); | |||
94 | extern int uv_bios_mq_watchlist_alloc(int, void *, unsigned int, | 101 | extern int uv_bios_mq_watchlist_alloc(int, void *, unsigned int, |
95 | unsigned long *); | 102 | unsigned long *); |
96 | extern int uv_bios_mq_watchlist_free(int, int); | 103 | extern int uv_bios_mq_watchlist_free(int, int); |
104 | extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect); | ||
97 | 105 | ||
98 | extern void uv_bios_init(void); | 106 | extern void uv_bios_init(void); |
99 | 107 | ||
diff --git a/arch/x86/kernel/bios_uv.c b/arch/x86/kernel/bios_uv.c index 4c02b2799216..7cf6fc3d1c10 100644 --- a/arch/x86/kernel/bios_uv.c +++ b/arch/x86/kernel/bios_uv.c | |||
@@ -134,6 +134,14 @@ uv_bios_mq_watchlist_free(int blade, int watchlist_num) | |||
134 | } | 134 | } |
135 | EXPORT_SYMBOL_GPL(uv_bios_mq_watchlist_free); | 135 | EXPORT_SYMBOL_GPL(uv_bios_mq_watchlist_free); |
136 | 136 | ||
137 | s64 | ||
138 | uv_bios_change_memprotect(u64 paddr, u64 len, enum uv_memprotect perms) | ||
139 | { | ||
140 | return uv_bios_call_irqsave(UV_BIOS_MEMPROTECT, paddr, len, | ||
141 | perms, 0, 0); | ||
142 | } | ||
143 | EXPORT_SYMBOL_GPL(uv_bios_change_memprotect); | ||
144 | |||
137 | s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second) | 145 | s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second) |
138 | { | 146 | { |
139 | return uv_bios_call(UV_BIOS_FREQ_BASE, clock_type, | 147 | return uv_bios_call(UV_BIOS_FREQ_BASE, clock_type, |