lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Apr 2017 20:30:13 -0400
From:   Paul Gortmaker <paul.gortmaker@...driver.com>
To:     <linux-kernel@...r.kernel.org>
CC:     <linux-next@...r.kernel.org>,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Jérôme Glisse <jglisse@...hat.com>,
        Evgeny Baskakov <ebaskakov@...dia.com>,
        John Hubbard <jhubbard@...dia.com>,
        Mark Hairgrove <mhairgrove@...dia.com>,
        Sherry Cheung <SCheung@...dia.com>,
        Subhash Gutti <sgutti@...dia.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH 3/4] mm/hmm: fix Kconfig to have valid usage of "select"

The use of "select" like this will most likely cause new
randconfig warnings and failures because the child categories
get chosen, and force select the parent, even though the parent
dependencies are not met.  For further details, see "select"
in Documentation/kbuild/kconfig-language.txt file.

But we also don't want to be duplicating the main feature dependencies
across all the child options, which is annoying when the dependencies
change.  So we use the typical ARCH_HAS as a dependency collector,
and the existing HMM option is now dependency free, and hence a
valid option for use with "select".  It retains its original purpose
which is to be set if and only if any of the child options are set.

Finally, the existing help text is currently orphaned, since the
HMM bool doesn't have a following short description, and hence it
will never be offered to the end user.  So delete it, but ensure
the two child options point to the Documentation/vm/hmm.txt file.

Cc: Jérôme Glisse <jglisse@...hat.com>
Cc: Evgeny Baskakov <ebaskakov@...dia.com>
Cc: John Hubbard <jhubbard@...dia.com>
Cc: Mark Hairgrove <mhairgrove@...dia.com>
Cc: Sherry Cheung <SCheung@...dia.com>
Cc: Subhash Gutti <sgutti@...dia.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@...driver.com>
---
 mm/Kconfig | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/mm/Kconfig b/mm/Kconfig
index 43d000e44424..3e9c31bf9aaa 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -289,23 +289,17 @@ config MIGRATION
 config ARCH_ENABLE_HUGEPAGE_MIGRATION
 	bool
 
-config HMM
+config ARCH_HAS_HMM
 	bool
+	default y
 	depends on MMU && 64BIT
-	help
-	  HMM provides a set of helpers to share a virtual address
-	  space between CPU and a device, so that the device can access any valid
-	  address of the process (while still obeying memory protection). HMM also
-	  provides helpers to migrate process memory to device memory, and back.
-	  Each set of functionality (address space mirroring, and migration to and
-	  from device memory) can be used independently of the other.
 
-	  This is primarily useful for devices like GPU, for GPGPU compute workload,
-	  with APIs such as OpenCL or CUDA. See Documentation/vm/hmm.txt.
+config HMM
+	bool
 
 config HMM_MIRROR
 	bool "HMM mirror CPU page table into a device page table"
-	depends on MMU && 64BIT
+	depends on ARCH_HAS_HMM
 	select HMM
 	select MMU_NOTIFIER
 	help
@@ -313,16 +307,16 @@ config HMM_MIRROR
 	  process into a device page table. Here, mirror means "keep synchronized".
 	  Prerequisites: the device must provide the ability to write-protect its
 	  page tables (at PAGE_SIZE granularity), and must be able to recover from
-	  the resulting potential page faults.
+	  the resulting potential page faults.  See Documentation/vm/hmm.txt.
 
 config HMM_DEVMEM
 	bool "HMM device memory helpers (to leverage ZONE_DEVICE)"
-	depends on MMU && 64BIT
+	depends on ARCH_HAS_HMM
 	select HMM
 	help
 	  HMM devmem is a set of helper routines to leverage the ZONE_DEVICE
 	  feature. This is just to avoid having device drivers to replicating a lot
-	  of boiler plate code.
+	  of boiler plate code.  See Documentation/vm/hmm.txt.
 
 config PHYS_ADDR_T_64BIT
 	def_bool 64BIT || ARCH_PHYS_ADDR_T_64BIT
-- 
2.11.0

Powered by blists - more mailing lists