File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,9 @@ static void idxd_cleanup_internals(struct idxd_device *idxd)
343343static int idxd_init_evl (struct idxd_device * idxd )
344344{
345345 struct device * dev = & idxd -> pdev -> dev ;
346+ unsigned int evl_cache_size ;
346347 struct idxd_evl * evl ;
348+ const char * idxd_name ;
347349
348350 if (idxd -> hw .gen_cap .evl_support == 0 )
349351 return 0 ;
@@ -355,9 +357,16 @@ static int idxd_init_evl(struct idxd_device *idxd)
355357 spin_lock_init (& evl -> lock );
356358 evl -> size = IDXD_EVL_SIZE_MIN ;
357359
358- idxd -> evl_cache = kmem_cache_create (dev_name (idxd_confdev (idxd )),
359- sizeof (struct idxd_evl_fault ) + evl_ent_size (idxd ),
360- 0 , 0 , NULL );
360+ idxd_name = dev_name (idxd_confdev (idxd ));
361+ evl_cache_size = sizeof (struct idxd_evl_fault ) + evl_ent_size (idxd );
362+ /*
363+ * Since completion record in evl_cache will be copied to user
364+ * when handling completion record page fault, need to create
365+ * the cache suitable for user copy.
366+ */
367+ idxd -> evl_cache = kmem_cache_create_usercopy (idxd_name , evl_cache_size ,
368+ 0 , 0 , 0 , evl_cache_size ,
369+ NULL );
361370 if (!idxd -> evl_cache ) {
362371 kfree (evl );
363372 return - ENOMEM ;
You can’t perform that action at this time.
0 commit comments