From nobody Sun Oct 19 03:36:29 2025 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1747628836; cv=none; d=zohomail.com; s=zohoarc; b=EyT8WFu4+Q8jv0SMsnkCJose2HnwaBvJNV/JUCYs4RWbRYzR4HhQsEu37PLEzOs343zehECbxSphcqMGID37jVkOFgRiBnOC1klZdcIEsoB63Gc+Se9tIEdYaYh75ZwJPU58puQqi3r+IRTPjB6GS/yMcncdOz0U8XOhnv4/Jak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747628836; 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=6qi58OsTABBr981B/8AZV6yobLaS4vDssxw7naPBl2U=; b=CMlovp4LepjiVCHmSMato+m6rS0m4Wo55akC+HORFaDLQCVeMixOtDZHyj2bMp+yR2vPwHm4DiX6z9Gg05gPj/W88Ja4a/PhnrDbFUqRtymTPg7KbgbvtCdZiOWN3GrNGV+G7SGD8dQoIYmiZymmW5BBZUwzRvwS42EuBsmzqVg= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1747628836479433.4371811861764; Sun, 18 May 2025 21:27:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uGs3L-0000bm-Cq; Mon, 19 May 2025 00:24: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 1uGrnH-00055k-Cf; Mon, 19 May 2025 00:08:04 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uGrnF-0004BT-Ej; Mon, 19 May 2025 00:08:02 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-af908bb32fdso3032599a12.1; Sun, 18 May 2025 21:08:00 -0700 (PDT) Received: from toolbx.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231ecd5ea41sm41750035ad.228.2025.05.18.21.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 May 2025 21:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747627679; x=1748232479; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6qi58OsTABBr981B/8AZV6yobLaS4vDssxw7naPBl2U=; b=F6O7KY7C9mvLbeDWQuHISTwjJAVVEXuF54dh+ghqzGP5kGxZKsbWV0zdbccrSSHdwh XYNobNzp6IMLzn3iHGnawrvlW6rcq2ucIKpdgR8S14rmmXTjjLDc+swYlu2KidPtj1ng DfQgk2U0TBl7V5Yn7TXXzIkyQCXtY6gg9goxo5keFNl1v/xp491v2un1w3rMhxJExXKZ 1Ck5ftpVIxHynit+JfLta1vnD4nFQPINxnf4Q+dC4qdHyuhk58Mvn8UptmEfsVz26Nyt FDENhRZYHyVAVNRko8/fgNWE6KEujLf+niK8Lol7GygAn9AGndSMtoRihw+mm3x5zTjy Xb8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747627679; x=1748232479; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6qi58OsTABBr981B/8AZV6yobLaS4vDssxw7naPBl2U=; b=Z9udmPdRo5y64wBai/Ym6dcY2x23iabt4N9T8uryEnF4UFepP2jinoc39EzJgPE2Kv LXRO8j7ml+qpQW02tZIJfV/KlFAGhWCjVTd+iWA+bVkDbkhWx2JQ9M2rULgXaLbSOq5E 94+ltEbnGE62EbVmVAiqZGz1QfTKWl7qgcfLJx5nXHyATXhh/oJJ1mzDMScdCF4/ie7h gj4tnxPXTITAX02cqmOcU0/w8XrhwYRciEeAiZSuPxEsQJPvrgwPKH/fXpIsfLFC3FZJ xVlwbYakio2f2sDP/NN2bbjHqx8qDWyrKeKbxiIlMlZ3CyKpsYSlfHCSi7Z+v3gPbrhL t9Pw== X-Forwarded-Encrypted: i=1; AJvYcCVXpuiLPIY8qWIANdSQTmmyC2TdFdltLZVtlG09cZ0Pe4UcMMvIJ7rG4ob61xpGOWMUo5LNuBXbMIiNJg==@nongnu.org X-Gm-Message-State: AOJu0YzHMrPpJIxGoFouavMvw2xCqyBWEbT2J7C1mAUDM93oNeZnjNLr KWOB43C7qluhCaciWAyGRZVFZVX5HeMfONYWDhm/zkl/NTT1fZCM4/pmAWsiZA== X-Gm-Gg: ASbGnctM5wXxsFjZ7Tv/u/0D++GfDgH6t6eh6StqC8Vuc3JxJ54fWqWNhnq5ZhNIgs5 0YT34oeXPbSaGNiNdelvgCI+BfpXjEjYfbP8G5Vt0DTlLu36dutDCHZEkGXwAMPBfwRSGP1sKE0 r614sf0XrBvSfxiiEMexR4C8752WXwkhaiJvaMhmfwq/EgjIDjhgnop7lRGwz+zNWyIDuUEhyYK mr4gn8xyU6kanPIbVbAO1u0tyYzugUVsN/tdgNyvteZq++qoI0PqerLm4zvVoZbH/WFTQFkYJUq AuYozWGCQ/Hs5pka7qVk/7YHgsrASpSH3YzR4qn29bNOZf6fdoDBxkKa3ReuyJzPVLjwyCMH9ZR 0xHIRTWikl6cN9+ZUMAhxH4gK9SJURzJUwIAJlnz/zsZZLotCq7vJJeIx X-Google-Smtp-Source: AGHT+IHKmb4D0nfIS1CHukiUDBdgupwm+w1qzLJ7ucRLuKxzcuVW6pNInR8p3PeBQwGpqEb7XLqr5w== X-Received: by 2002:a17:902:c202:b0:231:c89f:4e94 with SMTP id d9443c01a7336-231c89f4f9amr147373365ad.21.1747627678692; Sun, 18 May 2025 21:07:58 -0700 (PDT) From: alistair23@gmail.com X-Google-Original-From: alistair.francis@wdc.com To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Paolo Bonzini , Kohei Tokunaga , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PULL 17/56] hw/riscv: Fix type conflict of GLib function pointers Date: Mon, 19 May 2025 14:05:14 +1000 Message-ID: <20250519040555.3797167-18-alistair.francis@wdc.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250519040555.3797167-1-alistair.francis@wdc.com> References: <20250519040555.3797167-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2607:f8b0:4864:20::531; envelope-from=alistair23@gmail.com; helo=mail-pg1-x531.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1747628837562116600 From: Paolo Bonzini qtest_set_command_cb passed to g_once should match GThreadFunc, which it does not. But using g_once is actually unnecessary, because the function is called by riscv_harts_realize() under the Big QEMU Lock. Reported-by: Kohei Tokunaga Signed-off-by: Paolo Bonzini Reviewed-by: Alistair Francis Reviewed-by: Kohei Tokunaga Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20250410161722.595634-1-pbonzini@redhat.com> Signed-off-by: Alistair Francis Cc: qemu-stable@nongnu.org --- hw/riscv/riscv_hart.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/riscv_hart.c index ac6539bd3e..333083a4f1 100644 --- a/hw/riscv/riscv_hart.c +++ b/hw/riscv/riscv_hart.c @@ -104,8 +104,11 @@ static bool csr_qtest_callback(CharBackend *chr, gchar= **words) =20 static void riscv_cpu_register_csr_qtest_callback(void) { - static GOnce once; - g_once(&once, (GThreadFunc)qtest_set_command_cb, csr_qtest_callback); + static bool first =3D true; + if (first) { + first =3D false; + qtest_set_command_cb(csr_qtest_callback); + } } #endif =20 --=20 2.49.0