From patchwork Thu Jun 27 13:37:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=ya1gGsoQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W906s6Mxfz20Xg for ; Thu, 27 Jun 2024 23:39:49 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKP-0000yS-OR; Thu, 27 Jun 2024 09:38:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpKO-0000x3-72 for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:20 -0400 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKI-0006Kp-Ta for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:16 -0400 Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-376266a65c8so29204445ab.3 for ; Thu, 27 Jun 2024 06:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495494; x=1720100294; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=iP3blhpOG/UV/59pEfGGJ3KAPs2EsafUmQmrZ34OeNU=; b=ya1gGsoQ2CQVRQo+m5Qrb8oPuIrJ1iX5+rMCOhMPN02gxzF2MHP8z+5gnXjor9N3Gi kZRBcRkLN2HMZGkhfMJ4e5qY0cDZTOAjDKT5oECmIud2ZHjO6jIgZzhNaEK3Ju2+fKPI ZLZKZbo69iebt6pl6sa7KwMYS0UWJe22ZJ292mqkr2Z9uRrHrdUkPqnEJ1BON+Gz7rRl SVkT+odnLf1zk0EZD0MZEw8hWM9f57TVLj0mLSrPORxFmNCpxzRXpF0KTlOtxj1HrlzM TR544uyY7WXfbnocgO/Li7qe9s36C4AAkRk0BGHs8tiwQ3L8h4u+vxeAPnGRNK9BDPHl gIFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495494; x=1720100294; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iP3blhpOG/UV/59pEfGGJ3KAPs2EsafUmQmrZ34OeNU=; b=oxXacPXDgrFKzfFO/R972+UPFBdt9C4lKIe0GNCOjwhGLbzTYzHf2J4HgPMktec+BA ZmG6SUh2JxZE1f9htpwqa5ngO1KBgFkFMU4xjDTS7JWyDHn+BDk7/PnIvuLDAaXcIRvi emSO/0rbYbZ1/CirhYDER3hgzFNJmtwPxx0/aWe7SLxgONbwIHA6lS0PjabLIs73Qr30 XE3xi29Rl8DApCiMk9CIB8FiygVNX/p0UT/xf1SK5EX5l2FyoscKkvC9zATaxLR0W1dD QCZPRunbocVcPaGN+++snRHkPqweMlDEFvBYmZSEXxzl5pSLTqOvJTC6NrnUslXSxUww XB8w== X-Forwarded-Encrypted: i=1; AJvYcCVLhgfHi4zQaIRA2awLE78SJfTfDrn8nVTCh8ylHdIShsRvptMolLOl38Pj+IU7NTWslnAwUkADFqnnDVBAL/FAUhGH X-Gm-Message-State: AOJu0Yw1gOBoWI4ICxehd2rVQUWerUXt9hf2Q7IqHLaZxheRvkdVx7RW fvStOJObdlxbXRplhPtKwSbBl3FT1logwR9m6NN/+3KNsFDri3+rcreibAk/4to= X-Google-Smtp-Source: AGHT+IHf3jIhWTbSTXHSifyb26fGEQBo1unk8u+4a2sfQG0Lwv5b0drDi6cRG7DTmmvL6lxvgvJh9g== X-Received: by 2002:a05:6e02:1a44:b0:375:b381:9ad1 with SMTP id e9e14a558f8ab-3763f5aa404mr177979675ab.6.1719495493754; Thu, 27 Jun 2024 06:38:13 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-72746793be8sm1089226a12.48.2024.06.27.06.38.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:38:13 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:44 +0900 Subject: [PATCH v2 01/15] cpu: Free cpu_ases MIME-Version: 1.0 Message-Id: <20240627-san-v2-1-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::12c; envelope-from=akihiko.odaki@daynix.com; helo=mail-il1-x12c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- hw/core/cpu-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index f131cde2c038..a3073c17d098 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -289,6 +289,7 @@ static void cpu_common_finalize(Object *obj) qemu_cond_destroy(cpu->halt_cond); g_free(cpu->halt_cond); g_free(cpu->thread); + g_free(cpu->cpu_ases); } static int64_t cpu_common_get_arch_id(CPUState *cpu) From patchwork Thu Jun 27 13:37:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953273 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=3dfUEHYU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W905b5Ntzz20Xg for ; Thu, 27 Jun 2024 23:38:43 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKV-00012x-1G; Thu, 27 Jun 2024 09:38:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpKT-00011V-80 for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:25 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKQ-0006LZ-Ec for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:25 -0400 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-6eab07ae82bso5671337a12.3 for ; Thu, 27 Jun 2024 06:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495500; x=1720100300; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=GK1NnhFlKONfJOQ1epeja3jVUC6tPChPm6e/EkyYkzg=; b=3dfUEHYUCKzfRk7JTHaTwWcEEyeH9EmUDesSahiUXQXRaAOjwIMN2m2BkjCSkiyV1L h1fkXkEGFmToUnYBsBc39jrsJcx8RZxiALKMndPOGtQKWgToLxj5SL/kWIWU8iT0cOma BhdLbdGqSd+wxfGv0xQ3abc9vGKwllX2JNCtyYSUJD3oi4NpB69Wb0n4qj2jy6RLWW6E Fppt3Hrbk050D8CDfCQogynhKavRTEYuwU8cPHEz4DTEaYKiTw1eq55JsR3l3Ovfyn0F S20DtImPfnrYkXlWh63M/mCo5f4WjuKBukeXFDOQOxcE6d0rOMJvmSdkf/956ShPZ0s0 3hUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495500; x=1720100300; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GK1NnhFlKONfJOQ1epeja3jVUC6tPChPm6e/EkyYkzg=; b=b1eVRf0Pbx0g5C/jJ6EivgNe8jK5uRIoiCLDrEdlhtUHPgdiuavhOBDV/m8NPWKBwe O0EoJRP3S6oQ+qf0W0zvkAQhnyjCudHjWK++ZSvh07wWHuH5eBwoEYDLEAxK3s2XGHsE D92xKxVinZ9J4laDuKtP3Rv+lMj4+yPYA4vcAGpjkXy8CR+9j5qBXF3ESzpn4+r7UsoK 4KlO5qo5XiZHD7knLZPcNBG5WkspLtUo4wejKf/XaaP5kRzOwtUSXB/stV0f7WOONUGy uu4bKV/wnaeyctKl0EGDMz9SJIRVmVhh89YPpDA1BqaT71VBl2QF6ft5YFR+cc+s4j1C wSVg== X-Forwarded-Encrypted: i=1; AJvYcCUvLYzDW2mIOfp6KE8SER7GGekEFHGL+8klG/MgviGFYPil1zI4Ne8pTdErMtw/Ya5o0zsmgcpVehtAdVNH1wNZm0dR X-Gm-Message-State: AOJu0YxiKEv2QFRcCTjsYM3bYacmn7C4L9fNpfvTMG2Ggvv939ZhaP2q KkopkK9wmKZDQjJCuAKj174JwrJDt3sTjFVDYQtwOskKZsAPhvcN7Oso0CYiI0M= X-Google-Smtp-Source: AGHT+IH3egdUupwHg3/fKTQf59c7eE0cNW7DQzddzdTPcu/CpgemJeZtdnd9ja5WHZ+QSceM/GYFVQ== X-Received: by 2002:a05:6a21:3382:b0:1be:c6e6:a712 with SMTP id adf61e73a8af0-1bec6e6a7edmr4650330637.29.1719495499967; Thu, 27 Jun 2024 06:38:19 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1faac8fcd7dsm13226835ad.117.2024.06.27.06.38.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:38:19 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:45 +0900 Subject: [PATCH v2 02/15] hw/ide: Convert macio ide_irq into GPIO line MIME-Version: 1.0 Message-Id: <20240627-san-v2-2-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::529; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org macio ide_irq is connected to the IDE bus. This fixes the leak of ide_irq. Signed-off-by: Akihiko Odaki --- hw/ide/macio.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/ide/macio.c b/hw/ide/macio.c index aca90d04f0e8..9c96a857a7c1 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -427,7 +427,7 @@ static void macio_ide_realizefn(DeviceState *dev, Error **errp) s->bus.dma = &s->dma; } -static void pmac_ide_irq(void *opaque, int n, int level) +static void pmac_irq(void *opaque, int n, int level) { MACIOIDEState *s = opaque; uint32_t mask = 0x80000000u >> n; @@ -446,6 +446,11 @@ static void pmac_ide_irq(void *opaque, int n, int level) } } +static void pmac_ide_irq(void *opaque, int n, int level) +{ + pmac_irq(opaque, 1, level); +} + static void macio_ide_initfn(Object *obj) { SysBusDevice *d = SYS_BUS_DEVICE(obj); @@ -456,8 +461,8 @@ static void macio_ide_initfn(Object *obj) sysbus_init_mmio(d, &s->mem); sysbus_init_irq(d, &s->real_ide_irq); sysbus_init_irq(d, &s->real_dma_irq); - s->dma_irq = qemu_allocate_irq(pmac_ide_irq, s, 0); - s->ide_irq = qemu_allocate_irq(pmac_ide_irq, s, 1); + s->dma_irq = qemu_allocate_irq(pmac_irq, s, 0); + qdev_init_gpio_in_named_with_opaque(DEVICE(obj), pmac_ide_irq, s, NULL, 1); object_property_add_link(obj, "dbdma", TYPE_MAC_DBDMA, (Object **) &s->dbdma, From patchwork Thu Jun 27 13:37:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=tOKzzI5S; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W905v0qndz20Xg for ; Thu, 27 Jun 2024 23:38:59 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKg-00016j-IE; Thu, 27 Jun 2024 09:38:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpKe-00015Q-0J for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:37 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKY-0006MU-LT for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:35 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1fab50496f0so2989385ad.2 for ; Thu, 27 Jun 2024 06:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495507; x=1720100307; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=H1Ud2sffuzrWRWcIEMkaft+gSFV/vM2qExG+yzsFHsg=; b=tOKzzI5S818bX1RcOKyIwWKZVxz8/r54xTNsQwNydWljGZga1ugk+/vcE+78DbdDKK zSzw2n2nBLUaMVn0QE+P/H0IGdr0xwEBfgF/fehCGtU7u7A3s3WXOSm3rc1TEFSHesDB qs8IA1Ecl8v3KHGWubjuQKgJUhEGOPd5r1/sUfHGmygbfJ0IGebPRLNOTa0qZKkQkNBn FmFN5MR1s0vKWP3YFmnYKSYQ71xMA5kqiBa+Xcz1ejOV24q75wIdm6l/YoJgVMBpWbIw uk0Ykm96GLf762CYZmZkxxTBT6GCa2UludZMzh2i5xkHyOBhWV/IVOD5gLlSvQ2rsxrN cWWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495507; x=1720100307; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H1Ud2sffuzrWRWcIEMkaft+gSFV/vM2qExG+yzsFHsg=; b=MVnLk9GoHcyXJdHhq/juw5MqPkPwhCHO9vbq81rQahpWyxEgGGmN0mgWLYvs+V5pib NTlA9wP/5LKd5TRGWUYnG0emvTOaiz2nyS8orN7JsvKtXWscFEVvbKkq9HVJL2rOEfyI F8mdKL9K57h48Pbwf21AKiqa9Qkn9akco4yiZRGxrlUspWQnOrNoBNzHpkLP7+nd0l7s sHyw2pb9+H9ohVJLHvIhZNOGH+WPvMRX4XVuJ1lc5sJcR0gjgca+Xp5lJglQ0mAM07ET Qp7SJilxkMbmEnwPDUJ9s3ELIyJAJ+ZZwiwXyjdj8yj1m6gd6q/opJpACtAWfEdkjobb F39w== X-Forwarded-Encrypted: i=1; AJvYcCUZc4saQimwFsiX8wQgyiGRFbE/I6UGDQLVBBSgfRJNhcQr1LFTGSHqTZ0cDegrWDaKusAzSkkUcD4aZk/tnz6gh9Ru X-Gm-Message-State: AOJu0YwBo56lRMtqA0UpfTwWvKVqSGzJPGSb2DwkoUX7UoN96C/JpTwt /IaPPP/UW8Vg24B/Hdmb9/l1Ql45cy5PmiI+Pe/stneiV+eoM3GDWFh3K6SEreU0H4+s6f9PZzk rtLU= X-Google-Smtp-Source: AGHT+IGlthtRlIAOrErKWBa0d4JJXHENu4FzsbU9EBlxzWOmvVmo/stPsHEbzaIw8JmTtJTtru3wgw== X-Received: by 2002:a17:902:ec8e:b0:1f9:f559:d8c7 with SMTP id d9443c01a7336-1fa240c5353mr166234385ad.57.1719495506752; Thu, 27 Jun 2024 06:38:26 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1faac979f54sm13182435ad.153.2024.06.27.06.38.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:38:26 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:46 +0900 Subject: [PATCH v2 03/15] hw/ide: Remove internal DMA qemu_irq MIME-Version: 1.0 Message-Id: <20240627-san-v2-3-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::62d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org A function pointer is sufficient for internal usage. Replacing qemu_irq with one fixes the leak of qemu_irq. Signed-off-by: Akihiko Odaki --- include/hw/ppc/mac_dbdma.h | 5 +++-- hw/ide/macio.c | 11 +++++++---- hw/misc/macio/mac_dbdma.c | 10 +++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h index 4a3f644516b3..1e1973c39580 100644 --- a/include/hw/ppc/mac_dbdma.h +++ b/include/hw/ppc/mac_dbdma.h @@ -32,6 +32,7 @@ typedef struct DBDMA_io DBDMA_io; typedef void (*DBDMA_flush)(DBDMA_io *io); +typedef void (*DBDMA_irq)(DBDMA_io *io); typedef void (*DBDMA_rw)(DBDMA_io *io); typedef void (*DBDMA_end)(DBDMA_io *io); struct DBDMA_io { @@ -154,7 +155,7 @@ typedef struct dbdma_cmd { typedef struct DBDMA_channel { int channel; uint32_t regs[DBDMA_REGS]; - qemu_irq irq; + DBDMA_irq irq; DBDMA_io io; DBDMA_rw rw; DBDMA_flush flush; @@ -172,7 +173,7 @@ typedef struct DBDMAState DBDMAState; /* Externally callable functions */ -void DBDMA_register_channel(void *dbdma, int nchan, qemu_irq irq, +void DBDMA_register_channel(void *dbdma, int nchan, DBDMA_irq irq, DBDMA_rw rw, DBDMA_flush flush, void *opaque); void DBDMA_kick(DBDMAState *dbdma); diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 9c96a857a7c1..425b670a52a9 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -427,9 +427,8 @@ static void macio_ide_realizefn(DeviceState *dev, Error **errp) s->bus.dma = &s->dma; } -static void pmac_irq(void *opaque, int n, int level) +static void pmac_irq(MACIOIDEState *s, int n, int level) { - MACIOIDEState *s = opaque; uint32_t mask = 0x80000000u >> n; /* We need to reflect the IRQ state in the irq register */ @@ -446,6 +445,11 @@ static void pmac_irq(void *opaque, int n, int level) } } +static void pmac_dma_irq(DBDMA_io *io) +{ + pmac_irq(io->opaque, 0, 1); +} + static void pmac_ide_irq(void *opaque, int n, int level) { pmac_irq(opaque, 1, level); @@ -461,7 +465,6 @@ static void macio_ide_initfn(Object *obj) sysbus_init_mmio(d, &s->mem); sysbus_init_irq(d, &s->real_ide_irq); sysbus_init_irq(d, &s->real_dma_irq); - s->dma_irq = qemu_allocate_irq(pmac_irq, s, 0); qdev_init_gpio_in_named_with_opaque(DEVICE(obj), pmac_ide_irq, s, NULL, 1); object_property_add_link(obj, "dbdma", TYPE_MAC_DBDMA, @@ -513,7 +516,7 @@ void macio_ide_init_drives(MACIOIDEState *s, DriveInfo **hd_table) void macio_ide_register_dma(MACIOIDEState *s) { - DBDMA_register_channel(s->dbdma, s->channel, s->dma_irq, + DBDMA_register_channel(s->dbdma, s->channel, pmac_dma_irq, pmac_ide_transfer, pmac_ide_flush, s); } diff --git a/hw/misc/macio/mac_dbdma.c b/hw/misc/macio/mac_dbdma.c index 2a528ea08caf..3450105ad851 100644 --- a/hw/misc/macio/mac_dbdma.c +++ b/hw/misc/macio/mac_dbdma.c @@ -114,7 +114,7 @@ static void kill_channel(DBDMA_channel *ch) ch->regs[DBDMA_STATUS] |= DEAD; ch->regs[DBDMA_STATUS] &= ~ACTIVE; - qemu_irq_raise(ch->irq); + ch->irq(&ch->io); } static void conditional_interrupt(DBDMA_channel *ch) @@ -133,7 +133,7 @@ static void conditional_interrupt(DBDMA_channel *ch) case INTR_NEVER: /* don't interrupt */ return; case INTR_ALWAYS: /* always interrupt */ - qemu_irq_raise(ch->irq); + ch->irq(&ch->io); DBDMA_DPRINTFCH(ch, "%s: raise\n", __func__); return; } @@ -148,13 +148,13 @@ static void conditional_interrupt(DBDMA_channel *ch) switch(intr) { case INTR_IFSET: /* intr if condition bit is 1 */ if (cond) { - qemu_irq_raise(ch->irq); + ch->irq(&ch->io); DBDMA_DPRINTFCH(ch, "%s: raise\n", __func__); } return; case INTR_IFCLR: /* intr if condition bit is 0 */ if (!cond) { - qemu_irq_raise(ch->irq); + ch->irq(&ch->io); DBDMA_DPRINTFCH(ch, "%s: raise\n", __func__); } return; @@ -562,7 +562,7 @@ void DBDMA_kick(DBDMAState *dbdma) qemu_bh_schedule(dbdma->bh); } -void DBDMA_register_channel(void *dbdma, int nchan, qemu_irq irq, +void DBDMA_register_channel(void *dbdma, int nchan, DBDMA_irq irq, DBDMA_rw rw, DBDMA_flush flush, void *opaque) { From patchwork Thu Jun 27 13:37:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=KZ3u8CeL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W906M5zdNz20Xg for ; Thu, 27 Jun 2024 23:39:23 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKq-00019Q-Op; Thu, 27 Jun 2024 09:38:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpKh-00016r-PU for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:40 -0400 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKd-0006Mu-Od for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:37 -0400 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3d5d7fa3485so382355b6e.1 for ; Thu, 27 Jun 2024 06:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495513; x=1720100313; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ttjpe0Zy78QRlVICf1w8g9FNolQGU7Fei8nrc5VuhDU=; b=KZ3u8CeLG3wv+E4DOhDghvmofyc5dHvZx+zctdB75dA3iRSS7P9F6EEJl0jF+Sy3Ow su8DGKXcHu7eS7bBb77dScPdNAp+fmOajodGE3VNJfG+q5Wm+q4sOIf+HHEHS7F8sb7V NjU/KsKkR6Ga+VrG+fd0YoKfYzgRB7QitKVlP93pIyQxVag6cwBX8DIgapo/tZypxj3r 83IhFfz95Erxwnvf6wUVhhMyeVGcPr5oMlNtcn89Yw/qihzSy9m81DpwyDTWKaM1Ag6L ouWHKSAsgmGZMjdgMbnwzJJhdhK97RhW8RdiIjQ8NwuhFnmR5OXDgYrWpbp415UIMk2X FlAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495513; x=1720100313; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ttjpe0Zy78QRlVICf1w8g9FNolQGU7Fei8nrc5VuhDU=; b=ks4gdxTocU3nmTKF5Nwvi7JiD9lqeVlgIC7RQXFa1rgr9xRRyrvOYMXRwqxuWZVw/x ZThqzcTZkEZIJVVIERxCX48kMhYcMF2jtV11FRkrtpotahlAPaT7USidAyr3S275Nv6F KmvlfrEjh3Lqt9Jnaw3lfngtNShwBq0gBcHYxr5aEu2flL4oEUm4WY5yiRMZcuJEb/rd zZ+fHETb2gp0LVBF7Cg2hN8E+fBS7piOERm7tqwZRi4B9dSar3HFtAgHJCWhrBRi5SDB nViOuaEr/iWOGz5bdq3S9ju3WoQG9At8pAQwIGXt2TpZpljyzvSUnJP65OpuO7MYlxCR A0QQ== X-Forwarded-Encrypted: i=1; AJvYcCUSRIoMOWNWsDXc/fiAearCVf3+4guPWRLkbPc8B2k00/xPj+Xa/qDLDYJjCcW1pJHskaweDnKsKu5GB5Em2BagSv3f X-Gm-Message-State: AOJu0YyXijRrObwPMfaH3LlRT9wdNfHmPoD2LmT9EjwVX0VtN39Mh2GX nfabqEvMKES6qwvRL5U02KKGJeHY2U1HrPbHznH0y5OysGOnnaKNsWP4bQmi2/g= X-Google-Smtp-Source: AGHT+IFN/aBIDxZnjlWX25a4chKiYG8RrkIkEkci/W6w41POb8g9HB7cE1bIk127xZ5DG/n29PtxHA== X-Received: by 2002:a05:6808:1813:b0:3d5:d7f8:a3e0 with SMTP id 5614622812f47-3d5d7f8a7f5mr1927401b6e.32.1719495513016; Thu, 27 Jun 2024 06:38:33 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-706b48cae37sm1337617b3a.3.2024.06.27.06.38.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:38:32 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:47 +0900 Subject: [PATCH v2 04/15] hw/isa/vt82c686: Define a GPIO line between vt82c686 and i8259 MIME-Version: 1.0 Message-Id: <20240627-san-v2-4-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::229; envelope-from=akihiko.odaki@daynix.com; helo=mail-oi1-x229.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes qemu_irq array leak. Signed-off-by: Akihiko Odaki --- hw/isa/vt82c686.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 8582ac0322eb..629d2d568137 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -715,13 +715,14 @@ static void via_isa_realize(PCIDevice *d, Error **errp) ViaISAState *s = VIA_ISA(d); DeviceState *dev = DEVICE(d); PCIBus *pci_bus = pci_get_bus(d); - qemu_irq *isa_irq; + qemu_irq isa_irq; ISABus *isa_bus; int i; qdev_init_gpio_out(dev, &s->cpu_intr, 1); qdev_init_gpio_in_named(dev, via_isa_pirq, "pirq", PCI_NUM_PINS); - isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1); + qdev_init_gpio_in_named(dev, via_isa_request_i8259_irq, "i8259", 1); + isa_irq = qdev_get_gpio_in_named(dev, "i8259", 0); isa_bus = isa_bus_new(dev, pci_address_space(d), pci_address_space_io(d), errp); @@ -729,7 +730,7 @@ static void via_isa_realize(PCIDevice *d, Error **errp) return; } - s->isa_irqs_in = i8259_init(isa_bus, *isa_irq); + s->isa_irqs_in = i8259_init(isa_bus, isa_irq); isa_bus_register_input_irqs(isa_bus, s->isa_irqs_in); i8254_pit_init(isa_bus, 0x40, 0, NULL); i8257_dma_init(OBJECT(d), isa_bus, 0); From patchwork Thu Jun 27 13:37:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=lPeMh6BU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W907p5ptmz20XB for ; Thu, 27 Jun 2024 23:40:38 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKt-0001Aq-Pu; Thu, 27 Jun 2024 09:38:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpKm-00018N-Ts for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:47 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKk-0006PJ-BP for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:44 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-70675977d0eso4113016b3a.0 for ; Thu, 27 Jun 2024 06:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495520; x=1720100320; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=y3Al/DkWdr7oNtWQmlrRFITkQePTtq0AALK4OUYETUY=; b=lPeMh6BUSXMhZknRYOo9Rira3NbdGSHeTgUErQqeDFzcqRXpqnKWb+2P5HblpLvOjj jQkXxbfRLKIiRj6/jM+my5ZA3LZB7TOFK+LQEfliyYJlsl/85JoKcXIleTMi4sopiup0 nOF+zPFRi8bvaH1DGXnde1IlEoC4nbUVOxR2yQEPZXdOQBs8AQEJ8T98MZe3rlYhVhl1 eylp8LDedrw0h6YDsBMphfxWVJUo1jQbm2fHjnIee25A2eLc09eRGmim2OJwZAslyfv2 99zKHsTyOBkDBOBCmBMKqr8U1NZpdhpbSaoSl842X+9mZp/RwvZyZfdWqCGdraRy5LvS oA2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495520; x=1720100320; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y3Al/DkWdr7oNtWQmlrRFITkQePTtq0AALK4OUYETUY=; b=UaBoSJ9Bg80+OH0DGDB/uioFVVyygIzi48gRSnAc7WoytGPwcNcucVAIpWuoUFQE/r +Nah4TeJbzA9AYguGXE59wc6OfyBFbpwSecQX5pIT+UWUfMNrRYcPT9f6WlDcGRP0Sl+ y55g0ES3ntlahwR7IvqtQEeh7T4Y24tA2Y266gYMvud4toMH7LE1Te8z+7mEhMD/26NB Eqvux13qf076J3PK1JY97VvX1tUpFIjdGEduPGhQ1i46/oye80N82yov0Z0A/aaCwMhi 8DsHqLSepW3cFw0Yc8fRqsfcE4T5SSWdlP3wuRambNhkM5zF4cu4c3qBMDs5nBi9hUWD Cb7Q== X-Forwarded-Encrypted: i=1; AJvYcCXrIYiUg5TkiBG3ZwVoxHAFHS7mxDAdK/7xsYHfjE8m3tbHQl/yagCkidKQnsH4hxNlXNtq346mEI/iJFRxl8Ll9ayd X-Gm-Message-State: AOJu0YxOEyYHhlw4qF6K8aU8fR4BH13IMavNuu3Jde5zvkjKHdWUmYYc pfmL8Mys5fqw8YZahk4ObbSMmSK7XTJzm1whlTmbwXRqyNVc9DgyDkCr8+oPPisoXJNHiCAXv39 bt8E= X-Google-Smtp-Source: AGHT+IHixATdz48pQww+mu3HBcr4wVkdvUAZf3x1lVxRgTZ61Ksvi18JOkIMtiIBBjcldi4x5EJhUg== X-Received: by 2002:a05:6a20:a8a1:b0:1bd:22cd:a639 with SMTP id adf61e73a8af0-1bd22cda715mr7144503637.8.1719495519790; Thu, 27 Jun 2024 06:38:39 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2c8fe9f1c35sm1441098a91.33.2024.06.27.06.38.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:38:39 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:48 +0900 Subject: [PATCH v2 05/15] spapr: Free stdout path MIME-Version: 1.0 Message-Id: <20240627-san-v2-5-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::431; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/spapr_vof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_vof.c b/hw/ppc/spapr_vof.c index 09f29be0b9de..c02eaacfed0b 100644 --- a/hw/ppc/spapr_vof.c +++ b/hw/ppc/spapr_vof.c @@ -28,7 +28,7 @@ target_ulong spapr_h_vof_client(PowerPCCPU *cpu, SpaprMachineState *spapr, void spapr_vof_client_dt_finalize(SpaprMachineState *spapr, void *fdt) { - char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus); + g_autofree char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus); vof_build_dt(fdt, spapr->vof); From patchwork Thu Jun 27 13:37:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=F1dG3X3T; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W90712tGRz20Xg for ; Thu, 27 Jun 2024 23:39:57 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKy-0001FT-6A; Thu, 27 Jun 2024 09:38:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpKt-0001Ap-QD for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:52 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKr-0006Qi-6h for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:51 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6fa0d077694so3705434a34.0 for ; Thu, 27 Jun 2024 06:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495526; x=1720100326; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=UtuCMhxUWw1DUkDzmxPc06M4yVAzJqdA967oAcSFqUQ=; b=F1dG3X3TWPB9MXJKsI7+ya5OpeWHWBLL17c5SmjmZ76jc3XRALRPlsyyqqoCV0RM0j FnY2hLEAiMpBP2hfUnEZLtibcTvC/iX8v0wef5P6iDuChmKG5HrlCMjCfQ8b1+nNkK9o CyqPFUIlT3EIwXOEyQOxyloxcLwfvAVVEFWLxZmOrxgFxaKDm/unbVI1MhsO4qBuqE2u aXBOw2M14si5rxZVDKuUsCdhYBqtvTIscjlvAVK9/stpjSxe7upnftCFRSu2KUhsDlrj fLxAvkoFJaZoo2o4XGEw7l/pPObHJ0oRbCoScoi4rAJd2zDpJWb2vg7WhLNpK6P3HfVr QZOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495526; x=1720100326; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UtuCMhxUWw1DUkDzmxPc06M4yVAzJqdA967oAcSFqUQ=; b=mPEkvRcrXUsMW55f6i3+uDn5pUUnxS1fF4kaS2Occaczdn4hP0/PsVGWsaysbly6W0 J5AjEYBcMc8TSm4lJTs3anPRh+3hP+GysVbhTsyOiH1ro3zXXc0hKMawMhZu1hIajzPe IzE4rMa6eJ0NLjmFAWXB5i0HGimEuj+f159fGFEk90ZBbJLQkNR2JsH+ciz1Kti0YPHf pk4jgzeDSVFaCnprtdvxb8drhMSiy4eaHPmBKgzmJ1bJk1o1Lhyy3khZQ/TY5gQR+py/ ljuMGgD/Zsm5hqAHfO4jsbY7xxphW4Byzm6cjQwYDSkl0QU/2F6HqviBeuo1SnDqwnhm Nqsw== X-Forwarded-Encrypted: i=1; AJvYcCVwDcbCMyCxlJFX48wGXIlS0Y4IzEJJDUVG3wBTPDMR6gqnAbNY6ZGrp4EIn18ezloIfqvKJg+MyUl6v3YE5NtlIl77 X-Gm-Message-State: AOJu0YzRDKFWEFq2rknhIYWrXZN6QZsU7TD59+BOKtNvEQxkEoZ3ksfq wiqetBsWTolyT+uFzsdVz2urC3HviLJxIMBDvr6dZdcOeKivjsdg/jiXc37sLS8= X-Google-Smtp-Source: AGHT+IE68QrvJItc29/tXsB2hhrn925IlwaD+nMu6WIGfpGM9AqZp/e9DNODXCKlCLfsXKLgBm7gVg== X-Received: by 2002:a05:6870:9692:b0:254:c27c:1b19 with SMTP id 586e51a60fabf-25d06ec3501mr16894009fac.54.1719495526263; Thu, 27 Jun 2024 06:38:46 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-706b491c898sm1333327b3a.77.2024.06.27.06.38.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:38:45 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:49 +0900 Subject: [PATCH v2 06/15] ppc/vof: Fix unaligned FDT property access MIME-Version: 1.0 Message-Id: <20240627-san-v2-6-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::32b; envelope-from=akihiko.odaki@daynix.com; helo=mail-ot1-x32b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org FDT properties are aligned by 4 bytes, not 8 bytes. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell --- hw/ppc/vof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c index e3b430a81f4f..b5b6514d79fc 100644 --- a/hw/ppc/vof.c +++ b/hw/ppc/vof.c @@ -646,7 +646,7 @@ static void vof_dt_memory_available(void *fdt, GArray *claimed, uint64_t base) mem0_reg = fdt_getprop(fdt, offset, "reg", &proplen); g_assert(mem0_reg && proplen == sizeof(uint32_t) * (ac + sc)); if (sc == 2) { - mem0_end = be64_to_cpu(*(uint64_t *)(mem0_reg + sizeof(uint32_t) * ac)); + mem0_end = ldq_be_p(mem0_reg + sizeof(uint32_t) * ac); } else { mem0_end = be32_to_cpu(*(uint32_t *)(mem0_reg + sizeof(uint32_t) * ac)); } From patchwork Thu Jun 27 13:37:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953276 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=p3qr0+Sk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W906J4c72z20Xm for ; Thu, 27 Jun 2024 23:39:20 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpL1-0001LL-N9; Thu, 27 Jun 2024 09:39:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpKz-0001Hq-DP for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:57 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKw-0006Rk-Qs for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:38:57 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1faad2f1967so4741805ad.0 for ; Thu, 27 Jun 2024 06:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495533; x=1720100333; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jOjlX532fbSm/MfzxqkUiGMJdKmyu/k4tTVPVBmckwI=; b=p3qr0+SkmQk1jz7lZKJzBUqbMtbpK0mKS84hCbY8OIrNu4ryc/kwJ34HxyUK6UGGos Y0fqPcQBSitSEMI0PvER7pxpHlnqGTR/hH3SOrSBe7RusQ0uWT/Fo6YQAefIGvAg5amz yn/0Au5TJoeWbA1HzWHUbzPc6ygAgCiczONHwqCtycYjRD3g6vfHCXQVIFJFX4mhvELS Zpf2FZDI0L44Tzgq6/AXC3tnf2Y4OMoqPnvI1tk2SggsTxhkWtyr5EpJGwo1duUk43yj mCIBlXF/6uOprrzO7s6VV/pA2YPV01YDOKGjyQlSRfObhgPXrUknnkVa1WDv0lUlyXjz g5TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495533; x=1720100333; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jOjlX532fbSm/MfzxqkUiGMJdKmyu/k4tTVPVBmckwI=; b=GQi4ey+PR3tHP/jL0+EJphXV10Jz245DNrqvQQkmG0LkUHQ/qnNENSS8uGLhQYZ+Xu 1QWx1P+rqLGOJHErZLtwlknOLbGqvKYSyfTXexLvq+kSkKS4jxnT103DiIRInragwCii HXQ1UsfiA13jMZSZZIhnjOeMZsf1XKqGe9VK64AEPAx2T4AIfe1ahOsHMgmPYLW/8SW0 +DMfAJxAxt/4vPSrtE/cuTRzCObtOek1+7A5TkAQ3SOYzzIIeuDxirzDGp1w2lN45zyv 1hzPFei09x7tqJGuBOLdRLJl2poWTLwtDr6L6Bd1K4cpVv5ZZeFfMvhuWhfzaRZQMmMB pdRg== X-Forwarded-Encrypted: i=1; AJvYcCUd4ALYgAuP44z72qMx5+NcB68ngfdM7rqKyLEE8Uz25fPSttRjJGEWMEZ7dIdAl45H7aJwg8+qn6u+n+mdwu8xDtc7 X-Gm-Message-State: AOJu0YyA/9eIEGFkmkHYoGfEo7ptjrYiNAx9MVfj9o5HvJ3xFpCHtQRz Nmfke5uBlgfk8Cdq/Y6emurNUeR1cJEcceZ/OiOVgakNFp8rbYndnVFVHeZidA4= X-Google-Smtp-Source: AGHT+IEsd/pK7793+mXsdWMSRBASbbLo0NH3GV736hPrqauCSFkiwnjE8CzZdSLfrh8RDV6qe4Qb4Q== X-Received: by 2002:a17:902:ea05:b0:1f8:62a1:b6af with SMTP id d9443c01a7336-1faad4c7cc1mr26078615ad.21.1719495532682; Thu, 27 Jun 2024 06:38:52 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1faac999bfcsm13185575ad.234.2024.06.27.06.38.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:38:52 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:50 +0900 Subject: [PATCH v2 07/15] hw/virtio: Free vqs after vhost_dev_cleanup() MIME-Version: 1.0 Message-Id: <20240627-san-v2-7-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::635; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- hw/virtio/vhost-user-base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/vhost-user-base.c b/hw/virtio/vhost-user-base.c index a83167191ee6..124ef536206f 100644 --- a/hw/virtio/vhost-user-base.c +++ b/hw/virtio/vhost-user-base.c @@ -223,6 +223,7 @@ static void vub_disconnect(DeviceState *dev) { VirtIODevice *vdev = VIRTIO_DEVICE(dev); VHostUserBase *vub = VHOST_USER_BASE(vdev); + struct vhost_virtqueue *vhost_vqs = vub->vhost_dev.vqs; if (!vub->connected) { return; @@ -231,6 +232,7 @@ static void vub_disconnect(DeviceState *dev) vub_stop(vdev); vhost_dev_cleanup(&vub->vhost_dev); + g_free(vhost_vqs); /* Re-instate the event handler for new connections */ qemu_chr_fe_set_handlers(&vub->chardev, From patchwork Thu Jun 27 13:37:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=QcqaHWYj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W906k55X1z20Xg for ; Thu, 27 Jun 2024 23:39:42 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpL7-0001OG-BX; Thu, 27 Jun 2024 09:39:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpL5-0001NH-9Y for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:03 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpL3-0006Tp-GB for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:03 -0400 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2c8dc2bcb78so1461148a91.1 for ; Thu, 27 Jun 2024 06:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495539; x=1720100339; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6PV0Jwd3ow6/n1FaesIzFULRk/ni0qv5jyS/+wLDXMU=; b=QcqaHWYjlNZDngp0PqSn+pMq3x0BilHZQthv2tTqvbr9+YCyvO0Truu3HBqc/7fPG5 udps2PfuB9SJ/OrsaYqirQApm79m/dQguD6E8XTKC8aL9IT/lQUJHGzvvaSeRrDiMd4R NektLqDoP/2J8pTbMWtCsfj3q1whoXT1SVNPqfBF/imkpTYr+ZTuz6GHbpkVe3Bkcamo RyE4CPjHFoDI1roXhquShMJrW0hYlpxSPi8+5IFigPDFBxjF/WrsJJZJ32T0y73JU7Qk FVYgvPABJBvZeKf6NClZw+G3pTEqQ3rpZfNme9CvSALwIeSp7mKlNA3FOp8x7E3eoq+3 Xbpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495539; x=1720100339; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6PV0Jwd3ow6/n1FaesIzFULRk/ni0qv5jyS/+wLDXMU=; b=Jf9Mhj76znVzqgK5ykgd/k8uYF/FKVu3R682GpV+GTGikK0KBMqsoxGpuvnikv9mOF uTxjkBmDcugxDzFGwk7QqMLmmZ5DbEvEK3Re1vZmm6vpIJaEk2ZczvUP0tpiVHuVXXws nOqrDKwpqLpF5aZZu0ff93Oqbfb9d7RoGjEbFgaa3A1YNS6LzaiWA+mrGUkjGgdK2LGA Yv7wq5L9n9Fv70AW2Vp1bOX6vAo8ADA8fBv2uTMCDCKmsCx8jsvUc6JjOgqUWlkXgDaO KmYjRsz/zO/yKn8wrb7V1FfL6HgTSF5QiaJaB43FJBbQbvPVbugpLzbx0wDN5UyTfO6S fYRw== X-Forwarded-Encrypted: i=1; AJvYcCU1w83pD32HCu2X+RhneSh0T2xzq8+FpMWC2Z4yq24Qq4mNn/GZy9anHl00Rx+AuAfKnj+F15H2iPPSDN3IlTGdo0Nq X-Gm-Message-State: AOJu0YwOXH1YPBWmPay48NadB4GQLChDwb7dKxVL9On/iMLCI/oi3HOL b5tZoIsDxOT7eGIjPJ4/ogzhP3rz+0G7MPKBoIkPRqaoAPVkxWTkREgM23a0L/k= X-Google-Smtp-Source: AGHT+IFhbuBpEabR6Yyi6TNRReI6E/qCCZTqe1ej20jTUBAg55/M7mIawYiSZUH0E8xhDFfhuRfkqg== X-Received: by 2002:a17:90a:917:b0:2c7:c914:69 with SMTP id 98e67ed59e1d1-2c86141cc09mr12260587a91.43.1719495539229; Thu, 27 Jun 2024 06:38:59 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2c8d7e63936sm3609235a91.19.2024.06.27.06.38.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:38:58 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:51 +0900 Subject: [PATCH v2 08/15] migration: Free removed SaveStateEntry MIME-Version: 1.0 Message-Id: <20240627-san-v2-8-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::1030; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Xu --- migration/savevm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index c621f2359ba3..10b261823b7c 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -874,6 +874,8 @@ int vmstate_replace_hack_for_ppc(VMStateIf *obj, int instance_id, if (se) { savevm_state_handler_remove(se); + g_free(se->compat); + g_free(se); } return vmstate_register(obj, instance_id, vmsd, opaque); } From patchwork Thu Jun 27 13:37:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=3YEktQY4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W906J4Lqyz20Xg for ; Thu, 27 Jun 2024 23:39:20 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLC-0001Vy-Od; Thu, 27 Jun 2024 09:39:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpLB-0001TW-Cu for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:09 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpL8-0006V1-Ni for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:08 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1faad409ca7so4181215ad.1 for ; Thu, 27 Jun 2024 06:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495545; x=1720100345; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6MgmHQG/2ylhpi7rbXo5VyylZZdoY/6uUXCCV6pKunI=; b=3YEktQY4Cf9mZ6ojcJDmxaq+/SRt+RI0N6N1Vsn4KC9bV+AObK7oZWXsZoPohCBynS B474C4l4Gm4uFKO8qjb941adW3fuD4TNFGUq4BKrO3mMwtO8TPIBuQs2k87RpeWes9c/ HNRmpoL3bEec3/Q0D8EkADytvqC646u2UQ9nyzDKqxMlC71sZ9Q9iJyDwAxscxpnjLSA wqh+94UWPrOBNfS+492EmEtqWrgu0QVN2snPVx8dGFC/MwJZdmLZTRStjMnLO+dhTmCB R3+ZAd0s8QuBZbyh9F1b6ykYQ4uxwAi2/SHmKE5IX86qYGm9kGJaHddVeoe8q/c/hl9W YqWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495545; x=1720100345; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6MgmHQG/2ylhpi7rbXo5VyylZZdoY/6uUXCCV6pKunI=; b=kqr3KbjJuwzNBl/sFh/94WidhOZr9PQDr+gr2qsLx/hO2PFB2wlX1bKzBj/AXkucGg KTeoECRpfreRnM6SHzx1CD8YZpTpi6f0QWbie7pMPHccHyGlMsPxdHXhVAdsjrXgRpqv TSNNiL5mBkAWv+L5+lUdWmBmxA2I3aQLm9QR3iN+61XO41UUT3kYKTu6HL1syWi83Uys dIg6XSHlF/Ow/nZJHVZ9J+RV7B3kMWlZOfSPs7B9HlB2ATJmzzwo5WNQag5PrPTan3LT gHEniNH/nvFAMc0gctvevmRctmYsrNqgRzqDkC2AFxkfUOVcfOzYWWojBL/CZtiiW75z XJIA== X-Forwarded-Encrypted: i=1; AJvYcCWQ+uF6p53QD8AdYCUz9mu2gYsZwfXFWWBicEXJ2lFDaVVKpQOIW7NtVl3mTK3AqjWkV6fwTZkJCZ7LQj0M6iGmsaj7 X-Gm-Message-State: AOJu0YymT4OKhMVVRXWoZe4uDoUs87o7ohtyYqXd6St5s++U2Fa97yYt hHYJQQkCdnmKln6s1JoMhzNYRPRHJD0KJ5ZPV8PVk1MaXsCCZUNUBj3eGIsCtyw= X-Google-Smtp-Source: AGHT+IEOQ/m6W0EaVrS87L9pcyV7z7eXSKdvdlz5a1XfK+ZrnOVnl6VAIXcrZ4tj5pOxawKYTrGRaA== X-Received: by 2002:a17:903:228a:b0:1f6:dccd:c6db with SMTP id d9443c01a7336-1faac2df4b0mr24948755ad.30.1719495545496; Thu, 27 Jun 2024 06:39:05 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1faac9791fdsm13201035ad.127.2024.06.27.06.39.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:39:05 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:52 +0900 Subject: [PATCH v2 09/15] memory: Do not create circular reference with subregion MIME-Version: 1.0 Message-Id: <20240627-san-v2-9-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::635; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org A memory region does not use their own reference counters, but instead piggybacks on another QOM object, "owner" (unless the owner is not the memory region itself). When creating a subregion, a new reference to the owner of the container must be created. However, if the subregion is owned by the same QOM object, this result in a self-reference, and make the owner immortal. Avoid such a self-reference. Signed-off-by: Akihiko Odaki --- system/memory.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/system/memory.c b/system/memory.c index 74cd73ebc78b..949f5016a68d 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2638,7 +2638,10 @@ static void memory_region_update_container_subregions(MemoryRegion *subregion) memory_region_transaction_begin(); - memory_region_ref(subregion); + if (mr->owner != subregion->owner) { + memory_region_ref(subregion); + } + QTAILQ_FOREACH(other, &mr->subregions, subregions_link) { if (subregion->priority >= other->priority) { QTAILQ_INSERT_BEFORE(other, subregion, subregions_link); @@ -2696,7 +2699,11 @@ void memory_region_del_subregion(MemoryRegion *mr, assert(alias->mapped_via_alias >= 0); } QTAILQ_REMOVE(&mr->subregions, subregion, subregions_link); - memory_region_unref(subregion); + + if (mr->owner != subregion->owner) { + memory_region_unref(subregion); + } + memory_region_update_pending |= mr->enabled && subregion->enabled; memory_region_transaction_commit(); } From patchwork Thu Jun 27 13:37:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953284 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=uaF7zszF; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W90731j7Yz20Xg for ; Thu, 27 Jun 2024 23:39:59 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLd-0001z9-GD; Thu, 27 Jun 2024 09:39:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpLL-0001bs-Ey for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:19 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLG-0006WJ-SU for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:17 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-71884eda768so4034566a12.1 for ; Thu, 27 Jun 2024 06:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495551; x=1720100351; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Yvl4pAdGzIA/y7zkDQtF9iZK7ptxPpuy1nIWlUirby4=; b=uaF7zszFj+kz80phxfb8lk1Ot7je7a0Yr3pvZry3QyHavtrSngDzdm41+eZIv469fw Ay8TA826kLpRlqmQP5XbY8ZxQSfuFCWcllxD1aFf9CPfwREnX04rt3BcYUekDP03HV4g zV2QzWwxSQRfY2cwGs8E+EvunT4q2BsKRoyHN4+jJ9YTw/N2ahjP4oTZdK+LWs/UFnQu rpeLmkuMFzLErtn3dPJ0qccx/gUeTVI9QLTPzfxUGkB88i82CkXVJxQnNZSlsig7+7QS 0RN4olyKeat03LnZdY7tGSbvqlXWizIZsfq/kVl8q3ia3PBrQq3pAQ8SOvT8EeuNCdtl bRNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495551; x=1720100351; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yvl4pAdGzIA/y7zkDQtF9iZK7ptxPpuy1nIWlUirby4=; b=maISNVoo0Js+AhQwD9vl8hajYsI/riilRAOPuOWnkzSM+r2Tivjb31AoqZ2DRNVG2I qji1Xo6xfsOq9k4cUy/JB2eP3SSBT5UFhFw+ogZHWeI+CEr5eInMGTYsRKknmPyLrsNq UPRSZKYPGlY+oCbVjB6i+nmXxIpJnBCK44uMubWp0eZHCII0w3p4f23GtMFmnOS+rq4H pL3Vi9+HJbCBRTRBRVWpN6LMUve/AiGW9At/rgpm9zQ6J+rc9UUKp1rr9JlUC1rghcm9 5mV045O71GncpP/i+CUi8dArmNmkXuUtCKnr+y4bVopPwvXBiUgl3vj/FC40ycgD+mG0 YEzA== X-Forwarded-Encrypted: i=1; AJvYcCX8IEXw/+lBTBJzU02lNqZtik39i/+mpTJGzn/7hbumbkWkC/IZBrx7O6kw67a6Y+jJA4n9y6iBLJzORFLIOkoGuKVn X-Gm-Message-State: AOJu0YyVb8pnQ04D/qvUSoYMCmzVV8UHOS+wu0viu9hFMJBqallMOEMN yOEY/pEcO2rxApy+k2JMjyvqMESqUJBo8qW7xlgqGjFH0JAAYZY5BWu2bOyKOUg= X-Google-Smtp-Source: AGHT+IFlBGhq8j7ZQMV5qMOOdFsofTqP+NF+lT2o/+u4EH2nCOdF15FzOTWiA/9TuXR60cGyfzX9NA== X-Received: by 2002:a05:6a20:12c3:b0:1be:cbe9:f765 with SMTP id adf61e73a8af0-1becbe9f89amr3175993637.18.1719495551639; Thu, 27 Jun 2024 06:39:11 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1faac9a73fcsm13434485ad.252.2024.06.27.06.39.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:39:11 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:53 +0900 Subject: [PATCH v2 10/15] tests/qtest: Use qtest_add_data_func_full() MIME-Version: 1.0 Message-Id: <20240627-san-v2-10-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::531; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x531.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org A test function may not be executed depending on the test command line so it is wrong to free data with a test function. Use qtest_add_data_func_full() to register a function to free data. Signed-off-by: Akihiko Odaki Reviewed-by: Thomas Huth --- tests/qtest/device-introspect-test.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c index 5b0ffe43f5f4..587da59623dc 100644 --- a/tests/qtest/device-introspect-test.c +++ b/tests/qtest/device-introspect-test.c @@ -266,7 +266,6 @@ static void test_device_intro_concrete(const void *args) qobject_unref(types); qtest_quit(qts); - g_free((void *)args); } static void test_abstract_interfaces(void) @@ -310,12 +309,12 @@ static void add_machine_test_case(const char *mname) path = g_strdup_printf("device/introspect/concrete/defaults/%s", mname); args = g_strdup_printf("-M %s", mname); - qtest_add_data_func(path, args, test_device_intro_concrete); + qtest_add_data_func_full(path, args, test_device_intro_concrete, g_free); g_free(path); path = g_strdup_printf("device/introspect/concrete/nodefaults/%s", mname); args = g_strdup_printf("-nodefaults -M %s", mname); - qtest_add_data_func(path, args, test_device_intro_concrete); + qtest_add_data_func_full(path, args, test_device_intro_concrete, g_free); g_free(path); } @@ -330,7 +329,7 @@ int main(int argc, char **argv) qtest_add_func("device/introspect/abstract-interfaces", test_abstract_interfaces); if (g_test_quick()) { qtest_add_data_func("device/introspect/concrete/defaults/none", - g_strdup(common_args), test_device_intro_concrete); + common_args, test_device_intro_concrete); } else { qtest_cb_for_every_machine(add_machine_test_case, true); } From patchwork Thu Jun 27 13:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953289 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=sJQmCuwg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W907p2pHhz20X6 for ; Thu, 27 Jun 2024 23:40:38 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLf-00026p-IJ; Thu, 27 Jun 2024 09:39:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpLN-0001cl-3A for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:21 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLL-0006Xd-9D for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:20 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-70671ecd334so4054472b3a.0 for ; Thu, 27 Jun 2024 06:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495558; x=1720100358; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bOTqGJASqbN+xq2cvidGDOZj3Yf25P/ZsUr7Yh4tZjc=; b=sJQmCuwgbShIncPBnBQaiqJgjpg/UDYFFr2kfbd4pvIRt2mCj2dp+WJ5TFD9PeJIDn gbrKLS1zKH51hwCQuoPXnHh4pUxlM4D+lHMY046ucz8ByRn9f9yj/TGK4k/vAC+pNDEm N3TxBayynRDcRiCH3hYIsCqgqrHihXw9rxULSrFCLUIHgp3fGyo8J8O2fHXBVQcYrmWn XMMTyhW6Pdf6gw/v1KNUz+FbssgTh4Mm+ueVX2DOaTY0LZI4LKmcy2kX1NuzJiNu3/mB qLY5pKO/iG4dR6tiVpc3/CzrXxgVoan7q58jzfa8NvHasJgosdHTHC4spc+FfwsofH1Y p2ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495558; x=1720100358; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bOTqGJASqbN+xq2cvidGDOZj3Yf25P/ZsUr7Yh4tZjc=; b=uSDE2OQcc2tDty7EX4qKeBAJSyxVsNbMtmSFVPPXRYejXJV84qEWNylbR81suNKMDt pcI5t10i6/iwfK33VRFicBdrULJmlgSHKxoCmzjox6RE/wGfGRAR5CBEsJHnCTTSFXhz VX1XMDK758PDB2N594iUzY6vjHXI5/pdMMmHQ+btgewnD0bnR17lgWeGYzpfikILrgXg t9WO56pnmCNfhKyhMY0iDnfnQzfMGikJGS3E8wqEJuRh6erCj+cVm6t+my52qNrtvwv0 wOOBuLVfL4pc91nm0ZIke9zHxA3M7TB8WaT9NKUKhTcMtdcBT5uvexiOwgmOiZDr2fXy zgNg== X-Forwarded-Encrypted: i=1; AJvYcCWtHR8SetowCTXbwi5dT1+Iyv+95bPWarEHDhvZM4625PXgsSJMoIeqPsNVvNidUxKtc/zzcdgWOPN9qEoR+wSZ26oO X-Gm-Message-State: AOJu0Yzn5Wo2Zg2ghZbtHZlS1DED/2CO60KaSj/TSWL2NSjcqdaJ19Cz Y82Y1ELT2LBQdojNdUsUnOgPTcPc7MFQbGGCwbrh2M4eGxEI+koCs8NfgnkYcIE= X-Google-Smtp-Source: AGHT+IEWG5kSC0j6fCgKsJMYPuPASJg34e7zfzd1IrPkvGFbb3HCzQ4eIvOXePGeln+k/PXzaWks+w== X-Received: by 2002:a05:6a00:138f:b0:706:6895:3c85 with SMTP id d2e1a72fcca58-70670ffbfb9mr18643834b3a.27.1719495557805; Thu, 27 Jun 2024 06:39:17 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-706b491cd54sm1338229b3a.79.2024.06.27.06.39.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:39:17 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:54 +0900 Subject: [PATCH v2 11/15] tests/qtest: Free unused QMP response MIME-Version: 1.0 Message-Id: <20240627-san-v2-11-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::429; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x429.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- tests/qtest/libqtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 18e2f7f28278..f89da7b80797 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -744,6 +744,8 @@ QDict *qtest_qmp_receive(QTestState *s) response, s->eventData)) { /* Stash the event for a later consumption */ s->pending_events = g_list_append(s->pending_events, response); + } else { + qobject_unref(response); } } } From patchwork Thu Jun 27 13:37:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=cVJreDbr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W908h6lVpz20X6 for ; Thu, 27 Jun 2024 23:41:24 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLu-0002l6-G0; Thu, 27 Jun 2024 09:39:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpLV-0001j1-Ik for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:30 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLS-0006Yg-SH for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:29 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-706b14044cbso868889b3a.2 for ; Thu, 27 Jun 2024 06:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495564; x=1720100364; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7RVNKACznzXJwsczryHdNsSEUqVvGG/uCg/TYBM83LM=; b=cVJreDbrNyiOhrzWdpvWoa3z5kTvuLhjDXUTLhXW8Uq+PdTonjEkO5lC5EqN71ahAN IjaXltu9rXc5H5oOkXfYMya8dZpXB7hua4brkq40WAAl3gTb3TTDxizO2l1+pI226awh Ac/nwwLoZFcBhrQjBY6+Mhc4noeBOZyFDGnRremwIxIINr8UCL+uBgDjzAXxcYDVS7w4 eEBwU3FmuXuj3iggb619xnhrkrDmYBQI6RRu+PC7wtPoxV7CcvqMZckrZPelGkBSJp8r P7Eu2HeHXVCnoFwP2li37eB9BG/di95dKsqc2EExVtqFq0Wr7/uUoQvXw2EBrC6UzxnQ L89g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495564; x=1720100364; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7RVNKACznzXJwsczryHdNsSEUqVvGG/uCg/TYBM83LM=; b=EWzV1ggoax/W861Wu5T01BQP8DNz0otYvOBhdQLXu4imWFl5wvmCMkgv1kMRCnqnoI 84t0kiKF2zA4SZDQK+mczVww/JQnlfhRntvxol/HpS6GFivNWjBTdqGDoWNO2pXJa3DT iB4ul+TpZKDjdzWYiZnLjfyyPsnLxIxviEV51HtIfnMRPKFgCscsYN3QTocpoSIpmvBL NTVDOpz06fNKxxRXdYXUeszXO4it12evOB1X2p1BtGe+kRLJmuNTAm7hRj9t3qoatEgf 0VJgb1POsxkza/q4/7JB78V36G+HGEyX16Z90ZRdaEHjVB22Zmm26vvT2EumYoaFxBc9 hO6w== X-Forwarded-Encrypted: i=1; AJvYcCV9giHCX+gGGKTgUVcIlSURlTFuTjwM998Zq/rJwpUIb0dz7V3QFuy7ota0MY+frcJiiALIdpnpXHTzerxQQfInL5nk X-Gm-Message-State: AOJu0YxrL5RpCFPgw0HQPCld6WBtQBKJu3rHjAz/T2Fbr2Ql5lmsP3M2 YM8TVmjmaVyJ8ot3oYvBpBkyPF92IpW0zXxE9J8+ydoxiwa5s+Gl6W1TfsCYbRk= X-Google-Smtp-Source: AGHT+IHi3SFb6IfzyjZU4LPjQOe2vtYPxvsTt5zgvDsBZjlxp/FQibJVmn1SawfGhDC4rTTaywaq1g== X-Received: by 2002:a05:6a00:3c94:b0:706:7153:92ae with SMTP id d2e1a72fcca58-706745be252mr16837324b3a.19.1719495563984; Thu, 27 Jun 2024 06:39:23 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-706b4a0fdbesm1331259b3a.127.2024.06.27.06.39.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:39:23 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:55 +0900 Subject: [PATCH v2 12/15] tests/qtest: Free old machine variable name MIME-Version: 1.0 Message-Id: <20240627-san-v2-12-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::436; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x436.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell --- tests/qtest/libqtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index f89da7b80797..1605c0c9f615 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1509,6 +1509,7 @@ static struct MachInfo *qtest_get_machines(const char *var) int idx; if (g_strcmp0(qemu_var, var)) { + g_free(qemu_var); qemu_var = g_strdup(var); /* new qemu, clear the cache */ From patchwork Thu Jun 27 13:37:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953283 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=biy81hPq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W90716Gqbz20Xm for ; Thu, 27 Jun 2024 23:39:57 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLp-0002Xy-Lc; Thu, 27 Jun 2024 09:39:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpLZ-0001nM-4N for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:34 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLX-0006ZU-D8 for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:32 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1f9a78c6c5dso61129445ad.1 for ; Thu, 27 Jun 2024 06:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495570; x=1720100370; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IDtmLd4DIh+2XRkZ57QtXjyzkDOakOx1Ds4rKdXYuOE=; b=biy81hPqEVeom0tS62rhmoWFdc4gY0m71tzlpx6Ckby30aFmqMysTmlzrqKFn941PK kWpPIAU8DNXPFWTilUyfLdflVpF7aw0Bs0m0YcdYk0pkTY3lCvA3VQIkEtVkQd4QROcI +h28A3U6YpvvwgnO/56ZJBMDOOG/+6v53nv+FA2cZMDPNeCJDtqrgdi1T/v6Y8VbgbVc lMxD/pex0bMBr8tEhswoMEqaaROwHjxaGAqSGtcBPxH/S+MDtYA9pb4wpuheb/tZfMFd GastiCS36BCO2/WM1nrCWbxNZg6oDRloBAF43DwT33nEO226OWIWJC98WJXETRrt/mrB yfwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495570; x=1720100370; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IDtmLd4DIh+2XRkZ57QtXjyzkDOakOx1Ds4rKdXYuOE=; b=AdWp1zRMmgf3VRVVDI+KsLen0zzQ/EeKrdJi2pEjNlhHhoEpkvGzRqS/zSaJREth5/ X22P/mbMS17qzkfztOeTZ+Ibmxr/PwrSvAxJGwmBZrtNQgSnkMagtlOtggZDJ7M9akHO tXGFEKWl5116DNXH6zA+rQsNxd+MFSarJLyEJ6XtC5SIKZW3piPjtQXAsu0VSWMNwKqy 1h0S49K401g8hSXVS07pIJS8mbERwzuXFKqfaofK55Rl4iDiwVM7BJk1CIb+RjStb5wX Q/DCVZrdHlRcRHJe1h/DDmkahBx9mNpZceFlx9PYaXwAwbzRAU0/NZhOft00HyFlcGUd GyhQ== X-Forwarded-Encrypted: i=1; AJvYcCWWXYQsmLqSQ1qqXSmFH5AjOrvcI93ylQQKNKMsR5b+eILD3aIoLEmQG2BfTI6vft+hiPAiVVLAEzA+WR7QBLfgPhXR X-Gm-Message-State: AOJu0Ywxvtg9Ox+hTto7VogT0gVrCWqpM3zhZ19NrtkEgM0K7RCmV0U+ JRBRc0eqvFZyBEDB7Mupwjl7V4Ka8dJnTL62kgWhvSNjTtWWNuTAuKUbkfMBP5w= X-Google-Smtp-Source: AGHT+IFzIGW+nsnWdJPHEbiNrp488hVRGEdrshmaBw10w7xHcEQJxXBh3T4EQrvFSPo6JhGmFg7hsQ== X-Received: by 2002:a17:902:e846:b0:1f6:502d:ca88 with SMTP id d9443c01a7336-1fa23f15aa5mr134051625ad.49.1719495570044; Thu, 27 Jun 2024 06:39:30 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1faac9c5266sm13108905ad.307.2024.06.27.06.39.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:39:29 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:56 +0900 Subject: [PATCH v2 13/15] tests/qtest: Delete previous boot file MIME-Version: 1.0 Message-Id: <20240627-san-v2-13-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::62b; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org A test run may create boot files several times. Delete the previous boot file before creating a new one. Signed-off-by: Akihiko Odaki --- tests/qtest/migration-test.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index b7e3406471a6..5c0d669b6df3 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -129,12 +129,23 @@ static char *bootpath; #include "tests/migration/aarch64/a-b-kernel.h" #include "tests/migration/s390x/a-b-bios.h" +static void bootfile_delete(void) +{ + unlink(bootpath); + g_free(bootpath); + bootpath = NULL; +} + static void bootfile_create(char *dir, bool suspend_me) { const char *arch = qtest_get_arch(); unsigned char *content; size_t len; + if (bootpath) { + bootfile_delete(); + } + bootpath = g_strdup_printf("%s/bootsect", dir); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { /* the assembled x86 boot sector should be exactly one sector large */ @@ -164,13 +175,6 @@ static void bootfile_create(char *dir, bool suspend_me) fclose(bootfile); } -static void bootfile_delete(void) -{ - unlink(bootpath); - g_free(bootpath); - bootpath = NULL; -} - /* * Wait for some output in the serial output file, * we get an 'A' followed by an endless string of 'B's From patchwork Thu Jun 27 13:37:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=U5OFeVL/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W907m2cFbz20X6 for ; Thu, 27 Jun 2024 23:40:36 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLw-0003Bx-P6; Thu, 27 Jun 2024 09:39:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpLf-000265-3B for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:39 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLd-0006aM-EO for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:38 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-71910dfb8c0so3645775a12.3 for ; Thu, 27 Jun 2024 06:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495576; x=1720100376; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=66SWenAU4qt0HqdzzgzjopUq88LncGGPdZoRZN6MJBw=; b=U5OFeVL/gbCE8SrtacwXOVTRXmxTxtukIofmUMDrS+SNrQZZG5xO08Glno18CGwJTo AEnH+XgTCDKqHhodC3sfShgdniXD6b+rxJRoBBhAZnH2oxxcXhn4f3TS2clq4l4DMvPb ZH87Te4FMbvjdY1ADHstvzqTT8+wgVgBeHX94jiYTitFQOoLQN5f2m+fl/dsbSqt5hZP RjnH6w0Gnjf3EfIxkSVU1sq56WuzQs8PEhF2AsOpHjsEbjO6qggA2nPUb4ZdriNw0rx0 AgzCqneLz9msmAK86WPIn1xUHkDFYipSMdxr/e2RCZNgzHAzqM36f8f2DyxPF0XL/o68 q4gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495576; x=1720100376; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=66SWenAU4qt0HqdzzgzjopUq88LncGGPdZoRZN6MJBw=; b=eNlW5TG80HETReXJvetkjkJM4cBak6qbH9E3NAbcgQZglJMc0FOdiuLwaYKZ3YXzHZ Juugthu1FGrWvvOqwa85y/WLu+AiwHiHrDKwEEpd71EVXK+NCNTJaMAnQFHlroSa7E5W X77/oYnMcFj62MXxSFd8kbb3uMFBb6nWgtsd3uCfQcBQ9TPID65+CbHR8dk+517kHN6C 2ojfAnpAsgJHh5BZiZ2jBu9U2ljuu52oaBOTHwvtsnvmc2Dt9CYiKPkZX181YXft4uak qkg673jNSGdpGN6zI2UWplwu8Fp4k7/7BPqDYbbEg4Lh64NAq0oX65VAzqJ/80hDHhbo tw8g== X-Forwarded-Encrypted: i=1; AJvYcCV2c1M4x+FWYSgAzvcY4gIhL/5db9vUPox0z268sbByupQRS8oq3l5LVSuLDPwG4OC8I/cJM8s//toCAKMAZIZVhst/ X-Gm-Message-State: AOJu0YyBHg9l0IjY2zqL2+KC1iKGpqaZTDTTqyTlbUWu/vN+yj4pREYy ROqSmzetj1GEHmzd/aW3DfNf77UjeJcN2C2slp/orYwWT6HZX7AJmY6mxQ6xW5w= X-Google-Smtp-Source: AGHT+IGK3IeNA1PsDdEds/reaHYwgDV95tDqPpf6AdGiFC4ZsLRZj1HBdWm8l3UiekhYxiotaysaqg== X-Received: by 2002:a05:6a20:1e58:b0:1be:c753:dc65 with SMTP id adf61e73a8af0-1bec753dd0cmr3363255637.18.1719495576216; Thu, 27 Jun 2024 06:39:36 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1faac8df617sm13243105ad.31.2024.06.27.06.39.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:39:36 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:57 +0900 Subject: [PATCH v2 14/15] tests/qtest: Free paths MIME-Version: 1.0 Message-Id: <20240627-san-v2-14-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::52c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- tests/qtest/qos-test.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/qtest/qos-test.c b/tests/qtest/qos-test.c index 5da4091ec32b..114f6bef273a 100644 --- a/tests/qtest/qos-test.c +++ b/tests/qtest/qos-test.c @@ -33,7 +33,6 @@ static char *old_path; - /** * qos_set_machines_devices_available(): sets availability of qgraph * machines and devices. @@ -191,6 +190,12 @@ static void subprocess_run_one_test(const void *arg) g_test_trap_assert_passed(); } +static void destroy_pathv(void *arg) +{ + g_free(((char **)arg)[0]); + g_free(arg); +} + /* * in this function, 2 path will be built: * path_str, a one-string path (ex "pc/i440FX-pcihost/...") @@ -295,10 +300,13 @@ static void walk_path(QOSGraphNode *orig_path, int len) if (path->u.test.subprocess) { gchar *subprocess_path = g_strdup_printf("/%s/%s/subprocess", qtest_get_arch(), path_str); - qtest_add_data_func(path_str, subprocess_path, subprocess_run_one_test); - g_test_add_data_func(subprocess_path, path_vec, run_one_test); + qtest_add_data_func_full(path_str, subprocess_path, + subprocess_run_one_test, g_free); + g_test_add_data_func_full(subprocess_path, path_vec, + run_one_test, destroy_pathv); } else { - qtest_add_data_func(path_str, path_vec, run_one_test); + qtest_add_data_func_full(path_str, path_vec, + run_one_test, destroy_pathv); } g_free(path_str); From patchwork Thu Jun 27 13:37:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1953295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=rSJK99kK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W90896Xtnz20X6 for ; Thu, 27 Jun 2024 23:40:57 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLx-0003IC-H2; Thu, 27 Jun 2024 09:39:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMpLl-0002QG-Kn for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:46 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLj-0006co-TR for qemu-ppc@nongnu.org; Thu, 27 Jun 2024 09:39:45 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-706b14044cbso869191b3a.2 for ; Thu, 27 Jun 2024 06:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719495582; x=1720100382; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=tYtFORlnbJN2+36DGKZvH4uH8NkkbHJaO5uVtPxgJZE=; b=rSJK99kK5W6uCphpWOC+v4YGxL8ZILNdhrJa5Va5ybMNK7R0Qnvy0bH8YL1I5VXEns gKF7E6jt2tjJxiKL/rJlbgeEIHtRTNsLnvAY6uFiyRygRJ0cvJ9AkP2Gk7nsGZph64JM cJnZolehVFqZDDoWhPWY2AJzejjJ8M9+vyUjaKJ258WmFgg6A32c9BGk0j8c/vKWSOpu uaPLyxQPygIwae78oEemGZGoBZR12hPXM/+GEaD/sNRBe5jgfZpN33vXmxotihhPnIUM DYWvBf4Y1qVQ5bwoQ9AMsuiw8ruXKJTdnpOkvUPLg17qPXMOGmK9bdrNGcLInb+shwnw jR2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719495582; x=1720100382; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tYtFORlnbJN2+36DGKZvH4uH8NkkbHJaO5uVtPxgJZE=; b=LU6I8rlMIts9JxkGE+08CDiFin9GMEyGiyZhiHmO7k+zaZQ8sGR/f86yoza8WdJNXi GrQjd+/VFbYwPVgMqzU3pnFVDHWM1/P22A48gyZHE/fV6Fc3ihR5QPyd/2L039XlJcG7 RUMbzYWE1YdFCQXk91+r9Btnyt4RFvXkmX5QVJYulNOqTk0LFwzchCK+ifYNEpZ+DoLb xEJxFcPG4oSe2m3Jqq9k5Mia72xV60rR4Vk01ltjcPZCrV4HLLOKh1QnFednzT97zGJF R9VPvjuzp8ZzYJ+LO2gHdD8IRxOfVAKTeSGJb/HkUxbCuCLX3+TeZPHQbgX56uuuDGZH yyBg== X-Forwarded-Encrypted: i=1; AJvYcCWmYGCvPK8wmo7D4VPz/+O3fjHb3RGE5cts+mLU/MNXytODP8xhK6o9KZLL3uFwefsWQEjqZmqBfKni6WSbRI633GU9 X-Gm-Message-State: AOJu0Yy/Kc0SY5B26VPi1vCDXIJ2XfnxIhkVdb8hjBxY68ULt/yrDV4G VE5WnAvoO6tAA12GEWyqgwM9wp/1fhBy2NPkQCVg/zWl+yUaWyuFNFTMY4Xicgk= X-Google-Smtp-Source: AGHT+IFXFWZxtxNetDL0x3QR81Q4NSGV4KUcXaVakXLBlruN2EYupN0blY/9gL/zVeN/j6uHx6EZmA== X-Received: by 2002:a05:6a00:1d1d:b0:706:6cb2:ed17 with SMTP id d2e1a72fcca58-7067455be23mr14036044b3a.2.1719495582624; Thu, 27 Jun 2024 06:39:42 -0700 (PDT) Received: from localhost ([2400:4050:a840:1e00:9ac7:6d57:2b16:6932]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-706b491008dsm1338261b3a.57.2024.06.27.06.39.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jun 2024 06:39:42 -0700 (PDT) From: Akihiko Odaki Date: Thu, 27 Jun 2024 22:37:58 +0900 Subject: [PATCH v2 15/15] tests/qtest: Free GThread MIME-Version: 1.0 Message-Id: <20240627-san-v2-15-750bb0946dbd@daynix.com> References: <20240627-san-v2-0-750bb0946dbd@daynix.com> In-Reply-To: <20240627-san-v2-0-750bb0946dbd@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::42a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org These GThreads are never referenced. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell --- tests/qtest/vhost-user-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index d4e437265f66..929af5c183ce 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -928,7 +928,7 @@ static void *vhost_user_test_setup_reconnect(GString *cmd_line, void *arg) { TestServer *s = test_server_new("reconnect", arg); - g_thread_new("connect", connect_thread, s); + g_thread_unref(g_thread_new("connect", connect_thread, s)); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); s->vu_ops->append_opts(s, cmd_line, ",server=on"); @@ -965,7 +965,7 @@ static void *vhost_user_test_setup_connect_fail(GString *cmd_line, void *arg) s->test_fail = true; - g_thread_new("connect", connect_thread, s); + g_thread_unref(g_thread_new("connect", connect_thread, s)); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); s->vu_ops->append_opts(s, cmd_line, ",server=on"); @@ -980,7 +980,7 @@ static void *vhost_user_test_setup_flags_mismatch(GString *cmd_line, void *arg) s->test_flags = TEST_FLAGS_DISCONNECT; - g_thread_new("connect", connect_thread, s); + g_thread_unref(g_thread_new("connect", connect_thread, s)); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); s->vu_ops->append_opts(s, cmd_line, ",server=on");