From patchwork Fri Mar 18 15:15:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12785507 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 DCACCC433FE for ; Fri, 18 Mar 2022 15:32:23 +0000 (UTC) Received: from localhost ([::1]:48912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVEaU-0001KM-S0 for qemu-devel@archiver.kernel.org; Fri, 18 Mar 2022 11:32:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKq-0003Q7-Vj for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:13 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:64150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKo-0004S6-8g for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:12 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22ICdRUf011365; Fri, 18 Mar 2022 15:16:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=YS4qhZXEWr7Bte/j7PeTSgoi7OVw5gRwQz9QxnmoTMY=; b=HjZTMT8sGbhGMBl60BiBYp+tOOTUlzfl9EIrC4or4IMgnnVFcV5S3Ne4+CtII6v+3Kwy OBAj2GLinOpeaouOdgtz1uoxJImacYO7hTDJTkJjAEdCeFgkT1km9exUun+HTg+mz7Dw TUZR74NwMAEO0asqifkihrmgAF540Ex9JnTPzMrTBTcBE/zcgQNrp6v9g8+WzDjFInx/ 36m+DrGOAX0ls+mQYtXo+TzNzxg/G4kkTqtKNa1OWUQ7lcYY3GYjEwauLg1p2Zz6vru2 LTMiibPCjHv7wwDmBPFDPmaNJxvhzXYqyayGfenWbBicDFWGg0xcIYwzlZMO9Mp2CEXZ ww== Received: from aserp3030.oracle.com ([141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3et60rkvxx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:06 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22IFAnm0171748; Fri, 18 Mar 2022 15:16:05 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2049.outbound.protection.outlook.com [104.47.57.49]) by aserp3030.oracle.com with ESMTP id 3et64u42bc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oVqwqxkmKfaJaJacwPaB/4krr015UK0DWXGSvC2xQgLSsg0dZbWf5ClSwBV+K0ImW65zU3/ob5EcygRd83b8yJa5pXQBRTzJPnNI95YMjvXtDKF6qlnv8NEHaIu9GDhf4Sx+i9XPrtoW7HULu2rRyIhHoSpdpBlOzWSHEcixxGJQPAsdmU8tHF40o1J5hNoMjTC2MmFF3q+DI/LNL+es9s00LaGLRV1fWySZc4xW1zWa4OgY1Dgjtfyz/9b9np9bOEdltrBzvsNLT/wBoFP6x+UmpSdDRP+TH9R22BbnNB9fQdukP9dHAqLyK2slQtgcoO/FwgHvx/cbfKIQ/1C9zQ== 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=YS4qhZXEWr7Bte/j7PeTSgoi7OVw5gRwQz9QxnmoTMY=; b=EzOpct39uiHl1y56y5BjCicUswITvDVGynmE87OXMCrOTC2ANZ5yROhFg15ThGdSfLCabmkeo5GsTd7doDh0hJqwsikD0ZRgsctnNmrVM/5SHXBibSItJDKaIS3/0niSlNwsrbq+mzkK8zG2PqphbR0Eiv6Z/EsW0INswXLZRP/5G32ToEt7Kx/nvzmpxPYiZZ2HiktG19bueAzmwPlBypMGkWiqOtA7CunIrRP5zFFmQodTamTnd4FjpxdpWs2zYn1MNITr09arbuuPD7IcB1+iZ2hvuunSaPKtdcmyetQM+3q9LfpE1kSICP3HUZqzDudWmL8jQh3enlgotNwdnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YS4qhZXEWr7Bte/j7PeTSgoi7OVw5gRwQz9QxnmoTMY=; b=JnmbiBTZCm65Lvy/7KLpEoEyfyHs5Lt6KKG5Da5O0chHkt8TYFOiNjjrvW1QXYxH8kM3bKAxUxXRZCam/vx4/lwexzUZVR8AeF2tnQLh5EmNxV8+yh+XPXYl4Bz3II3BqCbvYXHcy/iBY9UlHGc7+kNOjT1KyOjMcYbi1LXvhO4= Received: from MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) by MN2PR10MB4174.namprd10.prod.outlook.com (2603:10b6:208:1dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Fri, 18 Mar 2022 15:16:04 +0000 Received: from MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e]) by MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e%3]) with mapi id 15.20.5081.015; Fri, 18 Mar 2022 15:16:03 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH v2 1/5] accel: Introduce AccelOpsClass::destroy_vcpu_thread() Date: Fri, 18 Mar 2022 10:15:51 -0500 Message-Id: <20220318151555.381737-2-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220318151555.381737-1-mark.kanda@oracle.com> References: <20220318151555.381737-1-mark.kanda@oracle.com> X-ClientProxiedBy: DM5PR06CA0059.namprd06.prod.outlook.com (2603:10b6:3:37::21) To MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1d136ce-135c-4fd0-5c84-08da08f2376b X-MS-TrafficTypeDiagnostic: MN2PR10MB4174:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YmmrC0z3fT28lKDgsifpiVeGIc/57SgdjUdQK7j5GBlEDN2PzXh4VMi1GUniDQkxTm+2bFkUbXa01de3SERThF9IcMkJJd3Fy2LDRHW6TvvXwh4AQ7KrtHt5IXKax4bIyTnU65nvPA9E5Ewu87ZAqiJX/Vz7vNNLNv+eZmyzux/yS5jijCL3wAtefAWFPC0qF4IfvxMZ/1LZUy+Iypa7Yt1Sf83B4SeWidVegeID99EAKmBpY6jtbJkDz6pf7mNnZzqSf/7bqORJQe6XfkAmMpRZtGLe8XRKvMkgSjGCR1qKosWOF3qf1pHLj7SrPg0+R43mP4W3a6Y74q+jp0SIZ/rR4rL37G1RmZ/Bb1681U0MmdrtODc4r7hx0eYxZsA7mmKdq8XM2VLKzchL4uCS7QSXntY2DMuzhFdojEa2soP//4xhDtfXu+IWcH3fzKVL6/lpn3NOEF/tU3XSLE0CPyCYoZ858EZaVJXPoDW5sTwSRBWsCrmJQ+70L6CYWDb6N6u1ebL3b5NKjTKX3wUwaEua+n/8aG63CEe+R7ixVOKS5B8lRIB8mLCVBqdtlMEytzzET30mGq2S3EBSCWZL75899nfFnTlQAuLLeKYYtVX78az4KMMJwyLNKLD35ZJFy7eGlxSIFjnXQgHEwgLRUA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR10MB5825.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(52116002)(6506007)(508600001)(36756003)(6666004)(2616005)(1076003)(6486002)(6512007)(86362001)(186003)(316002)(8936002)(2906002)(6916009)(5660300002)(44832011)(66946007)(4326008)(66556008)(66476007)(8676002)(38100700002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: d5w8iCtAar42hHrlSbqT+y0WrPQn/cbkJTCJIOmLNydsIb0srvFY2YG7fpGEC+knnCZV2A/dTQR+lEW5emSzb+3sUc1ibGzLZylWLQPGfHaV8z9QG2QErOVbsabO97mPzazdhvq189pnRQO6gffxhu/jKTNC68Z1ope2enfjcukAtNw2noenX/TA9I5uKguj6+KLVAoEKCQTz01mf1FpzS9vJy6SNCMxXZK664BYM076KAKsj6QqQ/hLydANG6vS5aCT+UstjYE510GdOFbdvCMUIDT4pRX0KLmhlwnu0hz9XL32lLg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dQC+0PwnRmgALBv1FA1Ygm5RghTzHgOtcygk1JkY4ihkKUnnK/dEka0+tM++MaDLJy6ZRRGooICNYPG0vAIN1HB5mjWJJ97cmBS8G0bucBDc+mn2vuozO4c= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1d136ce-135c-4fd0-5c84-08da08f2376b X-MS-Exchange-CrossTenant-AuthSource: MW5PR10MB5825.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2022 15:16:03.8892 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HpmYZRP5SIgTZjVcvSviH65oGw47nZaU8g92MFd5tLCQR2u1qQgKl9Ca1ESi42jdxgywcJd6b7PkU/KojPBUEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4174 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10289 signatures=693715 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 suspectscore=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203180085 X-Proofpoint-GUID: brj0UrQeGysI62PltC54Hu3PFDRic_Sm X-Proofpoint-ORIG-GUID: brj0UrQeGysI62PltC54Hu3PFDRic_Sm Received-SPF: pass client-ip=205.220.177.32; envelope-from=mark.kanda@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, richard.henderson@linaro.org, Philippe Mathieu-Daude Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add destroy_vcpu_thread() to AccelOps as a method for vcpu thread cleanup. This will be used in subsequent patches. Suggested-by: Philippe Mathieu-Daude Signed-off-by: Mark Kanda Reviewed-by: Philippe Mathieu-Daudé --- include/sysemu/accel-ops.h | 1 + softmmu/cpus.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 6013c9444c..e296b27b82 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -31,6 +31,7 @@ struct AccelOpsClass { bool (*cpus_are_resettable)(void); void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ + void (*destroy_vcpu_thread)(CPUState *cpu); void (*kick_vcpu_thread)(CPUState *cpu); bool (*cpu_thread_is_idle)(CPUState *cpu); diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 7b75bb66d5..622f8b4608 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -609,6 +609,9 @@ void cpu_remove_sync(CPUState *cpu) qemu_mutex_unlock_iothread(); qemu_thread_join(cpu->thread); qemu_mutex_lock_iothread(); + if (cpus_accel->destroy_vcpu_thread) { + cpus_accel->destroy_vcpu_thread(cpu); + } } void cpus_register_accel(const AccelOpsClass *ops) From patchwork Fri Mar 18 15:15:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12785510 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 317DAC433F5 for ; Fri, 18 Mar 2022 15:34:18 +0000 (UTC) Received: from localhost ([::1]:53098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVEcL-0004AS-0m for qemu-devel@archiver.kernel.org; Fri, 18 Mar 2022 11:34:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKs-0003Uk-IQ for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:14 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:6124) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKq-0004SA-2j for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:14 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22ICdXdA017022; Fri, 18 Mar 2022 15:16:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=nq+rMN4EZdbNtxnnFneKPq1ygOexbKbz9dWpq0T8m74=; b=gZPNibcjtDKmO0wFZX0a/6OxHxrcc4zKELnMs1Tn5eWeK5TahXtpLYweCIq4ik66tF3H hGJW5KFvzSgrr8G8vprHOOGdSmp7d4nve7Yubbr0JHzrbEfWGq5R+MkMEtbKFraA4vQM fVNXRd6LGNUiLZz2mKEAmyb1maMUIMpAiTSzxSLh4S/9WCzdZZNJ4cYDnzlROu67MJ71 B17tfXnL3y+N+dUHV1Y6dpP61huGJHb3NMNR+1ceUcsEnaGrPt+3KetYaG1EiVGe47Kw UL4QbiGmk/lrxALREteuFk4vJFKeBZoy25R5aM74mgETHoeVJH1bMs5cPPfTnUxoBVOW vA== Received: from aserp3030.oracle.com ([141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3et5xwusvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:07 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22IFAecv171688; Fri, 18 Mar 2022 15:16:06 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2048.outbound.protection.outlook.com [104.47.57.48]) by aserp3030.oracle.com with ESMTP id 3et64u42bg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G9JXZGeNlajnNaKfVX53SK8SS6aNYKzYXY0uaHAdVugN/rJQJK4mKlkKWuWhwOYDxtU525/yuqdO1MXyOOXZte8qWOg2p2HvKKNnZqcKAWnHQtXUgIQwpriSbpcp6e5aEp362w1a276CblelltoTz0qYAneSQ6O/SjjBzUcBCPP2xA64GUzF8XWcUhimFxjlJe2euBLkSfqid/vSxTY66t51aPkbh2varPTcjD2mIlbRNnysuWGvOD1NrNBFpyEuBa0uUN1DBd64Cgu3t9T/Zsk4KbO3K4MofwznnepLbS0/vb8Rab8P12m0Woy+drjo3qM8NG1noICK+w4PUxJKZg== 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=nq+rMN4EZdbNtxnnFneKPq1ygOexbKbz9dWpq0T8m74=; b=PT7Dzx8SjpiYd5bo7qZzLxiwTi9eu5SdAEsyXyE0doNjR/crd5LVwbf61pMNzem94epglOUoGpsmUGQOxjNbgGG5PUdsp4Hgpntchsz+6qAcLndQ1KQYonFJhSBQMbiqJpHvax0eOzCvb8oGNucaNj+s/JQXHTI+9taHocxQY4BCrTtakSfcrHQHceJOu8Hr+aVK3xtBFUJ9WfQqiqquasMFtuJVyvMOtt93vbk7LoU8SxmcEnTbT6BnIUCcey+Wn8RbHn/kYyllze+OoFksrSnlHkf6r3xTMBA7Txwncq6CcQDWxntTn9FihX0zGQhkAd4qczSX5JhLM3yMUsbRPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nq+rMN4EZdbNtxnnFneKPq1ygOexbKbz9dWpq0T8m74=; b=Vgtor91zHFqbxA/b9CevFxM6Vs1Mi3vE194OypeYCXM3fUntK74YZ2RUfFV2nW24Lxy4TOB+rIiJ5LMnRpsj/NC12uoqUkdDhHLh+RZAJtgGQhH+G5Hgw2/4IhzN9aeYpmpdEEkC4KhbMgSquQYfct1w+j5WEOGKeU87f4h6IUM= Received: from MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) by MN2PR10MB4174.namprd10.prod.outlook.com (2603:10b6:208:1dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Fri, 18 Mar 2022 15:16:04 +0000 Received: from MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e]) by MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e%3]) with mapi id 15.20.5081.015; Fri, 18 Mar 2022 15:16:04 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH v2 2/5] softmmu/cpus: Free cpu->thread in destroy_vcpu_thread_generic() Date: Fri, 18 Mar 2022 10:15:52 -0500 Message-Id: <20220318151555.381737-3-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220318151555.381737-1-mark.kanda@oracle.com> References: <20220318151555.381737-1-mark.kanda@oracle.com> X-ClientProxiedBy: DM5PR06CA0059.namprd06.prod.outlook.com (2603:10b6:3:37::21) To MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86c7bb2f-81a8-43be-78f9-08da08f23844 X-MS-TrafficTypeDiagnostic: MN2PR10MB4174:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L7btBA4IcuyKFdXIFXZMqfohN2uYIjjkNe8PPn/tOK0eN6gw8IbbgIJEmwWD8KojuLf6kgdFLx31NCjrh00NK+NIb4oTk0ydPW29dtkUxfrF1D8sBNShEzrxJrP8XBcxjafLOFDgo+9D6h5OA+MfvIzsuldNWRPz+4FABnm06+bD+zQGKJr6WlT4bJuuyhPypd8K8iILlctC1tlOs0uubRQvWjJdFWBKoS8Sr0cZ2RgsXNHLrR6IXsuPad9EYpzb0aJaRro1rd0XguE2BOq5vK6KRcnOkMT/5hP5GIpn9CyFc+xN41lvXAxmqM750qLUmDxJ5NqHf5dORRNqbUOnSVCJvMkIXOBWWOIzezGTqQnebqCOWb1p9JwuweGx0tpWtnX9pXSLAde+CkwAQe1XqSSf/bzIWWfqMmsy3GvtM3kN0FNq8qaztWgKjtvBzkT0E7c6yigOs1MJJuOV+dHuBj9TEs7ix07KNJyX7yovWjMdGm9Bp0wS0nFid1xGsCAY634Pbzd4YIO3FrYN4WrQ+fjgf0WvJgiFNd4NAKCdI/SfbzBHvUFmo9l3VPGw5E6Ny00bLt+w7DWoDtmqRjPuzXxYut4L9P1UPYDGwEiMxQex5Z8BUOa3HD6D33IwEHdGuT4/qJGhOm7c4BbyyN3NwSUCOeTd21cY6SCDQ01jRJQOGBOvMlpldV9+WOF3oN4o X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR10MB5825.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(52116002)(6506007)(107886003)(508600001)(36756003)(6666004)(2616005)(1076003)(6486002)(6512007)(86362001)(186003)(316002)(8936002)(2906002)(6916009)(5660300002)(44832011)(66946007)(4326008)(66556008)(66476007)(8676002)(38100700002)(83380400001)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 20fGpWnTkRPHUTT/UiNNYIONdQ3qVXAl39ywxYpvaWcC94lK6gqERPbUEXMVgqYi0f1UZpMxVS5GB2+uermrrgy98YlcKEr9D38QJ/5JCflKOqa1xBekDvlpYO+haz6r++t6g6e0RIgt0EiI6r3EOhODVdYBiu4NfY+CFBphkv5K7NfVhBSag4iMb19sAEmv6NTk/qJB7WpWeyNtnARGtt7qu/sxaQOW/qGFajsOzJqZVcJ3ZMmbsH34EQV8HknLO7+RSk+zXbao3XHNdAYZqjfmzqdcaNES2guPqCFOgk1x6WNMYW3wwkAkX8k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EdDcBJBjQ23LZPbDLpF9WQMVwTH0TKerdy+wwt473ciySKlsK6SXM4mu/Y+QHEKRS6gIA6TPX0hlWleEHlU/+RS4xh0dubKSw3QClCpahvIQStD9PrA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86c7bb2f-81a8-43be-78f9-08da08f23844 X-MS-Exchange-CrossTenant-AuthSource: MW5PR10MB5825.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2022 15:16:04.6871 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cWcDOkXJA0Xe+pNyzo0mERGaKTYs4Xtf8bMLNPWtWoulmPb/zhMi44kF2X6Zol7EkSp2kUPtvRZDwdKPSsUJ7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4174 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10289 signatures=693715 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 suspectscore=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203180085 X-Proofpoint-GUID: lCzKEd__gK3zc8cqMXwc0zk5cFMPrb8I X-Proofpoint-ORIG-GUID: lCzKEd__gK3zc8cqMXwc0zk5cFMPrb8I Received-SPF: pass client-ip=205.220.165.32; envelope-from=mark.kanda@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Use a new AccelOpsClass::destroy_vcpu_thread() handler destroy_vcpu_thread_generic() to free cpu->thread. vCPU hotunplug related leak reported by Valgrind: ==102631== 8 bytes in 1 blocks are definitely lost in loss record 1,037 of 8,555 ==102631== at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117) ==102631== by 0x69EE4CD: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5600.4) ==102631== by 0x92443A: kvm_start_vcpu_thread (kvm-accel-ops.c:68) ==102631== by 0x4505C2: qemu_init_vcpu (cpus.c:643) ==102631== by 0x76B4D1: x86_cpu_realizefn (cpu.c:6520) ==102631== by 0x9344A7: device_set_realized (qdev.c:531) ==102631== by 0x93E329: property_set_bool (object.c:2273) ==102631== by 0x93C2F8: object_property_set (object.c:1408) ==102631== by 0x940796: object_property_set_qobject (qom-qobject.c:28) ==102631== by 0x93C663: object_property_set_bool (object.c:1477) ==102631== by 0x933D3B: qdev_realize (qdev.c:333) ==102631== by 0x455EC4: qdev_device_add_from_qdict (qdev-monitor.c:713) Signed-off-by: Mark Kanda --- accel/accel-common.c | 6 ++++++ accel/hvf/hvf-accel-ops.c | 1 + accel/kvm/kvm-accel-ops.c | 1 + accel/qtest/qtest.c | 1 + accel/tcg/tcg-accel-ops.c | 1 + accel/xen/xen-all.c | 1 + include/sysemu/accel-ops.h | 2 ++ target/i386/hax/hax-accel-ops.c | 1 + target/i386/nvmm/nvmm-accel-ops.c | 1 + target/i386/whpx/whpx-accel-ops.c | 1 + 10 files changed, 16 insertions(+) diff --git a/accel/accel-common.c b/accel/accel-common.c index 7b8ec7e0f7..80b0d909b2 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -28,6 +28,7 @@ #include "cpu.h" #include "hw/core/accel-cpu.h" +#include "sysemu/accel-ops.h" #ifndef CONFIG_USER_ONLY #include "accel-softmmu.h" @@ -135,3 +136,8 @@ static void register_accel_types(void) } type_init(register_accel_types); + +void destroy_vcpu_thread_generic(CPUState *cpu) +{ + g_free(cpu->thread); +} diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 54457c76c2..69c23f6763 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -467,6 +467,7 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, void *data) AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = hvf_start_vcpu_thread; + ops->destroy_vcpu_thread = destroy_vcpu_thread_generic; ops->kick_vcpu_thread = hvf_kick_vcpu_thread; ops->synchronize_post_reset = hvf_cpu_synchronize_post_reset; diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index c4244a23c6..fd439f8e23 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -89,6 +89,7 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, void *data) AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = kvm_start_vcpu_thread; + ops->destroy_vcpu_thread = destroy_vcpu_thread_generic; ops->cpu_thread_is_idle = kvm_vcpu_thread_is_idle; ops->cpus_are_resettable = kvm_cpus_are_resettable; ops->synchronize_post_reset = kvm_cpu_synchronize_post_reset; diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index f6056ac836..3ea148ed0e 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -51,6 +51,7 @@ static void qtest_accel_ops_class_init(ObjectClass *oc, void *data) AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = dummy_start_vcpu_thread; + ops->destroy_vcpu_thread = destroy_vcpu_thread_generic; ops->get_virtual_clock = qtest_get_virtual_clock; }; diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index ea7dcad674..4ef80c81e4 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -94,6 +94,7 @@ void tcg_handle_interrupt(CPUState *cpu, int mask) static void tcg_accel_ops_init(AccelOpsClass *ops) { + ops->destroy_vcpu_thread = destroy_vcpu_thread_generic; if (qemu_tcg_mttcg_enabled()) { ops->create_vcpu_thread = mttcg_start_vcpu_thread; ops->kick_vcpu_thread = mttcg_kick_vcpu_thread; diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 69aa7d018b..c5982a782c 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -220,6 +220,7 @@ static void xen_accel_ops_class_init(ObjectClass *oc, void *data) AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = dummy_start_vcpu_thread; + ops->destroy_vcpu_thread = destroy_vcpu_thread_generic; } static const TypeInfo xen_accel_ops_type = { diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index e296b27b82..46e3190119 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -46,4 +46,6 @@ struct AccelOpsClass { int64_t (*get_elapsed_ticks)(void); }; +/* free vcpu thread structures */ +void destroy_vcpu_thread_generic(CPUState *cpu); #endif /* ACCEL_OPS_H */ diff --git a/target/i386/hax/hax-accel-ops.c b/target/i386/hax/hax-accel-ops.c index 136630e9b2..8b6715d047 100644 --- a/target/i386/hax/hax-accel-ops.c +++ b/target/i386/hax/hax-accel-ops.c @@ -79,6 +79,7 @@ static void hax_accel_ops_class_init(ObjectClass *oc, void *data) AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = hax_start_vcpu_thread; + ops->destroy_vcpu_thread = destroy_vcpu_thread_generic; ops->kick_vcpu_thread = hax_kick_vcpu_thread; ops->synchronize_post_reset = hax_cpu_synchronize_post_reset; diff --git a/target/i386/nvmm/nvmm-accel-ops.c b/target/i386/nvmm/nvmm-accel-ops.c index f788f75289..f08292406c 100644 --- a/target/i386/nvmm/nvmm-accel-ops.c +++ b/target/i386/nvmm/nvmm-accel-ops.c @@ -88,6 +88,7 @@ static void nvmm_accel_ops_class_init(ObjectClass *oc, void *data) AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = nvmm_start_vcpu_thread; + ops->destroy_vcpu_thread = destroy_vcpu_thread_generic; ops->kick_vcpu_thread = nvmm_kick_vcpu_thread; ops->synchronize_post_reset = nvmm_cpu_synchronize_post_reset; diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c index 1d30e4e2ed..17a385324c 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -93,6 +93,7 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, void *data) AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = whpx_start_vcpu_thread; + ops->destroy_vcpu_thread = destroy_vcpu_thread_generic; ops->kick_vcpu_thread = whpx_kick_vcpu_thread; ops->cpu_thread_is_idle = whpx_vcpu_thread_is_idle; From patchwork Fri Mar 18 15:15:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12785444 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 391CCC433EF for ; Fri, 18 Mar 2022 15:17:26 +0000 (UTC) Received: from localhost ([::1]:34634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVEM1-0005jQ-Cg for qemu-devel@archiver.kernel.org; Fri, 18 Mar 2022 11:17:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKr-0003Oi-DL for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:13 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:6924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKo-0004SE-Bz for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:12 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22ICdMud009939; Fri, 18 Mar 2022 15:16:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=9DhsHghyJz5PWbnPL8tSW6XFGo1rSiSnNXPNDoifFHI=; b=YyPYB40yAkKOkw2LHvldi/xPlNYvGVoUWyxF52TmyDRafJcLqrD/rU53MiY6fhkMDaCE E30VPg1Ky9n5RcAkdJ5oVYFpI9bHxqHucCRmnWZT4TAl1St2lW4Nfyjg4ZXwpyLDeOz1 w1LKYdO5cek85WacJvJdTnC/hFeuXl3KiyZhVKh9pegZ3NwFiRvXTS4TnJcAby2NSMkP 9qLBNsKXMqzG9BDP7JX1eo9Gv9rlMzpFxO3VFQSa+3CmVjHdoGc8rTBn1zjW1QoYXGb3 FbvDnnjNkkrhwNj2scCHSHh9HtNTIGPeOfb4Rh4u0+Fgmsw7f/7EZYuqI6vqVIQvVbNY sQ== Received: from aserp3030.oracle.com ([141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3et52q452v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:07 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22IFAecw171688; Fri, 18 Mar 2022 15:16:06 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2048.outbound.protection.outlook.com [104.47.57.48]) by aserp3030.oracle.com with ESMTP id 3et64u42bg-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JPPQklTiabhvFxs+PuYOxuyEvu1/vHAWqV/AfGxbctMceHL8lrP6l1LIPG6e8jjI5pIBvKRvIZNIlh03BlfVn3rKJCw5sR9WXtkcyNXJgMUp4ru3yaiKeW4ylmnvs7tpPfXYyd420Y/usdpE18AKHqP4FgSfzwZNXdHepLzMlVcmukiNK6W0QfjLNjDU8+lHEnwfAF3z8nzwscrQwcc1HEtitsx0VMfM1hyDeDGH9P4Wh1+9IyaoDznxUFiz0jwuGedfGc6jPGc5PzC9oEXzsvOUBwTI5byQ+6znmGEQ8YNJbUbszJuniQsiBtRuRD3JVx70Rv25BH8JN+ubvThiEg== 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=9DhsHghyJz5PWbnPL8tSW6XFGo1rSiSnNXPNDoifFHI=; b=AgqLFEuZox5Z7x6vQ62skt8lJgj/DuGii6ovt+SkGyuKCY34F67czxhjjlQGbdDAcj7gPzXlXLqR/om8UqaOKNakT7SUv2A5uFWWYvkLZFR5T78KAztblQhDtCkSDROVbgC/47PiekiekTJi0qvPcXF1JJpmGvWTG0TtzweHG81EuHfD8eC6CvXJiT63ZzWVbR1Vxe/kX2y4sNxVTRmT6qw7sgH23ZMtj9bpHEnGKoA2iSzDEKeCK0Vnms+PlRAU75ewePS7aQjoQmgr06mUvIq7f/Gd7fa/pKWmO3ROv5YyW/HQ2QakFtHqvU3J/SLIJRXzTKDSkosc5p8xlByrmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9DhsHghyJz5PWbnPL8tSW6XFGo1rSiSnNXPNDoifFHI=; b=p4CV2ipEnbEMrYJkJbybcASxAI1+XWLTsvmwkswhOIbjuEAPAoJosPWweDquT1LeV228LK4rpiQb+LAq+3GkN5Qu3t1SxYxoB1NEKdM7xSdRjuJnA2FhOiggt3R3H3scJvsCp8Ma2UhBGSYlAd7lyN659R6hCPf20unHck37xjg= Received: from MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) by MN2PR10MB4174.namprd10.prod.outlook.com (2603:10b6:208:1dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Fri, 18 Mar 2022 15:16:05 +0000 Received: from MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e]) by MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e%3]) with mapi id 15.20.5081.015; Fri, 18 Mar 2022 15:16:05 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH v2 3/5] softmmu/cpus: Free cpu->halt_cond in destroy_vcpu_thread_generic() Date: Fri, 18 Mar 2022 10:15:53 -0500 Message-Id: <20220318151555.381737-4-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220318151555.381737-1-mark.kanda@oracle.com> References: <20220318151555.381737-1-mark.kanda@oracle.com> X-ClientProxiedBy: DM5PR06CA0059.namprd06.prod.outlook.com (2603:10b6:3:37::21) To MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7462ccd4-7522-44f5-6061-08da08f238c4 X-MS-TrafficTypeDiagnostic: MN2PR10MB4174:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OaQ+OGaRHBfUWTfr0J1L48QTJWMH3YKrSCOW/Il1VXfReoYPeMA7HW7DdEgfAr0/+4eNVtKF8WXH5nSpl+83aD2SBNhusi7bOuwX8VNLpUDNTj+sp7OCCSVIlXlyPspxUcElUK8GDOPwucW2FfB99wRQJnmqIZmzQ8iTMJcbRx7lsxME/RsGNIu7qmdOomIF8kfHoM0IuhVOwE1hQZDfHB4g5R9B21GDPGZjNe7bx0hXiwirYJQesNEiQUwL0zH8wPF2NVlwZiirSsGOCJUZXs+ABUK69j3amyOREZrqrM8mwlNqwLfeV2ogSVi1rV+eLccMgUMNVfTf7NCL6KdocMYMZrsVDoMb4cbmZpiUBVsGFuf+E9zov77jkzJVdEHbuVzQG7QtFtQ6KY/oSFO8YNj6xP+1gefdUzbFJNowIbF6vpjG0Cs63PjKTQe4nrXY+jGwTZd18gOz/GSOVu3Rpe385l858KvZrL6E6YheSJGC7CuCcw42k8dwut/tP2UuZ+0C4hV0LwUitpHddQ8IQHi/v79y0Nu6wFXVT/PQnUg+I2OCwrYI0H7iwjXiCfGPZXrktXrSR8MAY8lbZ1P8+ueyUugLkxjhZE+sK/UzoV03DSkSmvBwF0lWdKVul7Ybbu75lvayDDfvZlYaAkwoiWMtb7o9awOrSs+HqPqOsY29ZWj4hAQ9Th/htUOfX5fZLITn2oL6jHGgbaek35y8gw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR10MB5825.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(52116002)(6506007)(107886003)(508600001)(36756003)(6666004)(2616005)(1076003)(6486002)(6512007)(86362001)(186003)(316002)(8936002)(2906002)(6916009)(5660300002)(44832011)(66946007)(4326008)(66556008)(66476007)(8676002)(38100700002)(83380400001)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wbBGA7CQ+7+qjCozeRkmviQiB7n4uhuCytNgT5S0FVO520RRRpKFp/Ki1rCGiNjFpkpwz475RhaTO5soJVLDV2bX4nnNzXh6EssRuj6VQVnWAybgb1DhywOE92hfe/OjBeaphJGm/ffohoyhtELVtylR8VYn3QrE66GMoCpPjnrbvLhY2h5kLCzjhrxdmq9pvv+B2jdcU6eNT/5pIl06tKk7rmvjGPbblyT2GKwVdGs2+z6ZJrFIBGlwppa7uuMTwddD/prxROprcYw9Un8Ac7/4FO94F4HoECN2mU1+pF6jhZMMsrwdowD32lc1+UmwnnoudgWpjtnilQ/n6JdW1DhNr1f2S/NxnBDxbVQlPnEYSOgJMrSwvlFtU8negrU8f5+U2Hjqc0cUjrEqYofFD4NpzefHV6PXIYINARakacFuaG8kpzam3FrO9aPOef3CbT70t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Exchange-CrossTenant-Network-Message-Id: 7462ccd4-7522-44f5-6061-08da08f238c4 X-MS-Exchange-CrossTenant-AuthSource: MW5PR10MB5825.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2022 15:16:05.5254 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pIpQh+8Bpy1L6jdW5Hwjmis0s2rFDgkpZ2ebKhuEyTNKJr480kGX3sTUuCbJw3clR0TxvrwMNEvQWC1Gp4VJrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4174 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10289 signatures=693715 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 suspectscore=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203180085 X-Proofpoint-GUID: TMJ2q2j91M4RYgMzlEvYq2bVv6Sy6C_3 X-Proofpoint-ORIG-GUID: TMJ2q2j91M4RYgMzlEvYq2bVv6Sy6C_3 Received-SPF: pass client-ip=205.220.165.32; envelope-from=mark.kanda@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" vCPU hotunplug related leak reported by Valgrind: ==102631== 56 bytes in 1 blocks are definitely lost in loss record 5,089 of 8,555 ==102631== at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117) ==102631== by 0x69EE4CD: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5600.4) ==102631== by 0x924452: kvm_start_vcpu_thread (kvm-accel-ops.c:69) ==102631== by 0x4505C2: qemu_init_vcpu (cpus.c:643) ==102631== by 0x76B4D1: x86_cpu_realizefn (cpu.c:6520) ==102631== by 0x9344A7: device_set_realized (qdev.c:531) ==102631== by 0x93E329: property_set_bool (object.c:2273) ==102631== by 0x93C2F8: object_property_set (object.c:1408) ==102631== by 0x940796: object_property_set_qobject (qom-qobject.c:28) ==102631== by 0x93C663: object_property_set_bool (object.c:1477) ==102631== by 0x933D3B: qdev_realize (qdev.c:333) ==102631== by 0x455EC4: qdev_device_add_from_qdict (qdev-monitor.c:713) Signed-off-by: Mark Kanda --- accel/accel-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/accel/accel-common.c b/accel/accel-common.c index 80b0d909b2..ae71a27799 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -140,4 +140,5 @@ type_init(register_accel_types); void destroy_vcpu_thread_generic(CPUState *cpu) { g_free(cpu->thread); + g_free(cpu->halt_cond); } From patchwork Fri Mar 18 15:15:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12785459 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 2CA6FC433F5 for ; Fri, 18 Mar 2022 15:20:04 +0000 (UTC) Received: from localhost ([::1]:43294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVEOZ-0002y3-6H for qemu-devel@archiver.kernel.org; Fri, 18 Mar 2022 11:20:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKs-0003UQ-Df for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:14 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:12680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKq-0004SU-Gk for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:14 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22ICdFpa001713; Fri, 18 Mar 2022 15:16:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=ji9LDoKqE+00zMrQdX034lnfvLOuc2izypjOX8Lwtow=; b=JXaxFc31v26xD9si6G8+nxyLvnqia0/G5wh65M9tZBG4gV4e5t/ETbHiA12FKq2uSskC f+VxTBoEU2/u+h1lyjWUClQTlFhN5BnwC9X2QVLQo+EJBxoYm1DL0I6psbmXvraW9hvP HXYfswZeQyKqJv4hhPhLB86MgsFFp59vbVmquKVof3149PAwdLRnxKLpuVWLaGviAx56 d1bOH2nq2Sialj8PKpOXM4ek9i2HRw5orfmOhKrMqj1pf2benxXqrfRMjVCC4QhMd1MO RkvHRpWhBD+k7K1JwG7yGDT4ZnTTbukpsUNgSnzBM8+OMjhNjRVldi0CR1/hyz8wKQMn Tw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3et5fucc9q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:09 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22IFA35s061087; Fri, 18 Mar 2022 15:16:08 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by userp3020.oracle.com with ESMTP id 3et65aa4u1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TYZShjH11QJAyh5ALKreXWe3P5pCWf1Fcxcm6buC5rC3WMjDXHT8gzlDsf9fnHueEUKT1kg7GCk2qEzHd5cjDIg/VJ+u6sy7IgEa7Vftve2HnK1IJ5kHkUJ7EYa0xNkBX4RAJ+6nsFXzMrqhKpGBhZZUl+pdWMh7NpZinL+ff3UQ94r5tlHuTheMyxGScI0YLSnaNNO8FhreJDC1aTsXrzCBj+tGPOpCgqRu18E+Sx73PFEbepw1U81pKBj5HJ5mEpYJvibVGSoRGrU6/ly4LRL/L5iw80vdKIhaw3eFQU1m/rGedG/J6yepptChsg76kibc0goNhPRPx7pz/aYjWQ== 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=ji9LDoKqE+00zMrQdX034lnfvLOuc2izypjOX8Lwtow=; b=HU76SioPiAk3QNSsCF2A1UpJG8Ur31TqU4qcVF6WRXmnThUcXnJhAlQLJEcLFSC3lwCcb4E6BlIzdS6CNja+NvbsKU/SK+LsLcD9JpF0N1EbMZFEZQWv7Too0tk36u1EmvgfuX8vP5pSfyYGd54ga1hdNvf7NK5+n2Xa6xpsXO+wTRDqQ70WIR8hsqj5auIPX5qt7eH5+J/aEgQOOpKHdeFLSKjvJ2f8Ud2eCEi2PMCtbOiURjwR4MHUxnbYjFg+EQ4XhQadP2GJYVAdBa9gzLHhchxmsyu1FSdPRqstIgNuSMbJ+CLFC2jC5RXS55KS++GSugBldYMWf536fCul3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ji9LDoKqE+00zMrQdX034lnfvLOuc2izypjOX8Lwtow=; b=JhlwBWhlmfGelnMa6cnfXq9iu0k+skSWGJRgbvyXOXhO6DhntC1knkKA6v8feLSq+G+jwK/rbWwjscjMt0UhS7NZBN94LytOb8qZ4Rv8mpNUkOpWOWIWvIc9beT+0Ny3QLKu4n/IJtRltT905c3HZbFxO0/ZZmX0OfSX36W6vI8= Received: from MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) by MN2PR10MB4174.namprd10.prod.outlook.com (2603:10b6:208:1dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Fri, 18 Mar 2022 15:16:06 +0000 Received: from MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e]) by MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e%3]) with mapi id 15.20.5081.015; Fri, 18 Mar 2022 15:16:06 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH v2 4/5] cpu: Free cpu->cpu_ases in cpu_exec_unrealizefn() Date: Fri, 18 Mar 2022 10:15:54 -0500 Message-Id: <20220318151555.381737-5-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220318151555.381737-1-mark.kanda@oracle.com> References: <20220318151555.381737-1-mark.kanda@oracle.com> X-ClientProxiedBy: DM5PR06CA0059.namprd06.prod.outlook.com (2603:10b6:3:37::21) To MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e78cce2b-9e1f-408e-2512-08da08f2393e X-MS-TrafficTypeDiagnostic: MN2PR10MB4174:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zpbmUMDsl7PnFnLGn+YIh8ZTe2PYW3I+my7rO84r4kfml94kJdpu7KDDDE0AwHrGOZ6d1FpdSby0tHhNZDN75TzgaWkGmQ2+TXuXWXc2Q6u/bxWcbnuNHqAqc0wRqxmonlEtCZgpARAB9xZFFdtSkGDf7fTUKVILEEaWN0AM1cUFFuSW7lEEY4236MaGxKQjhBLTCU985sl1BsfEz1T+RJh3+ECPod4VpFEc0DiBY2TeOOecb3IRXhIQaDoVHMZMYeDHmZ9sv39ZctT0qfj2c5lWdXTTkL1hsY4L16toqb6r4GXKf1nfCTrhOBy2GmAAOaD+EG6WZ173AEdd2bQc8YNRyBhwzgko74jxmA2AbYm0XL7Wz9CQWEy4kSZc7IFPvdz5BZbdRjqiEwyX4y47e0nbCYVTvT6DCy7Dsm9TbYhJWWyFWw3KeapQQX44M1V44EMb4amq5MlhFxBWy/AD2OYds82w/zhktcEgF1mNjhXLx2sPL5L0WHHaLhcz+afeFcJirE0f687vmNcikcIqCpmVmTYXdtyVLpAEhNj06VDRjzhVKRslB/+Pq63Q4EHsWy7LBi+Mt2yRI3kt96yrETIOImYRo8y4y15uvo5o4Ow4uwx+GxW/t/f99FFouTEbFiMErfucuWVij343f1tmLw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR10MB5825.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(52116002)(6506007)(107886003)(508600001)(36756003)(6666004)(2616005)(1076003)(6486002)(6512007)(86362001)(186003)(316002)(8936002)(2906002)(6916009)(5660300002)(44832011)(66946007)(4326008)(66556008)(66476007)(8676002)(38100700002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dafniD4cz9B4Eatq0GXh5BU1RN5yJIH8aOVaNXnescKkNpWN4QqoX5AURVhw7dvOcNPlFWjo5rRH7zRnyCHTQh6xZ+OBPoY2yaaZfvJDVhpjZWeqHB4LLc2PpqhPv1H99OHO0lDC6+7FqbQsQyVMPhIzDTFxEqWpU1zlXcaFJziyF+wgHIHFqJnaEKT3N8djf1RWol7B9pbFPjWqYWmnaL/2k3xnjTgIgP2DwPmtLBZcFKdHnzg+9EvSJf2V8/shEDlAy/vx5c4gyDeQ+1uVxpYPggQ/4HzDzfKYkVqLMn8uLG2dKH10OYythVZHnZV+sdEuyJB37ALe5TiGGekeN9IoWzJG8yNywfU/7RweCKOKGDSQ6IVsEFiQByDvsD9t/O7b0TAqoU6C9LdsjiL892q4DR3CqAeWq0UrkHi/eGU/gOZr+FsgLTTZDSGHSl8mDdYL6F1ac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Exchange-CrossTenant-Network-Message-Id: e78cce2b-9e1f-408e-2512-08da08f2393e X-MS-Exchange-CrossTenant-AuthSource: MW5PR10MB5825.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2022 15:16:06.4015 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Epy+8/JXI27VgU+DGKxdMDh6C7wsMAnqZafuwgj1Ud/OfFW92wlI7xkTnZbD8SxeLvKu7xuz4vJtFe9Cnz+sVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4174 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10289 signatures=693715 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203180085 X-Proofpoint-GUID: YFlN276el79mckIwHGU7n0m6XmJk4WTE X-Proofpoint-ORIG-GUID: YFlN276el79mckIwHGU7n0m6XmJk4WTE Received-SPF: pass client-ip=205.220.165.32; envelope-from=mark.kanda@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" vCPU hotunplug related leak reported by Valgrind: ==132362== 216 bytes in 1 blocks are definitely lost in loss record 7,119 of 8,549 ==132362== at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117) ==132362== by 0x69EE4CD: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5600.4) ==132362== by 0x7E34AF: cpu_address_space_init (physmem.c:751) ==132362== by 0x45053E: qemu_init_vcpu (cpus.c:635) ==132362== by 0x76B4A7: x86_cpu_realizefn (cpu.c:6520) ==132362== by 0x9343ED: device_set_realized (qdev.c:531) ==132362== by 0x93E26F: property_set_bool (object.c:2273) ==132362== by 0x93C23E: object_property_set (object.c:1408) ==132362== by 0x9406DC: object_property_set_qobject (qom-qobject.c:28) ==132362== by 0x93C5A9: object_property_set_bool (object.c:1477) ==132362== by 0x933C81: qdev_realize (qdev.c:333) ==132362== by 0x455E9A: qdev_device_add_from_qdict (qdev-monitor.c:713) Signed-off-by: Mark Kanda --- cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu.c b/cpu.c index be1f8b074c..6a3475022f 100644 --- a/cpu.c +++ b/cpu.c @@ -173,6 +173,7 @@ void cpu_exec_unrealizefn(CPUState *cpu) if (tcg_enabled()) { tcg_exec_unrealizefn(cpu); } + g_free(cpu->cpu_ases); cpu_list_remove(cpu); } From patchwork Fri Mar 18 15:15:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12785482 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 79C3CC433F5 for ; Fri, 18 Mar 2022 15:28:33 +0000 (UTC) Received: from localhost ([::1]:37100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVEWm-0001fx-LL for qemu-devel@archiver.kernel.org; Fri, 18 Mar 2022 11:28:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKr-0003Sv-TE for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:13 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:10504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVEKp-0004SK-F6 for qemu-devel@nongnu.org; Fri, 18 Mar 2022 11:16:13 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22ICdJcd022661; Fri, 18 Mar 2022 15:16:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=Z6ajZwLQAHkBZACnGzv5snnJ/0lHKzsupoxikbPhH0o=; b=ed8GOyrAD4Et0qiVjRH0N+f5uSQCN1GKXxlxy9lqKtSeeHEzcyv/rhwPPIKcklmgUp80 BLuAVCnr0aINrtwQMBXf3gvLki1wk7+cg9zwYQyWJoFC4sODM6imdSXkE2zzX0F7w4U3 4TLUpZxkSjWVearGYvVgXsi15kzbwsNDX3vmGuUKCw+k4L3LVw0dhf+r2Urk1IffWd2I j1Wq6gJvl/sxToI8PsivyBmsXanpT+ONeTD/uWOfshFNi5NnYZHIdZD69/Wr5A+XLZ+E KywdSx8DOP2RDNl2K7APa0pnGcY9BFd4mIo6oKbPvogCXQXtwMEkpL5NuhMNte7msw70 ww== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3et5s6v8fc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:09 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22IFA35t061087; Fri, 18 Mar 2022 15:16:08 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by userp3020.oracle.com with ESMTP id 3et65aa4u1-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Mar 2022 15:16:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mZCPZhCSKvQ/Q/w0kEacD5hbMigCLv7xZ1bf9ITbVmCCo/dHI49Coi8IQcp/TpWnc4I1paZIDrNj2GXt0qGat3kkCVYkng3yFkxlUTD2E+bDPL+SgVOErIV7wv4zMEN/yzMtjnXZlwXHYxWTuhna72sra4qor2mDtxKKijJS0UxsH6doZFNRELqGH7xy8uhyKjSoAibUxI/ZAdg8iH3LYXNod+RBpwxBRKM6TSsghIoTP9PUjwGlJNWVjomA43VCk/cvCNAL62d1mJ6jDn1itj6XvwKIRgjBMTSOVUZmzeG6T9TyhXlckI5UX6VgfGo2sXl/gtRhdCN095zePRMQQg== 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=Z6ajZwLQAHkBZACnGzv5snnJ/0lHKzsupoxikbPhH0o=; b=cySc8svBpPxDpOnzgPrPtJKRlABNAHUcKCJOwM+yVizZ2+z8PSxa7K0cAwsNIx7REhl4dt9ojvtat8SV4HxiTgVpyBKvzqwH44/5VCSPRXEt2k5AuL4klm4IARTRgKEQMOEDetA1GcA+zKkdaVHqOyyuv+RLRQ06vcDlKksflvsK2tuQ3OzbSZTJ6pc3y+Pp1SEkHf/qt9853FqfsMCHk7KEXaynJsgeeXRh8OU7g35O3TS3OHbzWrzGSzPlF6IsPQ7YmlNDVcE1QcMRxcoSq8RcH7jvTGuPGy9VXGBtUKmPPGk7ZYWvUIXfdolw4j8e0Jsq1zAQu0ycvKNN3vk+RA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z6ajZwLQAHkBZACnGzv5snnJ/0lHKzsupoxikbPhH0o=; b=yMVwBUzUh0xc3WrQjSLBEMxNxwLHw9FMXlJ3tbsS7+iTOmHpRjHR4B9oyf0HzGMjQUejxmQBTLsth27V7pRKD59nRrMgMOsNH/MioK6yZoCGDYwhTKC7JvnUMXOukLmhyCMRokbDbgDs8hgi+P+HcMYqSf03jnQ7ltZlS4OMR8k= Received: from MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) by MN2PR10MB4174.namprd10.prod.outlook.com (2603:10b6:208:1dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Fri, 18 Mar 2022 15:16:07 +0000 Received: from MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e]) by MW5PR10MB5825.namprd10.prod.outlook.com ([fe80::5915:58a8:f9b1:a71e%3]) with mapi id 15.20.5081.015; Fri, 18 Mar 2022 15:16:07 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH v2 5/5] i386/cpu: Free env->xsave_buf in x86_cpu_unrealizefn() Date: Fri, 18 Mar 2022 10:15:55 -0500 Message-Id: <20220318151555.381737-6-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220318151555.381737-1-mark.kanda@oracle.com> References: <20220318151555.381737-1-mark.kanda@oracle.com> X-ClientProxiedBy: DM5PR06CA0059.namprd06.prod.outlook.com (2603:10b6:3:37::21) To MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f8af0d32-ee6a-41a4-66cb-08da08f239c8 X-MS-TrafficTypeDiagnostic: MN2PR10MB4174:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yQwFWdaZvYn8XV8DaMP8g7qqzOvkeC1y8My/VCaAr4BnQ0ksDdqjfv0+SlMFMcPyH8sgjAzC8C+K+qibXgjfsaj2EMAQ2o6tHIrIQJqEwIpKmpTt/DpSKy9ELdDItcIRt5XDERb1TcEF5+C4xnbPHYnnAYbiRkqDrjT9Rs/QPk+vUa1vCBmYoeHwZy2UjivGmNHvyTbasgWfnAq3h5lYQf5RgqKE8okU6zbx/wh5KA+XQz46ZR55E/UbN1JZobfvrwCrZ1tyYAMVl9bhTYIvDMpZ7XTttt/ItUf3kjXun9sXNQs4F/2MHYksBORwPqVlnr+/BohgNeT6f/gjXijR7D9ls2hhwxzwG0lhXnU2N6GsCt/EuF1CZyKffu8H+CzJGBeb955fUznmmSDZv+M8wwvkzzHEXJGfQIlnwlowTyoz2G9bitd3hP/B+ZCDdH/jdpsOAqe11bua9BLecc4ky24qzcP4X4bQQVbzwQio/SLGQn7lZCLhWkl+Y2y39gESQlvjBWPMBuZoGj6mNNo1vtpkPRR0OpiE73blNEg4ge3HWkmNy1X01mckGmBS76wLYrPIcF8akbgchoo6y9qHLnr7G6aEdgcfEDmAs8fGIqWBvj8YLRxUE8II+r2Jl+QC37uSdikDt2yyJdymmyCvuA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR10MB5825.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(52116002)(6506007)(107886003)(508600001)(36756003)(6666004)(2616005)(1076003)(6486002)(6512007)(86362001)(186003)(316002)(8936002)(2906002)(6916009)(5660300002)(44832011)(66946007)(4326008)(66556008)(66476007)(8676002)(38100700002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BkrVXSfUTBro5MhgzR4zWgs/wmk5+Wb6bKUQN5GSQTYOAjkAI/o0x8eoUojF5DtIg2Qe4WHVbMh1mLrdcTJZymGYZeLUcMBfrjT2fzTOVdxiSG1GRIfaaHTqESPnvnv3OumjJMdD0zcXnBi9gmBeo+9wfi6RZpvAsJ37CZvpsHNj/rUdotOBle35RUKZiC3cmbDftqcLNw1XvlVheGiKOCwg9rdfddQAvnGXFrsBxmoKKOIOlIzjon4zEu3uH4q5SnlqC/nZqhwtWq3xzXnur6h88B9pzQfqB+SJ/jM0A4q3EWm/1sxIYzHXBXTs5DnadhTtYTC29MSOSemK28eTR5Gn1+SFa0eUUdHDqZnRpzDBwZfEu0AxlCoQ9mHw8kJcXzNpRJJeJ5nF09kFJ3QLu3TpP49VPB4MCnJEPF6iQgvTe5r+LkZPSALupw183XzsY5u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+1s= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8af0d32-ee6a-41a4-66cb-08da08f239c8 X-MS-Exchange-CrossTenant-AuthSource: MW5PR10MB5825.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2022 15:16:07.3076 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n5X8GCB5+rGwwlHUst0Mu70kGratw5JIAaxTcEogb/C/iWUMapTcP7eadQtkhd5NDBJ/wDz0b6dcC8SS7EzP9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4174 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10289 signatures=693715 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 malwarescore=0 adultscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203180085 X-Proofpoint-GUID: -j5AC4mnTKZYgrQCYBGnmUUbGm6YW0nL X-Proofpoint-ORIG-GUID: -j5AC4mnTKZYgrQCYBGnmUUbGm6YW0nL Received-SPF: pass client-ip=205.220.177.32; envelope-from=mark.kanda@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, richard.henderson@linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" vCPU hotunplug related leak reported by Valgrind: ==132362== 4,096 bytes in 1 blocks are definitely lost in loss record 8,440 of 8,549 ==132362== at 0x4C3B15F: memalign (vg_replace_malloc.c:1265) ==132362== by 0x4C3B288: posix_memalign (vg_replace_malloc.c:1429) ==132362== by 0xB41195: qemu_try_memalign (memalign.c:53) ==132362== by 0xB41204: qemu_memalign (memalign.c:73) ==132362== by 0x7131CB: kvm_init_xsave (kvm.c:1601) ==132362== by 0x7148ED: kvm_arch_init_vcpu (kvm.c:2031) ==132362== by 0x91D224: kvm_init_vcpu (kvm-all.c:516) ==132362== by 0x9242C9: kvm_vcpu_thread_fn (kvm-accel-ops.c:40) ==132362== by 0xB2EB26: qemu_thread_start (qemu-thread-posix.c:556) ==132362== by 0x7EB2159: start_thread (in /usr/lib64/libpthread-2.28.so) ==132362== by 0x9D45DD2: clone (in /usr/lib64/libc-2.28.so) Signed-off-by: Mark Kanda --- target/i386/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a88d6554c8..014a716c36 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6572,6 +6572,11 @@ static void x86_cpu_unrealizefn(DeviceState *dev) } xcc->parent_unrealize(dev); + +#if defined(CONFIG_KVM) || defined(CONFIG_HVF) + CPUX86State *env = &cpu->env; + g_free(env->xsave_buf); +#endif } typedef struct BitProperty {