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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250603132736.554f611d@gandalf.local.home>
Date: Tue, 3 Jun 2025 13:27:36 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Hugh Dickins <hughd@...gle.com>, LKML <linux-kernel@...r.kernel.org>,
 linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>, Linus
 Torvalds <torvalds@...ux-foundation.org>, Christian Koenig
 <christian.koenig@....com>, Huang Rui <ray.huang@....com>, Matthew Auld
 <matthew.auld@...el.com>, Matthew Brost <matthew.brost@...el.com>,
 dri-devel@...ts.freedesktop.org, Maarten Lankhorst
 <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
 Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>
Subject: Re: [PATCH] mm: Fix compile error when CONFIG_SHMEM is not set


[ Adding DRM folks ]

On Tue, 3 Jun 2025 17:26:23 +0100
Matthew Wilcox <willy@...radead.org> wrote:

> On Tue, Jun 03, 2025 at 10:29:59AM -0400, Steven Rostedt wrote:
> > On Tue, 3 Jun 2025 01:02:36 -0700 (PDT)
> > Hugh Dickins <hughd@...gle.com> wrote:
> >   
> > > Agreed that ramfs does not use swap, so calling swap_writepage() would
> > > be weird.  But, thanks for the build fix Steve, but it cannot be right
> > > because return 0 says shmem_writeout() successfully sent the page to
> > > swap, and that has unlocked the page (or soon will do so).  It should
> > > return an error (-ENXIO?), but I haven't checked what the callers do with  
> > 
> > Yeah, I figured it should return an error, but looking at the code I
> > couldn't figure out what the proper error would be. Then I also noticed
> > that the other stub functions just returned zero so I did the same.
> > 
> > Perhaps add a WARN_ON_ONCE() if it is called without CONFIG_SHMEM configured?  
> 
> Or just make this module depend on SHMEM?  I don't think it makes much
> sense to use it without being able to swap, and shmem can't swap ...

Heh, not exactly sure what to make depend on CONFIG_SHMEM. The function is:

  ttm_backup_backup_page()

Which is defined when CONFIG_DRM_TTM is set, but just doing:

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index f094797f3b2b..ebb948a0142f 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -187,7 +187,7 @@ source "drivers/gpu/drm/display/Kconfig"
 
 config DRM_TTM
 	tristate
-	depends on DRM && MMU
+	depends on DRM && MMU && SHMEM
 	help
 	  GPU memory management subsystem for devices with multiple
 	  GPU memory types. Will be enabled automatically if a device driver

Isn't good enough because "select" can override depends on :-p and DRM_TTM
gets selected by:

 Symbol: DRM_TTM [=y]
 Type  : tristate
 Defined at drivers/gpu/drm/Kconfig:188
   Depends on: HAS_IOMEM [=y] && DRM [=y] && MMU [=y] && SHMEM [=n]
 Selected by [y]:
   - DRM_TTM_HELPER [=y] && HAS_IOMEM [=y] && DRM [=y]
   - DRM_RADEON [=y] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (AGP [=n] || !AGP [=n])
   - DRM_VMWGFX [=y] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (X86 [=y] && HYPERVISOR_GUEST [=y] || ARM64)
 Selected by [n]:
   - DRM_TTM_KUNIT_TEST [=n] && HAS_IOMEM [=y] && DRM [=y] && KUNIT [=n] && MMU [=y] && (UML || COMPILE_TEST [=n])
   - DRM_AMDGPU [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && !UML
   - DRM_NOUVEAU [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y]
   - DRM_I915 [=n] && HAS_IOMEM [=y] && DRM [=y] && X86 [=y] && PCI [=y] && !PREEMPT_RT [=n]
   - DRM_XE [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (m [=m] && MODULES [=n] || KUNIT [=n]=y [=y]
   - DRM_QXL [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && HAS_IOPORT [=y]
   - DRM_LOONGSON [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (LOONGARCH || MIPS || COMPILE_TEST [=n])
   - DRM_HISI_HIBMC [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y]
   - DRM_VBOXVIDEO [=n] && HAS_IOMEM [=y] && DRM [=y] && X86 [=y] && PCI [=y]

Should DRM itself depend on SHMEM?

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ