From patchwork Wed Jan 26 14:29:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12725101 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 3A696C2BA4C for ; Wed, 26 Jan 2022 14:37:04 +0000 (UTC) Received: from localhost ([::1]:43796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCjPy-000588-PF for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 09:37:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCjJD-0005po-P9 for qemu-devel@nongnu.org; Wed, 26 Jan 2022 09:30:03 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:39656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCjJA-0000ax-PW for qemu-devel@nongnu.org; Wed, 26 Jan 2022 09:30:03 -0500 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 20Q9Zbog006704; Wed, 26 Jan 2022 14:29:57 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=q6GIqEWBw8dkFczAKY1OZpajCY6J7AQ07pmX9IS1j54=; b=IUfKy1y9v3tWjkxYl8BNKtaT+IcPLJ+hB0Z4B/kfjjCh7BxIZWmf+mB5cK+1wHdLZKnM gqlGr5iUQneHkbHMMFpoMjTEqp71M2MlSyRYvKp+hJ3Yj7rbAZUgxjXGK3Lr2id7Vdoi p0Vcl25NaL9pQxJGS78O3XY8nhHbK7Ro/8GINdaSB0OUxVp2kUOTqDce7lQNN7QKGeKG Jm2jNKoFVMmfhZgZ/OTtUJ+13fSvKPB2nIU8DeTUxdHCpjnlIV5hdbZ/0wrwR6c4Swej w3j3C1tLL+hGLtYfEgfbFZoneikCjiquJltup4nNsLfjRg5z3+emT+0PD0F0dBJfJNcC yw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmjeray-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 14:29:56 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20QEQoxI181401; Wed, 26 Jan 2022 14:29:56 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2177.outbound.protection.outlook.com [104.47.58.177]) by aserp3020.oracle.com with ESMTP id 3dtax8fy4y-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 14:29:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DATKgPPJSTbvj9KYtuL6eumL1eu5FXzhe8fc777UOoYJC8Sa3wY73K2N6/AdwLLm0Po6yMXyhKvN2qPxfSsSWia1Jd5IRkwcd660T8e9aLtadxBFzvdtzZ7iUTEjPKaQyfgBh3Sg2YfWwOUULyuBnakvruLR/yz1grevVkWbCmiI9RqovU/5zaUEs42fJzPtaZuM2kgxXvGZbceEpsPN0YWNqjyXpwSYgVKd0ZlAdP23Og6h/iRqzKSKGu+tYBXJ3Yi56Ntrt1W8SNQQjwkJTYPIq4cAJR3om8Vw3GQ4uGiAUmBjOX5htU6msmhgcOKzxbANgvOTw057vdsfM6ItIA== 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=q6GIqEWBw8dkFczAKY1OZpajCY6J7AQ07pmX9IS1j54=; b=AdVXK57TUCynooJo+NHKaXmL+fFQmUDk0PCru5dkU+a1niSTyKH9oXaLA7hFu8B3fjWvuspniSZ002i+EZZOmCspjEcMpMjUh8V+aU2cjVKmkxvk6gPz1SbueslynvVCpNn2PyzSajOpUvGpt+51/A6wduy64p0noriO5gTi0eW1KxA+KIiTvTtsraLCUSwigICoOZuZfiH12HKskoazXiF8K1PfQdQVG/8CVIaJejUbJ3uYqVC2cVAL7GLZK2pe3uP1LaznQl5V0mHkzBtqLb4qPoKvATyScs3XSbgiTa5cNMFZovYLHNtjAjOrhoOGiINzTVE55Tt19s5VowstKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=q6GIqEWBw8dkFczAKY1OZpajCY6J7AQ07pmX9IS1j54=; b=oGn08maH5mOFfKPqTOu/A8+A6e5NnA1kqw60zKuK2oP5uPRR9Bf+qSFK3CWMZUVFjV1cCheAaUcfrKQh1KDAxUEIUuw4MYQfK2Y1prPit+Sg9LvwygP4p/CalljscB/+jV2DgVsRMB/Q3N0WZGVpDZ1uz01/YPUnuoTS6SxRjQs= Received: from SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) by CH2PR10MB3990.namprd10.prod.outlook.com (2603:10b6:610:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 14:29:54 +0000 Received: from SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::2511:c3af:9db2:6ba0]) by SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::2511:c3af:9db2:6ba0%7]) with mapi id 15.20.4888.013; Wed, 26 Jan 2022 14:29:54 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH 1/4] softmmu/cpus: Free cpu->thread in cpu_remove_sync() Date: Wed, 26 Jan 2022 08:29:43 -0600 Message-Id: <20220126142946.667782-2-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220126142946.667782-1-mark.kanda@oracle.com> References: <20220126142946.667782-1-mark.kanda@oracle.com> X-ClientProxiedBy: SN4PR0501CA0019.namprd05.prod.outlook.com (2603:10b6:803:40::32) To SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02d76edf-7c8e-4652-288a-08d9e0d851d8 X-MS-TrafficTypeDiagnostic: CH2PR10MB3990:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M/OqPF7F7dtvpYhtnp8LSTy25b9F7tlHnC9H8E26mVjfLnpmhlAkLEtAbYuFYEi1Ii4v7+9ShoSBRKZvfYRoXke9gvNl9wIPJej0WuRGoUXILgT8h7WgfHUSTMPOQ86yZjQ3SQTQMc05eJ2BLW37WY1RQBw3ziFVvpuV3rRRgxXmE1wxoahCSlVC13eYtLz3iIo8Sris0hf1VtPlA34Yo2yZ/psxjyAPrWAKmklO/oLgm5HipXKWKi5kVDfM7FbvnhgYczpVxH3VbQL1JjgceTOaz+DFiyNto+4o1z+s/AfDIkIDRihliTjtrQnETbOsjfJA6pnJfcCsBFZapQxixzGIGTAdwNXRLsmcFIHLwnWL6PFAzDdJYMvzyopeCns3RTzEFpv/we22LczDp41iQMuUxWs+foFsCX5lo2IqLD92hNjO3fcQ9lGoO0OKyjbGFTSEAOpaNOxfXO7hYhtNMPhdUyJb3zzFkKLHTbs006HrNDDkK2HCv/EVQflgX6wiHe0g8ACKW1oS4JpUgrK0gqCv3EAqGqZrSTaF/GGy0mxnLF0AXLFic/ooVwBxcU/bcwjVKj+DwodeMkQ70FrXxgikSmngb7TNizfUJ1zr/4n+v82Jood+ji/u8c3IHA8j3Vze8eTl92C04rQexOnH5V6bcHhutwYCJs4fuqC/f5IFdEj7iZNJ5nHe7qg48TUSvuCj6HxtvBC80kOpfyhv9A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR10MB5841.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(26005)(6486002)(316002)(66476007)(1076003)(186003)(66556008)(6916009)(66946007)(2616005)(107886003)(86362001)(6666004)(6512007)(6506007)(44832011)(52116002)(4326008)(8676002)(5660300002)(38100700002)(38350700002)(8936002)(2906002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k+a4TW3uQ469lNud812O3Rsf2be0xhW7Oabk2SYI2Ftf53b8FyzJQWD0e34M3kMaZMNZnuU9T4pQ+i/KqbZKUla+kR97vlI88l9yg3W1cQ4x3Dp/MoXAcaJ5SbMcJiboeejNnZ2en0BX020NzMV8UmTnXMgyW5w8OHVLO7BkKA/aS0SCZ/CYzzd00makZjANEEZJzvHKjx4Q1h1sWmkblg6HTSVucqc1AcaSU43Dz57uFmGx9lDQpYLfRSQ4WMtf4oVLirNQ7EENoBMsAD2OJDDYsDx30L31YozP66pePB6450fZydWxlxNvLvlq6KGjSquF9N92ZPNt55cU3xk3YAjAd1Lo3uUR+1jmsJo5C8r766m7XQ6hT2MrQak0uEemlnRQO7UkoRaeXfOqAX/C6XHZvkTE/kXSCBVEJ0fFXRuLvZP9HWg74chcPRU//IgswiPn+u+IGELEHMNCe3VujNlg8eIdEBWu6mx9aIujX7NcWcq3pZaktzigC+waToLIeGkSgkWqatVbHaFRA7dGmJMB1PMwC3RrlNl15ZHuLLLSMhJtrnZ9u8zeCeDpwkmmmYDCkjn8EvasZ/nSra9+jll9LHmG9sQwD6HG8MYDKcLsCsOi+alSAQYzsZuhLEeCPgwAFcDbhwBUdtolc0oewO8QEYsjma1Gb8nmYR3ijeHijIRZXnOyOX02BOuf5i3LP7fg+wggAMIipXBmUFlheOy7MY2mgPK2JX/puXZSSShjEJ/0HVFnw1EfUaDRSx/YMmFsx24st+ck7yKe8cUN6e1DBht2e3kfZwnMPYUlXSzy8qQfez3w8fSIwHL08VcAGx24C+qy0Thr4SXzhPPK4utBMnPjXL4KcaPQ4NEr0Q3udFpEZzpipdWezyUawKdKi7IePv7ICs/UnqO2e4wmxxiPrC0RikGJX0psNzzAc/QyDj2p/FZydPVMZ6x7YdBSBcqu5agG2MYSfXLZPZV1EY6HPMBNlLTAVs+ddqWoRAkHz/RdzD50CoLu89TY8RyugL+pkiAOc5tq/HczanYn678ua0PX23PN8K0eaSTFc60WINrpDlR4FuNLB7yu4tcRnBpoofL5aARC38V1FQmflPyVf+vZCsIY1eCWbq8N4k5J5xVRXP4LK3vhy+6V0X/ZBSMslaxgqWsYYRHKkUHJOBIynJxS//mBbSfNFFANbPxrU2dDPx2pGotdR3bXDCfKMEQ/VzywhjgqBU5OM3OffMk2WsZnLtrhcpjT6VGWmfHaoI3I5AVdwTnMNucTRPFA8bBLmqR+1cTm9aD+GF/NAnO1aOKJU+hjweGxn8r8w0T+Y+OKb2JZQNO7oMQRA0CveL/sCcq0pfyYlgjTBUbmsiQiXfbkmMVi0pPWv5pP1eG9/ss4ZVgji8Hda8Z00tz94ZQ7TUmUhNG2yaq0goz21D++kAze82zUN/Acg4iojjE2cyvMA0VLK/PdoooH+qIpKzHLv7KC9ckqMhLq2szWrubH3B/IJY8gB97Rae7mtO9zTUfhIs+wt5c1TTjGZoCeCEAZW0xydMZXjqenzXWUn47MhZwZX0DdtGdpCs8Eh3fZM+aNhhuea/bDhEip8G7/rJFi9lKzKBMZwGwrYl4QQGMkq8za72hYGqY773mEzFI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02d76edf-7c8e-4652-288a-08d9e0d851d8 X-MS-Exchange-CrossTenant-AuthSource: SA1PR10MB5841.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 14:29:54.1564 (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: 8pkLHV/XqgJLBfRwYwrzNqKCS2+FPSH1VMsdFM/8C3lPg/PAegsCe3R50LOHFJMM4PjLhKJAS4jpYEr55gmZRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB3990 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10238 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260088 X-Proofpoint-GUID: 3DKwDWvzFIY905x89yfV_Doz2VGVMg9Y X-Proofpoint-ORIG-GUID: 3DKwDWvzFIY905x89yfV_Doz2VGVMg9Y 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: ==377357== 8 bytes in 1 blocks are definitely lost in loss record 1,029 of 8,471 ==377357== at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117) ==377357== by 0x65C14CD: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5600.4) ==377357== by 0x8B5AC8: kvm_start_vcpu_thread (kvm-accel-ops.c:68) ==377357== by 0x7817AF: qemu_init_vcpu (cpus.c:634) ==377357== by 0x7185A3: x86_cpu_realizefn (cpu.c:6447) ==377357== by 0x8E46B7: device_set_realized (qdev.c:531) ==377357== by 0x8EE36F: property_set_bool (object.c:2268) ==377357== by 0x8EC3C5: object_property_set (object.c:1403) ==377357== by 0x8F075D: object_property_set_qobject (qom-qobject.c:28) ==377357== by 0x8EC72C: object_property_set_bool (object.c:1472) ==377357== by 0x8E3F7F: qdev_realize (qdev.c:333) ==377357== by 0x43F3A2: qdev_device_add_from_qdict (qdev-monitor.c:711) Signed-off-by: Mark Kanda --- softmmu/cpus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 23bca46b07..1d8380d4aa 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -603,6 +603,7 @@ void cpu_remove_sync(CPUState *cpu) qemu_mutex_unlock_iothread(); qemu_thread_join(cpu->thread); qemu_mutex_lock_iothread(); + g_free(cpu->thread); } void cpus_register_accel(const AccelOpsClass *ops) From patchwork Wed Jan 26 14:29:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12725102 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 231E3C2BA4C for ; Wed, 26 Jan 2022 14:38:08 +0000 (UTC) Received: from localhost ([::1]:46504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCjR1-000731-6w for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 09:38:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCjJC-0005nW-DV for qemu-devel@nongnu.org; Wed, 26 Jan 2022 09:30:02 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:40602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCjJA-0000b7-7f for qemu-devel@nongnu.org; Wed, 26 Jan 2022 09:30:01 -0500 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 20Q9Vep6006719; Wed, 26 Jan 2022 14:29:57 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=6S69sfqhj+MNqQfiQKHNvzBaCqzvS5fgzF90oG8m3Zo=; b=0Y+vi/mYm2HMagiu/fH4SeJgXJJUsW3tWUNVntfQJaXBaiW9jSV+igweGjDioSlp0wqa w3oLC7d/TLpgTh9x0x/3Q/iJR0jCvYb0XEEOXxsUQLEgcwhsd8OgJBkwT28D4TZ4CZkW in06t9RQ01AYnuKfS5G1DdvhrVhK7VzkY8yKE/2V9yU0REg3V1aF6zzYRXt2nKstGgq3 NON20qojepRGzmrjh+cFLX+5+fLUUiiI5iT5jAkQL+HyULMTl9n7c8vF98CSW4koVYhh TCfM9NRJfbVRQVKUEr9QSJzWcPdp/EyVU4ijwDTZn6vU4kykvaLubWEh2e1xE8fZ54Pz aw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsvmjerb5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 14:29:57 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20QEQoxJ181401; Wed, 26 Jan 2022 14:29:56 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2177.outbound.protection.outlook.com [104.47.58.177]) by aserp3020.oracle.com with ESMTP id 3dtax8fy4y-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 14:29:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQ0nK5un8S/0z1QCRg0VqOdEblIBCYX+qvS6D17oE6ZZ2XTN5Ry5OIlmqpXLcIozBMH/AfT/zZJJf3u7Wvb61UUSeJSVFcq1l5x0uigxnEyEnHFTtv/9TX8e2wlvRt7tqen9jUVsS/iyoYijjXUgV4duv/v7cukbMlAG4HH0VKZsObIG/ktvRFjdfmitU8eE9tXjMAfFSE9u+5PGU43V08HRrqQcKRZiajcuGn8y5xqYRmOi5G8LyyyjAkGN0P7RW0FnLFs+x2p/OSYxrh5bz7l5eI/SY0ddkZKLIiV0NACWeHzbzLzDjTQDYehijYkQKr3Sk0yNfqw4h6557TjojQ== 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=6S69sfqhj+MNqQfiQKHNvzBaCqzvS5fgzF90oG8m3Zo=; b=f1Q/er+YQ/ueTQXCLAepOhoD4+ZLYfrqU/E8+1qKcQNwXinaDKQFYl6hOqcV5xNlOXfGYp/+Yk/CoGzxt+jNPKQ+PGDOxeEudHP+148SNOH0K96zwRE0QHiW7DfxBDT5ZnrctiEOaMHByJx0UtWOXqilbk2BTKojOtQYIKqPqs4Stg7ZjRPusn3v89J0yUJgKF92yNUQIYXqR1WQpL7Xr7Nz/mPTILhaOyPwHDjM+tp+WBqnMbs3nwm5vXM/xnqkkIQCoxvRfg9zTrlYRxUB63DhbqGLfkwsaoRwD8Gdu4HChbDzeFrFWb6afGWWQHc8FzXiuTWPiaAvoyeYWdCLdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=6S69sfqhj+MNqQfiQKHNvzBaCqzvS5fgzF90oG8m3Zo=; b=EUimvkNm2uXqXMpfiBmx2HCwexo0UiOni+iXPRV9AvxSABgkmPukx5FOErpRkAtJi7lpXsqRV/ZNO4U4wWlVOV9QlwGl2STCt5UV1yS2Ozm6zIVwdnsLVzznpBOiAlDcnE1A24P3tvzTitpKHzTjt/Hl1qDDJvu+AFRHTFw2lhg= Received: from SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) by CH2PR10MB3990.namprd10.prod.outlook.com (2603:10b6:610:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 14:29:54 +0000 Received: from SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::2511:c3af:9db2:6ba0]) by SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::2511:c3af:9db2:6ba0%7]) with mapi id 15.20.4888.013; Wed, 26 Jan 2022 14:29:54 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH 2/4] softmmu/cpus: Free cpu->halt_cond in cpu_remove_sync() Date: Wed, 26 Jan 2022 08:29:44 -0600 Message-Id: <20220126142946.667782-3-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220126142946.667782-1-mark.kanda@oracle.com> References: <20220126142946.667782-1-mark.kanda@oracle.com> X-ClientProxiedBy: SN4PR0501CA0019.namprd05.prod.outlook.com (2603:10b6:803:40::32) To SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1c603e90-fbe9-41f4-179c-08d9e0d85218 X-MS-TrafficTypeDiagnostic: CH2PR10MB3990:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fHx325R47RpszYRR56PP6fTJ7ldjcb0ERE15EGNvrkn351AviwwmelDz4XVQmuuDBTdFt1lyShLs/TsJZ1tvDjBPQuCLCaF94NJrrhJtCxnm1AG9PwuThhqx4lXAbMJ7lesWnbF8LH80fnwmDTtKhqynNXynMWTVxqAK5UsAHWHX1AkALUBgp8UPwvv5UDjBSfdObr8UZ/HDfrqpbaYzZpYczQR0CWUcYS6K7iz0IYNCtwvf0mZ85/YLaFXly0gcAAjS+aPei1cGPgVkPtYEQvazXYTjCZyKjtmqvw9iFZLMmr3xFutvsvrHtKhwXkfNDW974pTl4L6vmq1ddJSD8qHJzElGInlhVDevZRZ64X6PqbgSfICNaBx9efEnWSQkDLmdHpqYGWR8J0G/7dcfAu6AZlQN+E2FqTIxBcF8PnTwKYi5UdIwp1oPNzKSGM1rKTlImQ+hJ6r6RqLroqRfEi6XuRerwIL10Hx58Zwy9dkHMwVf5hSAEfwoW8XS5uNqyUTkoEKG8NrCGV1igeTU1LM4NiCjsSLZpu7d7jo/auZocFFnsusoGQ5u+Ty2e+vJ4n4S0oqL429Pty4g2vc37bAS8AqtMKzweUd+FbMGbxYvWYXlBXRtf6MVVJsCIQnpvkL29RBF2ogbqI98esFGjNL1vWBbWuq2qM/Cj2Nh39jrdr0JQj/hLWr6hKIfL44tGcrjAwXN3i7le683N3if6w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR10MB5841.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(26005)(6486002)(316002)(66476007)(1076003)(186003)(66556008)(6916009)(66946007)(2616005)(107886003)(86362001)(6666004)(6512007)(6506007)(44832011)(52116002)(4326008)(8676002)(5660300002)(38100700002)(38350700002)(8936002)(2906002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FRnkME9xtOO93d8bvayIkaX7lDQxjBKde8QWdwzXio7iFijHJ52+4tvCvywyrJWT55kHjSqEtVNVyDkqsJhudoVNM4zdNwzJ5xWZp2kR6aVeE+UAKGbCR1puVcGbwPPtedYvd2hcirekG4Lfj0GAAA+HewKk5rVFrB3+XjLz9hp06biHihnv8gbba+Rwjtz3yHyyyDb2Fq44jDm0ZiWX5oINLQHX3UDnlF6G2S5srtGiqTQ0yajtzPxS7RTnC+lKv1eBL4Qt4lwGR0safBLAAFdbALXROW6eNqQMAfMwN7x4oXxRZlUOwQnPKJkTI5hAonwp0XT4t2Or0qZtEeSqmvnK1onyTpe2Q7UAt7LiLN3hfJKBbcykXrNbkZvCRAhWRn7E6uzEuSL8Bt5ActbzYNQIVcMYuJ9sUh6THGspAE+2dgz4vMECiwl4JRRk9zmCRdFZqdojwILNR3+66Y5UvknpmGvlvUauNTxKSkE3K+W6XU8u2MmNyrH1/3sBmXwfzQUJVK989XieOrEFaBAS/GsiTFgEyH6UffkIxYhPFFeYaa9bOWlz0pMhpvFrnL5PGKmF6T9bAFOITpYuGA4g8qM55A0mN8OXyiQA7JeZ67xShQjxBJWtcyihf3ZD2OImjQmhTCrr8rn9oAkxo3uofBLGfXUaJyj6pJEYcnDs9n5JW6T8oUqxexY4LpZScP1sJA4zoYSDEuaFi4OilWks0BRYFq3V7RrjT5GW6W3bxGu7dBzzKal8KXEX7xPEqnp9yRGkgbrVkQ2YMScEZx/NYaITnBbH3MDILAhU7mc5ST9mC+ySisa+US6ALUaVugaB19yG9tgElgooH/oclO/jFjx4KpIfJav5PDGm5HE+pwL/q6Fzl07mhotBdmtLOi1AzNKYBOpvn+qegBH5JOeOvwL5JNccpNZ2GO3hq+U6j0gqBpjRBu4sB9OohnyIFjdyudIBAana2au45HV//hTtSU5jw1DhJCrR8wEAqaKbLNEYA1X3WtQpVMsf78UaMA4jN6KrkGntR1wxEcK7w7BVOIK5m/Gv9YfMljcfNAUODZRu7x6stDrbcTvyzYWUSzseVKHGStd+SP/gc8puJszrQ0JVrGvezvAPKQgqIEoGAlXj27ulhprJYTuuArhp+PXdUvIXek/bH2YSc0U4Qe30ZBFHc8cVTF4wKEyV5GRzCKLi9D7xE2Ssu/VG0I2wJsnMInCCdzsn0TR/JMucJ+d6dyxgirIJ5WFxzdDKm9cY+dUz6izRBeqlb4Gotq0Mn36nIDoFq4pXHJwvtRCC9cwOpP9Vu9122w2H0BXoDkXwzqsTg5c0ZOCKiXJYhAZJaIpHV0QrER+3GAU5sDe3R5Z6E7nKBWD7Bxzuy+Uj+s48hGE/Oi/Rn4NS6EnMdC23B9vfYTc2zpcPig981YMNG22Pq6MQA89HF108ouJnCEewMwUpn1VkcwveZUoq1pXDshyCtVtAnPFFMfe/Sj2crZ0ei9SNiY1AjESbb8QMqky7dRV6f+hNXGfkXy1mKMbyWuI21THzlwfTOyK8WXC2WhhD7dfcUM1wTYAFMWUQPaJD18soFUx3QchowbVXWXiMExAq3oXBck1NMXjgkg7DTT7oQnOL2MAkQ2cQczXOk/jwAf4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c603e90-fbe9-41f4-179c-08d9e0d85218 X-MS-Exchange-CrossTenant-AuthSource: SA1PR10MB5841.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 14:29:54.5597 (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: m8gz9EjzO1LbSQeZjleDdJr9h+hqtICrE6R33iL2F9joaU0HmMBKfYiyxYT0jP0yADkyZ/kjnQ+ubiZs/nuiAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB3990 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10238 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260088 X-Proofpoint-GUID: P6mBp7rDWaOsq-X-xVq_cVpP2XGULX9t X-Proofpoint-ORIG-GUID: P6mBp7rDWaOsq-X-xVq_cVpP2XGULX9t 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: ==377357== 56 bytes in 1 blocks are definitely lost in loss record 5,017 of 8,471 ==377357== at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117) ==377357== by 0x65C14CD: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5600.4) ==377357== by 0x8B5AE0: kvm_start_vcpu_thread (kvm-accel-ops.c:69) ==377357== by 0x7817AF: qemu_init_vcpu (cpus.c:634) ==377357== by 0x7185A3: x86_cpu_realizefn (cpu.c:6447) ==377357== by 0x8E46B7: device_set_realized (qdev.c:531) ==377357== by 0x8EE36F: property_set_bool (object.c:2268) ==377357== by 0x8EC3C5: object_property_set (object.c:1403) ==377357== by 0x8F075D: object_property_set_qobject (qom-qobject.c:28) ==377357== by 0x8EC72C: object_property_set_bool (object.c:1472) ==377357== by 0x8E3F7F: qdev_realize (qdev.c:333) ==377357== by 0x43F3A2: qdev_device_add_from_qdict (qdev-monitor.c:711) Signed-off-by: Mark Kanda --- softmmu/cpus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 1d8380d4aa..edaa36f6dc 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -604,6 +604,7 @@ void cpu_remove_sync(CPUState *cpu) qemu_thread_join(cpu->thread); qemu_mutex_lock_iothread(); g_free(cpu->thread); + g_free(cpu->halt_cond); } void cpus_register_accel(const AccelOpsClass *ops) From patchwork Wed Jan 26 14:29:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12725098 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 650CEC3526D for ; Wed, 26 Jan 2022 14:32:53 +0000 (UTC) Received: from localhost ([::1]:35826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCjLw-0008E0-EK for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 09:32:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCjJD-0005pn-PF for qemu-devel@nongnu.org; Wed, 26 Jan 2022 09:30:03 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:43334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCjJA-0000bI-Fa for qemu-devel@nongnu.org; Wed, 26 Jan 2022 09:30:03 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20Q9gmGK007713; Wed, 26 Jan 2022 14:29:59 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=Nq7oiy1btdZSo4JYf9EiDMZq0mEzPUaiVsnpkIaQ4VQ=; b=1LRV/rBgwXkfP5HH6hFSa9v2ESRYJDcS3uvnMTWRNCcKD0cg0Dih5Dngm2U2slJhqts9 FWkb6/SQRkJCVuGNhMG/LWbMzu4cBrLadFERLkaRUEF3MOy9g9L9wYORcoJGmSthg6sP JErIa1DjiYCQEOqrv2BrMP5Yvxb7SiUc+ObOvZKQqNMDW85fcG56ghS0jWotI3RJ0dL7 PRkmFoT72a5FcQjV3TC95NY9oJgL/UJnZwlcPp6381FU6wfPSyfd7mQRusdqBR1agJnk uf3LQuDLhB207ohmQ7UoTjL7WX3BFboUprV4tlO9zfC2XpkoViBBcI9OHryn6M6DLG0/ jQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy9s6508-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 14:29:58 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20QEQoxK181401; Wed, 26 Jan 2022 14:29:57 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2177.outbound.protection.outlook.com [104.47.58.177]) by aserp3020.oracle.com with ESMTP id 3dtax8fy4y-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 14:29:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WPaydpo/D5KkRMzvbthJKuP+zpMMqABjtusn+BoxaJ12uAmXY9IqpWvvDWjHr7EtdQbgCrDWFbim5KaIik/UDuzDGBMFRYGn8mwwVm9TQquPpUvKinhN7T/Bv+bEw6ebiaFqwuh1u1pgl1Kj3YxzsntBlPKw2uUHD2P5zRaoCm+2oRR5niHRkezJElPZwlPIu63tnmVlxWVtPNgXgwHnDNFP3fTRNI9ij4pZFrL3Jq3SXNexTYe7/toPdwJioYF/ODC5RWqF9xOTj/Y39V50zU/9FgGDqhzErTpL5adYFaO/L7C60odWq3CL4bSxPyf5iAMk/RoP+E6O+ktLplwHYw== 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=Nq7oiy1btdZSo4JYf9EiDMZq0mEzPUaiVsnpkIaQ4VQ=; b=TQ+a/WLkDdLo9U9+WO9Sek/moxN34EXjJ2jhMY6BXMJ5PvsbbMj63khFb7nrSF+2oj1lhExce+9DcWENo9NfRdFFwlZtML86W1K8818KCG8GxyGDfxCLda55kkAfiJme9Ogkj6eAjh+/YcAT3H+wiRTceyyYzIvXs6zfLflMuINL4z0XNbdVe28Kl2wxT6P5iBMez80hdZP7KXcFQOWUzOjvJRmjAc5NA0DzosZtPFRV2eRDHaFzamsAvSeg3NaBUB56/qoFBzzNF6o5PHJCfWkWYasy5DXVx8MRhXoKxVWdVKmAj8d6K3pM/s7tkvIiCF93UFWcxdCSMrp1dY1wnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=Nq7oiy1btdZSo4JYf9EiDMZq0mEzPUaiVsnpkIaQ4VQ=; b=D3lNpp2G9YqyMY8DgWq+w6alO+zmhAKCKZMo8KopzS6rctCkOALjhULRsRA/6E5Uy11SiaNE5F+j/rQ8pWrK0mhJWqcRjgdN6epV1uJwvCQFeSAn4OJNAWFMswD/PhWkXg6nxJ3/etQHaJ/Uywa9kBdY9nkXOdZ7u7luDfQ3CSc= Received: from SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) by CH2PR10MB3990.namprd10.prod.outlook.com (2603:10b6:610:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 14:29:55 +0000 Received: from SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::2511:c3af:9db2:6ba0]) by SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::2511:c3af:9db2:6ba0%7]) with mapi id 15.20.4888.013; Wed, 26 Jan 2022 14:29:55 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH 3/4] cpu: Free cpu->cpu_ases in cpu_exec_unrealizefn() Date: Wed, 26 Jan 2022 08:29:45 -0600 Message-Id: <20220126142946.667782-4-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220126142946.667782-1-mark.kanda@oracle.com> References: <20220126142946.667782-1-mark.kanda@oracle.com> X-ClientProxiedBy: SN4PR0501CA0019.namprd05.prod.outlook.com (2603:10b6:803:40::32) To SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0dfaf5b6-622f-4ff0-fcee-08d9e0d85261 X-MS-TrafficTypeDiagnostic: CH2PR10MB3990:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BN7YjnVtRV51s/1DrMPDYHOoASfqZ5NwiD2s2kU8zkulHksx2lIRK+a0Cue5arPJ5YvBqIjWIX7sN6QV2a48bKUbjmEnfrQYhLJu4XGiev+SbZzsf73V/ZBjrn6bOe3noMGsqiCMI8hyorINyixTJGtaJ9oOSWnjYk/4trdh8lK4Oizz32ndEoVNUN9rqekWfRiViR82J51mYl8YjAuPHH/IwD6rOmuaTYxXxWbhFH27PIc25Mm3xdlgYE27iS2raTdThbsVS0WUNMhehamsu9KHMSkxjvKAMETakvTbYjN7qC0S9FxYIG2215uFDpkc2yg4VCAoi1/sRoLeOV5R1xFwNE7ohlRUcF+nW3qhZnI5w1F547i8zEXX+H0YDVVUtRQudQh3IRoTagVrGYReA+Ark2a1jkCVe2Q7N/cgRXu1uQLbKzRdTNi2Ub8FBS328hV+2qXaEjEFOMdGdxm+oX+0wCZb2UfsVfzdyhkSWETD22UNDXKpbvrY0kjRiUDhowceVJw+GNJnCvU8azK4x1+ePpVpsQfNKm8Av0Uqo8t8oOh4nhI7JU/UoDvWaMZ5erioKT7XIno3Q0Op485KwWPjT1abER2Jg/1JFffMucBesmNDRZOp77Ksd+rh+AAsWUWUWAQxX1jrTxfZU9L9wVCwa2Drf5KLLYZIoEE1q/0GlCrGoVmxAzKQbvmCXQFhANZ+bd0HSpoM3lF6rqa3mQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR10MB5841.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(26005)(6486002)(316002)(66476007)(1076003)(186003)(66556008)(6916009)(66946007)(2616005)(107886003)(86362001)(6666004)(6512007)(6506007)(44832011)(52116002)(4326008)(8676002)(5660300002)(38100700002)(38350700002)(8936002)(2906002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8CC0u1ubzBgcIjY6JeGuJr8vzdLr77HZnyGsrcSSfCKltfY1Dh+5kvEkoDRf4cx7hjRolyWB3eo+pswT+ttfRIHXCADAhErZ0ShvEXVMvk7ck4paYbzKWNc892PQDhN85fKFMdKMV0gvgPzHEJ1ymN7ZIBWxUtmmvnR/LYkZSXs9olQ3MCAc/PfRN6gKvFuJAbm7K+le867bS9Taw0v0fjUokGrB4qv3N6hJ+8mfBpMwNDwD0KPyJo0KFSKz8lH6BXd1Nv6j8NqlnGaunbGC52qXcg7QSn8SB5HoOnNxR69CbBdPoEmv2NnXb0OU6/geE66YDsA483wE/Ue0Gr+27oL1sumrTfncxJZlT2XyhZDnSSX5TTs7EdSCbIdn5Tz/T7f2Xg3ZjcYCanlrB0LGHGlOShcRYADfkoURSKjUSHBZbB/5J2nh5cDCyIZNSHjM2gbbjchggfHWw1KIBg/y1Sc8R8NKBcSskXWgM/QMfqyoXFfdkj0sRJfYbkR75BusNXp8SSKXZjBkZsDLJYGyQiYnGtJ7w/ZK/KfH85U0+8v/hqb2j3HxFPL+UIbiSNYmBTlBsuj2axogLWugaZvt5Cl4R1vND8DdX5YgZsFiGjiEhCd+NsUCkcdmUSoBTfcZY0aMVrlE1FF/xJh8QUkUgysyUou/FCKiQLcGc0CjlbtqYz5B6PyT5EX/NeJabY3C1fRQ81gw3xYu0DuuTR+bTGHNRdmGrOHNcTzM8WyEWoQ/f+x5kQx90uIIqUspsTS4cBcFyE9vOBlhTrSuywvvwMtxTOfXilFmvpPbZaWXDScuTK0D/QrD6HTR9HmzWVL/8Y1TzCPp/PdSWMWG4t55uG1WDzPAWYhSMAbXDtyo+cN7T4YlGzLFF4GrHgVi1MhuzeT+Mea+/CQ0Fe38bFch1bFX4+CvBOFTkD+Ax7ttmEh311A7+mUlTdKgQNqshV8Q9kGieJG9tIIwOQnOGRih9a7K3C6MOOlBXDhy+ViegKyRqyfw+HPavrAgtwOLTU5Nh+I6x2b2kbnIQpKDB2Ia+PO7tH+dzLFUmEn2TTlsdfEWjHpGekrkbVLojdzFK9MzaVs6U7X21dgsbIVt92L6jQiHaiFtnfbO2bNEBKCCmqah+YHYo3ZYWB20Jw0oqxmzZ/uvRU4hxpXqoEZPPsc1MxxU+9P5Sqf8W4ARxFkAnUjU30obWFdcrd20cFTTYidXmar2d/idn9qTh6mmTaFasuGNt0W3F7oM/38e9jz13NjJPr0Z7eiVR1RZ5c5WUNX4LQAuwSlN1BPIEgIUpAdU1vXfG/tfr1/Tpj2b3HGy854ZWl/RB/cxLpCvDRIpsdrQblHtZlMmwvZQoRn5SLCQvk3vbh0h+Ahjvgs3CQ1X1HyNfrl/1t9ghLKyFHshTQoPic7jgRdEfU6ezSI2E4WGWGLVmb5gu+WG+VjV8RooiInYWKY0LQcko7kMa4KptcPlIECDPw0gN8d9V75MiKiHPVy2t82ofSovMkgb5c0g6rcYWSukhD85F/i7ZMhvGg37a8bMkMqqG70aQybg2FGIIMSeNEA4fEG5KERsIg8HXJqKO9W7t9uPSPwCnEYyBrN8w/LVLNCi8xcGEUvBpu30FETNbDhtl+bFbthSejqcPXo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dfaf5b6-622f-4ff0-fcee-08d9e0d85261 X-MS-Exchange-CrossTenant-AuthSource: SA1PR10MB5841.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 14:29:55.0596 (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: 7eIw1SovTuOLfj6RW5g3hS7RQfRHBR1R68bDRT7Rs5v1+pF0jLqxSHCOWX/6wwf6yBtnDzWI7gln0Fv4BJx9zA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB3990 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10238 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260088 X-Proofpoint-GUID: ANKCWmzLaeMI38cE1xjZzJTnesKwB-SG X-Proofpoint-ORIG-GUID: ANKCWmzLaeMI38cE1xjZzJTnesKwB-SG 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: ==377357== 216 bytes in 1 blocks are definitely lost in loss record 7,042 of 8,471 ==377357== at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117) ==377357== by 0x65C14CD: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.5600.4) ==377357== by 0x78552E: cpu_address_space_init (physmem.c:750) ==377357== by 0x78175B: qemu_init_vcpu (cpus.c:629) ==377357== by 0x7185A3: x86_cpu_realizefn (cpu.c:6447) ==377357== by 0x8E46B7: device_set_realized (qdev.c:531) ==377357== by 0x8EE36F: property_set_bool (object.c:2268) ==377357== by 0x8EC3C5: object_property_set (object.c:1403) ==377357== by 0x8F075D: object_property_set_qobject (qom-qobject.c:28) ==377357== by 0x8EC72C: object_property_set_bool (object.c:1472) ==377357== by 0x8E3F7F: qdev_realize (qdev.c:333) ==377357== by 0x43F3A2: qdev_device_add_from_qdict (qdev-monitor.c:711) Signed-off-by: Mark Kanda --- cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu.c b/cpu.c index 016bf06a1a..d5c730164a 100644 --- a/cpu.c +++ b/cpu.c @@ -170,6 +170,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 Wed Jan 26 14:29:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12725099 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 38ADCC28CF5 for ; Wed, 26 Jan 2022 14:32:53 +0000 (UTC) Received: from localhost ([::1]:35832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCjLw-0008EK-83 for qemu-devel@archiver.kernel.org; Wed, 26 Jan 2022 09:32:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCjJD-0005pr-TA for qemu-devel@nongnu.org; Wed, 26 Jan 2022 09:30:03 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:45102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCjJB-0000bP-GN for qemu-devel@nongnu.org; Wed, 26 Jan 2022 09:30:03 -0500 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20Q9eW8F007704; Wed, 26 Jan 2022 14:30:00 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=rdEs78cHpq0NFFY3esYwSt0ZEk3NL9gCE82MQcmt/wE=; b=johLRi9QZcS/75ACrI6ZMTARmC+dSwv2PFBMVVGrBdYjNQGrwGhGHRPifBV5Yq77PWD9 GhX7rZzGiFKfN7aGIhGbu55nYZe7CePlRfiAqBI1Y5077obMWUkjsecnsj8hqAmsXWd2 7JzmTgBCzV9MNlscvWegWtHeqIAekShG9nY+K7k5haJjS+0ifUugQq48RV4fBSl/4H/u LUSob+biQn9bNEmWwP2GSUOHxua0HvoGgWRFEbP8wipHXv/hHGXtWtxjVYIeuh/yUwDs EGab+NEKF5N7ZYqKoWwi/d6OSEyLzB61Say5dWHPiBgn8D4cIICe9NVSkvfJnd71hCKQ tg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3dsy9s650b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 14:29:59 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20QEQoxL181401; Wed, 26 Jan 2022 14:29:57 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2177.outbound.protection.outlook.com [104.47.58.177]) by aserp3020.oracle.com with ESMTP id 3dtax8fy4y-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Jan 2022 14:29:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GpYOE2S2hRQOf5fpHb8S6O3vLwN428JDIfGaH2oEjrrUswcUJYZPQU3DRb9Vfa1XHHgjqi6c/RqwvLP0UmCCOGYB26rGZB7ffY4SnW6NKQCU/KXsfPAY6tMn3OIIf265cP1/orN0mjWRrI6GubvhHwQIh72dNhiyxpEgd19cPQiJ3SbWPlL+U3U/z6BnSr8nSGjmpFXzfq1ZpeVuEAZ+NcEcHsZnYjU1BcercjKz2zYAIy9/3UxL5zf+j9oqOhryhxVkMPU6SX9FhtaZXLEMHQ9mPSg05hAg3lTfWh3bJjT7nezCSUi5TZnvjg5MFLnq4yrUnjMw4dcf3NSK7aR5Aw== 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=rdEs78cHpq0NFFY3esYwSt0ZEk3NL9gCE82MQcmt/wE=; b=NgufNZqn5WRzMyCfzrA/eGStZ7aZLvH+BVgafEa7ehW7s2pVAZlZmnJvqGS8MEsgKW1O+nw8j4x78wl+t5a08Ca5yKIyYVBhdz6bXnMiUKpLJlYGgWSLYwypKetARjGZRsacFr/V7GtitNQJLu9p9+KwlS2ZuHxFDWXSgQnXFty+85n44sbNm6NjMhHk2jfsT/brAmWavXCvb2WKghzCAvBkVpQtBCvI+Tervyy9V3UFcGYcKv4w8nb4MZeHnXe/F5AeVFDQOOYBIPEJQocYDB0id/5+Yf2ZJbNVu8OYyU8Pq5I7nRO0aFkv7+wXKJ1QdSFIm4GBWNB4XQxX+rYeng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=rdEs78cHpq0NFFY3esYwSt0ZEk3NL9gCE82MQcmt/wE=; b=0I5LeeK07/fvBo7onmKYQcRQUvha3sQg/btyRfMlpmSeJJrdHNuiWXWsFwLvJn8u9NoSch8RqxusFDEw5QlGeu28zQLhOWQsyMuiOiwy9QNHZ1q/CRdFmXzAkM/iHZzVeWbDK2vrXgG8t7gZU4h6QTM8dIwIPX8fZpfTfH4C9yk= Received: from SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) by CH2PR10MB3990.namprd10.prod.outlook.com (2603:10b6:610:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 14:29:56 +0000 Received: from SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::2511:c3af:9db2:6ba0]) by SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::2511:c3af:9db2:6ba0%7]) with mapi id 15.20.4888.013; Wed, 26 Jan 2022 14:29:56 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH 4/4] i386/cpu: Free env->xsave_buf in x86_cpu_unrealizefn() Date: Wed, 26 Jan 2022 08:29:46 -0600 Message-Id: <20220126142946.667782-5-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220126142946.667782-1-mark.kanda@oracle.com> References: <20220126142946.667782-1-mark.kanda@oracle.com> X-ClientProxiedBy: SN4PR0501CA0019.namprd05.prod.outlook.com (2603:10b6:803:40::32) To SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0fb155ff-eb34-4d75-bb9f-08d9e0d852a4 X-MS-TrafficTypeDiagnostic: CH2PR10MB3990:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:635; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GAfQEsu+SkYPNotUYyrQgbAh42V4eX1oVgv9EtggYrTdwIk9h034KFWv5+Mr5RRq68SuCiX+MzFV6+HnshBbZYIy85olKuP42m4gCE+RQlWbcXFPAeC2XxhxAmZJfrs30yAP38KX6Ym9qO2KSbl1mm22D3x8IJEYRNOmsvuQEJfEMTENNypljObe+x+qDEaOkQAXxYujh5ToAekLm3HXUAY92qGQggD/Bo2teIRC/EM1IhXGhiirqmVdzdoFtidZ9KnIaAdoOHWe1WBtnWVOU4O+unQS63ZcvHA4NZA6HLrfwOSyEAy5FQ/SgIGkMpnOv/+BdxjnV/leAzA6vcF5O34oe/Z2BOHlRDRKF4EvIoXXPYpvMj2Q5zKvJ9lzdtKxSl9NKoiyO8NiFecJsWtLm/jeTZ0nfNui1Iym60YGUuZ6mYavunanAwUB546bcN0eeKcdKSvxSSR2tpl7CVQDGr0EQ6n3XSq/0F+otFMmj/JV/zdOady9hddR3q52GrF398B3LVZhKJsfLY8Xuah31fSZ0m7u52BrcabdsqwsDHCQPcc6a8DRsjh49SfTG32qjHGMNe6ruqOnFtBtoNNxrITWA6tDsPjf2X7GwgG1vrty8873P+yoV+z7DC8dJUeMxe0dZcBUxoyuNC6UlaXZDuo9pwfM2cPjw9FP17+YtzD0ba2/fXyNiSA3aRNX2NlZPsyfI9xhCJLQHH0PBTWFXQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR10MB5841.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(26005)(6486002)(316002)(66476007)(1076003)(186003)(66556008)(6916009)(66946007)(2616005)(107886003)(86362001)(6666004)(6512007)(6506007)(44832011)(52116002)(4326008)(8676002)(5660300002)(38100700002)(38350700002)(8936002)(2906002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BvSxuVChKjUZJa1OMv2u65W5mSpzYdNSQRPYpJzglDPVPJ4CMB7nLfMlkwHt3WFyY7uCXbweD0lvrckZ6pb94jkAkB28J2X1GEqCXIayEnMYLPWW9wDma9yoqPnmEGJ9VdMUOg2KZsM/s0zJ4yFZRJpu0imYZRnr5pC0VK800K92FmssW7aTTZBbF5jkl9sR6YZ305yanZv8yiy3RnhijKjYMwnX2goRqIL+jExjI+lOfDfG69ikOUuqhfzGOcVPir22g7oT+sy9/Lhn2fheDV4WSyzeTQXvQCrxhsHjKOpAqptFrdvYBZ22bNHoUv0n8LL9Z3jjZH63MaKxqNHGQ3xsOsS874C22TBK08x1wFvFXbcYkaRoAD2OqVEsd82Vlxdrm9syatcseUyil1Wl9idXEdY47OKJTcj2GxhmtBZsD9zdo9vaLCUh9tCxuu3AIX+GFoE464patKqE5EVksA94s1XImLHbndolJu1nDNVyVkPn/FlaEpl1XQ9oT2XZObLBMK5wE/xSvugZBHgl4fW44FkRbZlD7bCXijBpOui5YqNyQ4CFem3Rh2zSLtkRR9C/5SzDh19697IlR6XFhbw4g6vM/pUmElyQoElQZQC9FGDJR/cNnwQJXM0w/b30pdBLWSjiPRcWDHJKoqpIhZmageVKS/5XaEPt1oihXe+jZWm4h3nGdreqkHRBsyW9Zu6GT4YMoP2yV0Mywn2VsOfFSqOXN/ebOeewpmh12geZ1eOCZ5hTZgk9u1gNyZJXn2ynx+eM954TXaPLMHEBKeYKYaE2iSD0IlWGPwmrqKOzwx1pWRHgGC0orerzQbpLIaMMYtkQVVhrt+vq0BWLWwckNgcZExmkKUWQudOrE3vY9tAlf5OJI4IIlflasfxkrUW5xWTJSTbea0D3b3z3jlLOGfZ0GC5G8lMQmaOXOhG01deXE9oIYoZlO1mBIHDISzHrb8HXmhXDvk/XNWur8JfQABiJErOqLWg2YT/uvUB8kaSuigrheDngYU9Gbhvx396gD/q6UxYgaBSIlGidlJealdneyor/LZea3gtccEkVZoht1igjwRdUU+z5U+bihMFmWdK6CHfGGUlC8BWTmxGebV21mmMDTN7lkDYAw7gjackrnaHYt9grsHzxSeFSaMaL2UyQb4k0r+tsMvtBLacAZDHQfpMwcqj03vm7zacNBnaqxYfR+LQsejB3sE8gGoDzjGlhkTbgBDx1zysj8kjaGhe+D0mqh3fPtyI0aFU39HdzYWUgkYWsrhHFqYzaBWYJZGn3Pv6JysVzaIBT9cqq7HtmSzk2R5bW9k8Cm3GrTwBVIfZBSzSd22KpdD0KDk931XFYFIRF26CO+ZtXRLPUO9ahwjg04fOPCjCHgv3IaC/h9cnidQwnU1kCWyZOOsIHzAtmlHYcqqCDHd2uEniovplrL7GGGPubomkpXmPoKVKpBtUKUM/A3NV1tVRAVPYEtUNWrKWAa8jIF80wHqYdqeMM/svuobmhAZU/BOUnDNlgrmJEXwzqKX+iE5s/suOd2DEMz/avGycKJqJwYofmd60MpdcNBuQ9yD50lf1UL9tgsMvDpzfMiedSd2zC0UZxTsVnthceW8GAkkM/xAd3M//3YBp2+QuGLK1hNLE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fb155ff-eb34-4d75-bb9f-08d9e0d852a4 X-MS-Exchange-CrossTenant-AuthSource: SA1PR10MB5841.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 14:29:55.4971 (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: grw6tsN7ItWVwngg2yB9CJ4LwdMU7Bm5hJyDFf9H9F9D1e2XJElzzeJv0XWBNNH5+7cP+Ho30rF8sce6+LrGPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB3990 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10238 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201260088 X-Proofpoint-GUID: WLwF07B8jSUcjJLeEil4VeTf5o-FPQs1 X-Proofpoint-ORIG-GUID: WLwF07B8jSUcjJLeEil4VeTf5o-FPQs1 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: ==377357== 4,096 bytes in 1 blocks are definitely lost in loss record 8,354 of 8,471 ==377357== at 0x4C3B15F: memalign (vg_replace_malloc.c:1265) ==377357== by 0x4C3B288: posix_memalign (vg_replace_malloc.c:1429) ==377357== by 0xAA4773: qemu_try_memalign (oslib-posix.c:222) ==377357== by 0xAA47E5: qemu_memalign (oslib-posix.c:238) ==377357== by 0x6C403D: kvm_arch_init_vcpu (kvm.c:1986) ==377357== by 0x8AEB01: kvm_init_vcpu (kvm-all.c:516) ==377357== by 0x8B59EA: kvm_vcpu_thread_fn (kvm-accel-ops.c:40) ==377357== by 0xAA72F0: qemu_thread_start (qemu-thread-posix.c:556) ==377357== by 0x8EE8159: start_thread (in /usr/lib64/libpthread-2.28.so) ==377357== by 0x91FCDD2: clone (in /usr/lib64/libc-2.28.so) Signed-off-by: Mark Kanda --- target/i386/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index aa9e636800..33405d245d 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6487,6 +6487,7 @@ static void x86_cpu_unrealizefn(DeviceState *dev) { X86CPU *cpu = X86_CPU(dev); X86CPUClass *xcc = X86_CPU_GET_CLASS(dev); + CPUX86State *env = &cpu->env; #ifndef CONFIG_USER_ONLY cpu_remove_sync(CPU(dev)); @@ -6499,6 +6500,7 @@ static void x86_cpu_unrealizefn(DeviceState *dev) } xcc->parent_unrealize(dev); + g_free(env->xsave_buf); } typedef struct BitProperty {