Module Name: src Committed By: pgoyette Date: Sat Mar 17 06:49:57 UTC 2018
Modified Files: src/sys/arch/x86/x86 [pgoyette-compat]: cpu_ucode.c src/sys/compat/common [pgoyette-compat]: compat_60_mod.c src/sys/kern [pgoyette-compat]: kern_cpu.c syscalls.master src/sys/modules/compat [pgoyette-compat]: Makefile src/sys/modules/compat_60 [pgoyette-compat]: Makefile Log Message: Back out changes on the branch related to kernel microcode compat. Christos didn't like the way it was done, so waiting for a better approach/implementation. To generate a diff of this commit: cvs rdiff -u -r1.5.16.1 -r1.5.16.2 src/sys/arch/x86/x86/cpu_ucode.c cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/compat/common/compat_60_mod.c cvs rdiff -u -r1.71.16.5 -r1.71.16.6 src/sys/kern/kern_cpu.c cvs rdiff -u -r1.291.2.3 -r1.291.2.4 src/sys/kern/syscalls.master cvs rdiff -u -r1.14.14.2 -r1.14.14.3 src/sys/modules/compat/Makefile cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/modules/compat_60/Makefile 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/cpu_ucode.c diff -u src/sys/arch/x86/x86/cpu_ucode.c:1.5.16.1 src/sys/arch/x86/x86/cpu_ucode.c:1.5.16.2 --- src/sys/arch/x86/x86/cpu_ucode.c:1.5.16.1 Sat Mar 17 00:41:33 2018 +++ src/sys/arch/x86/x86/cpu_ucode.c Sat Mar 17 06:49:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_ucode.c,v 1.5.16.1 2018/03/17 00:41:33 pgoyette Exp $ */ +/* $NetBSD: cpu_ucode.c,v 1.5.16.2 2018/03/17 06:49:56 pgoyette Exp $ */ /* * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cpu_ucode.c,v 1.5.16.1 2018/03/17 00:41:33 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu_ucode.c,v 1.5.16.2 2018/03/17 06:49:56 pgoyette Exp $"); #if defined(_KERNEL_OPT) #include "opt_cpu_ucode.h" @@ -49,8 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_ucode.c, static struct cpu_ucode_softc ucode_softc; -#ifndef _MODULE - int cpu_ucode_get_version(struct cpu_ucode_version *data) { @@ -66,7 +64,6 @@ cpu_ucode_get_version(struct cpu_ucode_v return 0; } -#endif /* ! _MODULE */ #ifdef COMPAT_60 int @@ -84,7 +81,6 @@ compat6_cpu_ucode_get_version(struct com } #endif /* COMPAT60 */ -#ifndef _MODULE int cpu_ucode_md_open(firmware_handle_t *fwh, int loader_version, const char *fwname) { @@ -127,7 +123,6 @@ cpu_ucode_apply(const struct cpu_ucode * sc->sc_blobsize = 0; return error; } -#endif /* ! _MODULE */ #ifdef COMPAT_60 int Index: src/sys/compat/common/compat_60_mod.c diff -u src/sys/compat/common/compat_60_mod.c:1.1.2.4 src/sys/compat/common/compat_60_mod.c:1.1.2.5 --- src/sys/compat/common/compat_60_mod.c:1.1.2.4 Sat Mar 17 00:48:19 2018 +++ src/sys/compat/common/compat_60_mod.c Sat Mar 17 06:49:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_60_mod.c,v 1.1.2.4 2018/03/17 00:48:19 pgoyette Exp $ */ +/* $NetBSD: compat_60_mod.c,v 1.1.2.5 2018/03/17 06:49:57 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.4 2018/03/17 00:48:19 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.5 2018/03/17 06:49:57 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -61,11 +61,6 @@ static const struct syscall_package comp #define REQUIRED_60 "compat_70" /* XXX No compat_80 yet */ MODULE(MODULE_CLASS_EXEC, compat_60, REQUIRED_60); -#ifdef CPU_UCODE -int (*orig_compat_6_cpu_get_version)(struct compat6_cpu_ucode *); -int (*orig_compat6_cpu_ucode_apply)(const struct compat6_cpu_ucode *); -#endif - static const struct syscall_package compat__60_syscalls[] = { { SYS_compat_60__lwp_park, 0, (sy_call_t *)compat_60_sys__lwp_park }, NULL, 0, NULL } @@ -75,29 +70,19 @@ static const struct syscall_package comp int compat_60_init(void) { - int error; + int error = 0; error = syscall_establish(NULL, compat_60_syscalls); if (error != 0) return error; -#ifdef CPU_UCODE - orig_compat_6_cpu_get_version = vec_compat6_cpu_ucode_get_version; - *vec_compat6_cpu_ucode_get_version = compat6_cpu_ucode_get_version; - orig_compat6_cpu_ucode_apply = vec_compat6_cpu_ucode_apply; - *vec_compat6_cpu_ucode_apply = compat6_cpu_ucode_apply; -#endif return 0; } int compat_60_fini(void) { - int error; + int error = 0; -#ifdef CPU_UCODE - *vec_compat6_cpu_ucode_get_version = orig_compat_6_cpu_get_version; - *vec_compat6_cpu_ucode_apply = orig_compat6_cpu_ucode_apply; -#endif error = syscall_disestablish(NULL, compat_60_syscalls); return error; @@ -107,7 +92,6 @@ compat_60_fini(void) static int compat_60_modcmd(modcmd_t cmd, void *arg) { - int error; switch (cmd) { case MODULE_CMD_INIT: Index: src/sys/kern/kern_cpu.c diff -u src/sys/kern/kern_cpu.c:1.71.16.5 src/sys/kern/kern_cpu.c:1.71.16.6 --- src/sys/kern/kern_cpu.c:1.71.16.5 Sat Mar 17 02:56:36 2018 +++ src/sys/kern/kern_cpu.c Sat Mar 17 06:49:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cpu.c,v 1.71.16.5 2018/03/17 02:56:36 pgoyette Exp $ */ +/* $NetBSD: kern_cpu.c,v 1.71.16.6 2018/03/17 06:49:57 pgoyette Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.71.16.5 2018/03/17 02:56:36 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.71.16.6 2018/03/17 06:49:57 pgoyette Exp $"); #include "opt_cpu_ucode.h" #include "opt_compat_netbsd.h" @@ -131,27 +131,6 @@ kcpuset_t * kcpuset_running __read_most static char cpu_model[128]; -#ifdef CPU_UCODE -/* - * routine vectors for compat code - */ -static int stub_compat_6_cpu_ucode_get_version(struct compat6_cpu_ucode *ucode) -{ - - return ENOTTY; -} - -static int stub_compat_6_cpu_ucode_apply(const struct compat6_cpu_ucode *ucode) -{ - - return ENOTTY; -} -int (*vec_compat6_cpu_ucode_get_version)(struct compat6_cpu_ucode *) = - stub_compat_6_cpu_ucode_get_version; -int (*vec_compat6_cpu_ucode_apply)(const struct compat6_cpu_ucode *) = - stub_compat_6_cpu_ucode_apply; -#endif - /* * mi_cpu_init: early initialisation of MI CPU related structures. * @@ -306,10 +285,11 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void error = cpu_ucode_get_version((struct cpu_ucode_version *)data); break; +#ifdef COMPAT_60 case OIOC_CPU_UCODE_GET_VERSION: - error = (*vec_compat6_cpu_ucode_get_version)( - (struct compat6_cpu_ucode *)data); + error = compat6_cpu_ucode_get_version((struct compat6_cpu_ucode *)data); break; +#endif case IOC_CPU_UCODE_APPLY: error = kauth_authorize_machdep(l->l_cred, @@ -320,16 +300,17 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void error = cpu_ucode_apply((const struct cpu_ucode *)data); break; +#ifdef COMPAT_60 case OIOC_CPU_UCODE_APPLY: error = kauth_authorize_machdep(l->l_cred, KAUTH_MACHDEP_CPU_UCODE_APPLY, NULL, NULL, NULL, NULL); if (error != 0) break; - error = (*vec_compat6_cpu_ucode_apply)( - (const struct compat6_cpu_ucode *)data); + error = compat6_cpu_ucode_apply((const struct compat6_cpu_ucode *)data); break; #endif +#endif default: error = ENOTTY; Index: src/sys/kern/syscalls.master diff -u src/sys/kern/syscalls.master:1.291.2.3 src/sys/kern/syscalls.master:1.291.2.4 --- src/sys/kern/syscalls.master:1.291.2.3 Fri Mar 16 00:35:40 2018 +++ src/sys/kern/syscalls.master Sat Mar 17 06:49:57 2018 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.291.2.3 2018/03/16 00:35:40 pgoyette Exp $ + $NetBSD: syscalls.master,v 1.291.2.4 2018/03/17 06:49:57 pgoyette Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -878,7 +878,7 @@ { ssize_t|sys|50|mq_timedreceive(mqd_t mqdes, \ char *msg_ptr, size_t msg_len, unsigned *msg_prio, \ const struct timespec *abs_timeout); } -434 COMPAT_60 MODULAR compat_60 \ +434 COMPAT_60 MODULAR compat \ { int|sys||_lwp_park(const struct timespec *ts, \ lwpid_t unpark, const void *hint, \ const void *unparkhint); } Index: src/sys/modules/compat/Makefile diff -u src/sys/modules/compat/Makefile:1.14.14.2 src/sys/modules/compat/Makefile:1.14.14.3 --- src/sys/modules/compat/Makefile:1.14.14.2 Sat Mar 17 00:48:20 2018 +++ src/sys/modules/compat/Makefile Sat Mar 17 06:49:57 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14.14.2 2018/03/17 00:48:20 pgoyette Exp $ +# $NetBSD: Makefile,v 1.14.14.3 2018/03/17 06:49:57 pgoyette Exp $ .include "../Makefile.inc" @@ -45,14 +45,4 @@ SRCS+= compat_13_machdep.c SRCS+= compat_16_machdep.c .endif -.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" - -CPPFLAGS+= -DCPU_UCODE - -.PATH: ${S}/arch/x86/x86 - -SRCS+= cpu_ucode.c - -.endif - .include <bsd.kmodule.mk> Index: src/sys/modules/compat_60/Makefile diff -u src/sys/modules/compat_60/Makefile:1.1.2.4 src/sys/modules/compat_60/Makefile:1.1.2.5 --- src/sys/modules/compat_60/Makefile:1.1.2.4 Sat Mar 17 00:48:20 2018 +++ src/sys/modules/compat_60/Makefile Sat Mar 17 06:49:57 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1.2.4 2018/03/17 00:48:20 pgoyette Exp $ +# $NetBSD: Makefile,v 1.1.2.5 2018/03/17 06:49:57 pgoyette Exp $ .include "../Makefile.inc" @@ -10,17 +10,4 @@ CPPFLAGS+= -DCOMPAT_60 -DCOMPAT_70 -DCOM SRCS+= compat_60_mod.c kern_sa_60.c tty_60.c kern_time_60.c -# If being built for amd64, i386, or XEN3_DOM0 (but _not_ DOMU), we -# need to add - -.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" - -CPPFLAGS+= -DCPU_UCODE - -.PATH: ${S}/arch/x86/x86 - -SRCS+= cpu_ucode.c - -.endif - .include <bsd.kmodule.mk>