@@ -170,11 +170,6 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,
170
170
if (!IS_DGFX (xe )) {
171
171
/* Write out batch too */
172
172
m -> batch_base_ofs = NUM_PT_SLOTS * XE_PAGE_SIZE ;
173
- if (xe -> info .has_usm ) {
174
- batch = tile -> primary_gt -> usm .bb_pool -> bo ;
175
- m -> usm_batch_base_ofs = m -> batch_base_ofs ;
176
- }
177
-
178
173
for (i = 0 ; i < batch -> size ;
179
174
i += vm -> flags & XE_VM_FLAG_64K ? XE_64K_PAGE_SIZE :
180
175
XE_PAGE_SIZE ) {
@@ -185,6 +180,24 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,
185
180
entry );
186
181
level ++ ;
187
182
}
183
+ if (xe -> info .has_usm ) {
184
+ xe_tile_assert (tile , batch -> size == SZ_1M );
185
+
186
+ batch = tile -> primary_gt -> usm .bb_pool -> bo ;
187
+ m -> usm_batch_base_ofs = m -> batch_base_ofs + SZ_1M ;
188
+ xe_tile_assert (tile , batch -> size == SZ_512K );
189
+
190
+ for (i = 0 ; i < batch -> size ;
191
+ i += vm -> flags & XE_VM_FLAG_64K ? XE_64K_PAGE_SIZE :
192
+ XE_PAGE_SIZE ) {
193
+ entry = vm -> pt_ops -> pte_encode_bo (batch , i ,
194
+ pat_index , 0 );
195
+
196
+ xe_map_wr (xe , & bo -> vmap , map_ofs + level * 8 , u64 ,
197
+ entry );
198
+ level ++ ;
199
+ }
200
+ }
188
201
} else {
189
202
u64 batch_addr = xe_bo_addr (batch , 0 , XE_PAGE_SIZE );
190
203
0 commit comments