All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Elliott <elliott@hpe.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH v2 2/3] autoconf: Check for MAP_SHARED_VALIDATE and kernel/glibc conflicts
Date: Thu, 14 Feb 2019 20:57:24 -0600	[thread overview]
Message-ID: <20190215025725.19366-2-elliott@hpe.com> (raw)
In-Reply-To: <20190215025725.19366-1-elliott@hpe.com>

Some ndctl tests use two new mmap() flags named MAP_SHARED_VALIDATE
and MAP_SYNC that were added by linux kernel-4.15, intended to be
defined for applications by sys/mman.h. However, these do not
always exist; the distro must have glibc-2.28 and the architecture
must support MAP_SYNC.

In glibc-2.28, MAP_SHARED_VALIDATE was incorporated for all
architectures while MAP_SYNC was left out for these:
    alpha hppa mips powerpc sparc tile

See these git://sourceware.org/git/glibc.git commits on 2018-02-06:
    e76def72eb74 ("Add MAP_SYNC from Linux 4.15.")
    92669d6ee3f2 ("Add MAP_SHARED_VALIDATE from Linux 4.15.")

Expand the current check for MAP_SYNC to check both MAP_SHARED_VALIDATE
and MAP_SYNC in <linux/mman.h> and <sys/mman.h> and suggest remedies
for each possible combination of results:
    kernel  glibc  where defined?
      4.14   2.17  neither
      4.14   2.18  neither
      4.15   2.17  <linux/mman.h>
      4.15   2.18  <sys/mman.h> and <linux/mman.h>

Fixes: 94679e6b78aa ("ndctl, test: check availability of MAP_SYNC for poison test")
Signed-off-by: Robert Elliott <elliott@hpe.com>
---
 configure.ac | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8e57a53..6dca96e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,12 +103,30 @@ AS_IF([test "x$enable_test" = "xyes"],
 AM_CONDITIONAL([ENABLE_TEST], [test "x$enable_test" = "xyes"])
 
 AC_CHECK_DECLS([BUS_MCEERR_AR], [enable_bus_mc_err=yes], [], [[#include <signal.h>]])
+AC_CHECK_DECLS([MAP_SHARED_VALIDATE], [kernel_map_shared_validate=yes], [], [[#include <linux/mman.h>]])
+AC_CHECK_DECLS([MAP_SYNC], [kernel_map_sync=yes], [], [[#include <linux/mman.h>]])
+AS_UNSET([ac_cv_have_decl_MAP_SHARED_VALIDATE])
+AS_UNSET([ac_cv_have_decl_MAP_SYNC])
+AC_CHECK_DECLS([MAP_SHARED_VALIDATE], [enable_map_shared_validate=yes], [], [[#include <sys/mman.h>]])
 AC_CHECK_DECLS([MAP_SYNC], [enable_map_sync=yes], [], [[#include <sys/mman.h>]])
 
-AS_IF([test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes"],
+if test "x$kernel_map_shared_validate" = "xyes" -a "x$enable_map_shared_validate" != "xyes" ; then
+	AC_MSG_WARN([MAP_SHARED_VALIDATE supported by kernel but not by <sys/mman.h>, consider installing glibc-2.28 or later.])
+fi
+if test "x$kernel_map_shared_validate" != "xyes" -a "x$enable_map_shared_validate" != "xyes" ; then
+	AC_MSG_WARN([MAP_SHARED_VALIDATE not supported by kernel, consider installing kernel-4.15 or later.])
+fi
+if test "x$kernel_map_sync" = "xyes" -a "x$enable_map_sync" != "xyes" ; then
+	AC_MSG_WARN([MAP_SYNC supported by kernel but not by <sys/mman.h>, consider installing glibc-2.28 or later.])
+fi
+if test "x$kernel_map_sync" != "xyes" -a "x$enable_map_sync" != "xyes" ; then
+	AC_MSG_WARN([MAP_SYNC not supported by kernel or architecture, consider installing kernel-4.15 or later.])
+fi
+
+AS_IF([test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes" -a "x$enable_map_shared_validate" = "xyes"],
 	[AC_DEFINE([ENABLE_POISON], [1], [ndctl test poison support])])
 AM_CONDITIONAL([ENABLE_POISON],
-	[test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes"])
+	[test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes" -a "x$enable_map_shared_validate" = "xyes"])
 
 PKG_CHECK_MODULES([KMOD], [libkmod])
 PKG_CHECK_MODULES([UDEV], [libudev])
-- 
2.20.1

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2019-02-15  2:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 16:34 [ndctl PATCH 1/2] autoconf: Check for MAP_SHARED_VALIDATE Robert Elliott
2019-02-14 16:34 ` [ndctl PATCH 2/2] autoconf: print more possible package names for keyutils.h Robert Elliott
2019-02-14 17:55   ` Dan Williams
2019-02-14 16:53 ` [ndctl PATCH 1/2] autoconf: Check for MAP_SHARED_VALIDATE Dan Williams
2019-02-14 17:03   ` Elliott, Robert (Persistent Memory)
2019-02-14 17:54     ` Dan Williams
2019-02-15  2:57 ` [ndctl PATCH v2 1/3] autoconf: print more possible package names for <keyutils.h> Robert Elliott
2019-02-15  2:57   ` Robert Elliott [this message]
2019-02-15  2:57   ` [ndctl PATCH v2 3/3] ndctl, test: Make tests using MAP_SYNC only include <sys/mman.h> Robert Elliott
2019-02-15 17:55   ` [ndctl PATCH v2 1/3] autoconf: print more possible package names for <keyutils.h> Ira Weiny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190215025725.19366-2-elliott@hpe.com \
    --to=elliott@hpe.com \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.