From 836ef56c51c9f904417f165815e8a3b197bd9d00 Mon Sep 17 00:00:00 2001 From: Juston Li Date: Fri, 8 Dec 2023 13:51:12 -0800 Subject: [PATCH] venus: fix query feedback copy sanitize off by 1 Copy sanitization incorrectly included +1 range of the reset. Eg Reset Query=0 QueryCount=5 is [0,5) exclusive, not [0,5] inclusive. Fixes: 5b24ab91e43 ("venus: switch to unconditionally deferred query feedback") Signed-off-by: Juston Li Part-of: (cherry picked from commit 4f2b4b81d16edec691940f84e9b2b8e2cdb3dfd4) --- .pick_status.json | 2 +- src/virtio/vulkan/vn_queue.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ba10926..045101c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1364,7 +1364,7 @@ "description": "venus: fix query feedback copy sanitize off by 1", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "5b24ab91e43a54b4f4081db52ebf6653b97e72bb", "notes": null diff --git a/src/virtio/vulkan/vn_queue.c b/src/virtio/vulkan/vn_queue.c index 31e2d2d..9d8f6ad 100644 --- a/src/virtio/vulkan/vn_queue.c +++ b/src/virtio/vulkan/vn_queue.c @@ -547,7 +547,7 @@ vn_combine_query_feedback_batches_and_record( (vn_query_pool_to_handle(batch_clone->query_pool) == vn_query_pool_to_handle(batch->query_pool)) && batch_clone->query >= batch->query && - batch_clone->query <= batch->query + batch->query_count) { + batch_clone->query < batch->query + batch->query_count) { simple_mtx_lock(&feedback_cmd_pool->mutex); list_move_to(&batch_clone->head, &cmd_pool->free_query_batches); -- 2.7.4