From nobody Mon Apr 29 15:13:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1568983985; cv=none; d=zoho.com; s=zohoarc; b=gtlenUhVK+4OBIE8NuaKT6cOd8pPf3YwFSN8rug5hNtRiZxew2FzdE88nBhQQYz6lYV48dQPPNmL6qawLWZ3Feszz6oowsVdX7bsp6unOowncrxLHI6xqVvQkOKwQbFWNIcMPpypHzDeawtSpPqIp4t1qybw8oFvmbzVBNF0d0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568983985; h=Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=KI6NTqb1buhCdYJKVoPm4gQLaKDSP96PDJ7uqHgYONU=; b=WlqJ318Cc+VOKEe/zFofunq35LDQoalw73Nsg/HkLp2PQ59plm7i07GSVkKY+eIKUJTk/apsknTMuUsaxkRAvINr2jGIzk1QahGCILG61OzGect2Z3O0LIhQdAz0XTM7EC56nEjmqLh/KpXzi6J2bOu6A6DjOcMqDNm19F+b5xI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568983985137330.42108733845225; Fri, 20 Sep 2019 05:53:05 -0700 (PDT) Received: from localhost ([::1]:59086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBIPG-0003NS-G1 for importer@patchew.org; Fri, 20 Sep 2019 08:53:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48993) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBIMZ-00011t-3d for qemu-devel@nongnu.org; Fri, 20 Sep 2019 08:50:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBIMX-0001QC-1w for qemu-devel@nongnu.org; Fri, 20 Sep 2019 08:50:14 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:37188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBIMW-0001Kb-Mv for qemu-devel@nongnu.org; Fri, 20 Sep 2019 08:50:12 -0400 Received: by mail-wr1-x433.google.com with SMTP id i1so6646521wro.4 for ; Fri, 20 Sep 2019 05:50:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id t14sm2040467wrs.6.2019.09.20.05.50.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 05:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=KI6NTqb1buhCdYJKVoPm4gQLaKDSP96PDJ7uqHgYONU=; b=P/our2Wxx0ATVnb1oG/LssbUw7amOPlv6h8menQ0E/etnGRLtHEkXxUgotfhTz/S6R EsKzEATwuE0Z42Rj9PitN2gVn/3FkH3IG1pSC25OXa5JLBzQKSp5SKY5lf6AMkTOvzc/ Kbn9RLET0ZC/+GWi2SVXDIzSNy0kw/SPitLbhBsLWcDySB6nFzlKWLByt95THaLYXujR ZMa65tX5Jl2xEPeBM5TdQpvT/rt6b4G4EKUtLyLoqUVSJh/qaYutQsgvrX+sm96WJSw4 HBKFNRMnB+yYXYGmuwmsmAvC8Ag+uO71m3jobTTgAlaWJoVnTKd3QSQHGaT/SRCbssG3 aDYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=KI6NTqb1buhCdYJKVoPm4gQLaKDSP96PDJ7uqHgYONU=; b=rQRQi+9NPf4zHL5rTW4FMMXVVY4V+x8u0pKwLkCGWYENN20ynLvh5qQZbxSMoYsFpy 8fT+RaxJkaGZKLavfqtFUU45MxmcluUgXmyngghIllAGA3LRYNIERYSdP0LDeSCLy9Uz BOeEadMdxJgMjIofhSCqkGlh4JjMqTo4uddvOCs/axoyXEEmlTiDF2zEsGaMVBWNK2Pe WXg2h4RC902Oc/9FKueVq0cMG20lK0yUfCJS6I9BnMks9P048SyBUV368GZKYEC7Zfae ZKQvkoxt32oum5kj9Q0I+Lg/i+oQWSNIiBJOmJ0pb3TZG52MgIwTfdMXfD24Ps99QdsO 6vBA== X-Gm-Message-State: APjAAAWGZxAyTvLYPWboIb3XAeCoyi4BrFr757s07pmsH2iGVZninK1b 7GbWfNzwLCvK8Hl9KGxq4Le2GHRFel83nw== X-Google-Smtp-Source: APXvYqxSGh+btkb9KnW3EA6QDxTfasLVfHzJ6F5jZ0vzg95U5hwYar7X23e7hSDHLe9lzDKY/nMKRQ== X-Received: by 2002:adf:e548:: with SMTP id z8mr11829188wrm.324.1568983810940; Fri, 20 Sep 2019 05:50:10 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH] Remove unassigned_access CPU hook Date: Fri, 20 Sep 2019 13:50:08 +0100 Message-Id: <20190920125008.13604-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" All targets have now migrated away from the old unassigned_access hook to the new do_transaction_failed hook. This means we can remove the core-code infrastructure for that hook and the code that calls it. Signed-off-by: Peter Maydell Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- Based-on: ("[PATCH v1 0/2] RISC-V: Convert to do_transaction_failed hook") -- the last of the conversions isn't in master yet, but I figured I might as well put the cleanup patch out for review. include/hw/core/cpu.h | 24 ------------------------ accel/tcg/cputlb.c | 1 - memory.c | 7 ------- 3 files changed, 32 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index c7cda65c66d..a5a13e26a20 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -71,10 +71,6 @@ typedef enum MMUAccessType { =20 typedef struct CPUWatchpoint CPUWatchpoint; =20 -typedef void (*CPUUnassignedAccess)(CPUState *cpu, hwaddr addr, - bool is_write, bool is_exec, int opaqu= e, - unsigned size); - struct TranslationBlock; =20 /** @@ -86,8 +82,6 @@ struct TranslationBlock; * @reset_dump_flags: #CPUDumpFlags to use for reset logging. * @has_work: Callback for checking if there is work to do. * @do_interrupt: Callback for interrupt handling. - * @do_unassigned_access: Callback for unassigned access handling. - * (this is deprecated: new targets should use do_transaction_failed inste= ad) * @do_unaligned_access: Callback for unaligned access handling, if * the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory transactions @@ -174,7 +168,6 @@ typedef struct CPUClass { int reset_dump_flags; bool (*has_work)(CPUState *cpu); void (*do_interrupt)(CPUState *cpu); - CPUUnassignedAccess do_unassigned_access; void (*do_unaligned_access)(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); @@ -414,12 +407,6 @@ struct CPUState { */ uintptr_t mem_io_pc; vaddr mem_io_vaddr; - /* - * This is only needed for the legacy cpu_unassigned_access() hook; - * when all targets using it have been converted to use - * cpu_transaction_failed() instead it can be removed. - */ - MMUAccessType mem_io_access_type; =20 int kvm_fd; struct KVMState *kvm_state; @@ -879,17 +866,6 @@ void cpu_interrupt(CPUState *cpu, int mask); #ifdef NEED_CPU_H =20 #ifdef CONFIG_SOFTMMU -static inline void cpu_unassigned_access(CPUState *cpu, hwaddr addr, - bool is_write, bool is_exec, - int opaque, unsigned size) -{ - CPUClass *cc =3D CPU_GET_CLASS(cpu); - - if (cc->do_unassigned_access) { - cc->do_unassigned_access(cpu, addr, is_write, is_exec, opaque, siz= e); - } -} - static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index abae79650c0..9c21b320eb4 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -914,7 +914,6 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEnt= ry *iotlbentry, } =20 cpu->mem_io_vaddr =3D addr; - cpu->mem_io_access_type =3D access_type; =20 if (mr->global_locking && !qemu_mutex_iothread_locked()) { qemu_mutex_lock_iothread(); diff --git a/memory.c b/memory.c index b9dd6b94cac..93a05395cff 100644 --- a/memory.c +++ b/memory.c @@ -1278,10 +1278,6 @@ static uint64_t unassigned_mem_read(void *opaque, hw= addr addr, #ifdef DEBUG_UNASSIGNED printf("Unassigned mem read " TARGET_FMT_plx "\n", addr); #endif - if (current_cpu !=3D NULL) { - bool is_exec =3D current_cpu->mem_io_access_type =3D=3D MMU_INST_F= ETCH; - cpu_unassigned_access(current_cpu, addr, false, is_exec, 0, size); - } return 0; } =20 @@ -1291,9 +1287,6 @@ static void unassigned_mem_write(void *opaque, hwaddr= addr, #ifdef DEBUG_UNASSIGNED printf("Unassigned mem write " TARGET_FMT_plx " =3D 0x%"PRIx64"\n", ad= dr, val); #endif - if (current_cpu !=3D NULL) { - cpu_unassigned_access(current_cpu, addr, true, false, 0, size); - } } =20 static bool unassigned_mem_accepts(void *opaque, hwaddr addr, --=20 2.20.1