Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 two more files to convert to newer HYPERVIS...



details:   https://anonhg.NetBSD.org/src/rev/54a6d39e4b63
branches:  trunk
changeset: 971331:54a6d39e4b63
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Apr 21 20:20:39 2020 +0000

description:
two more files to convert to newer HYPERVISOR_physdev_op() interface

diffstat:

 sys/arch/x86/x86/bus_space.c   |  12 ++++++------
 sys/arch/x86/x86/sys_machdep.c |  11 +++++------
 2 files changed, 11 insertions(+), 12 deletions(-)

diffs (71 lines):

diff -r 05d9a785581e -r 54a6d39e4b63 sys/arch/x86/x86/bus_space.c
--- a/sys/arch/x86/x86/bus_space.c      Tue Apr 21 20:13:39 2020 +0000
+++ b/sys/arch/x86/x86/bus_space.c      Tue Apr 21 20:20:39 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_space.c,v 1.43 2019/12/03 04:57:25 riastradh Exp $ */
+/*     $NetBSD: bus_space.c,v 1.44 2020/04/21 20:20:39 jdolecek Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.43 2019/12/03 04:57:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.44 2020/04/21 20:20:39 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -136,10 +136,10 @@
 #ifdef XENPV
        /* We are privileged guest os - should have IO privileges. */
        if (xendomain_is_privileged()) {
-               struct physdev_op physop;
-               physop.cmd = PHYSDEVOP_SET_IOPL;
-               physop.u.set_iopl.iopl = 1;
-               if (HYPERVISOR_physdev_op(&physop) != 0)
+               struct physdev_set_iopl set_iopl;
+               memset(&set_iopl, 0, sizeof(set_iopl));
+               set_iopl.iopl = 1;
+               if (HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl) != 0)
                        panic("Unable to obtain IOPL, "
                            "despite being SIF_PRIVILEGED");
        }
diff -r 05d9a785581e -r 54a6d39e4b63 sys/arch/x86/x86/sys_machdep.c
--- a/sys/arch/x86/x86/sys_machdep.c    Tue Apr 21 20:13:39 2020 +0000
+++ b/sys/arch/x86/x86/sys_machdep.c    Tue Apr 21 20:20:39 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_machdep.c,v 1.52 2019/11/10 21:16:34 chs Exp $     */
+/*     $NetBSD: sys_machdep.c,v 1.53 2020/04/21 20:20:39 jdolecek Exp $        */
 
 /*
  * Copyright (c) 1998, 2007, 2009, 2017 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.52 2019/11/10 21:16:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.53 2020/04/21 20:20:39 jdolecek Exp $");
 
 #include "opt_mtrr.h"
 #include "opt_user_ldt.h"
@@ -377,16 +377,15 @@
                iopl = SEL_KPL;
 
     {
-       struct physdev_op physop;
        struct pcb *pcb;
 
        pcb = lwp_getpcb(l);
        pcb->pcb_iopl = iopl;
 
        /* Force the change at ring 0. */
-       physop.cmd = PHYSDEVOP_SET_IOPL;
-       physop.u.set_iopl.iopl = iopl;
-       HYPERVISOR_physdev_op(&physop);
+       struct physdev_set_iopl set_iopl;
+       set_iopl.iopl = iopl;
+       HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
     }
 #elif defined(__x86_64__)
        if (ua.iopl)



Home | Main Index | Thread Index | Old Index