public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH v7 1/5] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM
Date: Wed, 29 Apr 2026 13:46:37 -0700	[thread overview]
Message-ID: <20260429204637.GA3588527@ax162> (raw)
In-Reply-To: <20260410205929.3914474-2-matthew.brost@intel.com>

Hi Matthew,

On Fri, Apr 10, 2026 at 01:59:25PM -0700, Matthew Brost wrote:
> diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
> index 7993e85c0566..365a9c0b522a 100644
> --- a/drivers/gpu/drm/drm_gpusvm.c
> +++ b/drivers/gpu/drm/drm_gpusvm.c
> @@ -1544,13 +1554,33 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
>  				goto err_unmap;
>  			}
>  
> -			addr = dma_map_page(gpusvm->drm->dev,
> -					    page, 0,
> -					    PAGE_SIZE << order,
> -					    dma_dir);
> -			if (dma_mapping_error(gpusvm->drm->dev, addr)) {
> -				err = -EFAULT;
> -				goto err_unmap;
> +			if (!i)
> +				dma_iova_try_alloc(gpusvm->drm->dev, state,
> +						   npages * PAGE_SIZE >=
> +						   HPAGE_PMD_SIZE ?
> +						   HPAGE_PMD_SIZE : 0,
> +						   npages * PAGE_SIZE);

This patch is in -next as commit 37ad039fb367 ("drm/gpusvm: Use dma-map
IOVA alloc, link, and sync API in GPU SVM"), where it breaks the build
for certain platforms such as ARM.

  $ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mrproper allmodconfig drivers/gpu/drm/drm_gpusvm.o
  In file included from <command-line>:
  drivers/gpu/drm/drm_gpusvm.c: In function 'drm_gpusvm_get_pages':
  include/linux/compiler_types.h:699:45: error: call to '__compiletime_assert_361' declared with attribute error: BUILD_BUG failed
    699 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
        |                                             ^
  include/linux/compiler_types.h:680:25: note: in definition of macro '__compiletime_assert'
    680 |                         prefix ## suffix();                             \
        |                         ^~~~~~
  include/linux/compiler_types.h:699:9: note: in expansion of macro '_compiletime_assert'
    699 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
        |         ^~~~~~~~~~~~~~~~~~~
  include/linux/build_bug.h:40:37: note: in expansion of macro 'compiletime_assert'
     40 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
        |                                     ^~~~~~~~~~~~~~~~~~
  include/linux/build_bug.h:60:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     60 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
        |                     ^~~~~~~~~~~~~~~~
  include/linux/huge_mm.h:113:28: note: in expansion of macro 'BUILD_BUG'
    113 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
        |                            ^~~~~~~~~
  include/linux/huge_mm.h:120:35: note: in expansion of macro 'HPAGE_PMD_SHIFT'
    120 | #define HPAGE_PMD_SIZE  ((1UL) << HPAGE_PMD_SHIFT)
        |                                   ^~~~~~~~~~~~~~~
  drivers/gpu/drm/drm_gpusvm.c:1560:52: note: in expansion of macro 'HPAGE_PMD_SIZE'
   1560 |                                                    HPAGE_PMD_SIZE ?
        |                                                    ^~~~~~~~~~~~~~
  make[7]: *** [scripts/Makefile.build:289: drivers/gpu/drm/drm_gpusvm.o] Error 1
  ...

I think use of HPAGE_PMD_SIZE is expected to be gated by
CONFIG_TRANSPARENT_HUGEPAGE ifdefs?

Cheers,
Nathan

  reply	other threads:[~2026-04-29 20:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 20:59 [PATCH v7 0/5] Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap Matthew Brost
2026-04-10 20:59 ` [PATCH v7 1/5] drm/gpusvm: Use dma-map IOVA alloc, link, and sync API in GPU SVM Matthew Brost
2026-04-29 20:46   ` Nathan Chancellor [this message]
2026-04-10 20:59 ` [PATCH v7 2/5] drm/pagemap: Drop source_peer_migrates flag and assume true Matthew Brost
2026-04-17 11:03   ` Thomas Hellström
2026-04-10 20:59 ` [PATCH v7 3/5] drm/pagemap: Split drm_pagemap_migrate_map_pages into device / system Matthew Brost
2026-04-17 11:09   ` Thomas Hellström
2026-04-10 20:59 ` [PATCH v7 4/5] drm/pagemap: Use dma-map IOVA alloc, link, and sync API for DRM pagemap Matthew Brost
2026-04-17 11:11   ` Thomas Hellström
2026-04-10 20:59 ` [PATCH v7 5/5] drm/pagemap: Fix drm_pagemap_migrate_unmap_pages kerneldoc Matthew Brost
2026-04-10 21:07 ` ✓ CI.KUnit: success for Use new dma-map IOVA alloc, link, and sync API in GPU SVM and DRM pagemap (rev7) Patchwork
2026-04-10 21:44 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-11  8:43 ` ✓ Xe.CI.FULL: " Patchwork

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=20260429204637.GA3588527@ax162 \
    --to=nathan@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox