File tree 1 file changed +12
-3
lines changed
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)
343
343
static int idxd_init_evl (struct idxd_device * idxd )
344
344
{
345
345
struct device * dev = & idxd -> pdev -> dev ;
346
+ unsigned int evl_cache_size ;
346
347
struct idxd_evl * evl ;
348
+ const char * idxd_name ;
347
349
348
350
if (idxd -> hw .gen_cap .evl_support == 0 )
349
351
return 0 ;
@@ -355,9 +357,16 @@ static int idxd_init_evl(struct idxd_device *idxd)
355
357
spin_lock_init (& evl -> lock );
356
358
evl -> size = IDXD_EVL_SIZE_MIN ;
357
359
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 );
361
370
if (!idxd -> evl_cache ) {
362
371
kfree (evl );
363
372
return - ENOMEM ;
You can’t perform that action at this time.
0 commit comments