From patchwork Thu Apr 25 20:45:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13643748 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98A1FC4345F for ; Thu, 25 Apr 2024 20:46:25 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.712284.1112872 (Exim 4.92) (envelope-from ) id 1s05yk-0005ZG-SF; Thu, 25 Apr 2024 20:46:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 712284.1112872; Thu, 25 Apr 2024 20:46:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s05yk-0005Z9-PQ; Thu, 25 Apr 2024 20:46:02 +0000 Received: by outflank-mailman (input) for mailman id 712284; Thu, 25 Apr 2024 20:46:01 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s05yj-0005Z3-BH for xen-devel@lists.xenproject.org; Thu, 25 Apr 2024 20:46:01 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [2a01:111:f403:2414::601]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d1734622-0344-11ef-b4bb-af5377834399; Thu, 25 Apr 2024 22:45:58 +0200 (CEST) Received: from DM6PR02CA0165.namprd02.prod.outlook.com (2603:10b6:5:332::32) by BY1PR12MB8446.namprd12.prod.outlook.com (2603:10b6:a03:52d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Thu, 25 Apr 2024 20:45:55 +0000 Received: from DS1PEPF0001709D.namprd05.prod.outlook.com (2603:10b6:5:332:cafe::d4) by DM6PR02CA0165.outlook.office365.com (2603:10b6:5:332::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.35 via Frontend Transport; Thu, 25 Apr 2024 20:45:55 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0001709D.mail.protection.outlook.com (10.167.18.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.19 via Frontend Transport; Thu, 25 Apr 2024 20:45:55 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 25 Apr 2024 15:45:54 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 25 Apr 2024 15:45:54 -0500 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 25 Apr 2024 15:45:53 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d1734622-0344-11ef-b4bb-af5377834399 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X7iQ0LykB+aWpY57hw9GsM2NKOF5VxhgSWCoxCo27yoe4tz4vqn1x27y/IsL4e82eG2UKGcFNcXB876zpOjBnY2wuC1VL6eaPKAhCtSbUWzK1QLUZfS2xPb0GL29+zMwqnbl3M+Fek9PAAs4KT4XaNATRpvyPJI5f3xHrzuTcL5VkD0AMjjX0Fdgazn/ao2eZ0e3papHBngYyuUEJZxOc+b7JUHP6qvKgPNER1Fpo4F+TflvA7j9iP0mQluFvnJ2kCKM66bbPKI8mmevVqsVv3/gMKp5vAC4KcMDYazivyH3VAHAjDXfKH7Kbte2v4TY4EGKiwTRj8Ehsodo4reCeA== 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-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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nNeK6N9wpfbbLcb1iF7zED3QFLOXRI3qCXVxgpC+kJE=; b=D1rMqNeMgrSoVxPkRTSr5FND4/gMIYr2x/6jkajUgJ5QfnZkR6UI/A8VxSmbq0ejE7raOlBeoWGFvMJ+FjyRf9HYBocDMEMy9F8wdndVVG54ZixocuSjeXsaNjX9QaCbwL++E17C5nQasSMBFe5ke4G0T/NofCZQdNBCWCbN/5M= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=permerror action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Stewart Hildebrand To: CC: Stewart Hildebrand , Juergen Gross , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH] xen/spinlock: use correct pointer Date: Thu, 25 Apr 2024 16:45:46 -0400 Message-ID: <20240425204547.658536-1-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: stewart.hildebrand@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709D:EE_|BY1PR12MB8446:EE_ X-MS-Office365-Filtering-Correlation-Id: 265215ec-17e3-4328-4674-08dc6568b43b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YmHJqAI5nSGQ6rPUiQP9PmGLd1pgK/XOS0rMfeCMqnygD7oDNbsvwgCzF0rK0Y/F5X0MoqUJtA6+WgdyslFgB+3FSjhT/p+sXFobZMS/TivLQ5ApHp+RWdkgIXhT+9/1IdF6/c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CzbbCWZdjJHUSUow86u98jFCuLyrxTHh6sED54e5eukH2BQCFWA6aKwhYD7nKjp2bQZ2FVYp9j88NqCDQU8NsGvgyLcqfBA4ycLgJMGpl5vDQKEb2KUFmPj2USTytOCR7MTBCsNg8P5iGdHVeTopkqq7+jrv8exVWD3bZW5AP53+o/vLxjNnYhIdxQ1alQcmq7lAFEBbIe4 X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(36860700004)(1800799015)(82310400014)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2024 20:45:55.3774 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 265215ec-17e3-4328-4674-08dc6568b43b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR12MB8446 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 Reviewed-by: Jan Beulich Reported-by: tag? --- xen/common/spinlock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) base-commit: 23cd1207e7f6ee3e51fb42e11dba8d7cdb28e1e5 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,