Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen remove xengnt_grant_transfer() and xengnt_revok...



details:   https://anonhg.NetBSD.org/src/rev/d4fcd373144f
branches:  trunk
changeset: 1008915:d4fcd373144f
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Apr 05 17:48:30 2020 +0000

description:
remove xengnt_grant_transfer() and xengnt_revoke_transfer(), nothing
uses it any more

diffstat:

 sys/arch/xen/include/granttables.h |   8 +----
 sys/arch/xen/xen/xengnt.c          |  57 +------------------------------------
 2 files changed, 3 insertions(+), 62 deletions(-)

diffs (100 lines):

diff -r c74cadf253a9 -r d4fcd373144f sys/arch/xen/include/granttables.h
--- a/sys/arch/xen/include/granttables.h        Sun Apr 05 17:45:19 2020 +0000
+++ b/sys/arch/xen/include/granttables.h        Sun Apr 05 17:48:30 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: granttables.h,v 1.10 2019/02/02 12:32:55 cherry Exp $ */
+/* $NetBSD: granttables.h,v 1.11 2020/04/05 17:48:30 jdolecek Exp $ */
 /*
  * Copyright (c) 2006 Manuel Bouyer.
  *
@@ -46,12 +46,6 @@
  */
 void xengnt_revoke_access(grant_ref_t);
 
-/* allow a page transfer from a remote domain */
-int xengnt_grant_transfer(domid_t, grant_ref_t *);
-
-/* end transfer, return the new page address or 0 */
-paddr_t xengnt_revoke_transfer(grant_ref_t);
-
 /*
  * Query grant status (i.e. if remote has a valid mapping to this grant).
  * Returns GTF_reading | GTF_writing (0 if remote does not use it anymore).
diff -r c74cadf253a9 -r d4fcd373144f sys/arch/xen/xen/xengnt.c
--- a/sys/arch/xen/xen/xengnt.c Sun Apr 05 17:45:19 2020 +0000
+++ b/sys/arch/xen/xen/xengnt.c Sun Apr 05 17:48:30 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xengnt.c,v 1.27 2019/11/10 21:16:34 chs Exp $      */
+/*      $NetBSD: xengnt.c,v 1.28 2020/04/05 17:48:30 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.27 2019/11/10 21:16:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.28 2020/04/05 17:48:30 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -331,59 +331,6 @@
 }
 
 int
-xengnt_grant_transfer(domid_t dom, grant_ref_t *entryp)
-{
-       mutex_enter(&grant_lock);
-
-       *entryp = xengnt_get_entry();
-       if (__predict_false(*entryp == XENGNT_NO_ENTRY)) {
-               mutex_exit(&grant_lock);
-               return ENOMEM;
-       }
-
-       grant_table[*entryp].frame = 0;
-       grant_table[*entryp].domid = dom;
-       /*
-        * ensure that the above values reach global visibility 
-        * before permitting frame's transfer (done when we set flags)
-        */
-       xen_rmb();
-       grant_table[*entryp].flags = GTF_accept_transfer;
-       mutex_exit(&grant_lock);
-       return 0;
-}
-
-paddr_t
-xengnt_revoke_transfer(grant_ref_t entry)
-{
-       paddr_t page;
-       uint16_t flags;
-
-       /* if the transfer has not started, free the entry and return 0 */
-       while (!((flags = grant_table[entry].flags) & GTF_transfer_committed)) {
-               if (xen_atomic_cmpxchg16(&grant_table[entry].flags,
-                   flags, 0) == flags ) {
-                       xengnt_free_entry(entry);
-                       return 0;
-               }
-               HYPERVISOR_yield();
-       }
-
-       /* If transfer in progress, wait for completion */
-       while (!((flags = grant_table[entry].flags) & GTF_transfer_completed))
-               HYPERVISOR_yield();
-
-       /* Read the frame number /after/ reading completion status. */
-       __insn_barrier();
-       page = grant_table[entry].frame;
-       if (page == 0)
-               printf("xengnt_revoke_transfer: guest sent pa 0\n");
-
-       xengnt_free_entry(entry);
-       return page;
-}
-
-int
 xengnt_status(grant_ref_t entry)
 {
        return (grant_table[entry].flags & (GTF_reading|GTF_writing));



Home | Main Index | Thread Index | Old Index