From patchwork Mon Mar 21 14:14:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kanda X-Patchwork-Id: 12787295 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 B3658C433F5 for ; Mon, 21 Mar 2022 14:16:29 +0000 (UTC) Received: from localhost ([::1]:35546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWIpg-0002KO-Kb for qemu-devel@archiver.kernel.org; Mon, 21 Mar 2022 10:16:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWInr-0008UY-EA for qemu-devel@nongnu.org; Mon, 21 Mar 2022 10:14:36 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:15710) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWInn-0002RD-Lp for qemu-devel@nongnu.org; Mon, 21 Mar 2022 10:14:34 -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 22LCw9cl022268; Mon, 21 Mar 2022 14:14:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=f/RJeG7YDeefbdr8Jvp4o9drOY/QWN6DZHyL1ATOhbE=; b=PaCtwWi/vn0uj4I9d5r3WQzLji0L6O7RTiAwBysByBA6VADCTWdIPhFlZHLrm3HLWE65 rP3VKDkUx7qyWWMY4LSYFfOcCvBDUWK4WFxN7+4s/bE/A/iZs96ajIeE3BklaB3lXMWe c9Tzib8e6+R9WY2KFtxDnQ18pLku2+CkqQmyH3dT0Ivf6XNfHmOO0diPWTOi4NhVrMSD uMvPC0QrTY4HCtNBas5fFi9wCZ2BfntSS4p6hNm+m8luT9hydqH3yfnBdo+hAS7W+EQA +6JbiEsNkPlk0T91GixDdCskzROMzpgz6oPh9l9mAYoGnkpxKq7RgCAiMQoGpZwWvYbb GA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3ew5kckd1s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Mar 2022 14:14:20 +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 22LE5cUa051515; Mon, 21 Mar 2022 14:14:19 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by userp3020.oracle.com with ESMTP id 3exawgse9r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Mar 2022 14:14:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dxa9rRBTjbO9oCbflYfsbhfB+SMUZGrie5VFvn8+JVw73JCFPelNngOxi8E3cv7ea6s9FnIuqbRnB8umxP79qQS2EVS2O8Zz4oQfSL/Q/AA/KoSIfVH7bxuSAKfcAvysZMcYpzyjPDG41Zz+VDBlXTMqqfzHdVm+xgizrQMwA1Y0BtORwVoZ4f0o9/PrsnbmMOUPqFc3DbviQSktslQcyMb0BNxuk9RmJWjx9G4zCePWdwMBQ8iM57xDnIlAoQLqgmtYskaH6MtXY5AyL3O+mw3KW/m/KB464F0n8CvXh2mSalLp2GaIb5YFJsvF/SQzGkJRIuKGt9gvbFKNOC+EGQ== 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=f/RJeG7YDeefbdr8Jvp4o9drOY/QWN6DZHyL1ATOhbE=; b=iRZcwDWUn3oybtE/GItzOwakW3hREyyUu9ezfyHgZRPhEyA2eVv1QFxVQMmGXs5E0QR9N1gMdtaTYMweMwdK2amXNDEjApVOTEksyFtliWrH3l9gVOl6bDaR6e2/MPsycWMryRX1dt6mCL+d3I/+GnYJyuGrOTvTAMHdF3uvUhVJHvCEDNGMe0nKUvRh0n5LcfOb1Ji3sz++2vYvM2XYvIz6XrLKkEhO4s5BpOrvc6QLPuA5a+2VTY2xkgqI0KmueHmiDw8exgfSWQh8GKBCKS2f7Nbs7w8OGjT5sOWxW3U02zBhsMV5khoD/SfQDVuWZj1yK2v1IWeeyzPYYhp2xQ== 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=f/RJeG7YDeefbdr8Jvp4o9drOY/QWN6DZHyL1ATOhbE=; b=gxVbbLRZ+3UI6lYoMN+OjClhY34kD0Hxc2SdnDlhI1WmQHJueQ/kWIZYn98gkRarNRLskBd8ci/m3Vtu4RFLNIjMgc559/PZ8pPVXfi+vcy7/mVgEPrFjNKkFED0Nr+BXCIZ3W2jgJ9POPB/ObLUbOxln/QIbRxYVS+tZ7F+OKk= Received: from SA1PR10MB5841.namprd10.prod.outlook.com (2603:10b6:806:22b::16) by BN6PR1001MB2258.namprd10.prod.outlook.com (2603:10b6:405:2f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.18; Mon, 21 Mar 2022 14:14:17 +0000 Received: from SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::85a0:903e:852d:6c15]) by SA1PR10MB5841.namprd10.prod.outlook.com ([fe80::85a0:903e:852d:6c15%5]) with mapi id 15.20.5081.018; Mon, 21 Mar 2022 14:14:17 +0000 From: Mark Kanda To: qemu-devel@nongnu.org Subject: [PATCH v3 0/5] vCPU hotunplug related memory leaks Date: Mon, 21 Mar 2022 09:14:04 -0500 Message-Id: <20220321141409.3112932-1-mark.kanda@oracle.com> X-Mailer: git-send-email 2.27.0 X-ClientProxiedBy: DM6PR03CA0096.namprd03.prod.outlook.com (2603:10b6:5:333::29) 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: 09183cc7-8fe4-4299-9a92-08da0b4515ab X-MS-TrafficTypeDiagnostic: BN6PR1001MB2258: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: TNY7EzgpdmmZWWSBgykdYPDVqJbPKdI7CLhnlBY0yo0BjIMP33co0K7DP2coP07yGsUlWPIhrWTvF57fMgMqDr7lOTKVbRRJGu3ErtyXbxWCQ95euMJfuPrUVVZOa9xv38OWL2hEsUmSU1T6NKfDt2UxNtu3o7Re/BVQMhnjQyAtnKHPZiKmujGfT4MbXj7WRGmKaMrLAqdvA7B0AfAkwYQSoFmkbQwoszBhErxV1np/GOjNnYt4/Vc1e1goD7leDh756owSPNKL96xRgeX6LytrmEzPNdh/J/ZIdzFbxbZBgZm1T3BAjEKsGd82Y0GwpeU1BosiI1xug+TadfK1FP7CQBYMrKEa4ICuATsqLPNoXe8C0aitMOvQcmZczy7tUFfTiHTE7MhKYHpcAzoBx4KK/uTgki3erTt8UUxLyLKyX4+YTthU/JHSSSZavjXduXvx7YWMaw2r++hIGE+cO+uNDSLb09QsUHsAWYuu0dEEaLIcWnaldjCTmh9G74POx6tnJ8bWQhRhX6+ucwS+kJ8xHgQn2RHqpNrXVhUAmGT/o1Vg/0lg7sEFa2F1c5Wc3BLcLbTC/hZkUQdOnTekan5qzMxCxUopg8PFO5OsmBvjff8L+Ruf0+//tK+LETMAld8mt+OKrORnZISbBqdk2jJ279R59zF6uMemGF7U3+ya0XW9KQRY32HP2eXkcYzDLM8z21VFE3JXO4gDmIQuZA== 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)(107886003)(36756003)(2616005)(2906002)(6506007)(508600001)(6666004)(66476007)(316002)(186003)(66556008)(66946007)(6916009)(44832011)(26005)(1076003)(8676002)(4326008)(6512007)(86362001)(52116002)(6486002)(5660300002)(8936002)(38100700002)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?cjTnAA5vmrFM1TB8CPMEgJtHsp3O?= =?utf-8?q?0zzbGnMOq2ORrBYW8XSbA25vPc4qLFMilGNIVVNRIlJQVAt5J20p3KTXqloYAuErL?= =?utf-8?q?yBjWi8RkxyvUjYTAFi7m/D7wQkoE3PZ2zpeXboubURAtUQ8VQ9sT7ZMB+2uOwshst?= =?utf-8?q?IHw9lfPYASKYv2fKicQrCMPa/7Y6uEdS9uHqtQElmcE+9ZQOay89DIIXC0C+qrN50?= =?utf-8?q?q3hhPpm6Rh4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IPx2r/k1VyYL49hNfv0Zd8dpOvXYB7fZDnkw5s8amNs4aFZxP5t/XqKTll?= =?utf-8?q?Bu7VfShAldR5l9ssP4vHa+wMb7Br6C9cSROU82FBIdtuWDmaqxol50XX0f6y0Knt7?= =?utf-8?q?hZf8pRTVy7FpUwYtjLHYW51ip49nO293uOuFBdamqtfjNsRJplVoY4qFjxr6zpMZG?= =?utf-8?q?MUeiMZvfBATbs84CAeFlQpqEvLvenJWaA922PeK/zVV+CZ8nDKmAwEr87KO2n5U7Y?= =?utf-8?q?pqJoF+dJQhZ5KtmBfXQLAqFbePIM6rr9b3sFk/6gc5IyecRrRGrmaEMcoTyO/KXW+?= =?utf-8?q?m/ZYz9xM4h+sf2ysxPs5/ZxyqOK3e6KN6RxA=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09183cc7-8fe4-4299-9a92-08da0b4515ab X-MS-Exchange-CrossTenant-AuthSource: SA1PR10MB5841.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2022 14:14:17.2125 (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: eziNAN0wTDYIcPI0C3B+ldYs5EwHHdzQVOSlLhsOs0nRkOQLX4t+MCoxxP6PpMO0qHqIHV7G5rCDQ0EH310EBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1001MB2258 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10292 signatures=694221 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 mlxlogscore=778 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203210091 X-Proofpoint-GUID: 5_UQ5XJrjmYBFOXA8WU7ujWC1SaU04Mo X-Proofpoint-ORIG-GUID: 5_UQ5XJrjmYBFOXA8WU7ujWC1SaU04Mo 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, f4bug@amsat.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This series addresses a few vCPU hotunplug related leaks (found with Valgrind). v3: - patch 4: create cpu_address_space_destroy() to free cpu_ases (Phillipe) - patch 5: create _destroy_vcpu_thread() to free xsave_buf (Phillipe) v2: Create AccelOpsClass::destroy_vcpu_thread() for vcpu thread related cleanup (Philippe) Mark Kanda (5): accel: Introduce AccelOpsClass::destroy_vcpu_thread() softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_thread() softmmu/cpus: Free cpu->halt_cond in generic_destroy_vcpu_thread() cpu: Free cpu->cpu_ases in cpu_address_space_destroy() i386/cpu: Free env->xsave_buf in KVM and HVF destory_vcpu_thread routines accel/accel-common.c | 7 +++++++ accel/hvf/hvf-accel-ops.c | 10 ++++++++++ accel/kvm/kvm-accel-ops.c | 10 ++++++++++ accel/qtest/qtest.c | 1 + accel/tcg/tcg-accel-ops.c | 1 + accel/xen/xen-all.c | 1 + cpu.c | 1 + include/exec/cpu-common.h | 7 +++++++ include/sysemu/accel-ops.h | 3 +++ softmmu/cpus.c | 3 +++ softmmu/physmem.c | 5 +++++ target/i386/hax/hax-accel-ops.c | 1 + target/i386/nvmm/nvmm-accel-ops.c | 1 + target/i386/whpx/whpx-accel-ops.c | 1 + 14 files changed, 52 insertions(+)