Module Name: src
Committed By: jdolecek
Date: Tue Apr 21 20:20:39 UTC 2020
Modified Files:
src/sys/arch/x86/x86: bus_space.c sys_machdep.c
Log Message:
two more files to convert to newer HYPERVISOR_physdev_op() interface
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/x86/x86/bus_space.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/x86/sys_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/bus_space.c
diff -u src/sys/arch/x86/x86/bus_space.c:1.43 src/sys/arch/x86/x86/bus_space.c:1.44
--- src/sys/arch/x86/x86/bus_space.c:1.43 Tue Dec 3 04:57:25 2019
+++ src/sys/arch/x86/x86/bus_space.c Tue Apr 21 20:20:39 2020
@@ -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 @@ x86_bus_space_init(void)
#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");
}
Index: src/sys/arch/x86/x86/sys_machdep.c
diff -u src/sys/arch/x86/x86/sys_machdep.c:1.52 src/sys/arch/x86/x86/sys_machdep.c:1.53
--- src/sys/arch/x86/x86/sys_machdep.c:1.52 Sun Nov 10 21:16:34 2019
+++ src/sys/arch/x86/x86/sys_machdep.c Tue Apr 21 20:20:39 2020
@@ -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 @@ x86_iopl(struct lwp *l, void *args, regi
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)