From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495599; cv=none; d=zohomail.com; s=zohoarc; b=WjlsDm97ScJ485c3kSl0TYH/3XqvYp5VoweWB3DkZ/gxKv2Lwa9Rt3FAnRhOU8AymW7g5SUYv4diKsOP+cuZ//LSRF9lgh7VZn1ob1YujkiUfk8YlYTyKACBJqDD1Em8g8iD2VdVfIzqXr9COqLWmyLZ2vXaDqaTClOZjyD2GbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495599; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iP3blhpOG/UV/59pEfGGJ3KAPs2EsafUmQmrZ34OeNU=; b=n3wOnINbiz40vM7zcA/8HcPdaDxAtcpG0b2iKD4taOLnj0flFcdrg4a2bj+DpN7f0xoyI4/I4sfxMMdc4xuJeQ6VYmdJMbmcHHNVSW0cZgkwz1pLLW2cmXPPNYGR+EpOfda0VZRZ3ZgmyXzNnPl960RJO5PbjNc0zEiA4+CkpSQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495599077126.21403264037906; Thu, 27 Jun 2024 06:39:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKS-00010a-3R; Thu, 27 Jun 2024 09:38:24 -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-0000x4-6U for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:20 -0400 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKI-0006Ko-Uo for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:16 -0400 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-37613975e20so32090265ab.2 for ; Thu, 27 Jun 2024 06:38:14 -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) 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=TPC7X6ILcb/HoAU9ts6W5Y5tepZjMutaMistAD6SAd19toUFkSvGCBbeMl3XJeJw9M Z8G9Vv2SEbFVty6utY+s66nYCz9YF8vrScFDcgALxHW5Pap2nFkAeR+b5CU6eNJalDKm PPhE6hY+jI2xWqjG8O/WQjzuiKSqYOE9xjhlhYe2hGtrfN7q5EeqrG0fGQiCEjdNV0yf IB6v/ceW9lRW+DWY7u08cMOfsOLhuJrXX0OIzHEKLL3Wx+n8BqXcZTBjXZo3wYhHOF2m vHRoBpfIsbZx0fj3Yb6RR9J9HNAAotTvtIK/V3OvAltklBs892rvBNSIScICcaWaFByu 1moQ== X-Gm-Message-State: AOJu0YwMmblqV3BZvmbMV7B2gw36H+/2nqQVCCG5f9aSSOySAuFwZc/0 Svj7CEd7tuRKXYCCB2BlKCr/gbO4K+hy+qwMQdEiukD9kUF5KBfImgrQmkfliwk= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12d; envelope-from=akihiko.odaki@daynix.com; helo=mail-il1-x12d.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495601129100001 This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin --- 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); } =20 static int64_t cpu_common_get_arch_id(CPUState *cpu) --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495664; cv=none; d=zohomail.com; s=zohoarc; b=QqkTH1Rp61s1qom1mkB/YFGrVS4ZGuD/sUNH6iEj1XqnoZkeJmJjeqmd+IAHmnAXBr65iRgqgbAXag0NQwiDGGCuPDUjcrnArjdhKZFsrdtD4D0//4fWRJ56Uj6j6xFg4XWQPmGGL77ZOxAumTUj5r8brya6apWSBgMrC1KRFtY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495664; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GK1NnhFlKONfJOQ1epeja3jVUC6tPChPm6e/EkyYkzg=; b=F1qvl/3g9JKhQoDZTP6Oj1Noyrf9mVI9LkcuGPc1kRLXwblfrn0TsLVLfAT/pnm5PnORkrBACycdhp/RzdcmlOpvDDS8wEUofaqglDqwpyRmTtXcsvJp5ud9NeTC7gpX8IdPpq9JheJAiYVzeM79uOw0b3OwS2aPHEoUDFXKO/Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495664818876.4959163381553; Thu, 27 Jun 2024 06:41:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKU-00011n-0y; Thu, 27 Jun 2024 09:38:26 -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 1sMpKQ-00010G-Uy for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:22 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKP-0006LX-9O for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:22 -0400 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-6eab07ae82bso5671334a12.3 for ; Thu, 27 Jun 2024 06:38:20 -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) 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=eiZMzFws1/8bf3fh8b3Ut5xwlK5ap2efXKeWpXsRpVSzIw99nDdbmRKzjF+G8USlkb 7g84y2M0ptgk/SD4OlSoQTkvlbDbxZ4Q366a3cU1CGrAeQ30nFnBot3Mw1HtopM0lP6f X1LLdSDIPYK//haOEnl3pA47979WA9Igr6B1DvZDPhTxJsx0B/pkv3R0AxEYQ6D/p32X 5fT5Bv8dEKUmcdYMQN4lYIPptw98bszGgh/m51pD1huAE8BITlA38DyVv9MGL6aMdlaC iCiMdAT0v5vioDVY01vWdHYDX+HFycdErOpUjTCvqxK1WCvXv0pJdGiGwITn/dwApXvm 6jOA== X-Gm-Message-State: AOJu0YwjMRXgZs24L5ajSo6lp7TZyX2Wxi+eE5iAI+dz7YSIgRMWBJnU Yv1OCjP3AMCcLP4POtUEzUM7mmqtKC+xPEf/UGudoGSzMNMEB+dHTdX1FrAF3BI= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::536; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x536.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495665452100003 macio ide_irq is connected to the IDE bus. This fixes the leak of ide_irq. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin --- 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 =3D &s->dma; } =20 -static void pmac_ide_irq(void *opaque, int n, int level) +static void pmac_irq(void *opaque, int n, int level) { MACIOIDEState *s =3D opaque; uint32_t mask =3D 0x80000000u >> n; @@ -446,6 +446,11 @@ static void pmac_ide_irq(void *opaque, int n, int leve= l) } } =20 +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 =3D 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 =3D qemu_allocate_irq(pmac_ide_irq, s, 0); - s->ide_irq =3D qemu_allocate_irq(pmac_ide_irq, s, 1); + s->dma_irq =3D qemu_allocate_irq(pmac_irq, s, 0); + qdev_init_gpio_in_named_with_opaque(DEVICE(obj), pmac_ide_irq, s, NULL= , 1); =20 object_property_add_link(obj, "dbdma", TYPE_MAC_DBDMA, (Object **) &s->dbdma, --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495687; cv=none; d=zohomail.com; s=zohoarc; b=d9KowZeNbtfkeLlr9pKiyNvy7hbNLjkEbAIc6k/55Cxe/NVtVubifmV3j6vo5os2Ua6UFth1vj996zt0SDk7qZc6AoLulqZcrm3jRjPMZZ5kH7F1xEEeaeuPYgWkY5IM163WqIQ/FYLX7DGO8UMtMmug71/JKHbMs336qDkAZvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495687; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H1Ud2sffuzrWRWcIEMkaft+gSFV/vM2qExG+yzsFHsg=; b=f1SDUm5728T3y91bWMgXfPOlGp/eudbLtEps5G4ATz4zUZW5YzPEdS5Byyer6DvaxwF0zlRiCJMzti0EFL8AqiWw/yDTwWPXPg+2578H+cBu2QPwBWAWCC+f5s1nKPoTfRNkLwmH2ZVU1yf7FyBXaRxi14kNeEt5rs1OexoM9qE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495687911723.5823282555743; Thu, 27 Jun 2024 06:41:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKt-00019R-1D; Thu, 27 Jun 2024 09:38:51 -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-00015R-0X for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:38 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKW-0006MV-53 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:35 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1fa75f53f42so18712395ad.0 for ; Thu, 27 Jun 2024 06:38:27 -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) 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=MiYy2R+bDs9twW36BjacCO/+unOT8Y+mspQse8LK+qB7w7yZ4CYM4Lq4bktsVj7zxL gFqBTYMCQle7rybWhxJ3ods3dQiZZaKSJai1Y34yY3MpnriejpUmXKGUHORhPXy7gbpa Icqy91AD1FjJWMoiBGG52f/wvoO+lcAf52oyxzpv9chcDvCzfBNUG6voMTt96vrOoiiF DYhapWGhioAfSgFztN7hmHWD/T6RYarzMFo95xNtoyCdpRwNJeiEXEn1V/s5iHCc1am4 Atf67GLNN88cwMy9vTqaQBEeo25q+Ew9JgFP7fdm//Can/xYvJu7venNgmpx9vCJanbx wGgg== X-Gm-Message-State: AOJu0YwiMpEkpYBv9ZI2oWati/DPRC59BZ8YYb6CvrFdPD8ed5LmMAYL GiC8Bs6yT12QvxzwbJh+cavB1H1cGv4/wQQTrKEPez0KJFgyOMNdGhPhofuVfHc= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::631; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x631.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495689584100003 A function pointer is sufficient for internal usage. Replacing qemu_irq with one fixes the leak of qemu_irq. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin --- 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; =20 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; =20 /* Externally callable functions */ =20 -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 =3D &s->dma; } =20 -static void pmac_irq(void *opaque, int n, int level) +static void pmac_irq(MACIOIDEState *s, int n, int level) { - MACIOIDEState *s =3D opaque; uint32_t mask =3D 0x80000000u >> n; =20 /* 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) } } =20 +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 =3D qemu_allocate_irq(pmac_irq, s, 0); qdev_init_gpio_in_named_with_opaque(DEVICE(obj), pmac_ide_irq, s, NULL= , 1); =20 object_property_add_link(obj, "dbdma", TYPE_MAC_DBDMA, @@ -513,7 +516,7 @@ void macio_ide_init_drives(MACIOIDEState *s, DriveInfo = **hd_table) =20 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); } =20 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] |=3D DEAD; ch->regs[DBDMA_STATUS] &=3D ~ACTIVE; =20 - qemu_irq_raise(ch->irq); + ch->irq(&ch->io); } =20 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); } =20 -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) { --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495572; cv=none; d=zohomail.com; s=zohoarc; b=Ji014vM9gGh8Hj3n7r9soyDRaWvM3teA3Cc4GuD8qP2nE4+fsALEmts4yRzrtoaLyX9Qztp+tJ/zo40/pEQSvKslq0n+plQ4b6CSRQ0lpfCLBENdwdZqbnVtt+wRAKgYCiwhXe0DztbfiUoaDrCp310Q2EBMJhkJa3oxK32pxZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495572; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ttjpe0Zy78QRlVICf1w8g9FNolQGU7Fei8nrc5VuhDU=; b=LyWoBJ7enqKvNhyiZQ28FFaAjE37A8Wwp6hWE7NaoOF7VIuOGZ9TPmTGi5rMNGX+9E2K0sEmQffr6EnlU3/C9CRjHSg865RCyRc/sEcLkgvFo9bnosvL8SWiMcWjoFKhDJk3D8+5lgKnvn5iUjWElYmlS9fRsknwY4LYe7ildRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495572083895.911785197307; Thu, 27 Jun 2024 06:39:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKt-0001Am-OU; 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 1sMpKh-00016p-Pc for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:40 -0400 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKd-0006Mw-Ot for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:37 -0400 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3c9d70d93dbso5277945b6e.3 for ; Thu, 27 Jun 2024 06:38:34 -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) 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=LsbFjIA/CBkH9CHpbLv0a60z67YsNbeNxkOtdvtBPmdCRGCmnPTou2001QUwH2kIAi P0QKzLGnbyGlOQqYYrtxkzfSG+ShiLA3UdN0pTSGDaLxisomIzekiGww/G2WR3gkLklD 8nGH2x6+OhJLuBRtTrSuRYp3ZGygLEssY1ea9msrsnwpxAL/cFCoUAMcmgGXR0i1YX4t VGFuR4yEBuKav5GQd+Efi0H2RH6rYFBvZcYnvXzWPiV846GEjKz+/KUIDwh3Yyp2UJ7/ +57mRLjYdcWwCfc85gCVWXFaj2MXf/P4lhFPCsKwy0+3zWCLkem3tRCHnGmIcDuhye4R wH7w== X-Gm-Message-State: AOJu0YwIvWD9oUlDKIvPuHuIKPa7m8RRbx1RZCzPFeNAm990kW4ettOj r1KNNniGXgGwbQKBLSmRBYyfdmo21gJPhwaVd9BeoDvIIMk1/NmN8sA+c4If8sc= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::22a; envelope-from=akihiko.odaki@daynix.com; helo=mail-oi1-x22a.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495573085100001 This fixes qemu_irq array leak. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin --- 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 **err= p) ViaISAState *s =3D VIA_ISA(d); DeviceState *dev =3D DEVICE(d); PCIBus *pci_bus =3D pci_get_bus(d); - qemu_irq *isa_irq; + qemu_irq isa_irq; ISABus *isa_bus; int i; =20 qdev_init_gpio_out(dev, &s->cpu_intr, 1); qdev_init_gpio_in_named(dev, via_isa_pirq, "pirq", PCI_NUM_PINS); - isa_irq =3D 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 =3D qdev_get_gpio_in_named(dev, "i8259", 0); isa_bus =3D isa_bus_new(dev, pci_address_space(d), pci_address_space_i= o(d), errp); =20 @@ -729,7 +730,7 @@ static void via_isa_realize(PCIDevice *d, Error **errp) return; } =20 - s->isa_irqs_in =3D i8259_init(isa_bus, *isa_irq); + s->isa_irqs_in =3D 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); --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495608; cv=none; d=zohomail.com; s=zohoarc; b=NWmEv9QUbo0m3xt+yuTQpqh3/8mojg21lwiYBgFvNp2xavQa4w9uXBHQ9bEa4pOB6iY1DRe3eEt0C1gjI+5ykUTUfIEhRuXzk4pPME0/Z36pHY/yboDT6hRwx1CoUB7LigYb0+41JaARESei2ISZy64fxgBgBokYXzcXvWgr0+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495608; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=y3Al/DkWdr7oNtWQmlrRFITkQePTtq0AALK4OUYETUY=; b=LQVX8dgdiG4oR4b0yyNX2wxN35r5CuFzfxL8ZTqfZOEf21+NtR53sB7NdGL/r8pBQQr/KA5ZgVHdn4IK/QfhkPtrnf0I+FBt90uEkQipX4jmkkdHeJ2qQ3JB4udARPafQ7TH2k+DN1S29JIW8AQ1JGa0zjJIGBpt2iQSRSLRAKo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495608573693.555780464863; Thu, 27 Jun 2024 06:40:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKt-0001Al-OD; 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 1sMpKl-00018F-Tl for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:46 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKk-0006PI-B8 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:43 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-706b14044cbso868103b3a.2 for ; Thu, 27 Jun 2024 06:38:41 -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) 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=u4WbwAIAStdoneyV58CMcwTDXqXo1E3iIGLcsVwaGsR68DyRjVx9bAeUXCjTymEO91 gTfpgSo0PloHA+DFOQCxbZEsEXtZD1BJYRQyGodCuzvt+BpU0/PUnDdFF8qfOcW21sbL Vr+h4EZRbd/xFPQpam3EHJwpRWvZNjrRn09F3c6frfhOxgmQcPBQ7YyiEGdBqRdTtMQF IqlPxBc/PmfRUKTdJmQ6shO1SORp73fflA3Fwij4hrayKHzY7ztjAWWOXaYv377ZPnlS lEdUD4AO5r0uewC7vW+92qIfzGSjRcc7o9AcW1P+xWfedvVgpO/RmBTr12+IyveXp/sa lFKw== X-Gm-Message-State: AOJu0Yw0wBGtGtQy5nq3ifG6K3pwHuhiITLaYmHT+0e04p90CuAuSrp0 R4gYCZw8lZOfSt9sLQRJFP+bP6SMh2jsikMzInVUMWtkprjxAhyPYmGW9nT8+78= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42c.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495609198100002 This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin --- 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, SpaprMac= hineState *spapr, =20 void spapr_vof_client_dt_finalize(SpaprMachineState *spapr, void *fdt) { - char *stdout_path =3D spapr_vio_stdout_path(spapr->vio_bus); + g_autofree char *stdout_path =3D spapr_vio_stdout_path(spapr->vio_bus); =20 vof_build_dt(fdt, spapr->vof); =20 --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495572; cv=none; d=zohomail.com; s=zohoarc; b=MEsrx0D4rusgiZMbExLbgIeNdNgo+fRRQThzbAbXM3sEiCOA0C4o+LZhjzcemKL4QQp8FrCVVU9Six7Wj/8bhn+8GIMGomcnm4FP5lzhYDL/YGCo67SrBIuoRIO8Fn46d2Vi8rVgffmyIGzDZNKU6ZE4TzeL/ikbOJAiTVJx+uU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495572; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UtuCMhxUWw1DUkDzmxPc06M4yVAzJqdA967oAcSFqUQ=; b=kHTTlRIwN+RLGwlSEuSKykF/rHVayBOMoxfYOWED0OuCwQK/Lw5Jv6HAb38aWEDJrS/OGb2FMt8sGsPvs7iZI9Pld7t2Ef211JI7rICC+yid7nhXgDapc5WzRqv72LAJOKgQVKDE5SETgBGauJEeQ27ckas0YHxvIKSkhW6vgD0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495572342888.6212161557246; Thu, 27 Jun 2024 06:39:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpKx-0001Ek-Kj; Thu, 27 Jun 2024 09:38:55 -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 1sMpKw-0001Cw-8t for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:54 -0400 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKr-0006Qe-6T for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:53 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-25d5333989dso1256777fac.1 for ; Thu, 27 Jun 2024 06:38:47 -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) 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=v9uqnYBMbfpktqK2rT6us8vLRDnQbvps85d2dxzxPyUWSu3NOWJLpvcd7cjifDWTLW wM65DKkdvxOcQI4F3/onsTPGY8xpnZQog87111aLsPPKlMcjT4ja9fje52w/CinLyVMC O/EHkBnzA1R83T8DvW0ANNor0/qgBb9rLD7rREZZJwDR9wH3NLaCg9sNSl7wXQpkXhbM tMUwlmIBznJ/eL/lYekvgfs+KJpuamQbaLGdHukw6v2Z/cRC5s7Xr+YaW+ftntVPJ+XO kVMLKTdOazbYL5Avnl8liIERZMYQcW2ycxlhGfKPenYIiH8DzJ2VcFS3fzdAbCVvvgRm 4klQ== X-Gm-Message-State: AOJu0Yws1b2mcMPzx3I7FhLdmjI4VCs8BjCXhpnFpbKWXdapFpzVwr1S hB1E73gOCCkUF/Qp2LztPSM4uhd9dBuHjfMXgQMj8hjDJSdUSLzMywWuGWqOHLk= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2001:4860:4864:20::35; envelope-from=akihiko.odaki@daynix.com; helo=mail-oa1-x35.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495573088100002 FDT properties are aligned by 4 bytes, not 8 bytes. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin 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 =3D fdt_getprop(fdt, offset, "reg", &proplen); g_assert(mem0_reg && proplen =3D=3D sizeof(uint32_t) * (ac + sc)); if (sc =3D=3D 2) { - mem0_end =3D be64_to_cpu(*(uint64_t *)(mem0_reg + sizeof(uint32_t)= * ac)); + mem0_end =3D ldq_be_p(mem0_reg + sizeof(uint32_t) * ac); } else { mem0_end =3D be32_to_cpu(*(uint32_t *)(mem0_reg + sizeof(uint32_t)= * ac)); } --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495640; cv=none; d=zohomail.com; s=zohoarc; b=fjW9u3asbOfS3Lg4ChMYO4Ygn/M5oPKqequZseE++YJMSaVziVV+Z7vzJOPnUS6ZcN/ajjOk4jdZT+Q79cZYDY/y4uMCjBrYRaPYhk/XKcV2dh/rpjgNwUAY0AoZSchKBkMsAFDQec6QgjJ0UKXmzwe8b86LYCZk8R8P0KXevM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495640; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jOjlX532fbSm/MfzxqkUiGMJdKmyu/k4tTVPVBmckwI=; b=mLmDdKqarXLDHPAXjdoAx7C8JX+T/jry/LDXj15imxyblK22jeWpWqdhyktS5IrWML3zIh3zBfw48q0BZQmGHdpg3gDJP3tm1vvaQeU1+/psyLVjGQxW4eWWdDnyoVrZ8bYkw3iYZW8laKeHrgHdnTzepllAajp/o0W4m2aDWPQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495640354445.62198505857475; Thu, 27 Jun 2024 06:40:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpL1-0001KA-1Z; Thu, 27 Jun 2024 09:38:59 -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 1sMpKy-0001FF-0Z for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:56 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpKw-0006Rj-Ci for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:38:55 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1faad2f1967so4741795ad.0 for ; Thu, 27 Jun 2024 06:38:53 -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) 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=N0Uu5nmhuc7O+W0rosJOy8VrDZnKoDhvBzRbFk8qM7XcgC8UIkZB3j0+qybIugGr6+ 8NVCNiZXS4gp9UMXaO32O+QwqAh1Nj8395CoId26TMdlq6m4l7Th4961tzXOqjoBcgvl wCy7fZmOVyVoS4EiRpuIeI+DuavQyYNPN1IPS/uZzkPgmmKDitSNogmGlSgCCPaAO/m0 X6V+b9S1KbjZY+kA5TqUugLHMvipZVLFgDF+/pEnpn6TODoG7y6QLPPq2RMtREBzd3wX p1C/CIIZe2FSTQKFkKk0p9fcA6HruGXoy/MrwEslpNBkIGS5ZK6emppiLluN6siswzmt 9yVw== X-Gm-Message-State: AOJu0YxsE/OmyY4hg1M2MzWmfRDjOMAydeHKDoSYygHZP1AiJ5llvYX3 CyyDZyyskx8RD4+rl5VjoQnqMD4j+PCWHIs/NGiWVjz1bvwV+CmDM19elBBfnGM= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::634; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x634.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495641321100002 This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin --- 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 =3D VIRTIO_DEVICE(dev); VHostUserBase *vub =3D VHOST_USER_BASE(vdev); + struct vhost_virtqueue *vhost_vqs =3D vub->vhost_dev.vqs; =20 if (!vub->connected) { return; @@ -231,6 +232,7 @@ static void vub_disconnect(DeviceState *dev) =20 vub_stop(vdev); vhost_dev_cleanup(&vub->vhost_dev); + g_free(vhost_vqs); =20 /* Re-instate the event handler for new connections */ qemu_chr_fe_set_handlers(&vub->chardev, --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495682; cv=none; d=zohomail.com; s=zohoarc; b=iaOOjR0OG6oc825reXpw/BujoFgCRWyfLO7lFBt4RlQ1CDFk+U3+VgJmNBvUJjkV8CRkQsIzia/TOC3p7oAHmOmccVJysgp/YaX/hV/O4rMRvr5hrBPe/US1d5JVzddrpGoKJZ8BIQK7wspZffyrbthwLdAxJ3BCiW8TiimRysE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495682; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6PV0Jwd3ow6/n1FaesIzFULRk/ni0qv5jyS/+wLDXMU=; b=MEem+VBxNrq1DUnVdp7eOcXeYtG6bpmoIvq920eubRKwkoQNi35dRYnf4r7NBiYUI3lcyutziDcvLCveunUInmMH3se7vvTPAl0p33pzPDmzJjJmxr4t3cY2SOHdQT5o5vxfBL5PyBcmNr5164FrhxDacxoqmqKKw+mCGDWFyiQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495682675928.6092883234323; Thu, 27 Jun 2024 06:41:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpL5-0001ND-2j; Thu, 27 Jun 2024 09:39:03 -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 1sMpL4-0001Mx-6n for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:02 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpL2-0006Tq-Jx for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:01 -0400 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2c7bf925764so6363939a91.0 for ; Thu, 27 Jun 2024 06:39:00 -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) 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=SqtWNKWPWfU5wjWnCAbgLZKr0OKa044QR7cKSdnPusb4KvS+RPfGUTOAFu9pJBzhvk oyy05TVVtkiQMKX1hLNd/LOFZzF9xyUleuQN+Sp0W2YQP28oA3k9De6wqCDcAqbjD401 E81NjXNBXX4oYznEz14PLjYiY2YEJkWOWLqyH0n5jGnJPunwl4boyPSsIRj0kcmoSEp9 t1OQK/vyz3nQtAzVJ2VpDKk9XY49j2eh0uhlBFHZjrbrVyCMLr3NspbNHGUjXSLu4+fq kW3OomzclMvw4ukpORmw4LMo5nMEkftFnW/5+5DEW2QWBRy5qqnl1hZWfbeQEMG/Ggma swXQ== X-Gm-Message-State: AOJu0YwMsdrzL5Eb0jbfsQ8YXmKE/6c8GkCf5Cg7gXNmE66XG5jLCB1A 4CBUOsj33BD9c9sIFnUpU11LBK9n9Q1cvxnvTqpJTVbBycRZRl7f6eIzU1jcVT4= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::1035; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1035.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495683556100006 This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Xu Reviewed-by: Michael S. Tsirkin --- 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 in= stance_id, =20 if (se) { savevm_state_handler_remove(se); + g_free(se->compat); + g_free(se); } return vmstate_register(obj, instance_id, vmsd, opaque); } --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495641; cv=none; d=zohomail.com; s=zohoarc; b=bTQAUBUoAlUYizY5/9pZkFkILF0WS3yM/23l56mD0Q1ObyEtBxdzPFCgAHzMGdsL+GQzxXxL+dJKNsdROgidbzOxcbwcjoLdJxh2ivdtf/KbWao04Trd8a//JvAhZMSrgtyYXbhvgcQSgGAyicXszpNRClo7iyv6J53Ri2Pi+lQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495641; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6MgmHQG/2ylhpi7rbXo5VyylZZdoY/6uUXCCV6pKunI=; b=Bf+IkHvvz4tzkMriY9Etyca43VvcajVQ/stZUvQn0tAbBMIf4k0pTQ1CGaHI038qZhckzMTHXOTcexKbLjXlLUyED4JwRclklGmONUSpj13EeQl9ZFH+V/9gUjsGUZBIpMuAiBx+yxCWShzLZ/YgNrnWivAz9UWxlEdw4vh22zE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495641146751.5829605041404; Thu, 27 Jun 2024 06:40:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLG-0001Zc-GH; Thu, 27 Jun 2024 09:39:14 -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 1sMpLC-0001VV-7S for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:11 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpL9-0006Uz-H0 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:09 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1faad409ca7so4181175ad.1 for ; Thu, 27 Jun 2024 06:39:06 -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) 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=a7cibJZBiq30t8nrzDYf2jgftOT4amw00UOHNiTKHDOTXMMSNClrIH9QOSq8v59FcP pHX7m/S4NQecHWu+Zu9kDgxL9mQDD7WmPsFSV4q/JkBxVZxZyJdW0HNri7CT+mb+X2qA qIuSCkF1UuHaLOstzh3wnCMq2VYU14SQ8GC/6VfQb+wXqJxWue2a0Wa5vs4k7TRJsEbT 6G4B8VigR5rczWt1Sn+mhrkN1YWQrFqzVNObLQIkZLiEsLZWjNZ4jCmWSgiPmEcIfG39 M39xYNBhBUOmdqy+O3f75Hh0JXOJQ+S82QcSJCR39WjWl2zmhsQomLWcRIcwjIrqVXDx CNzw== X-Gm-Message-State: AOJu0Ywh96dCoBP8gXXM1/nxCP2NrqTW36JCIBIC/vbjE6bH+AakFSz1 Bt5aOPl7pQUAxAByKLNcNdJwkFbNfizJfE2W0g1SXgKGIbmQzmyBDCn+NlYcSr8= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::633; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x633.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495641311100001 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 Reviewed-by: Michael S. Tsirkin --- 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_subregion= s(MemoryRegion *subregion) =20 memory_region_transaction_begin(); =20 - memory_region_ref(subregion); + if (mr->owner !=3D subregion->owner) { + memory_region_ref(subregion); + } + QTAILQ_FOREACH(other, &mr->subregions, subregions_link) { if (subregion->priority >=3D 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 >=3D 0); } QTAILQ_REMOVE(&mr->subregions, subregion, subregions_link); - memory_region_unref(subregion); + + if (mr->owner !=3D subregion->owner) { + memory_region_unref(subregion); + } + memory_region_update_pending |=3D mr->enabled && subregion->enabled; memory_region_transaction_commit(); } --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495695; cv=none; d=zohomail.com; s=zohoarc; b=l1Lr0vxvszrYO7gRKAVWEuB5WdH/z8+0f13Pl3xsHsmS/Du3Vkn8tmg5ZyaDmAQ2+IzCA+tdZQ3JTd2dM+oezYblVhEdPWXbwcjwy0tkY4KTndEayzmLPKziNbgX2yPsi4BV8oKit8QFGnnt88jJt9sehPh5S+w6bcwjqDciuNs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495695; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Yvl4pAdGzIA/y7zkDQtF9iZK7ptxPpuy1nIWlUirby4=; b=S/0h2NxEvzBQ5Ar7TBNuCP3oMWMwIFrx1lR9FN8f5DPZHTeU9+GthumXftvcGP326Sch8BBY9nPHMUaoNyuvGG0ywR8E/ih7EtOklTsRqEZnBksouuqUp63tAIqACgY31mm6ngUutwFOjWH+Md52zM0Qe17xSwO1o2QKLCf7Y84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495695822908.9952443304566; Thu, 27 Jun 2024 06:41:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLN-0001cr-7U; Thu, 27 Jun 2024 09:39: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 1sMpLI-0001af-CE for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:16 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLG-0006WH-LX for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:16 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-7182a634815so4429106a12.3 for ; Thu, 27 Jun 2024 06:39:12 -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) 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=k+VAIeG7VYnUpJ5JohNmNhYmjC+LPmDLqbXs0dYR5hkWSGMtNV8ZBtHBQheHiT7krF y49bJyQoKraqtlZRSzSJTd8Hb/psqQbY3hq6t02meSmUcb/loFBDVczgPjAjweflzL2H M+YtOi+YEtmqIjAS12yBNMN/zEk3VZHHgrG5tl/zRcBDAofhVCgtQixEYNHNhDjY9137 FNVW/4lWlF2rMRYpK6LgjW+BRKPBFpootLrHWfxH+j1NHBLatPqZPk+rAJvd4e+QSO5O ww+LNVWJD/GFog3bquWfoSP/drF8G+z5rtTTFIJP0b8RdKyn8YzPW1z096qHfMDqeiwP mEPA== X-Gm-Message-State: AOJu0Yy5Cy2rF5WGhSBWB6QdhDnIXzIsYzO3a4rs3IKtNB+Ih+QizhA1 5OOxRJYotnShMPvVfWK2r1S2bOTcyIGBGNYMeTH5peJJb7ev29UIWpQS1PLRAzc= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::530; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x530.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495697658100005 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: Michael S. Tsirkin 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-intr= ospect-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) =20 qobject_unref(types); qtest_quit(qts); - g_free((void *)args); } =20 static void test_abstract_interfaces(void) @@ -310,12 +309,12 @@ static void add_machine_test_case(const char *mname) =20 path =3D g_strdup_printf("device/introspect/concrete/defaults/%s", mna= me); args =3D 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_fre= e); g_free(path); =20 path =3D g_strdup_printf("device/introspect/concrete/nodefaults/%s", m= name); args =3D 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_fre= e); g_free(path); } =20 @@ -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_concr= ete); + common_args, test_device_intro_concrete); } else { qtest_cb_for_every_machine(add_machine_test_case, true); } --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495647; cv=none; d=zohomail.com; s=zohoarc; b=Xax4NpSMnh01TPhLQirw/OOB4VZD1cfL/C8fdV8+rmwADhULYULKiqCKCz9Wr1v2+prwkHiwZuHkQxSrQt/trNeMH3RK9tiFWk9I7+xTKI8tzPVhVJUnyJmuK04RjGb8FnzAzuJXUMdgM/LOq072lSnkgJoGgbzhlkkXUFpL67g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495647; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bOTqGJASqbN+xq2cvidGDOZj3Yf25P/ZsUr7Yh4tZjc=; b=a2IHVi/ul90MTsZyXZKJ/fSq4YsXyY42oYYN66qaYFgap5EkRgTvoadXPn7tH9FrgcR7bHUFwaHwnTTyuAuUdBpPRZ1fgmqk+Q6ToWKojMMJpWqZBsim9QtSX+R1nqcOaxc8wqM8fXPpQcNzuTCrOQR7e5JI/yXCWsEExxVEYT0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495647295718.4058386275151; Thu, 27 Jun 2024 06:40:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLn-0002Ma-QF; Thu, 27 Jun 2024 09:39:48 -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 1sMpLO-0001gJ-B6 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:23 -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 1sMpLM-0006Xf-BS for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:22 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7067108f2cdso4256063b3a.1 for ; Thu, 27 Jun 2024 06:39:18 -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) 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=RoUM2X6eai3vb3B2QDXjcHELegeDhcOfRAI8liksbgWOiUxU2wHXkyptzNJ0O5l7uJ M7betqr8QtbZ0PDeoAjzWHcUUsxqd4eFcS0nU0IGQ5e+b7wwJAxJPcolWNbFo3DImoE5 rY6iKLcfhPr+XflaGAlVrPiXCaOpS+Lc34bQbqRD8dVIwrAxgvuL6gL0ZQl0mZ/+oDae 086tulRQGaMvoSVzFAjenKId0qw1pwy4DjcBVsokGc0A/iruKncaMQq495O6gRfztjC0 Dxh0WzEqeVQuz3Rf6t/tDj74qgemjZJp2ClaD/kdFlOXCqr0EF9iyCBKGkvYH1QmfDdd LYVg== X-Gm-Message-State: AOJu0YypLzJiVxpyNXgsfmkH5Jo75UtGyaStPCqm7otSgC7FvVN9dhVX uIDEuwLHh96+Cp8lPA2Yx/aFWACPOCZLq6b6Y9K3YtQ0bAiIvs4v+PwyN+Gyiec= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495649457100001 This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin --- 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 =3D g_list_append(s->pending_events, respons= e); + } else { + qobject_unref(response); } } } --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495609; cv=none; d=zohomail.com; s=zohoarc; b=M6IM6qo6S5tvHkpEK0GhVsFzGIQrGPRjOcBGghHsA67/6zokOU/b6r9cTOg123Af15uhpY6KWKgnSAgLci/EzJqToP3CtPy6HBMbp0C98AiPeqZY/r/3HXpAcZ9tTyFVlZ1CrlaXxpFTJTmLknpZV7HhY2X/BtFdz82mplTRTxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495609; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7RVNKACznzXJwsczryHdNsSEUqVvGG/uCg/TYBM83LM=; b=ebAiGbM8TR4Bn6Qdp07fbHfUoXmGYRa7YiD9Xo2Ew535gs/ErccRAJzFNLcpdD1ec/Edj6qo2rm7yS20BHVZa0tiW237T1KeNilVkwTdca6q7k63exqpCQWNI0q2Inv+jdga+nx6cHw/nRGoGr1c3reofSHp39Zk4qYGnp0cp24= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495609486909.8457809517631; Thu, 27 Jun 2024 06:40:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLp-0002Td-5z; Thu, 27 Jun 2024 09:39:49 -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-0001j2-J2 for qemu-devel@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-0006YW-5x for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:29 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-70675977d0eso4113864b3a.0 for ; Thu, 27 Jun 2024 06:39:25 -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) 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=wVWH4IL8LkfWAjT56guzW86mLLF3vojw8Gq8JZPk89+yJICWwPyRZGD2UA5MN+X9Wm 9KIzZFhxuv7eHnIxELoVzh9rmQMbkOmooduuPLJbIMQwbF6KHTUrSEptVxgd8KiYHQ7o mX1t/6Peejv9eH5ExkBR3OhYOnnIVQWoxkaGmuFiA8XjyWeophdA3wbGbBzLwnkUiQQ+ oN/WV/8kCkDt6fgf4/21NBqNQPied/U6GxwsJpiyLZVrvBKmvxJhIO5V/6gzLSblqpL+ yxK80/22t0PE4lN1wGgVvVhW1/brovUCsx6eeG5Dof/CVMUUdfGQ/5u/TRZ0zuDU0tOj XB0A== X-Gm-Message-State: AOJu0Yynt2iMDJzPjFEPiX5RRRLQ3aoQYZ2QgQjb8Gsn9dZhelSpUQud KWF1+PV0jMmxGAhtdI8gtgPEY4fbNCc2LyNluH+Do68ioNW3BzxItsRHk+gL1sg= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495611262100007 This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin 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; =20 if (g_strcmp0(qemu_var, var)) { + g_free(qemu_var); qemu_var =3D g_strdup(var); =20 /* new qemu, clear the cache */ --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495682; cv=none; d=zohomail.com; s=zohoarc; b=GrNCX5ZYvYEt9MZ3dguz+snmaYoxsONGTmOpJHd9cpurO4dL7AaJjSPBa+gGL0+QquMPi3wSa48ygkUZfvoxEoW76BcIJ8Ruy98S6javHO2mRJ4qLwinbFrDyWl5KekeCXLHibWSwtuYe0Ur/UXPqTzbMh43uHp5/QpuG1Ef1Fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495682; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IDtmLd4DIh+2XRkZ57QtXjyzkDOakOx1Ds4rKdXYuOE=; b=StQ0hKnazt19vr2HaHMvXOnjlMNHSrhrNWX5DkgmpU3pJL7C95U8qMEC5rgdv8LoqfUyz6IV6qgrkHXlTk8kLFNEwY+HsM3+GoOEwpYW9blUZtWE0AhvUWel0co8Ji0JXIxIoC6pZXhGiJ+ttv7gMi7NQYXF/bTGBlICbSXov6w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495682765686.1850952870182; Thu, 27 Jun 2024 06:41:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLu-0002hl-HK; 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 1sMpLZ-0001nL-2r for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:34 -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 1sMpLX-0006ZT-D1 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:32 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1f70c457823so54392185ad.3 for ; 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) 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=K4dwbD9R7BvyhTDsLCR5IM8+v1SZksHkfp/Ht3i8EH1KvX+l2MLu+rqBqwWDief1sD 0SM53xJsXItEtOJFfH9lsIV06BhPSCLZIBPTOIon6uXcZ/GLciETNZX6W1vcCPEgGlKQ DLO7M/h0LXwrmfFXtzOvE/HkzR1BDKilyyL4M2gPMs/OhOGamVK3yx6GjZqW7HJgEBj2 EX5pYWD1aiCROtgLx1X6g8evz6Fsc4IAZiU3Tg3r4lwMMDme3g8lAoAA5PN/Niqb8OCw LfhBC9jZHW4hy7HKdJg3rakQPKam2J1X3DKA9eXihu6HMoCkWTXMw3WeX/VAXUWx3awI lCYA== X-Gm-Message-State: AOJu0YxIyVjd2hmXvdM0nifvoz7/x5Ao+4igsyEv3sKzw4STd6eX9XGe VX3+H9JVFCWUSMrgoWlkNe9dtwspiqpT8qqsFLQxSUPhI6krdbg3IkI6+mSu/nE= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495683549100005 A test run may create boot files several times. Delete the previous boot file before creating a new one. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin --- 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" =20 +static void bootfile_delete(void) +{ + unlink(bootpath); + g_free(bootpath); + bootpath =3D NULL; +} + static void bootfile_create(char *dir, bool suspend_me) { const char *arch =3D qtest_get_arch(); unsigned char *content; size_t len; =20 + if (bootpath) { + bootfile_delete(); + } + bootpath =3D g_strdup_printf("%s/bootsect", dir); if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { /* the assembled x86 boot sector should be exactly one sector larg= e */ @@ -164,13 +175,6 @@ static void bootfile_create(char *dir, bool suspend_me) fclose(bootfile); } =20 -static void bootfile_delete(void) -{ - unlink(bootpath); - g_free(bootpath); - bootpath =3D NULL; -} - /* * Wait for some output in the serial output file, * we get an 'A' followed by an endless string of 'B's --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495643; cv=none; d=zohomail.com; s=zohoarc; b=JiY7Y3ieOwLICjN1LWeZD3GQs9jCGK/GDxD7BaDBB/PGMuyMQZLHcaIVJNuF1DJ5en9o4o4gSw3NHs5KZtgmyG1mLEv7YAO+5KpeEQiyu2yilE1yoap8k2UOjBD6XGqqC5NowBGqn2Rid1qsfCv9IkzdfTDiloCsiihxSHRcWbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495643; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=66SWenAU4qt0HqdzzgzjopUq88LncGGPdZoRZN6MJBw=; b=BiRU9pUXUwpQZgfagajRSvDfo1B83DBQuXf231TeYWikYv78+FJuvBt3TaZJGj5XOY2+83L9JXrdbd2/HKJhQBHZxeKWThwuGtZguB8AmZom6kMN19Gt0f23dXLZP6o5ZPKs9JcyHqn1dmnR+WBH5Xwcc5MLQz8sLDhFWiIMwhU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171949564356686.15320647482565; Thu, 27 Jun 2024 06:40:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpLw-0003AJ-QG; 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-000266-81 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:39 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLd-0006aO-Jr for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:38 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-7187e6b3584so3721709a12.0 for ; Thu, 27 Jun 2024 06:39:37 -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) 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=jSzU+it3/GzPbpWCKZoWY9oi1D2uRVijSTwaAsx+AgsVGI18qu8mjLH4z/iXfcun1o Vok6klRjmaSxFbshAaflvPkXZIoUZTrzfH2qUXFi6WatGb0jWVf6KNg+JDcseCu06Jjc vgEP9NuZFsUNSISICIXKXEUjCkDDRQdKYHhRdD5NEVUMkVDJmbpWlIyF20k0DA0J76Lq 2CYNbv06nlvJhGMAnQeU5Dw4UEAL2CJwCDW5QmYTSS8I73dFItkqkAF7Lghexv3MXU0D dzouMV8kp8EQYd5+SDMWbdaBqdC0zsT5/wlqTOydQupHflm+HOdjmIPMhMyBRjBJ0jsa d8EA== X-Gm-Message-State: AOJu0YymWoBLL5dn0ntvr54P3x9FkzOB0MMnMOjGJ2BQKuCkN/g1OiCR vlnUyMpyN1N9CTiDW1sG/jXOqigsQ3ACCWJerFIc9TzIGxMMJBw8XTNYLEMiIcU= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::535; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x535.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495645352100011 This fixes LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin --- 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; =20 =20 - /** * 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(); } =20 +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 le= n) if (path->u.test.subprocess) { gchar *subprocess_path =3D g_strdup_printf("/%s/%s/subprocess", qtest_get_arch(), path_st= r); - 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); } =20 g_free(path_str); --=20 2.45.2 From nobody Sun Nov 24 23:48:08 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719495707; cv=none; d=zohomail.com; s=zohoarc; b=OtNy5lh8aGYpQH9yNcLCy9LglrSKISnVSzGk/ZLlnoJNnNoRXGpGxceHV0ylLSW7Ofxh/bLjgPEVxoA9sqm1n+DpGj5xoE6hOPzBfFfKo3pM9NzH60tESeyPWLanh5dMowxrCf0monplKJhuDPqSwsUSrs2Szenpdeo8P67h1BQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719495707; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tYtFORlnbJN2+36DGKZvH4uH8NkkbHJaO5uVtPxgJZE=; b=SGHEKSXtW5Ha/VvrdmYR0CKdE7pDMXm47aXBhvSKq9vcxECWm5McWSwre9okmhcrb8BMx/DHSJIRFdi9tTkb2PAPM8Niyb0Puv/LKNaSytrpqR8KDpA/FCvfjp4u3HS34wZk0JG9ijHQ3zEXjLJcDHMV0fROUJTBWzn90ERyqg8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719495707983303.9960326073515; Thu, 27 Jun 2024 06:41:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMpMN-0003wd-5N; Thu, 27 Jun 2024 09:40:26 -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 1sMpLm-0002Qv-22 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:46 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMpLj-0006cq-Tj for qemu-devel@nongnu.org; Thu, 27 Jun 2024 09:39:45 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-70673c32118so3808609b3a.3 for ; Thu, 27 Jun 2024 06:39:43 -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) 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=M9BJwgbGu9QtLPkxMk8jCZDbNVoPLGqk3a1ThxZXNZNiTEEmZejZR/vpi3ieUgmMzv +QRzufSGP2tnp3ItDtkXhQU26nytxA2CbIThurlEhd1NL4ez4etuUuS5P2JwZygB54Xc 4XvZ+Qqd539qUfiDuHkEWLk2QaKY5B+eNlCUlJKK75kJzoa8cjc+GgcL+JXYN0P4yPny udzO/tt63fIhz31/KcAy0J0IAD/N1JjhMxY043VntnG5Rgsuh0QOcLwUraJn6oN0FGut QBERvTUylnYxMY2IhGscnRFoizxKSjxan4bB+07KUKARnaYfOmBlL2WreyBMiVJUgRGH m24A== X-Gm-Message-State: AOJu0YwBjmq5cS8pxdLnr4wEYo+OmJEMSYrz58GwhHtnJJkXzol3tm1F 2kOdAN3RfMV4oo2EsqQ64pY+ODme/SV2w02yTBzk2IKPAI5AeGjOdpZT3snBSTY= 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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-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: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42c.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-devel@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-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719495709688100002 These GThreads are never referenced. Signed-off-by: Akihiko Odaki Reviewed-by: Michael S. Tsirkin 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 *c= md_line, void *arg) { TestServer *s =3D test_server_new("reconnect", arg); =20 - 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=3Don"); =20 @@ -965,7 +965,7 @@ static void *vhost_user_test_setup_connect_fail(GString= *cmd_line, void *arg) =20 s->test_fail =3D true; =20 - 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=3Don"); =20 @@ -980,7 +980,7 @@ static void *vhost_user_test_setup_flags_mismatch(GStri= ng *cmd_line, void *arg) =20 s->test_flags =3D TEST_FLAGS_DISCONNECT; =20 - 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=3Don"); =20 --=20 2.45.2