From patchwork Fri Dec 16 21:42:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 634456 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1079981pvb; Fri, 16 Dec 2022 14:11:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf5bDV4GaaiSDka/2f3RBV6L4BZC9vlr7DSWaCCCsu6mWk0cmjJY2N/R/6pdnjlGO9TnCPtj X-Received: by 2002:a05:622a:4d0b:b0:3a8:1d3c:47e1 with SMTP id fd11-20020a05622a4d0b00b003a81d3c47e1mr28727492qtb.58.1671228659922; Fri, 16 Dec 2022 14:10:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671228659; cv=none; d=google.com; s=arc-20160816; b=LQP5TRgQlAU3a7KIw5CF/rNY/GhvW8H1QRhzLlNBtfuwy03z5liP1JyGnYQRk1Y/BM i6xrxKG89rPTkRHyDwsQ0X6mA9OoJKiH/cK3Uwmw2W65BVXMRhvIGDiNVAI2JMr4xIVC aW56Uuy6spLFyTs1D/r/4xbMS4aIZ2oPIaEDvtWix9BMQ1pxoQa4AFTl6T/AvQACbsWd Bgyb2thxUH5UdLzHx5YDbBoqqgEnxorQIaXzu1Qff0pAZW3tU6T8MqWZ+ttFjJuGKm/H f1YGp4cGMkOlEHfoslCHUf6eyav21ZcVwYEZpxb2sZ346AAq1aJP0xeVbuyHIDHD3jGr XWxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=7JDlZZ95XjtIp7lmmMxiRnDc54R2t8VHCWZoay81uuo=; b=BunBjyR7jj4bWLnVEeh0ZkEmKiAWJ1YzE2BaoZgQ6+39uZyS5UAg7SEYKctd0co+ct Oa3sgYURmnmnZEWMhJuyT5LVDxxcbMrErnSXNSut9Ime+hJQtIFUdLRp7jbqk4KRHYCQ GYYe/WH3Rb8jXrjFbBIjpjbsdCRpKAkwriPCV3kYtC6ycHRRn8HHl5/ncdt0uk+847ym 1/bqGmGxherTMLhiYTItzN/0LFVs/U7xBC2DwZOYzNuvk8tk+RoYgiVbT7E4u82OSCit VvKZQLYfLN7xTnaKUez1WQSIiKhs6lpbzpUVoRfqSV9PNSwgy2jeS8aKBi/klrCd4mHz VD2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qb+2tEd3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l10-20020ac84a8a000000b003a97befcdb9si332709qtq.641.2022.12.16.14.10.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Dec 2022 14:10:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qb+2tEd3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IU6-00062M-AD; Fri, 16 Dec 2022 16:43:14 -0500 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 1p6ITt-0005wj-Db for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:05 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6ITp-0000ck-JY for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:01 -0500 Received: by mail-wm1-x32d.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so2678214wmb.5 for ; Fri, 16 Dec 2022 13:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=7JDlZZ95XjtIp7lmmMxiRnDc54R2t8VHCWZoay81uuo=; b=qb+2tEd3ZMRI8oYO2pEAvtPDETaxH9yq6tRX2MTRfIVo+B74H2pXLtzp3KkZodsm3y WCmFGJxa8y9CkLDa2W0eDB2vFcZ4TxJWQ+gldQs1YjA997ivDEoQF1GYJN0mbZYgU12J FYVTwXzFcmAm8Eq5nd70M2GQE47NnqCrD7UdYAQa70HD23lVv0GhoybGJLDFUXq3NjfG evCXr5/9tO1z8Bl+7SsVsigyu8IPZ5phwLA2P269051HeIgBHNc3tsbLOR6Z77LIhyUw 5igU4q8iba7+adblpWac6kZopYKgpWmLaOV/HdGaCO8aeqXkK4rPUrOq390NWJXpTXNJ 45JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7JDlZZ95XjtIp7lmmMxiRnDc54R2t8VHCWZoay81uuo=; b=bnHpzsN/up1ud/+/6wAH5Q3jgEvVMLMdyfAN32cMipchTYe25WrFqXdRC1OXN61doh GJdZE+0CyWcGyOy/Isg+ABiMWLCPVlr9nUmjIsCwvv+cpZp0jE3/mWvnbZ2ZonGz5+Zy TUtvnPPxL1Bi4b3jORiFlqQsBvWCgLEC126x43WgJtwEKYMpB91DsY/4daoPjHYSh5it xGmGITiZVnPbRvbftf5Mgky/MSsTqkIBbOsCXBTjCdggC7IAvwMbcA+B5IKkMKG5VyHx QUsMTe3HOHGo79SxKibq/s/UAoKAsQ4uuIr0wTcn30SYbjzT0fRr5c85V0NqGGJ3v6D0 XnQw== X-Gm-Message-State: ANoB5pnJUMY8rYPbAsRxUyukmzgAr8PrEVrMxETji6LSpqAyHL4KR3qH f4RGKbUjWlsRI2a5AqlA4zGBV8G8fecrPD1R X-Received: by 2002:a05:600c:1e01:b0:3cf:a4fa:510 with SMTP id ay1-20020a05600c1e0100b003cfa4fa0510mr26952345wmb.30.1671226976267; Fri, 16 Dec 2022 13:42:56 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.42.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:42:55 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/36] hw/core/cpu-common: Convert TYPE_CPU class to 3-phase reset Date: Fri, 16 Dec 2022 21:42:19 +0000 Message-Id: <20221216214244.1391647-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert the parent class TYPE_CPU to 3-phase reset. This is a necessary prerequisite to converting the subclasses. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Message-id: 20221124115023.2437291-2-peter.maydell@linaro.org --- hw/core/cpu-common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index f9fdd46b9d7..78b5f350a00 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -116,9 +116,9 @@ void cpu_reset(CPUState *cpu) trace_guest_cpu_reset(cpu); } -static void cpu_common_reset(DeviceState *dev) +static void cpu_common_reset_hold(Object *obj) { - CPUState *cpu = CPU(dev); + CPUState *cpu = CPU(obj); CPUClass *cc = CPU_GET_CLASS(cpu); if (qemu_loglevel_mask(CPU_LOG_RESET)) { @@ -259,6 +259,7 @@ static int64_t cpu_common_get_arch_id(CPUState *cpu) static void cpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); CPUClass *k = CPU_CLASS(klass); k->parse_features = cpu_common_parse_features; @@ -269,7 +270,7 @@ static void cpu_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_CPU, dc->categories); dc->realize = cpu_common_realizefn; dc->unrealize = cpu_common_unrealizefn; - dc->reset = cpu_common_reset; + rc->phases.hold = cpu_common_reset_hold; cpu_class_init_props(dc); /* * Reason: CPUs still need special care by board code: wiring up