Re: svn commit: r367433 - in head/sys: compat/linux conf

2020-11-15 Thread Tijl Coosemans
On Fri, 6 Nov 2020 22:04:57 + (UTC) Conrad Meyer 
wrote:
> Author: cem
> Date: Fri Nov  6 22:04:57 2020
> New Revision: 367433
> URL: https://svnweb.freebsd.org/changeset/base/367433
> 
> Log:
>   linux(4): Fix loadable modules after r367395
>   
>   Move dtrace SDT definitions into linux_common module code.  Also, build
>   linux_dummy.c into the linux_common kld -- we don't need separate
>   versions of these stubs for 32- and 64-bit emulation.
>   
>   Reported by:several
>   PR: 250897
>   Discussed with: emaste, trasz
>   Tested by:  John Kennedy, Yasuhiro KIMURA, Oleg Sidorkin
>   X-MFC-With: r367395
>   Differential Revision:  https://reviews.freebsd.org/D27124
> 
> Modified:
>   head/sys/compat/linux/linux_common.c
>   head/sys/compat/linux/linux_dummy.c
>   head/sys/compat/linux/linux_misc.c
>   head/sys/conf/files.i386
> 
> Modified: head/sys/compat/linux/linux_common.c
> ==
> --- head/sys/compat/linux/linux_common.c  Fri Nov  6 21:33:59 2020
> (r367432)
> +++ head/sys/compat/linux/linux_common.c  Fri Nov  6 22:04:57 2020
> (r367433)
> @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -48,6 +49,20 @@ FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in
>  FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator");
>  
>  MODULE_VERSION(linux_common, 1);
> +
> +/**
> + * Special DTrace provider for the linuxulator.
> + *
> + * In this file we define the provider for the entire linuxulator. All
> + * modules (= files of the linuxulator) use it.
> + *
> + * We define a different name depending on the emulated bitsize, see
> + * ../..//linux{,32}/linux.h, e.g.:
> + *  native bitsize  = linuxulator
> + *  amd64, 32bit emulation  = linuxulator32
> + */
> +LIN_SDT_PROVIDER_DEFINE(linuxulator);
> +LIN_SDT_PROVIDER_DEFINE(linuxulator32);
>  
>  SET_DECLARE(linux_device_handler_set, struct linux_device_handler);
>  
> 
> Modified: head/sys/compat/linux/linux_dummy.c
> ==
> --- head/sys/compat/linux/linux_dummy.c   Fri Nov  6 21:33:59 2020
> (r367432)
> +++ head/sys/compat/linux/linux_dummy.c   Fri Nov  6 22:04:57 2020
> (r367433)
> @@ -29,21 +29,19 @@
>  #include 
>  __FBSDID("$FreeBSD$");
>  
> -#include "opt_compat.h"
> -
>  #include 
>  #include 
>  #include 
>  #include 
>  #include 
>  
> -#ifdef COMPAT_LINUX32
> -#include 
> -#include 
> -#else
> +/*
> + * Including linux vs linux32 here is arbitrary -- the syscall args 
> structures
> + * (proto.h) are not dereferenced by the DUMMY stub implementations, and
> + * suitable for use by both native and compat32 entrypoints.
> + */
>  #include 
>  #include 
> -#endif
>  
>  #include 
>  #include 
> 
> Modified: head/sys/compat/linux/linux_misc.c
> ==
> --- head/sys/compat/linux/linux_misc.cFri Nov  6 21:33:59 2020
> (r367432)
> +++ head/sys/compat/linux/linux_misc.cFri Nov  6 22:04:57 2020
> (r367433)
> @@ -99,19 +99,6 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  
> -/**
> - * Special DTrace provider for the linuxulator.
> - *
> - * In this file we define the provider for the entire linuxulator. All
> - * modules (= files of the linuxulator) use it.
> - *
> - * We define a different name depending on the emulated bitsize, see
> - * ../..//linux{,32}/linux.h, e.g.:
> - *  native bitsize  = linuxulator
> - *  amd64, 32bit emulation  = linuxulator32
> - */
> -LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE);
> -
>  int stclohz; /* Statistics clock frequency */
>  
>  static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = {
> 
> Modified: head/sys/conf/files.i386
> ==
> --- head/sys/conf/files.i386  Fri Nov  6 21:33:59 2020(r367432)
> +++ head/sys/conf/files.i386  Fri Nov  6 22:04:57 2020(r367433)
> @@ -52,6 +52,7 @@ cddl/dev/dtrace/i386/dtrace_asm.S   
> optional dtrace co
>  cddl/dev/dtrace/i386/dtrace_subr.c   optional dtrace 
> compile-with "${DTRACE_C}"
>  compat/linprocfs/linprocfs.c optional linprocfs
>  compat/linsysfs/linsysfs.c   optional linsysfs
> +compat/linux/linux_common.c  optional compat_linux
>  compat/linux/linux_dummy.c   optional compat_linux
>  compat/linux/linux_event.c   optional compat_linux
>  compat/linux/linux_emul.coptional compat_linux

linux_common.c defines the linux_common module which contains stuff that
is common between 64 bit and 32 bit linux on amd64, but there's no such
module on i386, which is why the file wasn't in files.i386.  You should
put LIN_SDT_PROVIDER_DEFINE in a file that is in 

svn commit: r367433 - in head/sys: compat/linux conf

2020-11-06 Thread Conrad Meyer
Author: cem
Date: Fri Nov  6 22:04:57 2020
New Revision: 367433
URL: https://svnweb.freebsd.org/changeset/base/367433

Log:
  linux(4): Fix loadable modules after r367395
  
  Move dtrace SDT definitions into linux_common module code.  Also, build
  linux_dummy.c into the linux_common kld -- we don't need separate
  versions of these stubs for 32- and 64-bit emulation.
  
  Reported by:  several
  PR:   250897
  Discussed with:   emaste, trasz
  Tested by:John Kennedy, Yasuhiro KIMURA, Oleg Sidorkin
  X-MFC-With:   r367395
  Differential Revision:https://reviews.freebsd.org/D27124

Modified:
  head/sys/compat/linux/linux_common.c
  head/sys/compat/linux/linux_dummy.c
  head/sys/compat/linux/linux_misc.c
  head/sys/conf/files.i386

Modified: head/sys/compat/linux/linux_common.c
==
--- head/sys/compat/linux/linux_common.cFri Nov  6 21:33:59 2020
(r367432)
+++ head/sys/compat/linux/linux_common.cFri Nov  6 22:04:57 2020
(r367433)
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -48,6 +49,20 @@ FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in
 FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator");
 
 MODULE_VERSION(linux_common, 1);
+
+/**
+ * Special DTrace provider for the linuxulator.
+ *
+ * In this file we define the provider for the entire linuxulator. All
+ * modules (= files of the linuxulator) use it.
+ *
+ * We define a different name depending on the emulated bitsize, see
+ * ../..//linux{,32}/linux.h, e.g.:
+ *  native bitsize  = linuxulator
+ *  amd64, 32bit emulation  = linuxulator32
+ */
+LIN_SDT_PROVIDER_DEFINE(linuxulator);
+LIN_SDT_PROVIDER_DEFINE(linuxulator32);
 
 SET_DECLARE(linux_device_handler_set, struct linux_device_handler);
 

Modified: head/sys/compat/linux/linux_dummy.c
==
--- head/sys/compat/linux/linux_dummy.c Fri Nov  6 21:33:59 2020
(r367432)
+++ head/sys/compat/linux/linux_dummy.c Fri Nov  6 22:04:57 2020
(r367433)
@@ -29,21 +29,19 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_compat.h"
-
 #include 
 #include 
 #include 
 #include 
 #include 
 
-#ifdef COMPAT_LINUX32
-#include 
-#include 
-#else
+/*
+ * Including linux vs linux32 here is arbitrary -- the syscall args structures
+ * (proto.h) are not dereferenced by the DUMMY stub implementations, and
+ * suitable for use by both native and compat32 entrypoints.
+ */
 #include 
 #include 
-#endif
 
 #include 
 #include 

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Fri Nov  6 21:33:59 2020
(r367432)
+++ head/sys/compat/linux/linux_misc.c  Fri Nov  6 22:04:57 2020
(r367433)
@@ -99,19 +99,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-/**
- * Special DTrace provider for the linuxulator.
- *
- * In this file we define the provider for the entire linuxulator. All
- * modules (= files of the linuxulator) use it.
- *
- * We define a different name depending on the emulated bitsize, see
- * ../..//linux{,32}/linux.h, e.g.:
- *  native bitsize  = linuxulator
- *  amd64, 32bit emulation  = linuxulator32
- */
-LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE);
-
 int stclohz;   /* Statistics clock frequency */
 
 static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = {

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Fri Nov  6 21:33:59 2020(r367432)
+++ head/sys/conf/files.i386Fri Nov  6 22:04:57 2020(r367433)
@@ -52,6 +52,7 @@ cddl/dev/dtrace/i386/dtrace_asm.S 
optional dtrace co
 cddl/dev/dtrace/i386/dtrace_subr.c optional dtrace 
compile-with "${DTRACE_C}"
 compat/linprocfs/linprocfs.c   optional linprocfs
 compat/linsysfs/linsysfs.c optional linsysfs
+compat/linux/linux_common.coptional compat_linux
 compat/linux/linux_dummy.c optional compat_linux
 compat/linux/linux_event.c optional compat_linux
 compat/linux/linux_emul.c  optional compat_linux
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"