From: Ramalingam C <ramalingam.c@intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>
Cc: "Hellstrom Thomas" <thomas.hellstrom@intel.com>,
"Matthew Auld" <matthew.auld@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: [Intel-gfx] [PATCH 4/4] drm/i915: enforce min page size for scratch
Date: Wed, 8 Dec 2021 19:46:13 +0530 [thread overview]
Message-ID: <20211208141613.7251-5-ramalingam.c@intel.com> (raw)
In-Reply-To: <20211208141613.7251-1-ramalingam.c@intel.com>
From: Matthew Auld <matthew.auld@intel.com>
If the device needs 64K minimum GTT pages for device local-memory,
like on XEHPSDV, then we need to fail the allocation if we can't
meet it, instead of falling back to 4K pages, otherwise we can't
safely support the insertion of device local-memory pages for
this vm, since the HW expects the correct physical alignment and
size for every PTE, if we mark the page-table as 64K GTT mode.
v2: s/userpsace/userspace [Thomas]
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
drivers/gpu/drm/i915/gt/intel_gtt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.c b/drivers/gpu/drm/i915/gt/intel_gtt.c
index 1428e2b9075a..b30e4478f098 100644
--- a/drivers/gpu/drm/i915/gt/intel_gtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gtt.c
@@ -337,6 +337,18 @@ int setup_scratch_page(struct i915_address_space *vm)
if (size == I915_GTT_PAGE_SIZE_4K)
return -ENOMEM;
+ /*
+ * If we need 64K minimum GTT pages for device local-memory,
+ * like on XEHPSDV, then we need to fail the allocation here,
+ * otherwise we can't safely support the insertion of
+ * local-memory pages for this vm, since the HW expects the
+ * correct physical alignment and size when the page-table is
+ * operating in 64K GTT mode, which includes any scratch PTEs,
+ * since userspace can still touch them.
+ */
+ if (HAS_64K_PAGES(vm->i915))
+ return -ENOMEM;
+
size = I915_GTT_PAGE_SIZE_4K;
} while (1);
}
--
2.20.1
next prev parent reply other threads:[~2021-12-08 14:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 14:16 [Intel-gfx] [PATCH 0/4] drm/i915: Basic enabling of 64k page support Ramalingam C
2021-12-08 14:16 ` [Intel-gfx] [PATCH 1/4] drm/i915: Add has_64k_pages flag Ramalingam C
2021-12-08 16:08 ` Andi Shyti
2021-12-08 14:16 ` [Intel-gfx] [PATCH 2/4] drm/i915/xehpsdv: set min page-size to 64K Ramalingam C
2021-12-08 14:34 ` Matthew Auld
2021-12-08 15:10 ` Thomas Hellström
2021-12-08 15:48 ` Ramalingam C
2021-12-08 16:09 ` Andi Shyti
2021-12-08 14:16 ` [Intel-gfx] [PATCH 3/4] drm/i915/gtt/xehpsdv: move scratch page to system memory Ramalingam C
2021-12-08 16:11 ` Andi Shyti
2021-12-08 14:16 ` Ramalingam C [this message]
2021-12-08 16:12 ` [Intel-gfx] [PATCH 4/4] drm/i915: enforce min page size for scratch Andi Shyti
2021-12-08 15:34 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Basic enabling of 64k page support Patchwork
2021-12-08 16:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-12-08 20:36 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Basic enabling of 64k page support (rev2) Patchwork
2021-12-08 21:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-12-09 3:14 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-12-09 16:45 ` [Intel-gfx] [PATCH 0/4] drm/i915: Basic enabling of 64k page support Ramalingam C
-- strict thread matches above, loose matches on Subject: below --
2021-12-07 16:51 [Intel-gfx] [PATCH 0/4] " Ramalingam C
2021-12-07 16:51 ` [Intel-gfx] [PATCH 4/4] drm/i915: enforce min page size for scratch Ramalingam C
2021-12-08 13:32 ` Thomas Hellström
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=20211208141613.7251-5-ramalingam.c@intel.com \
--to=ramalingam.c@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=thomas.hellstrom@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