All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Oded Gabbay <ogabbay@kernel.org>,
	Jeffrey Hugo <quic_jhugo@quicinc.com>,
	"Wludzik, Jozef" <jozef.wludzik@intel.com>,
	Wludzik@freedesktop.org,
	Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Subject: Re: [PATCH] accel/ivpu: Extend address range for MMU mmap
Date: Thu, 19 Oct 2023 08:05:11 +0200	[thread overview]
Message-ID: <20231019060511.GB547256@linux.intel.com> (raw)
In-Reply-To: <20231018110113.547208-1-stanislaw.gruszka@linux.intel.com>

On Wed, Oct 18, 2023 at 01:01:13PM +0200, Stanislaw Gruszka wrote:
> From: "Wludzik, Jozef" <jozef.wludzik@intel.com>
> 
> Allow to use whole address range in MMU context mmap which is up to 48
> bits. Return invalid argument from MMU context mmap in case address is
> not aligned to MMU page size, address is below MMU page size or address
> is greater then 47 bits.
> 
> This fixes problem disallowing to run large models on VPU4
> 
> Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Applied to drm-misc-fixes

Thanks
Stanislaw

> ---
>  drivers/accel/ivpu/ivpu_mmu_context.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/accel/ivpu/ivpu_mmu_context.c b/drivers/accel/ivpu/ivpu_mmu_context.c
> index 0c8c65351919..c1050a2df954 100644
> --- a/drivers/accel/ivpu/ivpu_mmu_context.c
> +++ b/drivers/accel/ivpu/ivpu_mmu_context.c
> @@ -11,6 +11,7 @@
>  #include "ivpu_mmu.h"
>  #include "ivpu_mmu_context.h"
>  
> +#define IVPU_MMU_VPU_ADDRESS_MASK        GENMASK(47, 12)
>  #define IVPU_MMU_PGD_INDEX_MASK          GENMASK(47, 39)
>  #define IVPU_MMU_PUD_INDEX_MASK          GENMASK(38, 30)
>  #define IVPU_MMU_PMD_INDEX_MASK          GENMASK(29, 21)
> @@ -328,12 +329,8 @@ ivpu_mmu_context_map_sgt(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx,
>  
>  	if (!IS_ALIGNED(vpu_addr, IVPU_MMU_PAGE_SIZE))
>  		return -EINVAL;
> -	/*
> -	 * VPU is only 32 bit, but DMA engine is 38 bit
> -	 * Ranges < 2 GB are reserved for VPU internal registers
> -	 * Limit range to 8 GB
> -	 */
> -	if (vpu_addr < SZ_2G || vpu_addr > SZ_8G)
> +
> +	if (vpu_addr & ~IVPU_MMU_VPU_ADDRESS_MASK)
>  		return -EINVAL;
>  
>  	prot = IVPU_MMU_ENTRY_MAPPED;
> -- 
> 2.25.1
> 

      reply	other threads:[~2023-10-19  6:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 11:01 [PATCH] accel/ivpu: Extend address range for MMU mmap Stanislaw Gruszka
2023-10-19  6:05 ` Stanislaw Gruszka [this message]

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=20231019060511.GB547256@linux.intel.com \
    --to=stanislaw.gruszka@linux.intel.com \
    --cc=Wludzik@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacek.lawrynowicz@linux.intel.com \
    --cc=jozef.wludzik@intel.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.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 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.