@@ -104,16 +104,6 @@ struct spinlock;
104104/* Maximum possible number of NPUs in a system. */
105105#define NV_MAX_NPUS 8
106106
107- /*
108- * One bit per slice. We have lower slices which cover 256MB segments
109- * upto 4G range. That gets us 16 low slices. For the rest we track slices
110- * in 1TB size.
111- */
112- struct slice_mask {
113- u64 low_slices ;
114- DECLARE_BITMAP (high_slices , SLICE_NUM_HIGH );
115- };
116-
117107typedef struct {
118108 union {
119109 /*
@@ -127,7 +117,6 @@ typedef struct {
127117 mm_context_id_t id ;
128118 mm_context_id_t extended_id [TASK_SIZE_USER64 /TASK_CONTEXT_SIZE ];
129119 };
130- u16 user_psize ; /* page size index */
131120
132121 /* Number of bits in the mm_cpumask */
133122 atomic_t active_cpus ;
@@ -137,23 +126,9 @@ typedef struct {
137126
138127 /* NPU NMMU context */
139128 struct npu_context * npu_context ;
129+ struct hash_mm_context * hash_context ;
140130
141- /* SLB page size encodings*/
142- unsigned char low_slices_psize [LOW_SLICE_ARRAY_SZ ];
143- unsigned char high_slices_psize [SLICE_ARRAY_SIZE ];
144- unsigned long slb_addr_limit ;
145- # ifdef CONFIG_PPC_64K_PAGES
146- struct slice_mask mask_64k ;
147- # endif
148- struct slice_mask mask_4k ;
149- # ifdef CONFIG_HUGETLB_PAGE
150- struct slice_mask mask_16m ;
151- struct slice_mask mask_16g ;
152- # endif
153131 unsigned long vdso_base ;
154- #ifdef CONFIG_PPC_SUBPAGE_PROT
155- struct subpage_prot_table spt ;
156- #endif /* CONFIG_PPC_SUBPAGE_PROT */
157132 /*
158133 * pagetable fragment support
159134 */
@@ -176,62 +151,62 @@ typedef struct {
176151
177152static inline u16 mm_ctx_user_psize (mm_context_t * ctx )
178153{
179- return ctx -> user_psize ;
154+ return ctx -> hash_context -> user_psize ;
180155}
181156
182157static inline void mm_ctx_set_user_psize (mm_context_t * ctx , u16 user_psize )
183158{
184- ctx -> user_psize = user_psize ;
159+ ctx -> hash_context -> user_psize = user_psize ;
185160}
186161
187162static inline unsigned char * mm_ctx_low_slices (mm_context_t * ctx )
188163{
189- return ctx -> low_slices_psize ;
164+ return ctx -> hash_context -> low_slices_psize ;
190165}
191166
192167static inline unsigned char * mm_ctx_high_slices (mm_context_t * ctx )
193168{
194- return ctx -> high_slices_psize ;
169+ return ctx -> hash_context -> high_slices_psize ;
195170}
196171
197172static inline unsigned long mm_ctx_slb_addr_limit (mm_context_t * ctx )
198173{
199- return ctx -> slb_addr_limit ;
174+ return ctx -> hash_context -> slb_addr_limit ;
200175}
201176
202177static inline void mm_ctx_set_slb_addr_limit (mm_context_t * ctx , unsigned long limit )
203178{
204- ctx -> slb_addr_limit = limit ;
179+ ctx -> hash_context -> slb_addr_limit = limit ;
205180}
206181
207182#ifdef CONFIG_PPC_64K_PAGES
208183static inline struct slice_mask * mm_ctx_slice_mask_64k (mm_context_t * ctx )
209184{
210- return & ctx -> mask_64k ;
185+ return & ctx -> hash_context -> mask_64k ;
211186}
212187#endif
213188
214189static inline struct slice_mask * mm_ctx_slice_mask_4k (mm_context_t * ctx )
215190{
216- return & ctx -> mask_4k ;
191+ return & ctx -> hash_context -> mask_4k ;
217192}
218193
219194#ifdef CONFIG_HUGETLB_PAGE
220195static inline struct slice_mask * mm_ctx_slice_mask_16m (mm_context_t * ctx )
221196{
222- return & ctx -> mask_16m ;
197+ return & ctx -> hash_context -> mask_16m ;
223198}
224199
225200static inline struct slice_mask * mm_ctx_slice_mask_16g (mm_context_t * ctx )
226201{
227- return & ctx -> mask_16g ;
202+ return & ctx -> hash_context -> mask_16g ;
228203}
229204#endif
230205
231206#ifdef CONFIG_PPC_SUBPAGE_PROT
232207static inline struct subpage_prot_table * mm_ctx_subpage_prot (mm_context_t * ctx )
233208{
234- return & ctx -> spt ;
209+ return & ctx -> hash_context -> spt ;
235210}
236211#endif
237212
0 commit comments