From: Maarten Lankhorst <dev@lankhorst.se>
To: intel-xe@lists.freedesktop.org
Subject: [FOR-CI-DO-NOT-REVIEW 05/12] drm/xe: Do not dereference ggtt_node in xe_bo.c
Date: Thu, 8 Jan 2026 11:34:08 +0100 [thread overview]
Message-ID: <20260108103412.637731-6-dev@lankhorst.se> (raw)
In-Reply-To: <20260108103412.637731-1-dev@lankhorst.se>
A careful inspection of __xe_ggtt_insert_bo_at() shows that
the ggtt_node can always be seen as inserted from xe_bo.c
due to the way error handling is performed.
The checks are also a little bit too paranoid, since we
never create a bo with ggtt_node[id] initialised but not
inserted into the GGTT, which can be seen by looking at
__xe_ggtt_insert_bo_at()
Additionally, the size of the GGTT is never bigger than 4 GB,
so adding a check at that level is incorrect.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
drivers/gpu/drm/xe/xe_bo.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 8b6474cd3eaf2..21e7a738cfed8 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -1709,7 +1709,7 @@ static void xe_ttm_bo_destroy(struct ttm_buffer_object *ttm_bo)
xe_assert(xe, list_empty(&ttm_bo->base.gpuva.list));
for_each_tile(tile, xe, id)
- if (bo->ggtt_node[id] && bo->ggtt_node[id]->base.size)
+ if (bo->ggtt_node[id])
xe_ggtt_remove_bo(tile->mem.ggtt, bo);
#ifdef CONFIG_PROC_FS
@@ -3603,8 +3603,8 @@ void xe_bo_put(struct xe_bo *bo)
might_lock(&bo->client->bos_lock);
#endif
for_each_tile(tile, xe_bo_device(bo), id)
- if (bo->ggtt_node[id] && bo->ggtt_node[id]->ggtt)
- xe_ggtt_might_lock(bo->ggtt_node[id]->ggtt);
+ if (bo->ggtt_node[id])
+ xe_ggtt_might_lock(tile->mem.ggtt);
drm_gem_object_put(&bo->ttm.base);
}
}
--
2.51.0
next prev parent reply other threads:[~2026-01-08 10:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-08 10:34 [FOR-CI-DO-NOT-REVIEW 00/12] Testing entire GGTT privatization preparation series Maarten Lankhorst
2026-01-08 10:34 ` [FOR-CI-DO-NOT-REVIEW 01/12] drm/xe: Start using ggtt->start in preparation of balloon removal Maarten Lankhorst
2026-01-08 10:34 ` [FOR-CI-DO-NOT-REVIEW 02/12] drm/xe: Convert xe_fb_pin to use a callback for insertion into GGTT Maarten Lankhorst
2026-01-08 10:34 ` [FOR-CI-DO-NOT-REVIEW 03/12] drm/xe: Add xe_ggtt_node_addr() to avoid dereferencing xe_ggtt_node Maarten Lankhorst
2026-01-08 10:34 ` [FOR-CI-DO-NOT-REVIEW 04/12] drm/xe/display: Avoid " Maarten Lankhorst
2026-01-08 10:34 ` Maarten Lankhorst [this message]
2026-01-08 10:34 ` [FOR-CI-DO-NOT-REVIEW 06/12] drm/xe: Improve xe_gt_sriov_pf_config GGTT handling Maarten Lankhorst
2026-01-08 10:34 ` [FOR-CI-DO-NOT-REVIEW 07/12] drm/xe: Privatize xe_ggtt_node Maarten Lankhorst
2026-01-08 10:34 ` [FOR-CI-DO-NOT-REVIEW 08/12] drm/xe: Make xe_ggtt_node offset relative to starting offset Maarten Lankhorst
2026-01-08 10:34 ` [FOR-CI-DO-NOT-REVIEW 09/12] drm/xe: Rewrite GGTT VF initialisation Maarten Lankhorst
2026-01-08 14:50 ` [FOR-CI-DO-NOT-REVIEW 10/12] drm/xe: Move struct xe_ggtt to xe_ggtt.c Maarten Lankhorst
2026-01-08 14:50 ` [FOR-CI-DO-NOT-REVIEW 11/12] drm/xe: Make xe_ggtt_node_insert return a node Maarten Lankhorst
2026-01-08 14:50 ` [FOR-CI-DO-NOT-REVIEW 12/12] drm/xe: Remove xe_ggtt_node_allocated Maarten Lankhorst
2026-01-08 17:25 ` [FOR-CI-DO-NOT-REVIEW 11/12] drm/xe: Make xe_ggtt_node_insert return a node Maarten Lankhorst
2026-01-08 17:25 ` [FOR-CI-DO-NOT-REVIEW 12/12] drm/xe: Remove xe_ggtt_node_allocated Maarten Lankhorst
-- strict thread matches above, loose matches on Subject: below --
2026-01-08 20:25 [FOR-CI-DO-NOT-REVIEW 00/12] Testing entire GGTT privatization preparation series Maarten Lankhorst
2026-01-08 20:25 ` [FOR-CI-DO-NOT-REVIEW 05/12] drm/xe: Do not dereference ggtt_node in xe_bo.c Maarten Lankhorst
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=20260108103412.637731-6-dev@lankhorst.se \
--to=dev@lankhorst.se \
--cc=intel-xe@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