From patchwork Sun Jan 12 22:17:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 856799 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1179487wrc; Sun, 12 Jan 2025 14:24:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUVpC+pdJ/VLTXAxy408rmJz24j4zO6ahHrcZe1cGR3VeTRpJtrxCxydIHwJBrC8XRmPZNOUQ==@linaro.org X-Google-Smtp-Source: AGHT+IGmSnF9vmOAelSII6uwuKRArcNnV677FboNcZtWopr0k5gQhWQ6ZybNcGyl+ngSiv7Km4X+ X-Received: by 2002:a05:622a:e:b0:467:5d5d:fabf with SMTP id d75a77b69052e-46c71026369mr262243261cf.25.1736720652357; Sun, 12 Jan 2025 14:24:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736720652; cv=none; d=google.com; s=arc-20240605; b=JLJbRmOc9N+u4yfkQPvfPZXALA/pbnphaBh7jr2EPjqGeN3UrvHW8g5ZjfZDtrLD7D MYW84MdLTAzaRyt9itHjPSK2tA7T2wfGhseiaoF4PIzAYzCV0ZlEOqWHwJqPmBL41Y2a QI0C1zhBO+N0V6liaQMVJaMFfAgo/IaUKy3X/QKfPdrtY11Ez4TvL3NjBj4q/hwl2q8T c9uuH3m/wFGoGmT3X0OK0GT6+sBSkrz0EEqMwh9GheqyfMsxKJKR6vWfMtrhaQEGiecS 1amNQ5XCTpHo9alTadTE426GIUZFOxaBsQAEaOzbVCMuHvzuhUqeWHU/0av+nZ86jb1i MkGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:cc:to :from:dkim-signature; bh=sio+Ya9Jtq0ztZ7UXdsNT1P9BXGr2RmzsMYT4fsV77Y=; fh=3//KcqJEsa04kIBt5Nb/DJuP+2GuH1NwDRxnSl44zdw=; b=J35kbYYz03Q7MOcgSXnnkM6e8apsTSblFwebWw3rKf+oBDWn2gFIdQ2DQyySRHHL+v FR8t9zUIM5GqRBJ4qFHl7PiGo6F7SZjcqsER2cUK0ReS+rLl5pfmSNPa2QqOeTv6QPf2 5Zzvps88JXMdf6WO+mOczjLgFIkaLs0FGYDUUw/86DvL29ptUNzziS1452ebtTtvl4Wc OwvN2CkWrqdMj6NEdoCrPnLy5bwh6Ue8qMytt6+eqJy2OKjwcyGYEb5Mz8eXrhg2ozh5 zJujF7Wr7QjcSRFKvu1jIXXtdIdtxPPkqUfe5RR4AyU1+KDGNbVnVkW+5rUNqBVVD5hH cu5Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BpQvceSe; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dfadf660fasi79318196d6.350.2025.01.12.14.24.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 14:24:12 -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=BpQvceSe; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX6KE-0004OE-CT; Sun, 12 Jan 2025 17:20:54 -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 1tX6K1-00049H-2b for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:43 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX6Jy-0006rI-8B for qemu-devel@nongnu.org; Sun, 12 Jan 2025 17:20:39 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43621d27adeso25505175e9.2 for ; Sun, 12 Jan 2025 14:20:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736720436; x=1737325236; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sio+Ya9Jtq0ztZ7UXdsNT1P9BXGr2RmzsMYT4fsV77Y=; b=BpQvceSelT+Mjhm/2roZD8LtxHJXMB1LXP2iAHVGfpc2Aj3VGmaQtn4Q/AVDwIXDzU D7qqMB61ST0Cx5wmZl9gouRXj6IDTc8H5n5oJNy9hy/qXUHYrThxHWx1+oXP/P1Wk2z0 w5ktSP9Bupg4qCoGAQNUGtb1XJKrCBeOp3txKpa7eBxsms+YEPi3NMqnOgt8ACjFyycZ 7jwJOjifAtHi2LJCCRTJLJrotZFVqbPVEiAa8NMUL6gFfc18CLp5Jyl1SygY/eabjpN4 LaGrRjI7RVc2jJFzyGMilJqjmSLRLUagt4jYcX1ljQqNWw8r2khl5BLeFBRlD7rYb08l r0Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736720436; x=1737325236; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sio+Ya9Jtq0ztZ7UXdsNT1P9BXGr2RmzsMYT4fsV77Y=; b=onNgmcWu+2KDBzharZtePa/XWF+1yYXswFbeM9pWzaQdefdBmnkdD6T9en4brxF7Bb +2gEuDBJGtDlJiv9rDMNdqeojDqHsjzZ7UigYLklHi9zgcAjhyDwoiH7uqiHf1ika3oJ yF73hUNscpQ8IoZFKfJIVOB4XhzSMIEdywRll0Zc6wulVAdRRqZxah94Ah8Y/3bdG2kT m3fu7wApncyF5Ck6NljQBb4ID83YZSKwJE8lTWKhZq+p0/HSNfbu5RKxczKtBnOic62t 1Dsg6Zl5dqjysDbTIfTY4KJLsl5tt3mMz3+1duMu1qWLECPv0BQ3J85QTxVyLxJtgEaf 9/DQ== X-Gm-Message-State: AOJu0YzLHCmdQF9CANJJHzePojvuuUFkAmxY8PTVZ2tX+NzpbNZkaWb7 bWbUrX6+VKh0WS7DeQihv6qGSvjNhCAotS2965gi0rhY/ZVHdtEFmN4iUmt4cqZfwShamND49fj GRqQ= X-Gm-Gg: ASbGncuQhLD90UgItWEe0fKxsu5pHPya3xdtwwBTMeDVTKrOspQa+EhwO4WtQRX9uCo G/uOL+ojHbTVpIQ1Jpic03HkLLueox9TAku2/2cWgYrBnOqKM9guHqEkBlNWSwKgYlUlG3T1SZQ 3Dwwyk/CTNVc5Qafx9yl3EsemSu+4GYLihbUlE09cIQRgr4S98THfJ8rdyfUDjQc3lxbSpGDwyv HRW2ArPauYxX3IB349omzh7VRKBSPFTUbbWBt20NLLUpgxNjI8sH4M1ZwAqQCNxyD6mZkdSogqK nIiBfvgoXPZTTGDvMm5k9CSYqvJMIIQ= X-Received: by 2002:a05:600c:871b:b0:434:f297:8e85 with SMTP id 5b1f17b1804b1-436e26932eamr187966275e9.10.1736720436296; Sun, 12 Jan 2025 14:20:36 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1bebsm10629170f8f.95.2025.01.12.14.20.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 14:20:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Helge Deller , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 38/49] hw/hppa: Reset vCPUs calling resettable_reset() Date: Sun, 12 Jan 2025 23:17:14 +0100 Message-ID: <20250112221726.30206-39-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112221726.30206-1-philmd@linaro.org> References: <20250112221726.30206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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 From: Helge Deller Rather than manually (and incompletely) resetting vCPUs, call resettable_reset() which will fully reset the vCPUs. Remove redundant assignations. Signed-off-by: Helge Deller Co-developed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241231190620.24442-4-philmd@linaro.org> --- hw/hppa/machine.c | 6 +++--- target/hppa/cpu.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 65259308e2e..8230f43e41c 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -655,12 +655,12 @@ static void hppa_machine_reset(MachineState *ms, ResetType type) for (i = 0; i < smp_cpus; i++) { CPUState *cs = CPU(cpu[i]); + /* reset CPU */ + resettable_reset(OBJECT(cs), RESET_TYPE_COLD); + cpu_set_pc(cs, firmware_entry); cpu[i]->env.psw = PSW_Q; cpu[i]->env.gr[5] = CPU_HPA + i * 0x1000; - - cs->exception_index = -1; - cs->halted = 0; } /* already initialized by machine_hppa_init()? */ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index d784bcdd602..41538d39d62 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -204,6 +204,7 @@ static void hppa_cpu_reset_hold(Object *obj, ResetType type) scc->parent_phases.hold(obj, type); } cs->exception_index = -1; + cs->halted = 0; memset(env, 0, offsetof(CPUHPPAState, end_reset_fields));