diff options
Diffstat (limited to 'arch/sparc64/mm/tsb.c')
-rw-r--r-- | arch/sparc64/mm/tsb.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/arch/sparc64/mm/tsb.c b/arch/sparc64/mm/tsb.c index 2cc8e6528c63..6ae2a5a702cb 100644 --- a/arch/sparc64/mm/tsb.c +++ b/arch/sparc64/mm/tsb.c | |||
@@ -149,7 +149,7 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_bytes) | |||
149 | BUG(); | 149 | BUG(); |
150 | }; | 150 | }; |
151 | 151 | ||
152 | if (tlb_type == cheetah_plus) { | 152 | if (tlb_type == cheetah_plus || tlb_type == hypervisor) { |
153 | /* Physical mapping, no locked TLB entry for TSB. */ | 153 | /* Physical mapping, no locked TLB entry for TSB. */ |
154 | tsb_reg |= tsb_paddr; | 154 | tsb_reg |= tsb_paddr; |
155 | 155 | ||
@@ -166,6 +166,52 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_bytes) | |||
166 | mm->context.tsb_map_pte = tte; | 166 | mm->context.tsb_map_pte = tte; |
167 | } | 167 | } |
168 | 168 | ||
169 | /* Setup the Hypervisor TSB descriptor. */ | ||
170 | if (tlb_type == hypervisor) { | ||
171 | struct hv_tsb_descr *hp = &mm->context.tsb_descr; | ||
172 | |||
173 | switch (PAGE_SIZE) { | ||
174 | case 8192: | ||
175 | default: | ||
176 | hp->pgsz_idx = HV_PGSZ_IDX_8K; | ||
177 | break; | ||
178 | |||
179 | case 64 * 1024: | ||
180 | hp->pgsz_idx = HV_PGSZ_IDX_64K; | ||
181 | break; | ||
182 | |||
183 | case 512 * 1024: | ||
184 | hp->pgsz_idx = HV_PGSZ_IDX_512K; | ||
185 | break; | ||
186 | |||
187 | case 4 * 1024 * 1024: | ||
188 | hp->pgsz_idx = HV_PGSZ_IDX_4MB; | ||
189 | break; | ||
190 | }; | ||
191 | hp->assoc = 1; | ||
192 | hp->num_ttes = tsb_bytes / 16; | ||
193 | hp->ctx_idx = 0; | ||
194 | switch (PAGE_SIZE) { | ||
195 | case 8192: | ||
196 | default: | ||
197 | hp->pgsz_mask = HV_PGSZ_MASK_8K; | ||
198 | break; | ||
199 | |||
200 | case 64 * 1024: | ||
201 | hp->pgsz_mask = HV_PGSZ_MASK_64K; | ||
202 | break; | ||
203 | |||
204 | case 512 * 1024: | ||
205 | hp->pgsz_mask = HV_PGSZ_MASK_512K; | ||
206 | break; | ||
207 | |||
208 | case 4 * 1024 * 1024: | ||
209 | hp->pgsz_mask = HV_PGSZ_MASK_4MB; | ||
210 | break; | ||
211 | }; | ||
212 | hp->tsb_base = tsb_paddr; | ||
213 | hp->resv = 0; | ||
214 | } | ||
169 | } | 215 | } |
170 | 216 | ||
171 | /* The page tables are locked against modifications while this | 217 | /* The page tables are locked against modifications while this |