@@ -109,7 +109,7 @@ struct gnttab_ops {
109
109
void (* unmap_frames )(void );
110
110
/*
111
111
* Introducing a valid entry into the grant table, granting the frame of
112
- * this grant entry to domain for accessing or transfering . Ref
112
+ * this grant entry to domain for accessing. Ref
113
113
* parameter is reference of this introduced grant entry, domid is id of
114
114
* granted domain, frame is the page frame to be granted, and flags is
115
115
* status of the grant entry to be updated.
@@ -125,14 +125,6 @@ struct gnttab_ops {
125
125
* access for this entry and return success(==1).
126
126
*/
127
127
int (* end_foreign_access_ref )(grant_ref_t ref , int readonly );
128
- /*
129
- * Stop granting a grant entry to domain for transfer. Ref parameter is
130
- * reference of a grant entry whose grant transfer will be stopped. If
131
- * tranfer has not started, just reclaim the grant entry and return
132
- * failure(==0). Otherwise, wait for the transfer to complete and then
133
- * return the frame.
134
- */
135
- unsigned long (* end_foreign_transfer_ref )(grant_ref_t ref );
136
128
/*
137
129
* Read the frame number related to a given grant reference.
138
130
*/
@@ -230,10 +222,7 @@ static void put_free_entry(grant_ref_t ref)
230
222
* Following applies to gnttab_update_entry_v1 and gnttab_update_entry_v2.
231
223
* Introducing a valid entry into the grant table:
232
224
* 1. Write ent->domid.
233
- * 2. Write ent->frame:
234
- * GTF_permit_access: Frame to which access is permitted.
235
- * GTF_accept_transfer: Pseudo-phys frame slot being filled by new
236
- * frame, or zero if none.
225
+ * 2. Write ent->frame: Frame to which access is permitted.
237
226
* 3. Write memory barrier (WMB).
238
227
* 4. Write ent->flags, inc. valid type.
239
228
*/
@@ -455,102 +444,6 @@ void gnttab_end_foreign_access(grant_ref_t ref, int readonly,
455
444
}
456
445
EXPORT_SYMBOL_GPL (gnttab_end_foreign_access );
457
446
458
- int gnttab_grant_foreign_transfer (domid_t domid , unsigned long pfn )
459
- {
460
- int ref ;
461
-
462
- ref = get_free_entries (1 );
463
- if (unlikely (ref < 0 ))
464
- return - ENOSPC ;
465
- gnttab_grant_foreign_transfer_ref (ref , domid , pfn );
466
-
467
- return ref ;
468
- }
469
- EXPORT_SYMBOL_GPL (gnttab_grant_foreign_transfer );
470
-
471
- void gnttab_grant_foreign_transfer_ref (grant_ref_t ref , domid_t domid ,
472
- unsigned long pfn )
473
- {
474
- gnttab_interface -> update_entry (ref , domid , pfn , GTF_accept_transfer );
475
- }
476
- EXPORT_SYMBOL_GPL (gnttab_grant_foreign_transfer_ref );
477
-
478
- static unsigned long gnttab_end_foreign_transfer_ref_v1 (grant_ref_t ref )
479
- {
480
- unsigned long frame ;
481
- u16 flags ;
482
- u16 * pflags ;
483
-
484
- pflags = & gnttab_shared .v1 [ref ].flags ;
485
-
486
- /*
487
- * If a transfer is not even yet started, try to reclaim the grant
488
- * reference and return failure (== 0).
489
- */
490
- while (!((flags = * pflags ) & GTF_transfer_committed )) {
491
- if (sync_cmpxchg (pflags , flags , 0 ) == flags )
492
- return 0 ;
493
- cpu_relax ();
494
- }
495
-
496
- /* If a transfer is in progress then wait until it is completed. */
497
- while (!(flags & GTF_transfer_completed )) {
498
- flags = * pflags ;
499
- cpu_relax ();
500
- }
501
-
502
- rmb (); /* Read the frame number /after/ reading completion status. */
503
- frame = gnttab_shared .v1 [ref ].frame ;
504
- BUG_ON (frame == 0 );
505
-
506
- return frame ;
507
- }
508
-
509
- static unsigned long gnttab_end_foreign_transfer_ref_v2 (grant_ref_t ref )
510
- {
511
- unsigned long frame ;
512
- u16 flags ;
513
- u16 * pflags ;
514
-
515
- pflags = & gnttab_shared .v2 [ref ].hdr .flags ;
516
-
517
- /*
518
- * If a transfer is not even yet started, try to reclaim the grant
519
- * reference and return failure (== 0).
520
- */
521
- while (!((flags = * pflags ) & GTF_transfer_committed )) {
522
- if (sync_cmpxchg (pflags , flags , 0 ) == flags )
523
- return 0 ;
524
- cpu_relax ();
525
- }
526
-
527
- /* If a transfer is in progress then wait until it is completed. */
528
- while (!(flags & GTF_transfer_completed )) {
529
- flags = * pflags ;
530
- cpu_relax ();
531
- }
532
-
533
- rmb (); /* Read the frame number /after/ reading completion status. */
534
- frame = gnttab_shared .v2 [ref ].full_page .frame ;
535
- BUG_ON (frame == 0 );
536
-
537
- return frame ;
538
- }
539
-
540
- unsigned long gnttab_end_foreign_transfer_ref (grant_ref_t ref )
541
- {
542
- return gnttab_interface -> end_foreign_transfer_ref (ref );
543
- }
544
- EXPORT_SYMBOL_GPL (gnttab_end_foreign_transfer_ref );
545
-
546
- unsigned long gnttab_end_foreign_transfer (grant_ref_t ref )
547
- {
548
- unsigned long frame = gnttab_end_foreign_transfer_ref (ref );
549
- put_free_entry (ref );
550
- return frame ;
551
- }
552
- EXPORT_SYMBOL_GPL (gnttab_end_foreign_transfer );
553
-
554
447
void gnttab_free_grant_reference (grant_ref_t ref )
555
448
{
556
449
put_free_entry (ref );
@@ -1423,7 +1316,6 @@ static const struct gnttab_ops gnttab_v1_ops = {
1423
1316
.unmap_frames = gnttab_unmap_frames_v1 ,
1424
1317
.update_entry = gnttab_update_entry_v1 ,
1425
1318
.end_foreign_access_ref = gnttab_end_foreign_access_ref_v1 ,
1426
- .end_foreign_transfer_ref = gnttab_end_foreign_transfer_ref_v1 ,
1427
1319
.read_frame = gnttab_read_frame_v1 ,
1428
1320
};
1429
1321
@@ -1435,7 +1327,6 @@ static const struct gnttab_ops gnttab_v2_ops = {
1435
1327
.unmap_frames = gnttab_unmap_frames_v2 ,
1436
1328
.update_entry = gnttab_update_entry_v2 ,
1437
1329
.end_foreign_access_ref = gnttab_end_foreign_access_ref_v2 ,
1438
- .end_foreign_transfer_ref = gnttab_end_foreign_transfer_ref_v2 ,
1439
1330
.read_frame = gnttab_read_frame_v2 ,
1440
1331
};
1441
1332
0 commit comments