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>,
Andi <andi.shyti@intel.com>,
Matthew Auld <matthew.auld@intel.com>,
Chris_intel_ID <chris.p.wilson@intel.com>
Subject: [Intel-gfx] [PATCH 4/4] drm/i915: enforce min page size for scratch
Date: Tue, 7 Dec 2021 22:21:56 +0530 [thread overview]
Message-ID: <20211207165156.31244-5-ramalingam.c@intel.com> (raw)
In-Reply-To: <20211207165156.31244-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.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@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..869b771a5fdc 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 userpsace can still touch them.
+ */
+ if (HAS_64K_PAGES(vm->i915))
+ return -ENOMEM;
+
size = I915_GTT_PAGE_SIZE_4K;
} while (1);
}
--
2.20.1
WARNING: multiple messages have this Message-ID (diff)
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>,
Andi <andi.shyti@intel.com>,
Matthew Auld <matthew.auld@intel.com>,
Chris_intel_ID <chris.p.wilson@intel.com>
Subject: [PATCH 4/4] drm/i915: enforce min page size for scratch
Date: Tue, 7 Dec 2021 22:21:56 +0530 [thread overview]
Message-ID: <20211207165156.31244-5-ramalingam.c@intel.com> (raw)
In-Reply-To: <20211207165156.31244-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.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@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..869b771a5fdc 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 userpsace 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-07 16:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 16:51 [Intel-gfx] [PATCH 0/4] Basic enabling of 64k page support Ramalingam C
2021-12-07 16:51 ` Ramalingam C
2021-12-07 16:51 ` [Intel-gfx] [PATCH 1/4] drm/i915: Add has_64k_pages flag Ramalingam C
2021-12-07 16:51 ` Ramalingam C
2021-12-08 12:43 ` [Intel-gfx] " Thomas Hellström (Intel)
2021-12-08 12:59 ` Matthew Auld
2021-12-08 13:22 ` Thomas Hellström (Intel)
2021-12-07 16:51 ` [Intel-gfx] [PATCH 2/4] drm/i915/xehpsdv: set min page-size to 64K Ramalingam C
2021-12-07 16:51 ` Ramalingam C
2021-12-08 12:50 ` [Intel-gfx] " Thomas Hellström (Intel)
2021-12-07 16:51 ` [Intel-gfx] [PATCH 3/4] drm/i915/gtt/xehpsdv: move scratch page to system memory Ramalingam C
2021-12-07 16:51 ` Ramalingam C
2021-12-08 13:26 ` [Intel-gfx] " Thomas Hellström
2021-12-07 16:51 ` Ramalingam C [this message]
2021-12-07 16:51 ` [PATCH 4/4] drm/i915: enforce min page size for scratch Ramalingam C
2021-12-08 13:32 ` [Intel-gfx] " Thomas Hellström
2021-12-07 20:01 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Basic enabling of 64k page support Patchwork
2021-12-07 20:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-12-08 3:46 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2021-12-08 14:16 [Intel-gfx] [PATCH 0/4] drm/i915: " Ramalingam C
2021-12-08 14:16 ` [Intel-gfx] [PATCH 4/4] drm/i915: enforce min page size for scratch Ramalingam C
2021-12-08 16:12 ` Andi Shyti
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=20211207165156.31244-5-ramalingam.c@intel.com \
--to=ramalingam.c@intel.com \
--cc=andi.shyti@intel.com \
--cc=chris.p.wilson@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=thomas.hellstrom@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 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.