[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] xen/spinlock: use correct pointer


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Thu, 25 Apr 2024 16:45:46 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nNeK6N9wpfbbLcb1iF7zED3QFLOXRI3qCXVxgpC+kJE=; b=EJZPiOXrLRHKSqbnXr74GIHVhinRi8eCYP8bE+82fW0wvO5iMuv16OsotMSDn+mXeYUx7fM0ny53+B3k1XkEntIELl19YTH1pw4AlVfBbOUWirc8ESORGc0UmDBP9f7r+sc9mKF0ov71knpvX+tL9nVYpzPZ7B4JwVIddChdUoJhSSsKAbAusQM2e4Ro033g6X7w6SzhO9CG44YT4KS8OrPYqiIbzIXELhHhcXg1fK68B1cGqaBai+AvktIfWXjOo5OEN6HryoFJmAFZ+sxbMcHY3NLKNW4TiezN0kjmyNt6rn1Hdea2j6qpdjKJM/ud3x9E/ixRK5h//oU53kao5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X7iQ0LykB+aWpY57hw9GsM2NKOF5VxhgSWCoxCo27yoe4tz4vqn1x27y/IsL4e82eG2UKGcFNcXB876zpOjBnY2wuC1VL6eaPKAhCtSbUWzK1QLUZfS2xPb0GL29+zMwqnbl3M+Fek9PAAs4KT4XaNATRpvyPJI5f3xHrzuTcL5VkD0AMjjX0Fdgazn/ao2eZ0e3papHBngYyuUEJZxOc+b7JUHP6qvKgPNER1Fpo4F+TflvA7j9iP0mQluFvnJ2kCKM66bbPKI8mmevVqsVv3/gMKp5vAC4KcMDYazivyH3VAHAjDXfKH7Kbte2v4TY4EGKiwTRj8Ehsodo4reCeA==
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 25 Apr 2024 20:46:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The ->profile member is at different offsets in struct rspinlock and
struct spinlock. When initializing the profiling bits of an rspinlock,
an unrelated member in struct rspinlock was being overwritten, leading
to mild havoc. Use the correct pointer.

Fixes: b053075d1a7b ("xen/spinlock: make struct lock_profile rspinlock_t aware")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
---
 xen/common/spinlock.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 558ea7ac3518..28c6e9d3ac60 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -789,7 +789,11 @@ static int __init cf_check lock_prof_init(void)
     {
         (*q)->next = lock_profile_glb_q.elem_q;
         lock_profile_glb_q.elem_q = *q;
-        (*q)->ptr.lock->profile = *q;
+
+        if ( (*q)->is_rlock )
+            (*q)->ptr.rlock->profile = *q;
+        else
+            (*q)->ptr.lock->profile = *q;
     }
 
     _lock_profile_register_struct(LOCKPROF_TYPE_GLOBAL,

base-commit: 23cd1207e7f6ee3e51fb42e11dba8d7cdb28e1e5
-- 
2.43.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.