Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen need to set the version on resume same as d...



details:   https://anonhg.NetBSD.org/src/rev/28a734259b72
branches:  trunk
changeset: 932679:28a734259b72
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed May 13 16:13:14 2020 +0000

description:
need to set the version on resume same as during initialization

part of PR port-xen/55207

diffstat:

 sys/arch/xen/xen/xengnt.c |  19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diffs (56 lines):

diff -r 98e2434c7cd1 -r 28a734259b72 sys/arch/xen/xen/xengnt.c
--- a/sys/arch/xen/xen/xengnt.c Wed May 13 14:54:39 2020 +0000
+++ b/sys/arch/xen/xen/xengnt.c Wed May 13 16:13:14 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xengnt.c,v 1.37 2020/04/25 15:26:18 bouyer Exp $      */
+/*      $NetBSD: xengnt.c,v 1.38 2020/05/13 16:13:14 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.37 2020/04/25 15:26:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.38 2020/05/13 16:13:14 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -102,13 +102,6 @@
         */
        gnt_nr_grant_frames = gnt_max_grant_frames;
 
-
-       struct gnttab_set_version gntversion;
-       gntversion.version = 2;
-       rc = HYPERVISOR_grant_table_op(GNTTABOP_set_version, &gntversion, 1);
-       if (rc < 0 || gntversion.version != 2)
-               panic("GNTTABOP_set_version 2 failed %d", rc);
-
        nr_grant_entries =
            gnt_max_grant_frames * NR_GRANT_ENTRIES_PER_PAGE;
 
@@ -132,7 +125,6 @@
        mutex_init(&grant_lock, MUTEX_DEFAULT, IPL_VM);
 
        xengnt_resume();
-
 }
 
 /*
@@ -141,8 +133,15 @@
 bool
 xengnt_resume(void)
 {
+       int rc;
        int previous_nr_grant_frames = gnt_nr_grant_frames;
 
+       struct gnttab_set_version gntversion;
+       gntversion.version = 2;
+       rc = HYPERVISOR_grant_table_op(GNTTABOP_set_version, &gntversion, 1);
+       if (rc < 0 || gntversion.version != 2)
+               panic("GNTTABOP_set_version 2 failed %d", rc);
+
        last_gnt_entry = 0;
        gnt_nr_grant_frames = 0;
 



Home | Main Index | Thread Index | Old Index