From nobody Wed Nov 27 05:47:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1701293228; cv=none; d=zohomail.com; s=zohoarc; b=S845TsAAHOWMmJ0E6HNp1rFOfoF8hnyZJ9gQFBWzs2DBHd02pUxnFl2lA+ez6NqxNp9MAf+QrgEL4tRD+9I95x8z1b7elQOaI8YTHEMxnQ52nelKuKDoiYISnfuMrRNwtzMQfbBtyuY3l92vnN2N5QIGwbe9hHg/PeiORmRUfYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701293228; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xnTMhuYWY4rKexdgAFG5bYrl78FXKUVZK+idLclmJ2E=; b=lyeC7h3Nw6C55yjRNAReQtvWWfsCSy6j3+n1hHfVexrFOPbK3RAMN9jhahAccWdZWAdkmXmaoRWqvq40AhemOPm/DJan6XXrDBDZo+IvsF0mvoKDpOD9YR4o1eGEKg3lA3FVpohcjuw5TdaY8DAedUki+PoELd/MjaWHKjiQG90= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1701293228010882.3187485873738; Wed, 29 Nov 2023 13:27:08 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.644250.1005076 (Exim 4.92) (envelope-from ) id 1r8S56-0000pF-EF; Wed, 29 Nov 2023 21:26:52 +0000 Received: by outflank-mailman (output) from mailman id 644250.1005076; Wed, 29 Nov 2023 21:26:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r8S56-0000op-AK; Wed, 29 Nov 2023 21:26:52 +0000 Received: by outflank-mailman (input) for mailman id 644250; Wed, 29 Nov 2023 21:26:51 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r8S55-00008d-C2 for xen-devel@lists.xenproject.org; Wed, 29 Nov 2023 21:26:51 +0000 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 01b267cf-8efe-11ee-98e4-6d05b1d4d9a1; Wed, 29 Nov 2023 22:26:50 +0100 (CET) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-yAhr-UrSN4qD-XoM_Pt1Aw-1; Wed, 29 Nov 2023 16:26:46 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BBD3F1E441DC; Wed, 29 Nov 2023 21:26:43 +0000 (UTC) Received: from localhost (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C9BA2026D4C; Wed, 29 Nov 2023 21:26:42 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 01b267cf-8efe-11ee-98e4-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701293209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xnTMhuYWY4rKexdgAFG5bYrl78FXKUVZK+idLclmJ2E=; b=BjnmLQapKIUOutu3xmOlymOKKbUvpgx9ZhlujCr6TU2hEpSjYTwkypttx+uYuTHijeIzSs IS/SgmCNzdNLTHiybQ0QmAdk4oo2+xjb2lWVJMumhX4FjANF8rz/gFXhf6adllizLye8Cw DZLhDCjhhdVRSlZPLR/8PLo9llYmlGE= X-MC-Unique: yAhr-UrSN4qD-XoM_Pt1Aw-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Jean-Christophe Dubois , Fabiano Rosas , qemu-s390x@nongnu.org, Song Gao , Marcel Apfelbaum , Thomas Huth , Hyman Huang , Marcelo Tosatti , David Woodhouse , Andrey Smirnov , Peter Maydell , Kevin Wolf , Ilya Leoshkevich , Artyom Tarasenko , Mark Cave-Ayland , Max Filippov , Alistair Francis , Paul Durrant , Jagannathan Raman , Juan Quintela , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-arm@nongnu.org, Jason Wang , Gerd Hoffmann , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , BALATON Zoltan , Daniel Henrique Barboza , Elena Ufimtseva , Aurelien Jarno , Hailiang Zhang , Roman Bolshakov , Huacai Chen , Fam Zheng , Eric Blake , Jiri Slaby , Alexander Graf , Liu Zhiwei , Weiwei Li , Eric Farman , Stafford Horne , David Hildenbrand , Markus Armbruster , Reinoud Zandijk , Palmer Dabbelt , Cameron Esfahani , xen-devel@lists.xenproject.org, Pavel Dovgalyuk , qemu-riscv@nongnu.org, Aleksandar Rikalo , John Snow , Sunil Muthuswamy , Michael Roth , David Gibson , "Michael S. Tsirkin" , Richard Henderson , Bin Meng , Stefano Stabellini , kvm@vger.kernel.org, Stefan Hajnoczi , qemu-block@nongnu.org, Halil Pasic , Peter Xu , Anthony Perard , Harsh Prateek Bora , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eduardo Habkost , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Christian Borntraeger , Akihiko Odaki , Leonardo Bras , Nicholas Piggin , Jiaxun Yang Subject: [PATCH 4/6] system/cpus: rename qemu_global_mutex to qemu_bql Date: Wed, 29 Nov 2023 16:26:23 -0500 Message-ID: <20231129212625.1051502-5-stefanha@redhat.com> In-Reply-To: <20231129212625.1051502-1-stefanha@redhat.com> References: <20231129212625.1051502-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1701293228753000003 Content-Type: text/plain; charset="utf-8" The APIs using qemu_global_mutex now follow the Big QEMU Lock (BQL) nomenclature. It's a little strange that the actual QemuMutex variable that embodies the BQL is called qemu_global_mutex instead of qemu_bql. Rename it for consistency. Signed-off-by: Stefan Hajnoczi Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- system/cpus.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/system/cpus.c b/system/cpus.c index eb24a4db8e..138720a540 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -65,7 +65,7 @@ =20 #endif /* CONFIG_LINUX */ =20 -static QemuMutex qemu_global_mutex; +static QemuMutex qemu_bql; =20 /* * The chosen accelerator is supposed to register this. @@ -389,14 +389,14 @@ void qemu_init_cpu_loop(void) qemu_init_sigbus(); qemu_cond_init(&qemu_cpu_cond); qemu_cond_init(&qemu_pause_cond); - qemu_mutex_init(&qemu_global_mutex); + qemu_mutex_init(&qemu_bql); =20 qemu_thread_get_self(&io_thread); } =20 void run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) { - do_run_on_cpu(cpu, func, data, &qemu_global_mutex); + do_run_on_cpu(cpu, func, data, &qemu_bql); } =20 static void qemu_cpu_stop(CPUState *cpu, bool exit) @@ -428,7 +428,7 @@ void qemu_wait_io_event(CPUState *cpu) slept =3D true; qemu_plugin_vcpu_idle_cb(cpu); } - qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex); + qemu_cond_wait(cpu->halt_cond, &qemu_bql); } if (slept) { qemu_plugin_vcpu_resume_cb(cpu); @@ -502,7 +502,7 @@ void qemu_bql_lock_impl(const char *file, int line) QemuMutexLockFunc bql_lock =3D qatomic_read(&qemu_bql_mutex_lock_func); =20 g_assert(!qemu_bql_locked()); - bql_lock(&qemu_global_mutex, file, line); + bql_lock(&qemu_bql, file, line); set_bql_locked(true); } =20 @@ -510,17 +510,17 @@ void qemu_bql_unlock(void) { g_assert(qemu_bql_locked()); set_bql_locked(false); - qemu_mutex_unlock(&qemu_global_mutex); + qemu_mutex_unlock(&qemu_bql); } =20 void qemu_cond_wait_bql(QemuCond *cond) { - qemu_cond_wait(cond, &qemu_global_mutex); + qemu_cond_wait(cond, &qemu_bql); } =20 void qemu_cond_timedwait_bql(QemuCond *cond, int ms) { - qemu_cond_timedwait(cond, &qemu_global_mutex, ms); + qemu_cond_timedwait(cond, &qemu_bql, ms); } =20 /* signal CPU creation */ @@ -571,7 +571,7 @@ void pause_all_vcpus(void) replay_mutex_unlock(); =20 while (!all_vcpus_paused()) { - qemu_cond_wait(&qemu_pause_cond, &qemu_global_mutex); + qemu_cond_wait(&qemu_pause_cond, &qemu_bql); CPU_FOREACH(cpu) { qemu_cpu_kick(cpu); } @@ -649,7 +649,7 @@ void qemu_init_vcpu(CPUState *cpu) cpus_accel->create_vcpu_thread(cpu); =20 while (!cpu->created) { - qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); + qemu_cond_wait(&qemu_cpu_cond, &qemu_bql); } } =20 --=20 2.42.0