From nobody Mon Feb 9 14:02:50 2026 Delivered-To: importer@patchew.org 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; 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=1579795337; cv=none; d=zohomail.com; s=zohoarc; b=hwXjPQaqbawgphR/EgSu9BS4H7wnsV4yHgpqm7J4fM5uDgwmsV9EOj5RhtVW+M7v9eXgV47+sfTMHrPXJvWspz4ZtdfdIkwDQ8yVv7TKO6+3RF3dLO/RMbGkIBWTahXGb7o7eyD/E5td4eQvK7pyu35HX4DY3vSaiB1XANlwbz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579795337; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vwlRLCLCGC2CIZun7e1zwkFYcuHIPNLiExkIa5Xe/Rk=; b=Nm+m7dZLS1w+zXWVgjIAKIdwtIvsuwjMa5Ttm86ts/bw1fWp2BPX8lLjgQdN+c1iGXqOJ3PpJBJxu9rpO2Fn9xWYbGb2VUTWfeWvwGyUsB7SbQMNdGIXz7B2h96KkJMzkKDxfYgykCT9Xvrm/NhPJjqBIfauyAegZ9iDCmVYp5o= 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 1579795337489279.0973455973982; Thu, 23 Jan 2020 08:02:17 -0800 (PST) Received: from localhost ([::1]:59958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuevw-0007ox-0J for importer@patchew.org; Thu, 23 Jan 2020 11:02:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iucr9-0004fW-4i for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iucr7-0002z4-8y for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:11 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:51541) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iucr6-0002w9-Pu for qemu-devel@nongnu.org; Thu, 23 Jan 2020 08:49:09 -0500 Received: by mail-wm1-x32c.google.com with SMTP id t23so2641969wmi.1 for ; Thu, 23 Jan 2020 05:49:08 -0800 (PST) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s15sm3073171wrp.4.2020.01.23.05.49.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 05:49:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vwlRLCLCGC2CIZun7e1zwkFYcuHIPNLiExkIa5Xe/Rk=; b=SyyRQjlTwKWia6hn8LB2VBZpKGgMpo9uSg5nFZP3ZCZcAF+J12ReVcEN1eBiBxUFMW 9eYyAUzmxU4/pHs1WXG+HK6Hq9Add3PHqFfFMuokOpeqTChsmjd1/aCGjithbAvw8R/n yKUnIWGCXQtUyO2ik5xs3otbYbtLQC9KDj5XvotY+uh3Uf72L0EAXCYpzCd623GX1ovF F8Gfw5vfGN74Bk6fLzmyqOQBp7jCI49g6Z9dcnEtPrvp5TSAxVVKnawse377n86iKUAf kMTT6xa0T5TDPZNdLfUMq6Z9MLpGwcoBuixya4tpGiUNwBUebsM4T57hBYskkFoyH6qc ju2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vwlRLCLCGC2CIZun7e1zwkFYcuHIPNLiExkIa5Xe/Rk=; b=kaaqm62MQC6HsiU2h631u9au2jWuZ7X2p55vKyJF6pcEhiD7Dsr0NBN3tphG9BhtyY nh24aiSIJcnT+N2bYw8OBblwsUQMvww70fKG4brDtYueut4UF/jH6lESaWC2JyD+ypwl 5ffe35QLKXXTq051XL58L3ZYVu/PQL7R75iXazRqL+IAh1JLZa8u2d8I9pA4/z0Ym5Qi vsqEU6Qg9vm8xuDms/AcJMS2qQr97l8+K45xwA+6Yq3JMlqf7XF+YyY8P2OU3hKw5KOB Np/fLqfhV+RLJse0qLxmHkCsPD7xzFhcB1/9Bdgt3kFWeiiohBe6K1WpiLWNc/gwsRe6 tQKw== X-Gm-Message-State: APjAAAUtGg3iIpJ8Q9Kq6t41020jW0DsH8bd9lAAY53SeyxHwaBY6xPU 9KSbj29p6ESqZi0O7cTOCUslBabx X-Google-Smtp-Source: APXvYqyKX2aqlGGjmgzD57D7bFkDg3dWN4X8byHAKy1Qm9T7/nHCk2kOjxWeQfGi51TvroH+FVTRjA== X-Received: by 2002:a7b:cc98:: with SMTP id p24mr4381121wma.139.1579787346691; Thu, 23 Jan 2020 05:49:06 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 01/59] cpu: Introduce cpu_class_set_parent_reset() Date: Thu, 23 Jan 2020 14:48:04 +0100 Message-Id: <1579787342-27146-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> References: <1579787342-27146-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32c 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: Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Greg Kurz Similarly to what we already do with qdev, use a helper to overload the reset QOM methods of the parent in children classes, for clarity. Signed-off-by: Greg Kurz Reviewed-by: David Gibson Reviewed-by: Alistair Francis Reviewed-by: Cornelia Huck Acked-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <157650847239.354886.2782881118916307978.stgit@bahia.lan> Signed-off-by: Paolo Bonzini --- hw/core/cpu.c | 8 ++++++++ include/hw/core/cpu.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/hw/core/cpu.c b/hw/core/cpu.c index db1a03c..fde5fd3 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -239,6 +239,14 @@ void cpu_dump_statistics(CPUState *cpu, int flags) } } =20 +void cpu_class_set_parent_reset(CPUClass *cc, + void (*child_reset)(CPUState *cpu), + void (**parent_reset)(CPUState *cpu)) +{ + *parent_reset =3D cc->reset; + cc->reset =3D child_reset; +} + void cpu_reset(CPUState *cpu) { CPUClass *klass =3D CPU_GET_CLASS(cpu); diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 77c6f05..73e9a86 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1135,6 +1135,10 @@ void cpu_exec_unrealizefn(CPUState *cpu); */ bool target_words_bigendian(void); =20 +void cpu_class_set_parent_reset(CPUClass *cc, + void (*child_reset)(CPUState *cpu), + void (**parent_reset)(CPUState *cpu)); + #ifdef NEED_CPU_H =20 #ifdef CONFIG_SOFTMMU --=20 1.8.3.1