From nobody Sun Feb 8 16:18:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1596726496; cv=none; d=zohomail.com; s=zohoarc; b=MzurrwhxGS4LSWlWf40+ljMKXqSFRyy71SfiOESR8WQz8pH4uj8KySK+X+ifhyZCIZqjeYliumXkSipTn8y7Omz410taL+wBTsodXXX5CHVGGmdTT0rrwbVaoh1AU5gI8OiscoeuzaoZmH0JWQVyU50WdXQtUYrlvKVfLwl4ax4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596726496; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Yd8B73Gw4cOJwIA3rbelMxUQY6v/oFJycgT7kd1G4t0=; b=YmdVqU0yInvnreQgE5tNL5ywViOCPCvo1pPrSNJkSVtRPAz7eRq0z2rO+lXsxGF5pnjO9q5fBgeT30p37e2Q4WpzhWMrd5pwH8raJkDRrBGMF3cZJW/T9US7K+GRj5sY+sntDo7ueA37odAUsU2n7XLERKkav0jZOHUijRqccKk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1596726495996743.668609653761; Thu, 6 Aug 2020 08:08:15 -0700 (PDT) Received: from localhost ([::1]:48742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3hV8-0002Iy-Qb for importer@patchew.org; Thu, 06 Aug 2020 11:08:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3hUY-0001tW-4N for qemu-devel@nongnu.org; Thu, 06 Aug 2020 11:07:38 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:38975 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k3hUW-0006vV-9f for qemu-devel@nongnu.org; Thu, 06 Aug 2020 11:07:37 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-5BHE227dPBW-_IqzT6kkOw-1; Thu, 06 Aug 2020 11:07:34 -0400 Received: by mail-wm1-f69.google.com with SMTP id t26so4257037wmn.4 for ; Thu, 06 Aug 2020 08:07:33 -0700 (PDT) Received: from localhost.localdomain (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id i7sm7068637wrs.25.2020.08.06.08.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 08:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596726455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yd8B73Gw4cOJwIA3rbelMxUQY6v/oFJycgT7kd1G4t0=; b=Ap1bCHSelXpBFUcJPaAgbstUoH2SZA//ND+lz5iUcT5rE82Q0oT1SX600k1UlzuqhjJ4T9 GhWIXFunzigEC4ON7Y2fcgP8bt81EV/fNPVGpFqdjddbFIk4fbCl9O/f88E4N4gkOOZtdP TadRgCTnhaV35yL/y7ZOv9zScGK9KR8= X-MC-Unique: 5BHE227dPBW-_IqzT6kkOw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Yd8B73Gw4cOJwIA3rbelMxUQY6v/oFJycgT7kd1G4t0=; b=uArm2NnGJM5VZcA9i/ihe/2BGA+8YaKW29f8RzJp95j1shDnrVUTmlDj4Wl3reHj9G /N//FbfDX10pmdq5OXUM5/lThKiH6agBLhxZKSpBjUdBia4UX6Q3s4s362RtTrE5xuc8 4S18c6OUSYfSLzJ94fqWbp+TWEEJfe54yuUOMqErrjhzuYqqGoXors9X+04vS4PqvIEk XPpqyNrJPR16RxFeJEdTkUvAHh00bLr6SnKErTrgZPvC7Df+8o2G2SDxja8n+DO9zvDv v3uQNSSRJcRcqqzsmkx1ICci8GyuM55cvEPJ6sI6RMr+osqBneN8PKpe3TzTCOgN/yZP pS2w== X-Gm-Message-State: AOAM531mo8TqO1K2bogpnGwKAKzrbRzZ7e3mKuNOXgtSc8vpUU6xQ1vD XxfJiGWQWeRX6SOGVvG0OCnxai7whsj7bW8Wnsqv+vt02yKUw1iZ6K5xpiLfngUyEJC0+8cwypS DR0AnBXBQVXGQFnk= X-Received: by 2002:a05:600c:2209:: with SMTP id z9mr8239110wml.70.1596726449682; Thu, 06 Aug 2020 08:07:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziGvcqE5SO06uolnSmfdOH1E9nr0Mf0aFSikuEB+fz5ePyxZ//CU9I4E4/mDnfW+SjLnQY4Q== X-Received: by 2002:a05:600c:2209:: with SMTP id z9mr8239077wml.70.1596726449359; Thu, 06 Aug 2020 08:07:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.2] exec: Remove MemoryRegion::global_locking field Date: Thu, 6 Aug 2020 17:07:26 +0200 Message-Id: <20200806150726.962-1-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; 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=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/06 05:03:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Hildenbrand , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Alexander Bulekov , Stefan Hajnoczi , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Last uses of memory_region_clear_global_locking() have been removed in commit 7070e085d4 ("acpi: mark PMTIMER as unlocked") and commit 08565552f7 ("cputlb: Move NOTDIRTY handling from I/O path to TLB path"). Remove memory_region_clear_global_locking() and the now unused 'global_locking' field in MemoryRegion. Reported-by: Alexander Bulekov Suggested-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- include/exec/memory.h | 14 -------------- accel/tcg/cputlb.c | 4 ++-- exec.c | 2 +- softmmu/memory.c | 6 ------ 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 307e527835..bb84283376 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -377,7 +377,6 @@ struct MemoryRegion { bool nonvolatile; bool rom_device; bool flush_coalesced_mmio; - bool global_locking; uint8_t dirty_log_mask; bool is_iommu; RAMBlock *ram_block; @@ -1711,19 +1710,6 @@ void memory_region_set_flush_coalesced(MemoryRegion = *mr); */ void memory_region_clear_flush_coalesced(MemoryRegion *mr); =20 -/** - * memory_region_clear_global_locking: Declares that access processing does - * not depend on the QEMU global lock. - * - * By clearing this property, accesses to the memory region will be proces= sed - * outside of QEMU's global lock (unless the lock is held on when issuing = the - * access request). In this case, the device model implementing the access - * handlers is responsible for synchronization of concurrency. - * - * @mr: the memory region to be updated. - */ -void memory_region_clear_global_locking(MemoryRegion *mr); - /** * memory_region_add_eventfd: Request an eventfd to be triggered when a wo= rd * is written to a location. diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 5698292749..9ddf2b8dfa 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1053,7 +1053,7 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBE= ntry *iotlbentry, cpu_io_recompile(cpu, retaddr); } =20 - if (mr->global_locking && !qemu_mutex_iothread_locked()) { + if (!qemu_mutex_iothread_locked()) { qemu_mutex_lock_iothread(); locked =3D true; } @@ -1114,7 +1114,7 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntr= y *iotlbentry, */ save_iotlb_data(cpu, iotlbentry->addr, section, mr_offset); =20 - if (mr->global_locking && !qemu_mutex_iothread_locked()) { + if (!qemu_mutex_iothread_locked()) { qemu_mutex_lock_iothread(); locked =3D true; } diff --git a/exec.c b/exec.c index 6f381f98e2..05cfc34b6c 100644 --- a/exec.c +++ b/exec.c @@ -3135,7 +3135,7 @@ static bool prepare_mmio_access(MemoryRegion *mr) bool unlocked =3D !qemu_mutex_iothread_locked(); bool release_lock =3D false; =20 - if (unlocked && mr->global_locking) { + if (unlocked) { qemu_mutex_lock_iothread(); unlocked =3D false; release_lock =3D true; diff --git a/softmmu/memory.c b/softmmu/memory.c index af25987518..2303747feb 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -1221,7 +1221,6 @@ static void memory_region_initfn(Object *obj) mr->ops =3D &unassigned_mem_ops; mr->enabled =3D true; mr->romd_mode =3D true; - mr->global_locking =3D true; mr->destructor =3D memory_region_destructor_none; QTAILQ_INIT(&mr->subregions); QTAILQ_INIT(&mr->coalesced); @@ -2277,11 +2276,6 @@ void memory_region_clear_flush_coalesced(MemoryRegio= n *mr) } } =20 -void memory_region_clear_global_locking(MemoryRegion *mr) -{ - mr->global_locking =3D false; -} - static bool userspace_eventfd_warning; =20 void memory_region_add_eventfd(MemoryRegion *mr, --=20 2.21.3