From patchwork Wed Jun 26 11:06:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952519 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=SCdPH9CM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8JnF5QyVz20X1 for ; Wed, 26 Jun 2024 21:07:13 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQUC-0005IA-JE; Wed, 26 Jun 2024 07:06: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 1sMQUC-0005Hp-1b for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:06:48 -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 1sMQUA-0004ef-J6 for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:06:47 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-7024d571d8eso5109913b3a.0 for ; Wed, 26 Jun 2024 04:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400005; x=1720004805; 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=8gdrJSUaYQob8d/4ZxzgiF7J5n5fiKZWcn18f0CmUEY=; b=SCdPH9CMBhbehc8wnektX4X8oRmrwHenjJEZcZxUzGiTBUHwjFrtYE7P2NFEAI54t8 dHU6ybS4HWchqGi7O9S0k9QP2Sypv5TPryRDIjftAyjTJFy59s2yUgR/Fb7drFvHzL2y elA7igDCBAkdGfCnu/ndsF939H/6EkityYAuCi3nbdArPnZOgp6NQX3RCUAEL/KXuKc7 5cu768X4yq+mGLVSuKbGHBOiu1lMxFsqGj+YNOi/8bVdaJk11m/Dqj5fu6pvFG8ttUkT qs3hCe+WJpTfDKEfzRZiaNmNTb/AYRxlMHVeYddN7di8cq5BBmv3mkfs88QHtvHIO7+q u2aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400005; x=1720004805; 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=8gdrJSUaYQob8d/4ZxzgiF7J5n5fiKZWcn18f0CmUEY=; b=ZNhypjVwFX8xrlqS5xgWv6tZaavNKn95HacYGklx2GhK8ATHYlfYzhNZVCkmHLMh0o szhBYcbYAjSyIsWSz2lSdI0l//UknFGeP2ma3/GTFxn3Y8drXHKq5rGKUWgRoih0GAH9 YJK1tOfsWQQUyewyFkRFo+hIImNSVmOOITpBGafoHLxuhcGCZ6YGeuDdL8Pq8C8Lo8Qw JboTbtXWogEHz7lJn5Yb3HDH6GWDmH1d6yDWKckPY9eMCGfi7JygBLkkWYFDwteVMPzg if4pafHKWFHpYrqtXKQ7IxKbyFY3s6PfcY0DW2/MMUlycw7ZAl1F+M/LlgKmi466rAIT LGwg== X-Forwarded-Encrypted: i=1; AJvYcCXgp5Ls7w7PB7LtMCgMrHwk9L0M2sVIGHp1Vi34hziIi5PJV8XU0VHxUIPnb/MsGIBAm2tTP9tDjCEO9N9gZ0A41qpc X-Gm-Message-State: AOJu0YwMJQn+yUYaUhFHBvuZT6tbxhFGj3ER3jhExIJXfoB6rRs3xWfD m8QaoK1jYicQ1jPbAs277UUVdukFZUxFW44BJ6y0YaIyHu+NwebTWxi+k1pHjZc= X-Google-Smtp-Source: AGHT+IEm0Uk3jhijPGftXQo5d28gVdFOecDw4w56VU5pdI4g1PPkbbhI7q/sn3Q44Xj+9R245m8MMA== X-Received: by 2002:a05:6a20:1a96:b0:1be:c4bb:6f33 with SMTP id adf61e73a8af0-1bec4bb7008mr517626637.12.1719400005215; Wed, 26 Jun 2024 04:06:45 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1f9eb4ea7dbsm97876115ad.213.2024.06.26.04.06.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:06:44 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:24 +0900 Subject: [PATCH 01/14] hw/core: Free CPUState allocations MIME-Version: 1.0 Message-Id: <20240626-san-v1-1-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::436; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x436.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- hw/core/cpu-common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 0f0a247f5642..42f38b01a97f 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -274,6 +274,9 @@ static void cpu_common_finalize(Object *obj) { CPUState *cpu = CPU(obj); + g_free(cpu->thread); + g_free(cpu->halt_cond); + g_free(cpu->cpu_ases); g_array_free(cpu->gdb_regs, TRUE); qemu_lockcnt_destroy(&cpu->in_ioctl_lock); qemu_mutex_destroy(&cpu->work_mutex); From patchwork Wed Jun 26 11:06:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952522 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=nquZsbtD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jp71zPBz20X1 for ; Wed, 26 Jun 2024 21:07:59 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQUL-0005My-4r; Wed, 26 Jun 2024 07:06:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMQUJ-0005KP-BS for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:06:55 -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 1sMQUG-0004fV-Oa for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:06:55 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-70670188420so3081567b3a.2 for ; Wed, 26 Jun 2024 04:06:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400011; x=1720004811; 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=iRIsabjOCp7YSjFwcV1tRdeNsvY9o6uLKWp2oClGRk0=; b=nquZsbtDjKaqBReVXGUBgvoJcu7jMPDMavaSDJKxdOyHK79I8gDeSfpUthJAlCMwNr a3eBmMMiDrNqKZn0UPF2d0ZV3lKBlIjJtPBe8/mcR8MDEm5piiyoIRx98FaK0l77tGtc moxNYjF9Eko3w3oX0Qm97VpXUwJ8cbMpgasTTyHh5Dy8CdjgdSZHkzT7bVKUXLkT0a/N GFPOIJOvwXRlHU+AYyzhZ9IgNDEcItmSI5Kz4kp/D/6B7hG+Rx8eRqTtO9ooy2u6Pdv2 mot+HTd8dRrVyEYGAMD5HaW4v9ygPsyfAzmgiGTZx74Uk6pBGk8PzOkqiJGqqvkCWTZR f1gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400011; x=1720004811; 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=iRIsabjOCp7YSjFwcV1tRdeNsvY9o6uLKWp2oClGRk0=; b=IPLJqYGHlpM1Z58Grm0WHxHsutPKxaG7h+wObF1YCDZnKQT7y4v52OGH9iFj5RC6FQ 6rV34nG2pY/uY2BSMOL4GiSHMeAlCHCtuTLqsj7xdFuGQhD0UGoTV2fMGA1+tqXiR6gR xZ6vG4KqM68VB/q5Pr4Pw+m0VcRVEIwdIk+Pe/l3XyebC0DRt8qiBUTNbjtzpaea4vDh rz/RysmOPO44Jy4LQAh7TFJcjR0RfAMWVPClwMMCD0E5Bhm0ipndRXRY1LMDoc5O5FtM /rko2+9K013jVOsgyBgGXw/kdLyFKunulXnbSzoSZ9AxK+27CPX2dJm5rvxP4vLQ4RWz Y2tw== X-Forwarded-Encrypted: i=1; AJvYcCX0nizXdOGcXGevqPLEEhVARpEwxpnRXcJ9jOofcSfWzZjYakgBVWpxMZjbfXoxMoH6sUIkIFgyujw6/gIcBcywGpk7 X-Gm-Message-State: AOJu0YzzTSyxnRjeGWoJTxm3+FJrwBlkOoH+NF9FRLZ1lxtVQs0CjWV1 SK7VxI5yOVgJbZxAn64MAzRCxzM2txx+MjpyjwQLhWbTg092ExJICZ9SsK8RCHk= X-Google-Smtp-Source: AGHT+IH4urPQ6j+xa/HuI9tGhGaIO4IdTUEaZsjK099SMnteGDVmWKgkI9WZGwDiutNH4K+I8urtaA== X-Received: by 2002:a05:6a00:4ba6:b0:706:61d5:2792 with SMTP id d2e1a72fcca58-7066e52a5bfmr8524764b3a.8.1719400011404; Wed, 26 Jun 2024 04:06:51 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-7067d11a437sm6020153b3a.118.2024.06.26.04.06.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:06:50 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:25 +0900 Subject: [PATCH 02/14] hw/ide: Free macio-ide IRQs MIME-Version: 1.0 Message-Id: <20240626-san-v1-2-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::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-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- hw/ide/macio.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/ide/macio.c b/hw/ide/macio.c index aca90d04f0e8..d8fbc1a17ba6 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -464,6 +464,14 @@ static void macio_ide_initfn(Object *obj) qdev_prop_allow_set_link_before_realize, 0); } +static void macio_ide_finalize(Object *obj) +{ + MACIOIDEState *s = MACIO_IDE(obj); + + qemu_free_irq(s->dma_irq); + qemu_free_irq(s->ide_irq); +} + static Property macio_ide_properties[] = { DEFINE_PROP_UINT32("channel", MACIOIDEState, channel, 0), DEFINE_PROP_UINT32("addr", MACIOIDEState, addr, -1), @@ -486,6 +494,7 @@ static const TypeInfo macio_ide_type_info = { .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(MACIOIDEState), .instance_init = macio_ide_initfn, + .instance_finalize = macio_ide_finalize, .class_init = macio_ide_class_init, }; From patchwork Wed Jun 26 11:06:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=PPauVM+U; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8JpT6STjz20X1 for ; Wed, 26 Jun 2024 21:08:17 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQUU-0005YY-1I; Wed, 26 Jun 2024 07:07:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMQUO-0005OR-7M for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:00 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQUM-0004gR-Lg for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:06:59 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1fa07e4f44eso36444285ad.2 for ; Wed, 26 Jun 2024 04:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400017; x=1720004817; 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=NdtXuYtoYpM+68cWqs8hQd4tffE/iSVor/TSMG9jMpE=; b=PPauVM+UgMUALgAr2fPV8PkAPs0l5wP4h749VNITr2FVNnIZj9Vjp9bDeD5Enqgi1e zKzqgow6MU7nCBGtWauC0qWWuCCNbC4EaAAJQpCLy3P4Rplcfn+h5KWDU46JbmJfG5JC HJHjNXi26vgwn0ryQpxYpnFNnZVA0ndESeppXClx8QKUqRk1h2n/FUM1SeiUAKSYk3IL 1ORmS4qWGyTolpD7fUc79OP7QiWEPsFG9stszDntRN8lVHu5kjYpIpAvkuVNXJCAKHmK ABGk4R5CH4QR4ZIIcFd1aFBDiucay75pDnt8t70Ft7+yhjCjiy5SAQZrbhFU2Gi/emDR JITw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400017; x=1720004817; 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=NdtXuYtoYpM+68cWqs8hQd4tffE/iSVor/TSMG9jMpE=; b=rnghK5dfvq6BvTz35M0rMa8tANKd5btvR7ekv6BR5Mzwjw26EKorA7LgS/16gtfYWt +QRmIdlXt3rHU8ssBT6SeZ6KzUHDL/vIXOaPZPCUCl7QdGXi46w5mqFygqry1CZDA4Nb 0r2c9ZsbhH0Q9JvlTPl4QasDZUSyqObLWM+slGi5P1QzyBAXXTbcBp5sPbaXq9T9sDCw wJQnzOVkRs8CvlZp1fq2AwdVyMDijd4xV340J+STJc/+2NamQA9plw7NnhER5XkPgRKn zJVpiuberaY0SD9P4ZXRAHt8piI3Fs37OAGy0DSaJlG57ZSeKHdGu9VaLLPSSGM3OixW NCug== X-Forwarded-Encrypted: i=1; AJvYcCXNX69eAZhAhNpwZC3BEmiaa+2RcYxVjA/xC2uz4eA2o/2TBO/li/4QZ4fie3uLX9zEQmg4U1OICGzF99NkS3iFjkPY X-Gm-Message-State: AOJu0Yy1GNwO0/9Fr4HUCNROiCDRFRGOJVsEtISm1hA+X4sXoAuGHQs5 1ijzt+WXLoecJzJ0mFatcVjqWwxGYo05oRo/A9OUWzlVGwo01VClTN/RCIige04= X-Google-Smtp-Source: AGHT+IFg1T+vqFnUee178oY9EUIeMhokug+RTUydh6dLIMpcg1X+lIRMwce+VWX5z7BcMoNNVng/8A== X-Received: by 2002:a17:902:ea01:b0:1f7:3a5b:2f0 with SMTP id d9443c01a7336-1fa23ef7803mr126640085ad.44.1719400017213; Wed, 26 Jun 2024 04:06:57 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1fa2ac93ad8sm62979925ad.266.2024.06.26.04.06.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:06:56 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:26 +0900 Subject: [PATCH 03/14] hw/isa/vt82c686: Free irqs MIME-Version: 1.0 Message-Id: <20240626-san-v1-3-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::62c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- hw/isa/vt82c686.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 8582ac0322eb..189b487f1d22 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -721,7 +721,6 @@ static void via_isa_realize(PCIDevice *d, Error **errp) qdev_init_gpio_out(dev, &s->cpu_intr, 1); qdev_init_gpio_in_named(dev, via_isa_pirq, "pirq", PCI_NUM_PINS); - isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1); isa_bus = isa_bus_new(dev, pci_address_space(d), pci_address_space_io(d), errp); @@ -729,7 +728,9 @@ static void via_isa_realize(PCIDevice *d, Error **errp) return; } + isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1); s->isa_irqs_in = i8259_init(isa_bus, *isa_irq); + qemu_free_irqs(isa_irq, 1); isa_bus_register_input_irqs(isa_bus, s->isa_irqs_in); i8254_pit_init(isa_bus, 0x40, 0, NULL); i8257_dma_init(OBJECT(d), isa_bus, 0); From patchwork Wed Jun 26 11:06:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=NdMvlcJV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jq71S3qz20X1 for ; Wed, 26 Jun 2024 21:08:51 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQUW-0005bF-Gb; Wed, 26 Jun 2024 07:07:08 -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 1sMQUU-0005aZ-Ul for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:06 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQUT-0004iL-Dq for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:06 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-7180308e90bso3298529a12.1 for ; Wed, 26 Jun 2024 04:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400023; x=1720004823; 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=hHflsNUlf0krU4+kDJRTbEl0rU+aWlAR1DnSBXEnGRI=; b=NdMvlcJVHT9c5bfKIGnRRZ/o7s+orbVtxInFdJmZfajwgiw8VKY6eamj6EbmjaWc9S Kypw4dmL0K24sW8m4zY7ydRTQ27Idpxc916/c5JuHv0JDgqeXlqZDgtYT0/F9SeBRhEy FzafFa1cN4Y4iU3kFz2PlN/PMR8Z/57dkBCbfAFEM/knKr7yklC267j/4AK7krmdN2hD b3X7dPIJygXDFB0dHyz9WAkWGT6y9pNmeOskQl2VVJBIsAuPfMjiWClZip4O/eBZvU1a BTlF8D3/f4f7Pxf/Hzeph6PlozPTx1sfuphnxOeXSf0vVQ9F3FGeCL99xzXPtmiGHU48 fNdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400023; x=1720004823; 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=hHflsNUlf0krU4+kDJRTbEl0rU+aWlAR1DnSBXEnGRI=; b=gKS6vayYEO5emIL7cGwoD6OLH24oqfEa7xsqnAlrRDagr9lbp+MQsgnBaUlZv64FYd Ze+gcGO+1x3ixyxxoyQLzugyD5m8Av894fsXeQp2z0YWM/vZASuxKBIVAwYknjQ2EKQl roUX+jZ+aoMSezW8lgoBCFt/4Tu8YojExKuVjLm76CHAGuIqExd4D/7AYgThSqX/nu6T eUfHux1NYw43TP2gn+lumEhU10vay0OJBKGd9Kmh6riG6xLid4vQoff29vrp8kl/xTPE 342Luq6cHfE/MTxDIsUG1MKEVEohLq8YDvW6IcDGfCpgeaZVcxSH08205klnd3b1G5SZ b1og== X-Forwarded-Encrypted: i=1; AJvYcCVrx9e1KNGNTiVX2wQIaOhXowRs1Oh6d/R2+sBOzFaf4soFrM7LAPTHvdn5curxd+yPztemPt8uSD84v23RLaa0qvOn X-Gm-Message-State: AOJu0YykSWs19DCQaF48WZib5Gw3XRLVxCKZi30AZsNQD25g4QWfVt07 CJ15B96xByJflx++5ckA2nEMXXkWNxqP7rrh6mIi8RkIT0pF9SDoNp/B2LvHooI= X-Google-Smtp-Source: AGHT+IEVt4in5VKGiMWbgfza8PvhkVGfPJcperKBRoRNL31xxHf2zwlIVtjISGk/ZZcjgSQh3kkVXw== X-Received: by 2002:a17:90a:f190:b0:2c8:a8e:c1cd with SMTP id 98e67ed59e1d1-2c86124b458mr9135582a91.11.1719400023087; Wed, 26 Jun 2024 04:07:03 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2c8d81d2f15sm1371829a91.55.2024.06.26.04.06.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:02 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:27 +0900 Subject: [PATCH 04/14] spapr: Free stdout path MIME-Version: 1.0 Message-Id: <20240626-san-v1-4-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::52a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x52a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/spapr_vof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_vof.c b/hw/ppc/spapr_vof.c index 09f29be0b9de..c02eaacfed0b 100644 --- a/hw/ppc/spapr_vof.c +++ b/hw/ppc/spapr_vof.c @@ -28,7 +28,7 @@ target_ulong spapr_h_vof_client(PowerPCCPU *cpu, SpaprMachineState *spapr, void spapr_vof_client_dt_finalize(SpaprMachineState *spapr, void *fdt) { - char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus); + g_autofree char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus); vof_build_dt(fdt, spapr->vof); From patchwork Wed Jun 26 11:06:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952524 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=SJeHWumu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8JpF6D23z20X1 for ; Wed, 26 Jun 2024 21:08:05 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQV1-00060P-6l; Wed, 26 Jun 2024 07:07:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMQUb-0005my-Td for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:15 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQUa-0004jC-Aj for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:13 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-706a4a04891so780213b3a.3 for ; Wed, 26 Jun 2024 04:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400029; x=1720004829; 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=SJeHWumu0ADDAZqcqWySPr/apWvWYfN1p/9LGJNIguUIu6/3O45VqtGvkrkwMR7F67 MJDq00f5BYKOehSaJ0aGAcXjSqI3pYDBEFCeLu8gNn+iJqep/WQUH4RBs65Oa/ypIPbJ Z4u5NYh9i71DUVT1q+GpbRLXOKDaB1KAoIEuiGDGCfbTaVlYnisGX2l1VSDfuHpThRZs H6SPPhhjpifmbTZMV5BTEMyFIzLHmnG8q35N7JjelQYcCoxD/F2ReCxGEF8B8K9o3Cqh 0vWeepOmpZdvM8YWMGPkU4fnH3puK5DgvC+igwO5zm1ECh0J0diXzgjxC2MDnosrLKvs j0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400029; x=1720004829; 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=Tt2Tf/TQafbZIFeov15doncrdzhgtWW7Mxe5Q8hHbQybkt26JjYYRAKOZ5AiyGQA+m p7NDnLb8RvtheRkgQwfFvJGcnQJNzFErc3p8enGQqWUFIJ+rjBPbVI8SVgxGZOFy+hWO mEhDBUKQuRhwXC1IMJea3cT/obOuw61ZsI2HQ8qysv0Y4179N59QR1cCCegEiMsza601 GWAmhMk2CtFfDDMoxr8m4XC1mK7jctcQ5oDHx8Hlm/Q4vge9HWBeci1z4usibHqp36c0 MhrzInqLQZLjP/wx3r2ExCDA/4lzpKfJwBGR0bxp6rSzuAZm8+I1Piket/k5xTLwzeKa nnCQ== X-Forwarded-Encrypted: i=1; AJvYcCUUKW4ZKRX5tel/yOnglXKLlY4LbDQcF3cR3XPeK+5rRpyq3WbiorKQlxzNV32m7RpmoQ4IyjJr5xTNdsWbOzmovqAX X-Gm-Message-State: AOJu0YxjENNootv3SrkpFJ/pOVRQ9nzrNUpjpHz+hS8vfKC3LRQ5QieB 5/i6sJefph6siwLg3T6GCy+JgdblP1cQNG3ekIR14ue2cOygpaa0UdUGDUmryLE= X-Google-Smtp-Source: AGHT+IF3Dc+m0QChTJ3J+oL5hbq9A7fYtNIurG9m8CclKzIjtqkWKlYcuGP9lQhN+pnh+ee0yqYcZQ== X-Received: by 2002:a05:6a00:2b8:b0:6ec:da6c:fc2d with SMTP id d2e1a72fcca58-70670fd4341mr8138448b3a.23.1719400029011; Wed, 26 Jun 2024 04:07:09 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-706953ca94dsm3374624b3a.199.2024.06.26.04.07.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:08 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:28 +0900 Subject: [PATCH 05/14] ppc/vof: Fix unaligned FDT property access MIME-Version: 1.0 Message-Id: <20240626-san-v1-5-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::433; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x433.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org FDT properties are aligned by 4 bytes, not 8 bytes. Signed-off-by: Akihiko Odaki --- hw/ppc/vof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c index e3b430a81f4f..b5b6514d79fc 100644 --- a/hw/ppc/vof.c +++ b/hw/ppc/vof.c @@ -646,7 +646,7 @@ static void vof_dt_memory_available(void *fdt, GArray *claimed, uint64_t base) mem0_reg = fdt_getprop(fdt, offset, "reg", &proplen); g_assert(mem0_reg && proplen == sizeof(uint32_t) * (ac + sc)); if (sc == 2) { - mem0_end = be64_to_cpu(*(uint64_t *)(mem0_reg + sizeof(uint32_t) * ac)); + mem0_end = ldq_be_p(mem0_reg + sizeof(uint32_t) * ac); } else { mem0_end = be32_to_cpu(*(uint32_t *)(mem0_reg + sizeof(uint32_t) * ac)); } From patchwork Wed Jun 26 11:06:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952527 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=Kasg5Bb6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8JpZ4qFhz20X1 for ; Wed, 26 Jun 2024 21:08:22 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQV3-00065O-OW; Wed, 26 Jun 2024 07:07:41 -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 1sMQUu-0005vh-M4 for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:33 -0400 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQUe-0004k4-94 for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:31 -0400 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-5b97a9a9b4bso3065103eaf.0 for ; Wed, 26 Jun 2024 04:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400035; x=1720004835; 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=9ZmBpokay/lsP22q1IUevpTwDSp5jcANCIzAYF/y6M8=; b=Kasg5Bb6Tt1MkaOqRSR7GYkmqClZjSFA1Ek09+duFTpFHx8U/caOqF3wwwDCHi8Cs6 MvaXjdmCZvQxjkJYrcpMIKAt55JWqv8oiaL0ZMXyZe+hUm+F5jCHPKk5flUDlBcLivSW af1/socvMxka6Es9Smlf6QBhQog53apInvYwoGj96q4gLIEXAGBClT0r2jc3LcW0kH5k r4R03sL57xjHxPjRRPTz4sklJYVS7Rvb7ih8YnDw8yHIBKQJmD1/7Z3XqgcbfdWnMnQY IDO7nKvObSJzw8s9irW7dVvNRKNrqQWqmQpm7rbQlaAd6bQoZ94sk80fYzMRpy3X1JuV /x+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400035; x=1720004835; 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=9ZmBpokay/lsP22q1IUevpTwDSp5jcANCIzAYF/y6M8=; b=W4RrRoAiFI0bcMHD9W7dXsk4wRN9z+xdeoXx8Zbs6W+zFm/QJSXfSEE4/m9FOK4QOB RgsB3uinHmYZm5taWyYwzkjGo0L7PDNA4O/HY9EnVcQqfuZJ1d6++qNRiI21tPP5+98H DNdHlgDXL9n+GKxnpm0Qr5qJb3wktKlUdm9qrgwKEbQeAnVEhFva10IeySeSbj9hJFje AdgbtbjAzat6HsKkPiQqb13SgIjz/tnxQFn1LD0SwwaCruV1DCzIA2rsrJIPrxodpwg7 6ODMH5XN7eWwsyF3PBp/Lu6jcOkxdeFo2XoiP11jbsp61zY35F3JZzWVekUeFP3CikSn hZKw== X-Forwarded-Encrypted: i=1; AJvYcCXyLYxKzPohcHX7B0LPNr/XOAuIf4wVKxAykLq7KvPwDmwz71pv4kkcWoTKhVaIM62xxTUd7GVgzUTqLRoNEx47auTV X-Gm-Message-State: AOJu0Yw7sUX/DFf49p9iNx5vMQaIue3pblbODvKQa3jM7Y4y220QIV+m zUlvvTlOFeZH7htkRA/py/o+LBb2FT3HQ4OvgpPL9sJhOfx+GcDPEOWYJ3I9IKM= X-Google-Smtp-Source: AGHT+IGr7mhUQc/kwzoC2SIj/Sh4EbH/tfTc7GcCgH2CK8pzXdS0VBUK4r8QMhdZTjnrV0Z6lwmRkw== X-Received: by 2002:a05:6358:2824:b0:1a1:cb05:243c with SMTP id e5c5f4694b2df-1a23c1b2289mr1333891255d.25.1719400034980; Wed, 26 Jun 2024 04:07:14 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-71e1314dc83sm4678927a12.56.2024.06.26.04.07.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:14 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:29 +0900 Subject: [PATCH 06/14] hw/virtio: Free vqs before vhost_dev_cleanup() MIME-Version: 1.0 Message-Id: <20240626-san-v1-6-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::c29; envelope-from=akihiko.odaki@daynix.com; helo=mail-oo1-xc29.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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- hw/virtio/vhost-user-base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/vhost-user-base.c b/hw/virtio/vhost-user-base.c index a83167191ee6..124ef536206f 100644 --- a/hw/virtio/vhost-user-base.c +++ b/hw/virtio/vhost-user-base.c @@ -223,6 +223,7 @@ static void vub_disconnect(DeviceState *dev) { VirtIODevice *vdev = VIRTIO_DEVICE(dev); VHostUserBase *vub = VHOST_USER_BASE(vdev); + struct vhost_virtqueue *vhost_vqs = vub->vhost_dev.vqs; if (!vub->connected) { return; @@ -231,6 +232,7 @@ static void vub_disconnect(DeviceState *dev) vub_stop(vdev); vhost_dev_cleanup(&vub->vhost_dev); + g_free(vhost_vqs); /* Re-instate the event handler for new connections */ qemu_chr_fe_set_handlers(&vub->chardev, From patchwork Wed Jun 26 11:06:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=yhKuopH7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jqj1MHpz20X6 for ; Wed, 26 Jun 2024 21:09:21 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQV4-0006As-FO; Wed, 26 Jun 2024 07:07:42 -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 1sMQUz-0005xu-Hu for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:39 -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 1sMQUq-0004kz-93 for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:32 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1fa9f540f45so969265ad.1 for ; Wed, 26 Jun 2024 04:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400041; x=1720004841; 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=mUrmTt8+oFrzMkNkVkHTZpmYshFavrmG3OzzHBupQWA=; b=yhKuopH7NajgdB0EjwxQaCBPu3qyb8EajO8IOqVMA6b2IIfReFhhTQOX6rNEBjmjrO g32wB5dliPrTZrS5oH9auxe7pq69dWt1SiDhwjSB6cZL3d1bZW7iySCxIKTttBK20iNI EZQPHIomKhE/vWiM9yRUGOzKZVmG32bKxj2Dg4kWL7TMPkfvxnlrp0kYnusIKHoWgPeI JrVU2lwhN9BsrfKEtySQf7NHRF7+NIu1uSFrNvn8IdKcD4UKBzyrYzaGL6KYoHEDMF5X 9fZzRPO6fnBXXol4xQjO5Ny7ZVZ1IKDjAQHPo7+jVsntMAniafzvUS7Ctyg/6ltGzAD8 LEoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400041; x=1720004841; 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=mUrmTt8+oFrzMkNkVkHTZpmYshFavrmG3OzzHBupQWA=; b=cVqr2kTQwbeKIkiy8MmJSiVK+dB+Z74ZucX/lQ5tm2ASnyp2N+G9kL1uSVnmqK3BH8 bajbrAr4RiBOdXM5HXN0CGpdqsj/OF59nzgSzWaKTJupTExqoZuwaeVuanHp8qQEYXGT 4O6Ul+E0YuNhVRs89hAp0RJRkKb4FyapWQtaulfQ3gncMuE/kSdDXki0JJ0LFAFTcOFL WMemQno16Cg0Lq4AfzETsifQhJQ4wxQP5vJVwUqFLU/f2xp3Rlzh1i36TZWQXF3MfJ6K 3z1jV/lS0iuiLw070RhNj8qdnwxwGMSFDuUOG/U8XNKmedXnQWAcMIQWQyhAgYdP2fpz TAdQ== X-Forwarded-Encrypted: i=1; AJvYcCVjSwv/K0SN+0g1pXDfPpX4RLZaEZSmXp1iZhbqXQxCjWp1ekUwBJPRvUxIE8xebnNbIjUd4xG51tSmy/R1yEAoyWDu X-Gm-Message-State: AOJu0Yy+CHm7yk0kHH3CMdK/aFvHTA5+gIA72m1dBWbqmB8i7wFSx4KI K0OYln65txwQ7wzpifoje8qzqJX6npt4mKtjfXClhC5Cz5v3beIknvbcWX57RBU= X-Google-Smtp-Source: AGHT+IE4qbHI1diVoBe9v5IequM5ti+nRE8x43HfaWZexsEG4+NNwDbERwgbGUr7DxNcZjxO9MjDLw== X-Received: by 2002:a17:90a:8c91:b0:2c8:538d:95b7 with SMTP id 98e67ed59e1d1-2c8538d9832mr8818555a91.32.1719400040964; Wed, 26 Jun 2024 04:07:20 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2c8d8061497sm1380082a91.34.2024.06.26.04.07.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:20 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:30 +0900 Subject: [PATCH 07/14] migration: Free removed SaveStateEntry MIME-Version: 1.0 Message-Id: <20240626-san-v1-7-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::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-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Xu --- migration/savevm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index c621f2359ba3..10b261823b7c 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -874,6 +874,8 @@ int vmstate_replace_hack_for_ppc(VMStateIf *obj, int instance_id, if (se) { savevm_state_handler_remove(se); + g_free(se->compat); + g_free(se); } return vmstate_register(obj, instance_id, vmsd, opaque); } From patchwork Wed Jun 26 11:06:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=PJKT2esg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jq24MPkz20X6 for ; Wed, 26 Jun 2024 21:08:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQV8-0006Vz-1t; Wed, 26 Jun 2024 07:07:46 -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 1sMQUw-0005wj-1L for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:35 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQUr-0004ok-HK for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:33 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1f9c6e59d34so54189915ad.2 for ; Wed, 26 Jun 2024 04:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400047; x=1720004847; 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=iVExPEERs03d8J7JOBkBCKVU3MF1YFO5OIPVbHq+rGo=; b=PJKT2esgUPOSw4PI1EviJa7jzgkEzKz8wr71MnZDp2IK/jlrk+dCS3nlm0ms4jHOvp qzYXEEUc/MZ24ig7zqKsLZJVV30vCxYafjzoGSuq2+a4Tec4G4ex8Y+Z8azB7MCfXh8a 92ws+Sy1yHDe/bRz3IqbfEw06HO3nO0AsUrsbFIBr9ho2nQmfZ3Rd22oICkkUCD2luW8 dhHBOzk2whFQcRUJC7nkbTQzPB7J0iQrvoq3tF4d2n8RHO3HMI7RKEBDwwChLpBG4uxy +Z/i0nJ3TlyXNRyD/5+B4efdhXeoW4iHTC4pjsG7rg9OF7PP+LSRcjZlVxw+AmXmhedH kZ4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400047; x=1720004847; 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=iVExPEERs03d8J7JOBkBCKVU3MF1YFO5OIPVbHq+rGo=; b=mKf6yluTEMXHePfHM2HWiVELq7CYjHbtdSE+IL4zLPPQsjiPb29z20tdwQq1mRSrHQ pkXFdAfNvZ1WQVvBU91SrujzRqbAyB1CiNkyCkfS2oRqMiHJfkExMxcM43KIPWYCbGM3 e0vxLbTpZxbzLayvYeElzrDEeNiqtxN3UqmKuUZvAnPhgku5Q8ee7FmidnCw0Jb/9fBG Ih6MpRMMiTykP3Wet1b8C48V4xCOWFpCSbeI0baOAzfFdyKg5UFJ9WmLScs1WqEl/HqE Y7Keg17qRJOw5GLBbfWiZ8alDeEE0Xv/A7rH/diCgdWH9tMD8/GOlHijjlx1vVcKIsSt NgVA== X-Forwarded-Encrypted: i=1; AJvYcCW5F1zv6NiRVUt8Lscn87+qlEjTCVInyb7P/4JcO7Wuh0LuXoGsZDb5rKUj/moJ4gRYv2Xxt3kLyJxjaIBcIK9u92tv X-Gm-Message-State: AOJu0Yw2L33eglNHT9P36jvEcE3s4zM9V/V2f+IUkH0IZaAUAG2x2LBG lEIkMPEFrf+OODUDWbxD9utLqIQc4ZWY03RwLLUlnICdZdwl5NCUWQfu0KASPAg= X-Google-Smtp-Source: AGHT+IFHZSiES9BZEEPk+NXe29hftgQvC9L7D5dfAK7MIvE4y2e9kzrX+7AOJKzd50WKmiX8oIWT7Q== X-Received: by 2002:a17:90b:1d89:b0:2c7:9b9a:7619 with SMTP id 98e67ed59e1d1-2c858275bd3mr9505817a91.32.1719400046756; Wed, 26 Jun 2024 04:07:26 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2c8e3d5c212sm658497a91.39.2024.06.26.04.07.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:26 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:31 +0900 Subject: [PATCH 08/14] memory: Do not create circular reference with subregion MIME-Version: 1.0 Message-Id: <20240626-san-v1-8-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::629; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x629.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org A memory region does not use their own reference counters, but instead piggybacks on another QOM object, "owner" (unless the owner is not the memory region itself). When creating a subregion, a new reference to the owner of the container must be created. However, if the subregion is owned by the same QOM object, this result in a self-reference, and make the owner immortal. Avoid such a self-reference. Signed-off-by: Akihiko Odaki --- system/memory.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/system/memory.c b/system/memory.c index 9540caa8a1f4..6645da02c658 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2638,7 +2638,10 @@ static void memory_region_update_container_subregions(MemoryRegion *subregion) memory_region_transaction_begin(); - memory_region_ref(subregion); + if (mr->owner != subregion->owner) { + memory_region_ref(subregion); + } + QTAILQ_FOREACH(other, &mr->subregions, subregions_link) { if (subregion->priority >= other->priority) { QTAILQ_INSERT_BEFORE(other, subregion, subregions_link); @@ -2696,7 +2699,11 @@ void memory_region_del_subregion(MemoryRegion *mr, assert(alias->mapped_via_alias >= 0); } QTAILQ_REMOVE(&mr->subregions, subregion, subregions_link); - memory_region_unref(subregion); + + if (mr->owner != subregion->owner) { + memory_region_unref(subregion); + } + memory_region_update_pending |= mr->enabled && subregion->enabled; memory_region_transaction_commit(); } From patchwork Wed Jun 26 11:06:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=RaX/RR0R; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8JqC1TCMz20X1 for ; Wed, 26 Jun 2024 21:08:55 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQV5-0006It-Qy; Wed, 26 Jun 2024 07:07:43 -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 1sMQV1-0005zn-U5 for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:41 -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 1sMQUy-0004rU-CT for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:38 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-717f17d7c63so3600641a12.0 for ; Wed, 26 Jun 2024 04:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400052; x=1720004852; 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=RaX/RR0RVcL47N6gFfw+ZCUD20pZ5aYjajuvAQCLLup4OzYcfm7ziRV6vXpR4yL0EI DsM2KzHyFrpfpHHPAV6/5XgUUbciw6PhXKEJn1pe5nfVoFthpw0mfM9mPJxq1NDZhM51 a4yMRmyZ3wfIp1AIW/S0KBl8AdlZXoQrLVrPFsA6jcjhHQc1bnP0Urqc2/vdi+eOAQ9C D/iZQa2/+3wT+49Hpk87Q7iiSb+yRws9X7xDQBMqv2XS5WOsBQJRl2Z+3tdGwxo0jsKO xNESN9n5BeCJ8Gv7E6zZ8yLgIM1E1Qmuk4N94bUSfEqQRW3JBmlK8tPY5FCK0m62941Y gjag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400052; x=1720004852; 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=owtA3Sgu69f3HT2sRVFDEXTZqzVGCX/lK1pIYzVpEsAadD2YG0pOBdQEtLxhWsbxNN UlRc7qMLn7okiKbp9TNHEuAiAUlKkT0Cg8gd++A+WYbwl0GHzZlFFdQBpIpl5u+SYX25 1qo+kG1gie+SpjxGmiNovvcCIyOMS2znTE/MBesbn1VdZCZOynI4amn3z70QTJl7Rj8r UDEvmoyznZooGr7GXUpRwOSNWx/4LUZLcfX4TcQOBRTeS6ea3/oQ3UjzzAY8CTfd7U1W VXOFQZ5jZJgvygZ+5PwSHIwBArqJKQiDPEZznql/ollqYe4sOA6q3TRen1mywVr246do ME1g== X-Forwarded-Encrypted: i=1; AJvYcCWiS5bHdfSkNJ1E5kEFJwjcS+/d9iDR4lFE/km8WZdhuKqO6G61TlZeISyPBd5N3zE684VzXXM6g0ioz+Kuo9ork+Nj X-Gm-Message-State: AOJu0Yx7ByP5PQ7z2uZsdveNJFNRBqZGbI1O4SQgE6aulylwQoYi4O1M fhhY0WFZHIv6hFrgUwDo2WUU91MfgPrXZI2sZNebHDKxFlTUYnY0LL3j4GfzdTg= X-Google-Smtp-Source: AGHT+IGNy/dg4U98Mw6L58Fmy/xCAk1HTRjbu/c/K6qeFGwdBgIn6n/Pydp7aNAArHz0d6fsSKBO2g== X-Received: by 2002:a17:90a:c28c:b0:2c7:cf90:bd13 with SMTP id 98e67ed59e1d1-2c8613d2058mr8807637a91.26.1719400052622; Wed, 26 Jun 2024 04:07:32 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2c8d81d2a9dsm1370410a91.54.2024.06.26.04.07.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:32 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:32 +0900 Subject: [PATCH 09/14] tests/qtest: Use qtest_add_data_func_full() MIME-Version: 1.0 Message-Id: <20240626-san-v1-9-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::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-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org A test function may not be executed depending on the test command line so it is wrong to free data with a test function. Use qtest_add_data_func_full() to register a function to free data. Signed-off-by: Akihiko Odaki --- tests/qtest/device-introspect-test.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c index 5b0ffe43f5f4..587da59623dc 100644 --- a/tests/qtest/device-introspect-test.c +++ b/tests/qtest/device-introspect-test.c @@ -266,7 +266,6 @@ static void test_device_intro_concrete(const void *args) qobject_unref(types); qtest_quit(qts); - g_free((void *)args); } static void test_abstract_interfaces(void) @@ -310,12 +309,12 @@ static void add_machine_test_case(const char *mname) path = g_strdup_printf("device/introspect/concrete/defaults/%s", mname); args = g_strdup_printf("-M %s", mname); - qtest_add_data_func(path, args, test_device_intro_concrete); + qtest_add_data_func_full(path, args, test_device_intro_concrete, g_free); g_free(path); path = g_strdup_printf("device/introspect/concrete/nodefaults/%s", mname); args = g_strdup_printf("-nodefaults -M %s", mname); - qtest_add_data_func(path, args, test_device_intro_concrete); + qtest_add_data_func_full(path, args, test_device_intro_concrete, g_free); g_free(path); } @@ -330,7 +329,7 @@ int main(int argc, char **argv) qtest_add_func("device/introspect/abstract-interfaces", test_abstract_interfaces); if (g_test_quick()) { qtest_add_data_func("device/introspect/concrete/defaults/none", - g_strdup(common_args), test_device_intro_concrete); + common_args, test_device_intro_concrete); } else { qtest_cb_for_every_machine(add_machine_test_case, true); } From patchwork Wed Jun 26 11:06:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=l9ztF6Ac; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jqh6M2cz20X1 for ; Wed, 26 Jun 2024 21:09:20 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQV8-0006ad-ML; Wed, 26 Jun 2024 07:07:46 -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 1sMQV3-00064I-KL for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:41 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQV2-0004tz-1P for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:41 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2c80637d8adso4449632a91.0 for ; Wed, 26 Jun 2024 04:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400058; x=1720004858; 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=JjfUQuEae0R8cdwKe9GcIhsbAslV8NkVY8L54kIHCMI=; b=l9ztF6AcLQSVChSCqqJTVVqo7+jKpUWgnPMiUxZpvHikcOUFocHhkQwup+YXESG9MO hn11/otHE6WhB7RITSKgzU+HIgFEzkUv+DLSSHH1PPQBypmx1cAHmJRGctXryudyDGDG wFuGDna8q7PNtPjxKJ7JY0wltz8X3vAgNbxlhNSKxRSKf4KgQUPRBl6xVMLrVDaDWaer fviB7UiDYcYX9R5mQIcaB3nS1JYV0g2nOyRmJ+yjpmnDPLBVHhKsuiueGwAiw26G175I H/hwLJBO16/cyReHYHbhwtAikCHbXMZBgJ57LAaqaeoueZp/5Jf1l0iDCV++BmbohVeN KXvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400058; x=1720004858; 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=JjfUQuEae0R8cdwKe9GcIhsbAslV8NkVY8L54kIHCMI=; b=Kuuv3hBeWm5i0N9fJMrRww0Vt5zDalDfyXWk9wa8Rq150mD7nHkk/VAkGW1b+HVq7X 19l8MT1A/jXpsGB55hwwI9j2SUXU1k08F9dQ2uzjbmOGdfkug8qQdkyrw5psLaL0B0l4 TN69MExRXuxQUrHSZHP8N8Wgn1uo/HHNe/xwhdmd1Nefq78dyAuHUTa0wlxbDDRNK7xv u5O2ZbjRmLmt5PatuR0ptV2aRL9y6Nf3/PgLN/lMORsGXEk2yswKT9ZOJFv+/qX2Nk++ dPVCAKmBchC3wjLE6er+2xZO4qU+Hn7TBa1pSQ0qXTbKRfZuefo0yV50jIEyN3gm2Wi4 zS4w== X-Forwarded-Encrypted: i=1; AJvYcCVKUdSN9pBve4kqnYg541kCzU0qtpACg/XqWxj/4MY/E7MIwAzocSic/VIbzCKvgP0rDyyAOkZ0HKrcgQ2Df8S/fVIW X-Gm-Message-State: AOJu0YzN+IeuKuh0Wsn4ImH7tkmtYbmQfr+fcke0uGnq5+r7aJHPkW7D GkDBY8SYAAqiRK9fAtkAE3WtRcfAHlFtyodL/hAW9ftF57AjSos2YzMYb+mr7lDVcvY+zBq77J+ aHoQ= X-Google-Smtp-Source: AGHT+IHIDN4tW4JDc5fTZQZIemw+tavBwEvCkW8YIJ5Fh9l7Zao3bup8RJjQetrfRxOeOkLABmRjvA== X-Received: by 2002:a17:90a:fe0a:b0:2c1:aefa:1e7f with SMTP id 98e67ed59e1d1-2c85819fa27mr8551111a91.3.1719400058416; Wed, 26 Jun 2024 04:07:38 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2c8d8094371sm1377063a91.54.2024.06.26.04.07.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:38 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:33 +0900 Subject: [PATCH 10/14] tests/qtest: Free unused QMP response MIME-Version: 1.0 Message-Id: <20240626-san-v1-10-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::102a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- tests/qtest/libqtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index d8f80d335e74..28683fee28b2 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -743,6 +743,8 @@ QDict *qtest_qmp_receive(QTestState *s) response, s->eventData)) { /* Stash the event for a later consumption */ s->pending_events = g_list_append(s->pending_events, response); + } else { + qobject_unref(response); } } } From patchwork Wed Jun 26 11:06:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=EoPcPHJV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jpr4yWHz20X1 for ; Wed, 26 Jun 2024 21:08:36 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQVB-0006l6-CD; Wed, 26 Jun 2024 07:07: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 1sMQV9-0006d9-Lh for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:47 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQV7-0004vY-RS for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:07:47 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-70670188420so3082283b3a.2 for ; Wed, 26 Jun 2024 04:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400064; x=1720004864; 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=G/iOJJ9D9CGegt9ZDP3YD3xuz4pE7vwllWj27SOZguk=; b=EoPcPHJVhc/enXxpDLynjBEZ13Ft3pNHK41k79SWX//jb+y1wQJ3J7sSMuamI8UOZd XMUGVaC3S0XNiRsF79Cn6EZ3bZSoZSbGv4O2OjjloXYJag1tQzKIgP3BFYGjhMcKDTss DFlXZTpzw1sFXDs/zhCvuuuOmLGAsnZlEOxSluIX8plw+sNVVAP3gbwneBF244qh6f22 BE1TulEoSVEiyXuYD+I77o6jQnsP36/oXokjv8aTwjkW3GWZaPuCjZPwBd9E/Ol1Mmvy q8nUhv/t3fiaR+jQZOUPg2/lfK5n6lR6wHiBzthhZK+QvYJj1E/KbE42iptsc5vXa0Pf wgXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400064; x=1720004864; 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=G/iOJJ9D9CGegt9ZDP3YD3xuz4pE7vwllWj27SOZguk=; b=A7QnskxdjkcU/+pKxIILXHk+/KZX/TbmslqXNDIgSE2457EcYqG00dQSCrBGqHN4Mb ZmCRClhePfMkMGMXgQSaf/yeLPBPtHwzt1khkUb0zZcwkoYTT7pE4BVzcpXoWB0KKW19 OuBmgOqvotp/kMRMhPmiPC4UvzLeTkliyK0GjpTDNwKsUDIdsabZox3F8t/p19AfpTXy kvH7EEetZ3idsSwgYxThxe/n4KGqyLyioS34QbVVRO4gVhh4r14feVyUt/hh1YLKXxxe 57zudVqksk8KAauWJJPcKvMc57ieaXhCrMYwO5pw1be/m10kd6MLCfxOgQrbtflmtqsv yWVA== X-Forwarded-Encrypted: i=1; AJvYcCV+AR1XmeeU0LxIXgSqvhPgkUc4w8C7L9Mj2+PYSbSlCUuuFJGr+sIwuW9WEkFVHqFp1x2NrwgPW+Vy0KX4BLTL7/yl X-Gm-Message-State: AOJu0YwDwGvstkD7aJU6ocsK79qi9g+ntKhP6UJo3imXhIUlzhPEMhvI 2Wte8SXY8jeJCoGmLZhx4J/M1/tNMvhjzhuO7ZZgUYnPBrsqo5NmTy4QgfRovgk= X-Google-Smtp-Source: AGHT+IGZ7q5EdE7Yacjqa7EIZYyiK5wDOincTnN86B+2e41NepYsx4hlo3KnhsM/EmQA310DcZmMlw== X-Received: by 2002:a05:6a00:139f:b0:706:3204:fa4e with SMTP id d2e1a72fcca58-7066cbd0820mr14170890b3a.0.1719400064484; Wed, 26 Jun 2024 04:07:44 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-7065107b425sm9667624b3a.25.2024.06.26.04.07.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:44 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:34 +0900 Subject: [PATCH 11/14] tests/qtest: Free old machine variable name MIME-Version: 1.0 Message-Id: <20240626-san-v1-11-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::430; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x430.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- tests/qtest/libqtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 28683fee28b2..06585104c7af 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1502,6 +1502,7 @@ static struct MachInfo *qtest_get_machines(const char *var) int idx; if (g_strcmp0(qemu_var, var)) { + g_free(qemu_var); qemu_var = g_strdup(var); /* new qemu, clear the cache */ From patchwork Wed Jun 26 11:06:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=MmUcDohB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jpr62f3z20X6 for ; Wed, 26 Jun 2024 21:08:36 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQVS-0007uf-D7; Wed, 26 Jun 2024 07:08:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMQVQ-0007rF-5y for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:08:04 -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 1sMQVF-0004wZ-Sn for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:08:02 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-7066cba4ebbso2765783b3a.3 for ; Wed, 26 Jun 2024 04:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400070; x=1720004870; 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=MmUcDohBTSvlo2NHH7APomDrwVolYb3Z3vp23AkMn2GWrmuomUSlqUufc+wRx5WM12 SA0dhfZESVCBGOlnk87nanuXx3KtgT/8Kz3IAFs7oatxKFArO2oIRPeXlJ2GWDdJCcXn GWsxDNTk+hpiDHnMfnraAiMIG0fLr9nqHdyJsFyI5KNcElqCdHxlK6HWr8S/xjONmZ3m +0JCUMoCZsLQWKpfZEHc5QcdCVMZST0sfk15w43ppTJMFeg/yHFdFeEpcBtlxbZXB73j 5bZeV2/SnqPJUs6a+VadeyaO5pX8ji25Sd/fmLrGDwGXS4+QNRY9sIPgeCeBvuKhkBgU e7DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400070; x=1720004870; 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=Jgx2b54S0nEGFf1YvN4DgtjGrwvTKqUHyM94m0OQ8TnQB6PRflKF/tbwWlHEz2qi4M 9AGBxWDSo0K9Lg3IGgrEabyDgaoI1848FPCVFohuxJ2ICldW/lqVPi9nQNyRWwtlnpe7 XjoMqSP2MBh7fADooBy5vyI278TBi9Md/Bq+e8YrsAmC5bOZ9VyFTAraZXn7Gfs6RPwg 4j6XS2sIlVcqUv12Rmwucfe16LHijKkVEwCn+2BMunPoS69MAxJ4jWE1+x2q79/64YLg A1V/7W5Km/tpIBeP0+XCyednKq2npo3tPAEYIk0dwkpo5IFs0EUdKdsoyPZtHHBCdjHO nTug== X-Forwarded-Encrypted: i=1; AJvYcCUdzH0kz5igSeMp9xmnYtFL8OmJpNoaAUOGk+cYsi+bjQlEraX39L7WwxhD6yOEcmUIAzn6upQkT6L0OpNkvoH1wemI X-Gm-Message-State: AOJu0Yzlx3o45bku9kgIocsBsm5odF+Hd8vqZepow5M2FHeczgYqcK+m 7qcLgdTtNdCP85+ZRCxBj7l2cfB3IBMZLqiSODJ8OknWTr5HOUNHfpR5zZcZKPM= X-Google-Smtp-Source: AGHT+IEtTUgO/yYQ0iY6MlOqVPv57FtOgSJbQp3S4MxOFQ5jPw6w5cGtdccBLo9897IO/nsxIpFxsw== X-Received: by 2002:a05:6a00:22cc:b0:705:ddbf:5c05 with SMTP id d2e1a72fcca58-7066e52a7cbmr12746690b3a.11.1719400070579; Wed, 26 Jun 2024 04:07:50 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-7069d65dfc7sm2664394b3a.133.2024.06.26.04.07.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:50 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:35 +0900 Subject: [PATCH 12/14] tests/qtest: Delete previous boot file MIME-Version: 1.0 Message-Id: <20240626-san-v1-12-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::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-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org A test run may create boot files several times. Delete the previous boot file before creating a new one. Signed-off-by: Akihiko Odaki --- tests/qtest/migration-test.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index b7e3406471a6..5c0d669b6df3 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -129,12 +129,23 @@ static char *bootpath; #include "tests/migration/aarch64/a-b-kernel.h" #include "tests/migration/s390x/a-b-bios.h" +static void bootfile_delete(void) +{ + unlink(bootpath); + g_free(bootpath); + bootpath = NULL; +} + static void bootfile_create(char *dir, bool suspend_me) { const char *arch = qtest_get_arch(); unsigned char *content; size_t len; + if (bootpath) { + bootfile_delete(); + } + bootpath = g_strdup_printf("%s/bootsect", dir); if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { /* the assembled x86 boot sector should be exactly one sector large */ @@ -164,13 +175,6 @@ static void bootfile_create(char *dir, bool suspend_me) fclose(bootfile); } -static void bootfile_delete(void) -{ - unlink(bootpath); - g_free(bootpath); - bootpath = NULL; -} - /* * Wait for some output in the serial output file, * we get an 'A' followed by an endless string of 'B's From patchwork Wed Jun 26 11:06:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=LUsbLGOP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jpj1kXKz20X1 for ; Wed, 26 Jun 2024 21:08:29 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQVS-0007to-2Q; Wed, 26 Jun 2024 07:08:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMQVO-0007p9-7w for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:08:04 -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 1sMQVK-0004xH-Ar for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:08:01 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1fa9f540f45so973625ad.1 for ; Wed, 26 Jun 2024 04:07:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400076; x=1720004876; 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=s88RDAKD9didfyWyFg4xAviSDDkSMw5Wc3QBYXQ76FI=; b=LUsbLGOPiS+R0WPDf5DIWcBlLG8Nv8yDKUOmPoZPyTPknIb+OWqqBPaY3VwwTL2hUa fz2gUe60l0d61yPEuZLy5xntqtSW5zebYreHyA3VYvycN9iFlHbvuLUfynN13Nf0UPHz x7nkaPdOC9hXQJ1ZbZe8V3I/c51mwgZn6BDJF1ifEwo08r5kHT2W/BwjPfhNJ0LXPaCr DWQ6NnKR5IO32xzHwwyluffTx3T9Z7KMU6i/xcWcYahhoPrng0AjCNROVb8S1En5P+6y 63FuwU0zp0GO/m/Y2qu04k45ZR0YjXM/hKJQsoF9UtT41bi0Gw/LP7f0zhaJmWebnAQL 6idg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400076; x=1720004876; 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=s88RDAKD9didfyWyFg4xAviSDDkSMw5Wc3QBYXQ76FI=; b=iQERo29/CiHRmdHv+Pz777EW7KS46VWzS1JmmhoSZeEuYz0F4B0yzYFfD2vVz/+2Bo 8h3kz/eFwwclwiPfo6DnH3zEQMANwYJ4TxmteJKO05ucvjuzU3ho6TMlgootqkdVfLSy Ek41oiK1UuFjDYDTe9CDy4sJDyrht/0x7dzbGXaJrC76heQoI1YPfEpjWRBnT0TiJv0U 3P3MhdWjwyQCY9S+N15bepGyUhXD4kdV/iDUReq+AqnEcEhQiD3NUhqNPZeZJeE2ykPN OtHf7GdCw1w413CYGaOt5eGylpTAQzKKAgH/qlECJiSB6LBd1qWPs1/lx9XlxtPo1pbc ARXw== X-Forwarded-Encrypted: i=1; AJvYcCV9dj5vq833XDk7MYgRmQ9dWkr9A7/MaJNT/Qx91Cl7bU7SBQmcwoJD7i49Ch2+TziMwk+/JGO9fjDIedRJfUADZZ1Y X-Gm-Message-State: AOJu0YwBAHLbI+vhFj7DHFlfw0IqyiBdEzevsfB9SRvin3xPV8qSk/l4 +8FqVnBRkjo0MG875NZ0oGQ3wd5AuZq8IFrWQuJ5o6Q/hmZ+FtcpZ13xIvQMcX0= X-Google-Smtp-Source: AGHT+IHzTI+eaHCjNSlntryxBmmHmKVW9cUOvgNduBxD/9bFh8actwBSuXmkd8m5hlFYe6WlFS33CA== X-Received: by 2002:a17:902:7849:b0:1fa:925b:5b6e with SMTP id d9443c01a7336-1fa925b5e03mr8855945ad.63.1719400076478; Wed, 26 Jun 2024 04:07:56 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1f9eb3c5feesm97761515ad.161.2024.06.26.04.07.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:56 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:36 +0900 Subject: [PATCH 13/14] tests/qtest: Free paths MIME-Version: 1.0 Message-Id: <20240626-san-v1-13-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::62d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org This suppresses LeakSanitizer warnings. Signed-off-by: Akihiko Odaki --- tests/qtest/qos-test.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/qtest/qos-test.c b/tests/qtest/qos-test.c index 5da4091ec32b..114f6bef273a 100644 --- a/tests/qtest/qos-test.c +++ b/tests/qtest/qos-test.c @@ -33,7 +33,6 @@ static char *old_path; - /** * qos_set_machines_devices_available(): sets availability of qgraph * machines and devices. @@ -191,6 +190,12 @@ static void subprocess_run_one_test(const void *arg) g_test_trap_assert_passed(); } +static void destroy_pathv(void *arg) +{ + g_free(((char **)arg)[0]); + g_free(arg); +} + /* * in this function, 2 path will be built: * path_str, a one-string path (ex "pc/i440FX-pcihost/...") @@ -295,10 +300,13 @@ static void walk_path(QOSGraphNode *orig_path, int len) if (path->u.test.subprocess) { gchar *subprocess_path = g_strdup_printf("/%s/%s/subprocess", qtest_get_arch(), path_str); - qtest_add_data_func(path_str, subprocess_path, subprocess_run_one_test); - g_test_add_data_func(subprocess_path, path_vec, run_one_test); + qtest_add_data_func_full(path_str, subprocess_path, + subprocess_run_one_test, g_free); + g_test_add_data_func_full(subprocess_path, path_vec, + run_one_test, destroy_pathv); } else { - qtest_add_data_func(path_str, path_vec, run_one_test); + qtest_add_data_func_full(path_str, path_vec, + run_one_test, destroy_pathv); } g_free(path_str); From patchwork Wed Jun 26 11:06:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 1952530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=svuKajrI; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8Jpl340nz20X1 for ; Wed, 26 Jun 2024 21:08:31 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQVU-0007xq-SH; Wed, 26 Jun 2024 07:08:08 -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 1sMQVS-0007uP-Be for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:08:06 -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 1sMQVQ-0004yL-To for qemu-ppc@nongnu.org; Wed, 26 Jun 2024 07:08:06 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1f480624d0dso55747475ad.1 for ; Wed, 26 Jun 2024 04:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400082; x=1720004882; 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=svuKajrICBMbpHRDD6Ep+SaZjTwKHLAO0Bqv7CkS6cKVFmsvvuS+46J99fTAAX3PFF 8wRfrM2s2b/GIqRFctU/19entEQFvR9m77mZGAHNoa8uQCednOkyH62Gtg6lZwjSOCUZ 4OejJtcLARPbh5cEdD1de5ewH3fMmGlkULrmfo3fNOo0mCtTm5Gb5SaeviyXMR7tXxDF uXj9NaxI4nXJZJF4c/4a6lVloh/JUfY+14oHBEkSl57D2MvzSkwvcgs7co1G1/C23q4s 7o9b9AbZP3bH78OT4c/ifORyxmgbjZDn4HngXPplKaK0RMGuRDuyZSO4nhsVAm/KEptG 4Pug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400082; x=1720004882; 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=YgdprzcH0ThStSIjGa1IgOU3kbEFCJcy20B4mJOkwK5Q2KDOU1CFXzWauCS2HnndIz hcZ4rFZ56myTmeEVA8KWXTAK1Qn0ZKSIlnmfeNYFcWmDnIiBBKLIwGehAobo2+sOu0r4 1yEibz1kz7bEVpbFSy/wOxq6z+Eo5MKMuKhK/Eo04mtA9QLcI9Y9v7m3o9EDnITbHj+y GM2Q+DjIhl1VA2ut5HbKjPzPjTM7h0PbaCe5r80zkg1iCojfUHIWX9mUTiDrTxyyyCMg Hzmx0uJfPfXzShS0yi673OYHanF7gfM34CXz0kLI/HtREQw4KJ+4wDdQvN2dunzIcSc7 s7vQ== X-Forwarded-Encrypted: i=1; AJvYcCXrMUow8kK6g/ZJGDjtrLY+rNr6vqeae2th2s5+ejbMC5nc6D5N3ackmZpnAHqqZKItPC/dlakNwFbQzf9p2C3U/tGW X-Gm-Message-State: AOJu0YySkbeXiG26HASvN8wNntwKYdCxG4euSXRLybgFLrsaPHJCFovI 6D/Q7LNPn5kWyLML56OjHL5szrd27dIzfUF92xsi8AKZEwEVgg28DWP2bBZ1h/o= X-Google-Smtp-Source: AGHT+IHyZ8wV6Rh9xxRMzOoVr9YOmjr6z9m9zTaM5UgBGYRAIuUzpuVy2sbTaigPVbHMmiuBedLaVA== X-Received: by 2002:a17:902:c94d:b0:1fa:80b3:d64d with SMTP id d9443c01a7336-1fa80b3d9edmr33447555ad.31.1719400082459; Wed, 26 Jun 2024 04:08:02 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1f9eb3d5b33sm96978315ad.190.2024.06.26.04.07.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:08:02 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:37 +0900 Subject: [PATCH 14/14] tests/qtest: Free GThread MIME-Version: 1.0 Message-Id: <20240626-san-v1-14-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: none client-ip=2607:f8b0:4864:20::62d; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org These GThreads are never referenced. Signed-off-by: Akihiko Odaki --- tests/qtest/vhost-user-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index d4e437265f66..929af5c183ce 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -928,7 +928,7 @@ static void *vhost_user_test_setup_reconnect(GString *cmd_line, void *arg) { TestServer *s = test_server_new("reconnect", arg); - g_thread_new("connect", connect_thread, s); + g_thread_unref(g_thread_new("connect", connect_thread, s)); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); s->vu_ops->append_opts(s, cmd_line, ",server=on"); @@ -965,7 +965,7 @@ static void *vhost_user_test_setup_connect_fail(GString *cmd_line, void *arg) s->test_fail = true; - g_thread_new("connect", connect_thread, s); + g_thread_unref(g_thread_new("connect", connect_thread, s)); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); s->vu_ops->append_opts(s, cmd_line, ",server=on"); @@ -980,7 +980,7 @@ static void *vhost_user_test_setup_flags_mismatch(GString *cmd_line, void *arg) s->test_flags = TEST_FLAGS_DISCONNECT; - g_thread_new("connect", connect_thread, s); + g_thread_unref(g_thread_new("connect", connect_thread, s)); append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO); s->vu_ops->append_opts(s, cmd_line, ",server=on");