From nobody Sun Dec 14 06:34:35 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764697947; cv=none; d=zohomail.com; s=zohoarc; b=lt231Bax9GnuIRuTqga4hRgidTRCtL+/iXrJ9jFM6hbVJSaGNi/1vdF6I65eKUOKXJ1g+V7Efi/1mo0AjAC/kZ8EzqBdLXGY97Dk5KddAYo5EgQ4zBHqbMFIycgE3MY0U82myKoHQLpoua/X9R2SV+jGgFH0rhk+ppuSzzH3wrc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764697947; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nNAKiD2KFQe7dDwm1ph5n7Eqp+TtKu8jd1cW1u/1N9k=; b=eDwLMJKkeK+UEfRUCUXBGd3t2MWvRVTGSqYJrkP8ltQ29krtBhQaYlSCIA6abexEy5k0YtvJ+tyzbeERc/noG4L6+vC1UxXO4R7jjsgU4uTmPtFempp+mpWtlcG+YEKd1FsPvVok45KwY95lQaxZGUqclZzw3kHCB0Vb9PdmDJ0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764697947711411.4129212159761; Tue, 2 Dec 2025 09:52:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQUXp-0000iL-R0; Tue, 02 Dec 2025 12:52:10 -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 1vQUXY-0000fa-VB for qemu-devel@nongnu.org; Tue, 02 Dec 2025 12:51:54 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQUXW-0001Vt-Rr for qemu-devel@nongnu.org; Tue, 02 Dec 2025 12:51:52 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4779a637712so36462585e9.1 for ; Tue, 02 Dec 2025 09:51:49 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4792a6530a5sm1689915e9.5.2025.12.02.09.51.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 09:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764697908; x=1765302708; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nNAKiD2KFQe7dDwm1ph5n7Eqp+TtKu8jd1cW1u/1N9k=; b=elMwHUQRmOaaQGRtsphMqmQhedC2JfTcOK35Gxn8W+6V6g+Yb0yBXUrFi7BqpXDNGw wMzqtlG+rpnvwErmnLUXIU1L1dZzHYmqOBMrypsaixOksWTVb8C3pTcHUe/bLyU4Rpue +vxdt0mnbC0eK4SX5BYicbCZN0OFoM9zNeB0Y2k+hj5MIA4GDzxxeDDV8hLUghzVtQs0 PsrG3pqp7u1sxFAflqAUvX2FByYHF2zqhH/1JvjEP0uDjZHakPMnM6Yia0ih91E83OIt KQSij64XZR5kqD7TBfDqDT6CTCJzlX0Qh8sdHMAmH1U9PYR/133kCT9zKevbrgeAD111 sxiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764697908; x=1765302708; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nNAKiD2KFQe7dDwm1ph5n7Eqp+TtKu8jd1cW1u/1N9k=; b=f+81AvGzqeNIS91RP0nIXa3MNIoDpVAxj87jNmKpwVgCSt6TuuG7jVOr+N0DR72BAp ZEt95RklPpYcj24JxCobc/OxjMJ3wQO+cbNgDTDAppmQL3POHG6nohukRE4VnDNucTzV 70zUBAa1aF9vjHRk6uk1vXSjcbajZsxPWaeN47sAkJI4bMeHUq9BWuOZovv3Gnl1SUT7 FjBV/vsv+/AltiXU7yKp9y3E5ej+POPhMqJKSCCirh7BWzTWZvzCt/lzQ2XsVo3OWKxD RkmiROU22B3KujsPon+Rh4v19YadgINn+E9vfCpv8UmuHZ0ZWmCHUtPfo2Ncc+jdhAqE Lkgw== X-Gm-Message-State: AOJu0YwvsActKtkKYr7uczjpdSIuv2hk81srpn38gHLomHcgXTDRWfZy iacLQCBmGNmW4/QCbBdULU8UvWzIRNeYWT94lHI5QdVaiqsxh6ygjbMDrCTmLy5iD/Oz8dm3KKn SJTMYqFw= X-Gm-Gg: ASbGncvvvT3aN5I11mJSN7GPgy5CQDXRMiUNGH1XA0o3rGs29xrugp1hkkP1LZEMbUH u6EaGE+eY1X/Pw8OLMMrQEaV+UxSPuppvavLyPJ1vNZ4SeGaDl6vWy/2Gt+OrT+xf8u06lWxzsX Vnyc7i9v5XLCGF67asBhPot09K4+x4FSEsQu4Wi+wJgiU7Q5inDZGIwFPXT5cyArJZ1pEwRoQ58 r9GAWSI9a2zRMo4L4RxLAMLq3ikebzvhdMGxaK5YJ4yetneCaogSftGKyyUKhoMXJFk3VwtkQ9L 9C1GrIR9Fb4u5RkqO0DjLPlvrkgpHhgHnsIllgyNL08rngrJUN3GF608bdidCfrH2hp4GotFpUH 2eHUK5nl3zvLNv5+zZ0rBF8yz8hjxzeDGPr783CjCRNxsv2Cq6oC8Jn+MDSw9kmHOJFR3hvOQEu UwJiMRTDAJQD10fHJfHXEJOO8LHu7cJ5D3hMbsJOtDtFO+7LlheeSrUs7r+foKfkHkRjeKV8E= X-Google-Smtp-Source: AGHT+IGQWZrnhCXRrCNucUhJWFiPNs+g4YtJpn+pbgmUbfXkiD1t5XGrcULpcuYd3hQi9/Yd/6veiw== X-Received: by 2002:a05:600c:1d0e:b0:477:bb0:751b with SMTP id 5b1f17b1804b1-477c01c4d79mr401104005e9.27.1764697908157; Tue, 02 Dec 2025 09:51:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Richard Henderson , Alexander Graf , Peter Maydell , Christian Stussak , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.2] target/arm/hvf: Break loop if guest halted vCPU during hv_vcpu_run() Date: Tue, 2 Dec 2025 18:51:46 +0100 Message-ID: <20251202175146.20331-1-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Type: 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=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764697949179019200 Since commit 93ac765076a we try to call hv_vcpu_run() many times in a row, but we missed the guest could have halted a vCPU; if so we need to return to outer loop. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3228 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3230 Fixes: 93ac765076a ("target/arm/hvf: Keep calling hv_vcpu_run() in loop") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/hvf/hvf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index de1e8fb8a05..10ac5559ca1 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -2029,10 +2029,6 @@ int hvf_arch_vcpu_exec(CPUState *cpu) int ret; hv_return_t r; =20 - if (cpu->halted) { - return EXCP_HLT; - } - flush_cpu_state(cpu); =20 do { @@ -2041,6 +2037,10 @@ int hvf_arch_vcpu_exec(CPUState *cpu) return EXCP_INTERRUPT; } =20 + if (cpu->halted) { + return EXCP_HLT; + } + bql_unlock(); cpu_exec_start(cpu); r =3D hv_vcpu_run(cpu->accel->fd); --=20 2.51.0