Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/2] lib/intel_batchbuffer: Limit intel-bb to 48-bit va
Date: Thu, 11 May 2023 21:36:17 +0200	[thread overview]
Message-ID: <20230511193617.86458-3-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20230511193617.86458-1-zbigniew.kempczynski@intel.com>

On PVC Xe returns 57-bit va bit size. Unfortunately MI_* commands are
limited to 48-bit, so we should provide offsets which are within this
range and won't produce page faults like:

<4> [781.114047] xe 0000:8c:00.0: [drm]
	ASID: 1196
	VFID: 0
	PDATA: 0x00a3
	Faulted Address: 0x0000ffffffff0000
	FaultType: 0
	AccessType: 0
	FaultLevel: 4
	EngineClass: 3
	EngineInstance: 0
<4> [781.144174] xe 0000:8c:00.0: [drm] Fault response: Unsuccessful -22

Lets alter intel-bb with default (SIMPLE allocator, HIGH_TO_LOW strategy)
to omit 48-57 bit addressing by setting end of va range to 48-bit max.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 lib/intel_batchbuffer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 14ed8057e8..58ba28498a 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -937,7 +937,10 @@ __intel_bb_create(int fd, uint32_t ctx, const intel_ctx_cfg_t *cfg,
 		ibb->alignment = xe_get_default_alignment(fd);
 		size = ALIGN(size, ibb->alignment);
 		ibb->handle = xe_bo_create_flags(fd, 0, size, vram_if_possible(fd, 0));
-		ibb->gtt_size = 1ull << xe_va_bits(fd);
+
+		/* Limit to 48-bit due to MI_* address limitation */
+		ibb->gtt_size = 1ull << min_t(uint32_t, xe_va_bits(fd), 48);
+		end = ibb->gtt_size;
 
 		if (!ctx)
 			ctx = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_BIND_OPS, 0);
-- 
2.34.1

  parent reply	other threads:[~2023-05-11 19:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 19:36 [igt-dev] [PATCH i-g-t 0/2] Limit intel-bb to 48-bit Zbigniew Kempczyński
2023-05-11 19:36 ` [igt-dev] [PATCH i-g-t 1/2] lib/intel_batchbuffer: Add bind/unbind debug for single bo for Xe Zbigniew Kempczyński
2023-05-12  7:51   ` Kumar, Janga Rahul
2023-05-15 19:26   ` Kamil Konieczny
2023-05-15 19:39     ` Zbigniew Kempczyński
2023-05-11 19:36 ` Zbigniew Kempczyński [this message]
2023-05-15 19:18   ` [igt-dev] [PATCH i-g-t 2/2] lib/intel_batchbuffer: Limit intel-bb to 48-bit va Kamil Konieczny
2023-05-15 19:35     ` Zbigniew Kempczyński
2023-05-11 20:47 ` [igt-dev] ✓ Fi.CI.BAT: success for Limit intel-bb to 48-bit Patchwork
2023-05-12  3:51 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-05-12  5:14   ` Zbigniew Kempczyński
2023-05-12 12:34     ` Yedireswarapu, SaiX Nandan
2023-05-12 12:32 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=20230511193617.86458-3-zbigniew.kempczynski@intel.com \
    --to=zbigniew.kempczynski@intel.com \
    --cc=igt-dev@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox