From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183845; cv=none; d=zohomail.com; s=zohoarc; b=mMS59mW8Qj9aHfVcOG6o3LY7GnDd+cZvbyP72/6bYmBBOPfGJ2LaSjNE7ofqaeE8Z/xDqVZ2G+p2GP3PmWUqun+qdsAwxH8G9nFYe726Nuv4zRpS7032+ubxm1/AcQlBXgp16BR3upm1brB1YgzES0TMZ8f0PqZUdn/a/fHC4HQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183845; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=yfNMtIQVH/g1hzhti934J8Nc6bZ3Ap2ifCd+bJEPDr0=; b=LEcC3VFtuZiTnvnlRr4AbEIUCTyBMB/fnN2XqaBjZX7tqrAx67c6EYNeZLbfGW9mzQDp6U+ByMXjspDkGMIKDUqyG+VzQzzl9sZ8I/CdVZS+cnybfQiR0FHpOJLIH5kOGlzJufQXG+mKTPz1yTA6at+VJ9HQbFKNPKLLPSs5bMY= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183845876420.67590211059576; Wed, 23 Sep 2026 10:17:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QVq-0003dX-NJ; Wed, 23 Sep 2026 13:12:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVI-0003PG-4O for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:11:33 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVF-00010Z-FI for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:11:31 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTh0l3938136 for ; Wed, 23 Sep 2026 17:11:27 GMT Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvbwma28r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:11:27 +0000 (GMT) Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-5c93c294214so501728e0c.0 for ; Wed, 23 Sep 2026 10:11:27 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48868886e45sm8575710f8f.31.2026.09.23.10.11.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= yfNMtIQVH/g1hzhti934J8Nc6bZ3Ap2ifCd+bJEPDr0=; b=eK/WNOIR/wj63QFU Z65UluJyeKplPpSSde9H3q7bWyD/lSk9kfgth3H34M5M4gJtaoE5FYJ86IH0GoQZ LYqTAuJ/1csNE1Llkzpt53WUw+U3Cv117MVQcNyF+xaaTnuBpBycJqPJ33DKThmW r632nONfQB88qynArqWdpT+rYP6D9WGs/pO8MkYzTnaM1ZOtF12FvROP1JlpZ1k2 yNuozuxSzaiDHT6Byqfx94Wl9RrF2ERUDxuBiPeyP79Hs6Sk3zatzCQM8yhZhV5E MhXf+HjmKRhJAIYn2rscv4L7fTcQS8vBzT0e1HlQM2ZTkgLpjf/mrzkOVsZO/Mh2 /z5R5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183486; x=1790788286; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=yfNMtIQVH/g1hzhti934J8Nc6bZ3Ap2ifCd+bJEPDr0=; b=EO8ePoC2XFMuwGiStxiZmVJgm4Tu9tdpJQQTgOhhfyw5Hze0q16H9ttqKlr7nzV95/ bPnlKA8C0V8hLXaAMpBILkFIDmIgjyon6DW9V2ZTaJPoGU4VHfMEEeeDdev5LQpMqJ1i LEGeuuXulreXRjsMIB+t9TF/LZIsjZYK5kBCDxF1FzGSOyZfCAclV9U4/UzdfPbtPxyR wLHp/tyYiNxLH5r6Sg8sVQ2njHJdgC73nNa3iYVlr7oMrL50N4rkzXZ4AdA+GMWCtCQv tqyaf8gwzLy8fHWBLOdoli1/oCZ8sOrFCiF1ckld8bCKYRP/VjXE5GusDaFdETZCBnud CFUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183486; x=1790788286; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yfNMtIQVH/g1hzhti934J8Nc6bZ3Ap2ifCd+bJEPDr0=; b=qsAWrEIRhSfC1RUas9phnSUAkWpQ/p1G7FgF52FYUz3NKHuTUu5qMmSrPuUEC7aBFW lht8A26BaYltnSYS1VCqVn3UO5XwH76lGL2ZmcriTun0c4/4ONeDRKfTW0j1WswI3xza 7yx/wnJLnpTyn85BrmA21vVS6F+vnbODYgKlzW25AI+IJkR8CNUR19f3z7+yWpOupjta GaXTYofOVqaeHLE95XrFDfROs6vLP8MAEZYuB/2u9e95P4/1AmUgV63c8TfTjSKC7ZTm Q/nO5nLAqN5OFJ26UgBeT+TwN4z/SIt5evNUsYtxc2yGD3H+rYPO1C+d7tsBVpbBpog8 tJeg== X-Gm-Message-State: AFuF++nIlM/KFJjvgEmhUmVAucrWl32+pkyLaoEfabAfZzGHkKjXcHdl 9ts6o1Nq/s3pg/5uLIYke+aPz378fE5thuV7SjLMfs2ILjTb/K9lnyqGI69+IzYtNdjeXQAgdNn OEvSkYd47ItswnoOIQ30Q6I5SKph4XfW0CfQ4SqZzhX/Llu8Coto1Zh8tBGQymzwYJLIK X-Gm-Gg: AYBFou0n1xePMZFOzwYaYiq9PkOYAdysEQBO2mpqyRb27w1+5v134NV9flU9eiwZopO OUADXE1wMMSLtXgHJ43mzaURrIxXTBken2XjfC3uBfEbGUCTL9ThrOR3RMbTqpjKN6/gyJPLkTJ 3ZiEQO5gRK1dLhIor2Ar9pN9Jvd0rZO267p3LTsja8Sq4U4b9Rp/vobb8KRaNnY/kD0xT/inZRm lYiMnGPmnwX8MQ5CQymmAB72pnLKR1Y+GivNgUJFuZLMCnS9pZ7Wch/fe1KTHWgxGOmcNylvPMN UxIV5b0rdCJM8as6VesIiZC/D3upQ3g+3muN0/qs/e5m/k4wOEJTEgS/TsJOPariuU+OxMh5xJP OE1WcwDXDousTCgGi/59+cbghkWDCtKQUThwfvBJO X-Received: by 2002:a05:6102:e12:b0:7a1:f7d2:e845 with SMTP id ada2fe7eead31-7ac1d2d8af9mr3158159137.21.1790183486342; Wed, 23 Sep 2026 10:11:26 -0700 (PDT) X-Received: by 2002:a05:6102:e12:b0:7a1:f7d2:e845 with SMTP id ada2fe7eead31-7ac1d2d8af9mr3158143137.21.1790183485919; Wed, 23 Sep 2026 10:11:25 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 01/21] system: Document has_work() synchronization requirements Date: Wed, 23 Sep 2026 19:10:55 +0200 Message-ID: <20260923171116.31276-2-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX32VD6qtL8ep5 y+j3vOEyfNKHveYcKgehCFD/gdnfyxiHWPjzHN2Lc7dKEoGgAqV0Cj4fgIy87o1Agm3YQj++cFb FN6Kpi8dHdpVcq6UttSowNXQRi4Q4f4= X-Authority-Analysis: v=2.4 cv=R/6WitRX c=1 sm=1 tr=0 ts=6ab4083f cx=c_pps a=wuOIiItHwq1biOnFUQQHKA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=XUsUnerbLd2lX0N3J0UA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=XD7yVLdPMpWraOa8Un9W:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: AFyiQky01VoY5O2eq44nB_BXRp5cgpUX X-Proofpoint-ORIG-GUID: AFyiQky01VoY5O2eq44nB_BXRp5cgpUX X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX/oJV825b/QfS 986gDUNzDAIT80E14anZ6ycZS5/Pa+RJbCeFlgPudECPpKvdXaBb2+H+u0Qw4rSj7Sf5aVuMEsR v+DyUvTc3s/GNZGHfytSUw00a0AMuitN0ae2U2Mh+eVSZrmmGOKqNJFhmG4SwX3fwHpe25eWhgi Mr+mYBCwcNlWMK2baDA4pzrHv7rC5uLFwCqNhSxcA7g3+jnk7Fu4BHoAprjhtQH3UvONoF0e8/M /29ixGl12zLJl2yltxXYH1cVPbnmTLa3Mu4xt3GQzchT+93rO2qW/deOvBuEKPx9HVAdArgHJp1 mdJrQ+SWb8sBuFEkgpxVV3FcuQBmxEyAPs9olTYu0xneg7iJ7G6I+3u0oANNIQhzSsvDoZQOhXY vdBWx+V1pNjIjzzvUJjUyoqUXFudz9fCS2emvTqsamLI0LXpVm2ptKv6fhqPHdLF+bNXy1hWY6f DW7ugi7W8Xcnr8uHrHA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183848775158500 Document that has_work() may be called with or without the BQL. Require implementations to remain idempotent and avoid consuming work, and to synchronize state shared with other threads without acquiring the BQL unconditionally. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/core/sysemu-cpu-ops.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index e56eea18b78..d125540262d 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -19,8 +19,10 @@ typedef struct SysemuCPUOps { /** * @has_work: Callback for checking if there is work to do. * - * This function should be idempotent (i.e. not change state) as - * it will likely be queried multiple times before a CPU resumes. + * This callback may be called with or without the BQL. It must be + * idempotent, must not consume work, and must not assume that the BQL + * is held or acquire it unconditionally. State shared with other + * threads must use appropriate synchronization. */ bool (*has_work)(CPUState *cpu); /* MANDATORY NON-NULL */ /** --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183616; cv=none; d=zohomail.com; s=zohoarc; b=GqvYFMWAs+7Z98MB6ZJeSoC2oJZhea3orsu2Xv/TIInjGZS8Erh6MIXkoUxvoNkV8opCz1IIHMU1smgPmuEcnehKnkicDtTRjLMQMEE3y4kTLSoDDD0a3t1AxdlHo47JsM4LeLeo0pvBZ8B1gh1Qpw/PbWCuvyLSSg0fewtfA60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183616; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=4+Hm61vbLZRTj0yVKnQACRv0FSYIqQtRBRB3dZnU6TQ=; b=azdp3Wl2BsZ9+h3+LDpnbrcQ75VDjVJjwH51zdp6MrDux0j6wz648Kxpn0vAYmKAnYbLjH1Rrr7tnLLo4IIwTjOMd02So22DSPu1DpD6rEbwEuxW704t92HIOdSVNBg4r/gzI6/nAntg/0L6QRpz63yYt4YcW8o8su9YEX7TPcg= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183616475964.2142088534262; Wed, 23 Sep 2026 10:13:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QVs-0003g9-IH; Wed, 23 Sep 2026 13:12:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVP-0003R6-5Y for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:11:42 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVN-00011l-51 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:11:38 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGUHIL3106542 for ; Wed, 23 Sep 2026 17:11:34 GMT Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfmwh0te-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:11:34 +0000 (GMT) Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-9806756ea40so949098241.1 for ; Wed, 23 Sep 2026 10:11:34 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe0c3731fsm70878365e9.2.2026.09.23.10.11.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 4+Hm61vbLZRTj0yVKnQACRv0FSYIqQtRBRB3dZnU6TQ=; b=fFnbdV6A61S0S4UU VUQ2suoJRD9FzLf9dqjFghtiARh/C4l9OiqydsFIT6tmYRMOO0WotLQ8bKRcvIea Z7uumZhqGcWybBiR/UW9MCFDedeWJ19SfIb2+8aiV/Tgpqdh5SmZ7S18n502W7F1 Qnsng+88oeTg4UaqQ1cFEI1t/fVO9xZA4MOgDwzY9kZFPua0SNNEYep1LuYB7j4W DvOOKCKNQK2HSERBS2wCzrVKZDICThOoQ/FUPcD7DJEo7pQ+JDGrVxRsGF+pvBee XKH0Cjihq+V5SbKNUQJ54JIbm4sjXX+G+Vv/FDDzNcOM+17EPCKCkT646FbJ10kG 3qq5ZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183494; x=1790788294; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=4+Hm61vbLZRTj0yVKnQACRv0FSYIqQtRBRB3dZnU6TQ=; b=UJqbWfNccvcW3XeUPHCU4hdQPd7/t68uJn9++e3IZWncJdU34iYbk5WAviREkCjZv4 UBkJUG08wdBxwAxcGfb/iYm7cLnsJG7oralXK2SDYwrL/oMjlWc8qBoz+wgkbJ8jyQ58 qUXdr4uXPtisfLKjgfdEgzr95QRvvig9cpfZxfGtC8ko8MeE7MgMGfUxIvQh+3sLxOCV nTR4EUU/+9YJsvNvf33bd9boF/3SaLjPypb5ipLm6sOfw/7R7My+biN3cDEcVv0gH7aP 2i9mt0ucqvmeVSZH/bdyHC47k6r9A6xcvz4kqUzXv61YKlcbQdgkfcMe9R061YP4fWod p1qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183494; x=1790788294; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4+Hm61vbLZRTj0yVKnQACRv0FSYIqQtRBRB3dZnU6TQ=; b=Gh6esTzKP4mK3C4zIKuwRIf65HfR0RyHqOQOkPGNX8j17ZO5WvKx86wHTCxLmPKV6s WweGagLIVCPQGCFj0ly2dN1Cq/0PKfNamnVWVtRS6nBeOD/uTyiOVUGLXXjdgoTvsUtI chxtbc90+FoP5qVvasczmw6w/tJdobzkShV4GDcu4sqbLW39yPwLm+2GmK/oHHvrIKME qcrXuWGN3iy08HMYKhed3h3auL1hzUZSmdXfuK92DKjQMBn0kOPNr3dS/7c+IPGuFx9L JG10Y8lU2vwsuLFQC3z8KcZDEXTM1BMQL1LNAVrBH/cT3rTEWpz4BYsbLCKnMjhjC9wd WhUw== X-Gm-Message-State: AFuF++l1nRWI4cPI3cwnkNh9/R1Mn7XGykN0OQ1Rtll3kIPXgoahwx5M BwIKgg7dabfUP9n3Eha13hw/5eLi6xlinCtzhZkMjHF3LzBNtHNfjHf5bOokWituVYKzcBOolt1 kqXp3j9LBLtE1hG/aqWgau6OQkmYfiWcJKiG6BpQ1szlcLTU4+19zIPWAh8EemSvDUSXF X-Gm-Gg: AYBFou29JMaG/W6bvzFGAuHw/xBN1IEp6h59Fgm6m4B3ESxzTcfTi/hwoVk7Nw0x4Xa s8YoPw342rdHml2lPQKfDLBPN9FncjIZWKzOeMEHal5DZW7yEFa6icXbsuTXGFTX3eyOCSGuI6y 7K61Anpijew4HbcSBhHF9g8QAnVfTFBruaTRLSTqXQWZugMQNPaDeTzDuKBQY4o32myzn/J1jCi dfFid965mRecrsyO332sBSesBbiy3stL/pdXVQsFdiqxAJBSixtQ9FFeesk5X8uUXjPku98pv1F Pg8iNQwkoAyAnpq4hFnVHT/Oh5vkBisR+B5TbfFFk8XFuyfICk9ZMZeFA23V/DxssbZkc48SDiY N7KIjA7nCbm9tqsSMEIYXgL/1SGTwZIsb4fpsrptx X-Received: by 2002:a05:6102:4410:b0:7a7:19aa:8a86 with SMTP id ada2fe7eead31-7ac1d4db191mr3142895137.33.1790183493877; Wed, 23 Sep 2026 10:11:33 -0700 (PDT) X-Received: by 2002:a05:6102:4410:b0:7a7:19aa:8a86 with SMTP id ada2fe7eead31-7ac1d4db191mr3142874137.33.1790183493467; Wed, 23 Sep 2026 10:11:33 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Farman , Cornelia Huck , Matthew Rosato , Ilya Leoshkevich , David Hildenbrand , Halil Pasic , Christian Borntraeger Subject: [PATCH v3 02/21] target/s390x: Use s390_cpu_get_state() consistently Date: Wed, 23 Sep 2026 19:10:56 +0200 Message-ID: <20260923171116.31276-3-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX6dM+SKsk0M8F CE/ROOFyqRFTM6JN77bvdNS9sYZGiDx3bOcTtjkiJTGsqoHRFiIMBaR1887LEZ36rtVconQdiIi Hc9wNfM9HQAxICAvtDp5HWKzpS6ytoILTUj0iMB//it8g8vnGEagp2MXlR9Z1MVTBdAVt6owqkI MjgFqphvMhq5K+m/GFOVP2x9DGq3tXNjKdL2FX2w1YKxIAH7YAKOHVYA4xcm2ZcpjT0MlgjlSIH wPnp4MCwry9yNH9LVlMR4PhaICNtdyv3v6+47C+kM7/cHqxVCiV33t/ZTgoxSyrcXpLvHIIemWB u5rnpkaY+0UQPsWByPX3q6o4CcDiW/5iQhatjhw2RJKAtOJsdccU6voYJuptb2pfkP4y0MWaaip EccyMoORSRUD9NdVIAW9hoE/yF6D/x3YKIu7MiJohsBRVyU0Snx/ZWxjSaWVM9xXFhv+oqFmrwe hL76fqgpXDEfavvfRaw== X-Authority-Analysis: v=2.4 cv=WK/qzXsR c=1 sm=1 tr=0 ts=6ab40846 cx=c_pps a=R6oCqFB+Yf/t2GF8e0/dFg==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=VnNF1IyMAAAA:8 a=z94vmTcaOVfBjqTZL9kA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=TD8TdBvy0hsOASGTdmB-:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX4nxTnX7pxoas QWY4FxYqiewzdr7oOeUmckdzm4AiWFMSU7Svdyb/Ut+VGaLxEQ2OpgJBQk0wM47sPxu6OXaZrIJ bcDUA5xy7p8f++ngRCHL6TQuX72V8a4= X-Proofpoint-ORIG-GUID: 1Y3lBV47Mlz6lZzzvpdGM3f2GiIDd59M X-Proofpoint-GUID: 1Y3lBV47Mlz6lZzzvpdGM3f2GiIDd59M X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183617225158500 Replace direct reads of env::cpu_state with s390_cpu_get_state(). This keeps CPU state reads consistent across CPU transitions. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Farman --- target/s390x/cpu-system.c | 2 +- target/s390x/cpu.c | 2 +- target/s390x/kvm/kvm.c | 2 +- target/s390x/machine.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index cc9685221ae..c938c77d0bd 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -263,7 +263,7 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390= CPU *cpu) cpu_state); exit(1); } - if (kvm_enabled() && cpu->env.cpu_state !=3D cpu_state) { + if (kvm_enabled() && s390_cpu_get_state(cpu) !=3D cpu_state) { kvm_s390_set_cpu_state(cpu, cpu_state); } cpu->env.cpu_state =3D cpu_state; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 7c725b8a4a4..85afc5dec9a 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -130,7 +130,7 @@ static void s390_query_cpu_fast(CPUState *cpu, CpuInfoF= ast *value) { S390CPU *s390_cpu =3D S390_CPU(cpu); =20 - value->u.s390x.cpu_state =3D s390_cpu->env.cpu_state; + value->u.s390x.cpu_state =3D s390_cpu_get_state(s390_cpu); #if !defined(CONFIG_USER_ONLY) if (s390_has_topology()) { value->u.s390x.has_dedicated =3D true; diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index b34a9127141..6622886032e 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -407,7 +407,7 @@ int kvm_arch_init_vcpu(CPUState *cs) { unsigned int max_cpus =3D MACHINE(qdev_get_machine())->smp.max_cpus; S390CPU *cpu =3D S390_CPU(cs); - kvm_s390_set_cpu_state(cpu, cpu->env.cpu_state); + kvm_s390_set_cpu_state(cpu, s390_cpu_get_state(cpu)); cpu->irqstate =3D g_malloc0(VCPU_IRQ_BUF_SIZE(max_cpus)); return 0; } diff --git a/target/s390x/machine.c b/target/s390x/machine.c index f714834a98a..b44fba43f14 100644 --- a/target/s390x/machine.c +++ b/target/s390x/machine.c @@ -32,7 +32,7 @@ static int cpu_post_load(void *opaque, int version_id) * than via cpu_synchronize_state, we need update kvm here. */ if (kvm_enabled()) { - kvm_s390_set_cpu_state(cpu, cpu->env.cpu_state); + kvm_s390_set_cpu_state(cpu, s390_cpu_get_state(cpu)); return kvm_s390_vcpu_interrupt_post_load(cpu); } =20 --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183796; cv=none; d=zohomail.com; s=zohoarc; b=LuqoOtrs8ziypXMGSHdZgzyOmYKqvAOWjyY2GVCjRud2UrTjImsfVVSzrmEfD/ZjKqo80Dd3DdKw2EnL9r8LPiENToAkwC4enVu2616HyhH35GiK+QB50+gx+g/9Dg1lm3lr3PqDhWCHwvQu18erMCDSFXKs4YssXGMvZbv/2iQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183796; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=HjtG4nBnBjHP3J7mmX5f2+INYZmR70rs4qc55y42Quc=; b=hD8+wGJuV8jC7T95wuWvV3Vx3TFxUU6bvJqNlDpBmi80mg1UpkXM/ZVxx4Py0FSzfW68uhFy/KkhP2Ovycnqd3121HbRJIV44pKZODe1DmS9r0peg/DATVqDNVfBxt6XIIVoTjYvTZgTgBZyvuEg/a7WwjvA2DdnIbR3vkJVDjs= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183796665451.17648319373643; Wed, 23 Sep 2026 10:16:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QVs-0003gQ-QV; Wed, 23 Sep 2026 13:12:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVV-0003TD-Uv for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:11:46 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVU-00013V-8h for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:11:45 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTqX5741302 for ; Wed, 23 Sep 2026 17:11:43 GMT Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfjsh39e-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:11:42 +0000 (GMT) Received: by mail-vk1-f197.google.com with SMTP id 71dfb90a1353d-5c83007a11cso482252e0c.2 for ; Wed, 23 Sep 2026 10:11:42 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48868889130sm8042797f8f.37.2026.09.23.10.11.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= HjtG4nBnBjHP3J7mmX5f2+INYZmR70rs4qc55y42Quc=; b=bDq2X2PbCzU42CWu OCy24izNHNr2V3bCqCIyzM6ipTncVeeyl5BvpBxuY7H9Xw7JzholTVLIVPCE52iC FkeVhOtF9JXDW/ZC+SmaC+fdIefcoPQ1XnOK5Ca+eyCc1aWrGlZ2kQb+wv4xIMAZ FUCNnzMKS94caIScslRf846o95hzA4SXlQ4fgDmTwIC+DTxQoWhUTFXtltXoxdqL rHXedrlUEkahNW7JQdZCs0HYoKqk8PELsESffyTvKFXg0lxXELtIQyfJj71oyN0W 5VhMHXpV4dpwRSRG/Mx++ix1cJwlfvo/d5yo7SFSrGdWPbVX+5vKrzaJKkB4ec3R EtPcrw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183502; x=1790788302; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=HjtG4nBnBjHP3J7mmX5f2+INYZmR70rs4qc55y42Quc=; b=IovOGKS+wrgFKDJ60LoXMlJlLWCvLCn572dkckWKFYZA3P1R0vBCf35KpPAUzolgUr 1kIFUbZzgY89WxPwHponmbRaQrqOrjbqH6cg6WL/tHywiuJOPBvRaKFPpUIAJlHi/99w Bhj0o9pdxSvIWob/lHb07lyHWc7xxhhpB3QZ9QSdGGsxQv2N12lXcWo3Xzs7ygdDt/H1 tWEV4+QQBRvLIgdW+5T9ICgMcssiDIkhV+KfVvJbskF/JMg3LbrVXbIGWZYBIjzbj/wQ +pQzsIMgx8xHI7YvIoQZeERvtM/MkN3qArk+mrL18vtZ3ni3bQqHBRwQ/zRsStTU//TP ZUdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183502; x=1790788302; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HjtG4nBnBjHP3J7mmX5f2+INYZmR70rs4qc55y42Quc=; b=wi3bwNFHyyT3frdtm+DIoaq58ItYv4DX2h7hzHGk4om6iaa64uWwcy66TzvgrEfleW N8/m6xxV1gBwCpVfz6GcJT+xiTCRMZSgAkm0pPpMUjhv/6s2VZ086ZQHKhrlSyLE5o50 OYmXCqzGoh/+FceVJJily1cfdyAhj+wsuqZMj9w/SBkp+aMC9T4JX/fApjrAo+ge1jJY 2g0pnZZ+oBhvmzf8prVtZ0mQuWr6XpmqTbxC1v17KAIhbNUS/PKyl3DgZtlOoPXgt5mn pPrr63XX23pKixZ6YTUdlTlnOjCGgfCPjp7EtIJOyt5sCvv3Y3F1FZmlrq6VT8apLyyx xU8Q== X-Gm-Message-State: AFuF++l9xZ2HJCLwu5Td2ciSy0CX2Pcut0b2TWs+wYZsD3iAB0d7MAsT MLrHJRqr5GUMazSCF23Co3kzX5T0GYo4q466tnRAB7NfzoKyHwO72MyHSx6rVDrDmr5j8wf9Y4A dDVBvD78fRj+b/RW/oCba7j/xpAdj4Ir07i/PHy251qNJo68UgAYH5PihpJVuxVlvQgUg X-Gm-Gg: AYBFou1ne07G6IFkkwY1Ck1knqNeItwTHX93sUWKVAsgTTqeGz8f3j8HXD6gHQdRCkj mpTz6gjn6uDEWbnadZvp0ayuAdQdVe6XF7oIZ+vVxpJzY/ZXUIJDXj6/312Bqa9xffzqTzD/4UB a1FDu6eLl7PrYZz4nY3ym5VzJQg8b3Q1FIbVgcJz3rtyPQVw+WxxIRIz8Vlo3d3xsn0Ku9mClB3 Dvy88/Ht/qQvGi7G0+ZTvkpxqism7uMhIHFBIPlZ8VVZFIPerrcwDicfL+HPZtTSfA1hiv6M5Pq T9qKQGewRvVhTTEHlYx7oBXRRZyYlA6hXlTULfxCSW1E1Uefmo+we/EOq1JBdRmU4J5ngwp9y+z F/ib2Fz1hX15MU104YyH5nDxCV0mWxwCyncO4jV6Y X-Received: by 2002:a05:6102:94b:b0:7a6:a24e:8140 with SMTP id ada2fe7eead31-7ac1bd45308mr3214267137.14.1790183501703; Wed, 23 Sep 2026 10:11:41 -0700 (PDT) X-Received: by 2002:a05:6102:94b:b0:7a6:a24e:8140 with SMTP id ada2fe7eead31-7ac1bd45308mr3214241137.14.1790183501216; Wed, 23 Sep 2026 10:11:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Farman , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , Matthew Rosato , Halil Pasic , Christian Borntraeger Subject: [PATCH v3 03/21] target/s390x: Make s390_cpu_set_state() return void Date: Wed, 23 Sep 2026 19:10:57 +0200 Message-ID: <20260923171116.31276-4-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX4sXHSLQ8rMsl syZRUf4h36nNv0SmqszSGeOxVlKSZxEe74WtPcRnRMKK7mTCI0ZxWHgu0F/iJFp+N5rEmHXNaTz TH7/+fgD6elOZBEdhLXmExEp66Cl0CtE10T8lH5SNarqfbg8lSxTVULDyOm8+8iEFwmbhAnvHin pYAPdleiistgk2/+waoolGn2c7qHg0FbXY0TP2QqQ70FqJmhmaCTklQ8NZVxnlWa8z0xXzv2BdF 6mBlw11DNnP3COYs4rumm82R2lwgonnXXTRIxuMEaKxDhTp2xTcEb/XxGMM/kCZPg/ePZ6TFuOX CIu5CYSEM/g41m6CyNmfH6VEfeDCGczMhtzxqqy8DcJDEe1561841Sk9c2goP2zzfNJS2uw79iC 1Zce/tEhrn+DvmKq68PilFOYwVZPZ+bQcTDdyWrIxARpFwaglQDMDi6PTo+gPCOuSwqm4RIMlRa PDBb/+QAKVrdsi+/6pg== X-Proofpoint-GUID: qbKoQzFGsvDSYSwhJYZ4nujhY-oeoH-g X-Proofpoint-ORIG-GUID: qbKoQzFGsvDSYSwhJYZ4nujhY-oeoH-g X-Authority-Analysis: v=2.4 cv=K4+3jCWI c=1 sm=1 tr=0 ts=6ab4084e cx=c_pps a=JIY1xp/sjQ9K5JH4t62bdg==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=VnNF1IyMAAAA:8 a=otiJeUf2ZByGLVp8V8QA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=tNoRWFLymzeba-QzToBc:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX4YeCAJ5wdzv0 rSXsKcICfyE+6+vxynY7AVHTZ7EqFpI84rM7rBIj6xtLtOzDHFaxSei0Iwqv24KVFPfhJ9sC4t9 xeZUU5SBfOgH7WjImEdreF58KXFIqJc= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 suspectscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183798430158500 From: Philippe Mathieu-Daud=C3=A9 The return value of s390_cpu_set_state() is only used by the STOP interrupt handler. Make the setter return void and count running CPUs directly at that call site. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Farman --- target/s390x/cpu.h | 5 ++--- target/s390x/cpu-system.c | 4 +--- target/s390x/sigp.c | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 998bbb0d7ff..2d1dcc7045c 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -847,11 +847,10 @@ void s390_do_cpu_set_diag318(CPUState *cs, run_on_cpu= _data arg); int s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch_id, int vq, bool assign); #ifndef CONFIG_USER_ONLY -unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu); +void s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu); #else -static inline unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *= cpu) +static inline void s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu) { - return 0; } #endif /* CONFIG_USER_ONLY */ static inline uint8_t s390_cpu_get_state(const S390CPU *cpu) diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index c938c77d0bd..52561fffa3a 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -236,7 +236,7 @@ void s390_cpu_unhalt(S390CPU *cpu) } } =20 -unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu) +void s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu) { trace_cpu_set_state(CPU(cpu)->cpu_index, cpu_state); =20 @@ -267,8 +267,6 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390= CPU *cpu) kvm_s390_set_cpu_state(cpu, cpu_state); } cpu->env.cpu_state =3D cpu_state; - - return s390_count_running_cpus(); } =20 void s390_cmma_reset(void) diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index b6d44c5c31b..1801b8caa6e 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -617,7 +617,8 @@ void do_stop_interrupt(CPUS390XState *env) s390_store_status(cpu, S390_STORE_STATUS_DEF_ADDR, true); } env->sigp_order =3D 0; - if (s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu) =3D=3D 0) { + s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu); + if (s390_count_running_cpus() =3D=3D 0) { qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } env->pending_int &=3D ~INTERRUPT_STOP; --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183664; cv=none; d=zohomail.com; s=zohoarc; b=IduELNawV0qQ2PFL0cd/zG5sbOt6bkjrmDJvOl7P6J4hbLkr2p+lkQ6jK5VqzGQwCvNh9V3wr4KCSNxHfBCqg1NUFJqCwi6aYmnyQcPcWMU1m1gEst6832QBigr8hIrKD5k866aAeJ7Z4aWgQJtmdzB5zVVK/BnrJxMciT+UdDk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183664; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=EgqFffSwbMUDF9Wxjg2wykGybIoYKV1tdGf6snNqpXM=; b=MwJihdO9PkGP9hUw1jr987uKifwBxtX6bNE8uMWH5VqEdmd1LqWAw97I9+MyH/ZXEkdzzh5zB4ksLhIJfQufv62IX4hIUQMXPEJkyMFfzXyW1tIhsx8o7f3IEYRzAn80/Ye4kroszp72VlhF+pqrI+9HQgOGdUv6eL8yp+vQYlA= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183664130477.9923677955602; Wed, 23 Sep 2026 10:14:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QVu-0003hx-26; Wed, 23 Sep 2026 13:12:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVd-0003WW-Qk for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:11:54 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVb-00014M-5A for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:11:53 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGU2i03106204 for ; Wed, 23 Sep 2026 17:11:50 GMT Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfmwh0uk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:11:50 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-79014f0b44cso1069321137.3 for ; Wed, 23 Sep 2026 10:11:50 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48868889337sm8502085f8f.34.2026.09.23.10.11.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= EgqFffSwbMUDF9Wxjg2wykGybIoYKV1tdGf6snNqpXM=; b=bZbj92kfUm1Br0LZ GBlhqD2VL9omokwwE1mQWYyVx8h6AaKWVrq0/SwGnNG/jXqubxLQ4P8OaTRc9J8t YI5O3DBRdic32wWrzkZ/Vse35d8Hx6XqcChRZkxJ3BZsVm+wuSlNkMEcND07kx7u yc+aqaFUu8RWCs4vs+1OHBe3J8dXk+TdH0y51tauYdk0yLJG3MHJtvSLJW0uw0Wx pPTDyKzG0EBaOHaF/8L5XAf6dgvoZfaSIgB8pwRBsEW0U90/HraODnjdcZppoJtI XocGZX8NEn4qM+vNX4JX0IeSyHZ5TJSdkIQ4+WuIIGMXgts+UnyIazphJ7lTZfh2 X70tew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183509; x=1790788309; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=EgqFffSwbMUDF9Wxjg2wykGybIoYKV1tdGf6snNqpXM=; b=Z4cAvWcZ5bqIkN4XmHIJaTasEHDQEU8CwmwXylNxbhh9ADLimAcY2LK0DccYEsKFd1 qv6DNf322FCTR3mm3GUZkOGmZjcZEqfuIieF22gEOuDbQcoAMfLJ1wJJ0AhS05O7xlbV MzK+YzFf86Pu35J+PKY+9FhrTzyU6j3t0Y8gy9vSClIiyepIWF4gpuI3kY8uYEtWuswT PWT2ypD4OyezrLLE6HvyQfymazKJ37NUQmAZHv/QiufU9TaAoYlTdQIJmQkL66LQB/ig QK5WouSNYICrOUJWO7SRNVNoXmLE8EKkvZj8oxe4/69vnxXHzmAAzjgn0Ihv9TBQA742 NqRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183509; x=1790788309; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=EgqFffSwbMUDF9Wxjg2wykGybIoYKV1tdGf6snNqpXM=; b=jK5lYpg/jbNPhCuvUOm8vtJp9QYHTR6t5Qy55+PHw3uWvsr7mAKtu2N0TCNrVnHjL9 B3TPhTzPeQeXN4MTDIZt+VsdbncoWPzWXvrbLEp3LvQPlfQ6tmWPozAGJuZNebumAc8l 1qqh0w5z5UqxOvq9cV2ghRUVDKbKjFrF/KScZhLNusVc60TmtDmzC//z54Bhw4fra7Zp GuIBwWLJf5AiCcF5mOAJJ4aSRTndPPrtRsCrYcOUHvMUjjutdQA60C3m6ZRrNWHen0pT Do+kUMnkkTqfmGYRaF5YDak6pNl37DasJnFjy9Ryi3lVYJH2Sb6i5Xq/owkRfLQHrvOc TduA== X-Gm-Message-State: AFuF++lgvd0WFXFAQTpmb4vZ/SveWTnwAP/OYBQbQibSfGaS5prp+H5t UOUtElh/P7lFZiMGZuqOaMX4HuUA02WXT93+keau/UZwp25av6ahd92PPMyyip6qAiDhQZvrSNX jQW/m0pXCmtMsmawadO/q2ywzApi3PUNsa5v1cIh/rFtoJdV9aT8VCNxROKSH5fPGDudZ X-Gm-Gg: AYBFou27aZAf911A0vI5nI7Y6abo7V5iVbj13yrNDl2mAtW00fevyiMgdZLLK/7nsjZ g+bVJsKl1a3+iRcsrtE5IKTN+hvqV8FCot80TwR8hhuXDyW7Xh3cZ3ULE22iIeaunepL0l6Bmtl shaXVUTt/0OaXriJckfbUlL/ziad4XeaQCYpUgclhOnNsU1GLR1lPukksEOZifec59tSogtVpWH viqCJi7uWeH3rTVNaTBRfr/LPL3gbXoARNUfAfT3u6ZO/7LDhghgpKJA9eeROAM0H7bkK5GXtQY Z6zj9i+D44SbVgzWZrJr/yNLM2qzLTM/DfI7xInrAUt+XV7GSwShrukjZDA0FsvxHkfxS/wtpgN 6pLuas1eFazhzpj527M2d6SH3lJDQ4ExA/zcQi+0r X-Received: by 2002:a05:6102:3712:b0:7a1:f7e2:aae1 with SMTP id ada2fe7eead31-7ac1d0ca801mr2965678137.19.1790183509484; Wed, 23 Sep 2026 10:11:49 -0700 (PDT) X-Received: by 2002:a05:6102:3712:b0:7a1:f7e2:aae1 with SMTP id ada2fe7eead31-7ac1d0ca801mr2965665137.19.1790183509071; Wed, 23 Sep 2026 10:11:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Halil Pasic , Christian Borntraeger , David Hildenbrand , Jason Herne , Cornelia Huck , Eric Farman , Matthew Rosato , Ilya Leoshkevich Subject: [PATCH v3 04/21] target/s390x: Use S390CpuState for CPU state APIs Date: Wed, 23 Sep 2026 19:10:58 +0200 Message-ID: <20260923171116.31276-5-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX3boeVHhN+igr PeugJxTEeS4g0+XpHz0ijVE/iIoTN2D2rTotjJmZ3T9Krr7V50WIK73F4G0Ci7Jur61m7WVfWSW HXt7+XMvrzOnPfjHygeCVkwHfG4cz8955a6kZFNFDxvP295RNCLZSoVk+wShgbaszNp8wxrm0iZ OaYFiiugFdeMWfXeCRWMgUburAwx6cnmUHHsEsdMPYWke/rbkMaBS3xcTksr6H4PBJZ3HOqyW7s 8YTDH21qIi5LK1GTqn9t7SBCs9Ln7pnDsHj4D/AFxI8l/4XyK5Yw71L14LNYVCX8dHSIcx/AaO6 QXPZW64GaBh9wQWiu7WQX9exXu9vbBVpBdiTLO8aeqiZoR0fUsM0J5a1BHAoJr8JmYrvRqMvX8g 8yCxLIIQ7qiiRu2EnyIxHhTkr1AEgLdnWmrqrFglv0EUSlyX14vyXIF+n2M1xCuFATQIsvTQVTp eeHTTo6icZLI2cDdCxg== X-Authority-Analysis: v=2.4 cv=WK/qzXsR c=1 sm=1 tr=0 ts=6ab40856 cx=c_pps a=N1BjEkVkxJi3uNfLdpvX3g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=h1LczH6ptyU4K0ekaGAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX56q5lximN+K4 lb9aXIKZ31KRyrz3FiOO9IekZHmblQHMdcR2c4hB6/IpbZXc2864rxasNaYCVTDlNnsAj7snwz5 U+WhAZIBMeFgQzWnCM7GdcXAnuZmBfk= X-Proofpoint-ORIG-GUID: U1CruVu5cjgz_GdwjBIE5S8AJpgjsuLe X-Proofpoint-GUID: U1CruVu5cjgz_GdwjBIE5S8AJpgjsuLe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183665519158500 Use the QAPI S390CpuState enum for CPU state accessors instead of uint8_t. Handle state checks with switch statements. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Farman --- target/s390x/cpu.h | 6 +++--- target/s390x/kvm/kvm_s390x.h | 2 +- hw/intc/s390_flic.c | 7 +++++-- target/s390x/cpu-system.c | 18 ++++++++++++------ target/s390x/kvm/kvm.c | 2 +- target/s390x/kvm/stubs.c | 2 +- target/s390x/sigp.c | 6 +++++- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 2d1dcc7045c..bf9f6ed1de2 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -847,13 +847,13 @@ void s390_do_cpu_set_diag318(CPUState *cs, run_on_cpu= _data arg); int s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch_id, int vq, bool assign); #ifndef CONFIG_USER_ONLY -void s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu); +void s390_cpu_set_state(S390CpuState cpu_state, S390CPU *cpu); #else -static inline void s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu) +static inline void s390_cpu_set_state(S390CpuState cpu_state, S390CPU *cpu) { } #endif /* CONFIG_USER_ONLY */ -static inline uint8_t s390_cpu_get_state(const S390CPU *cpu) +static inline S390CpuState s390_cpu_get_state(const S390CPU *cpu) { return cpu->env.cpu_state; } diff --git a/target/s390x/kvm/kvm_s390x.h b/target/s390x/kvm/kvm_s390x.h index 3c4fa0489cf..b1ff66f04e3 100644 --- a/target/s390x/kvm/kvm_s390x.h +++ b/target/s390x/kvm/kvm_s390x.h @@ -22,7 +22,7 @@ int kvm_s390_mem_op(S390CPU *cpu, vaddr addr, uint8_t ar,= void *hostbuf, int kvm_s390_mem_op_pv(S390CPU *cpu, vaddr addr, void *hostbuf, int len, bool is_write); void kvm_s390_program_interrupt(S390CPU *cpu, uint16_t code); -int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state); +int kvm_s390_set_cpu_state(S390CPU *cpu, S390CpuState cpu_state); void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu); int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu); int kvm_s390_get_hpage(void); diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index 57fd4b2b81c..b5256b3ba88 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -193,8 +193,11 @@ static void qemu_s390_flic_notify(uint32_t type) cpu_set_interrupt(cs, CPU_INTERRUPT_HARD); =20 /* ignore CPUs that are not sleeping */ - if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_OPERATING && - s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_LOAD) { + switch (s390_cpu_get_state(cpu)) { + case S390_CPU_STATE_LOAD: + case S390_CPU_STATE_OPERATING: + break; + default: continue; } =20 diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index 52561fffa3a..fffac09f241 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -44,8 +44,11 @@ bool s390_cpu_has_work(CPUState *cs) S390CPU *cpu =3D S390_CPU(cs); =20 /* STOPPED cpus can never wake up */ - if (s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_LOAD && - s390_cpu_get_state(cpu) !=3D S390_CPU_STATE_OPERATING) { + switch (s390_cpu_get_state(cpu)) { + case S390_CPU_STATE_LOAD: + case S390_CPU_STATE_OPERATING: + break; + default: return false; } =20 @@ -202,12 +205,15 @@ unsigned s390_count_running_cpus(void) int nr_running =3D 0; =20 CPU_FOREACH(cpu) { - uint8_t state =3D S390_CPU(cpu)->env.cpu_state; - if (state =3D=3D S390_CPU_STATE_OPERATING || - state =3D=3D S390_CPU_STATE_LOAD) { + switch (s390_cpu_get_state(S390_CPU(cpu))) { + case S390_CPU_STATE_LOAD: + case S390_CPU_STATE_OPERATING: if (!disabled_wait(cpu)) { nr_running++; } + break; + default: + break; } } =20 @@ -236,7 +242,7 @@ void s390_cpu_unhalt(S390CPU *cpu) } } =20 -void s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu) +void s390_cpu_set_state(S390CpuState cpu_state, S390CPU *cpu) { trace_cpu_set_state(CPU(cpu)->cpu_index, cpu_state); =20 diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 6622886032e..dc67e848864 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -2007,7 +2007,7 @@ int kvm_s390_get_ri(void) return cap_ri; } =20 -int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state) +int kvm_s390_set_cpu_state(S390CPU *cpu, S390CpuState cpu_state) { struct kvm_mp_state mp_state =3D {}; int ret; diff --git a/target/s390x/kvm/stubs.c b/target/s390x/kvm/stubs.c index ebf3c83994d..c5ec7d3f1d3 100644 --- a/target/s390x/kvm/stubs.c +++ b/target/s390x/kvm/stubs.c @@ -128,7 +128,7 @@ int kvm_s390_mem_op_pv(S390CPU *cpu, vaddr addr, void *= hostbuf, int len, g_assert_not_reached(); } =20 -int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state) +int kvm_s390_set_cpu_state(S390CPU *cpu, S390CpuState cpu_state) { g_assert_not_reached(); } diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index 1801b8caa6e..09004e98a21 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -39,7 +39,7 @@ static void set_sigp_status(SigpInfo *si, uint64_t status) =20 static void sigp_sense(S390CPU *dst_cpu, SigpInfo *si) { - uint8_t state =3D s390_cpu_get_state(dst_cpu); + S390CpuState state =3D s390_cpu_get_state(dst_cpu); bool ext_call =3D dst_cpu->env.pending_int & INTERRUPT_EXTERNAL_CALL; uint64_t status =3D 0; =20 @@ -221,6 +221,8 @@ static void sigp_stop_and_store_status(CPUState *cs, ru= n_on_cpu_data arg) cpu_synchronize_state(cs); s390_store_status(cpu, S390_STORE_STATUS_DEF_ADDR, true); break; + default: + break; } si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } @@ -362,6 +364,8 @@ static void sigp_restart(CPUState *cs, run_on_cpu_data = arg) case S390_CPU_STATE_OPERATING: cpu_inject_restart(cpu); break; + default: + break; } si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183617; cv=none; d=zohomail.com; s=zohoarc; b=alb2jmIPpMx+GcFdXeou2zTtqrpDh7x0bW4j45bXNQNXH123nwVHLUOxJC4dx6x20kS2xp1J1bs1Br4j3JrwtvShJIcD/7x66tO+zKXPSe/Yi24g9V+DHfNKc7qHAbEvtAWbNt46DaLfwdcJEVPp0RGOSGQvoHeSV4vVdHU4bOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183617; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=NsAGRdq+9vptvPtJkbZuTIe/H9s+dn5Lcf3IVJFeHdY=; b=fdVFm21aO28hU73KDYoow9eocvtq7mVEWOw1Jrm1ZMiDsNwSnzdnm8hBTii4tBcpFWoWM1K/WKrLmjINw3XIKUHNLGn07t7mkl3UrkCNegTwrfP4EdzmE+EwyXzxNj6OWLfzakUxJDuCSWThWOXa6bSd1XgBC0FVRJQ+7gf+8SY= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183617442718.5170558797487; Wed, 23 Sep 2026 10:13:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QVx-0003mP-Kb; Wed, 23 Sep 2026 13:12:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVw-0003kz-Az for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:12 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QVt-00015Y-ME for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:12 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTgs83938110 for ; Wed, 23 Sep 2026 17:11:58 GMT Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvbwma2bd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:11:58 +0000 (GMT) Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-78a5a291af3so1073202137.0 for ; Wed, 23 Sep 2026 10:11:58 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fdf158147sm66316385e9.0.2026.09.23.10.11.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NsAGRdq+9vptvPtJkbZuTIe/H9s+dn5Lcf3IVJFeHdY=; b=LgEORBPwh729Uug4 6YleYsrEZ3iYuhpUzOS7iGcHLk8nrtr8qe2YuKlBeul0HlafiwHccFORvCTEcw2j uy+v7oT5XxL+8hoZDvOP/4KNz0LB26mogPO4IH7Rvvivq15bX+SA3xBwGdhcwApr GmTaG68CNUkdRuHm+GJoEGy0F211KgT69CePWgwrpBbZvZ0vBkEH3D0dHv6K+yPy xeOgRr1EJSZzvOKi4gq/HsZViexaPisK+s96OOarvhFDPpGkWHc32FOdwq3Y0M7d eRuMdTDmV35yYT5irAPlKc2L/aDLsTD+UUiSvkJ28sAJM75swwx8vhRguCcj/wcI pbXVGA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183517; x=1790788317; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=NsAGRdq+9vptvPtJkbZuTIe/H9s+dn5Lcf3IVJFeHdY=; b=M0hc+/9Sr64GmyB2T7v9vpFgIWrrHHPAHOoJl4NF7ETHYjftTWgte49ZS/qpRmyxn3 NDqs1pzTazckciJ7ulVswzlFig+ceRxSh/gHsY11HPVrZrUB/c/rJEtF1MJ+BjHjC+D8 GCenNHmy3XrOGe9ZndDLNZ4Z+oKlyDyFFA/42vvjkm16Iy3g9yFb5fq8jeKHy5xGQBQb MrVwGqyMh2Dxg2YmweaJwkw3DMfKn6JH5SZlWRy/3w+ED7Ew0WDUHVX/E5pahW3mdpGX oUfOlK4NlA917lmakVlmW5I2DiQVBqIx2i1f9IsQ5Zodz6W6Qj5d1MNh8NATXVyC1sM5 jq2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183517; x=1790788317; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NsAGRdq+9vptvPtJkbZuTIe/H9s+dn5Lcf3IVJFeHdY=; b=vDpJZtECuPrX7ITF4JiTrObnouVRvCdn/Ofc0eb4av6HIZaSXrZtEpXtNupRCeW8dx Km4jyyqHY7chqRtJ5V3m53gha0L/UjUgXrxce8BpjdFQd8Y+Hvw7ACluj1DB9+Y07F0j 8igsV6ftUaRhyzR4EfbofoklWm5UFCWymoJvWZhOOImCZIFi8EYa3ddvKFZ+g9DstUFl vqCNlFOaUEx5w+OQp6+2akQlb0Lkqj+1cxsBfJpGPSZ/mN1b/MtImF15K13UssoV9MsU tRq4F2FhsnY39JkkyWGL5YCanZ4qgO8Ys55h0ZnNG8GUyQqNZtCycGd5h5zZ8FuDSGzo PANA== X-Gm-Message-State: AFuF++kwgGVKPbWNtItXaj5dm8HUiGb7vH3nq0jUZlaKVwvQD2nFLqW9 r4Rsedjm2U2jWm//F1MliSKFzP2Nyy9RhaBcRQAOoiqrekOfDBQG1qgw/MiH3MnV91UobXxvJqA UCRet2UEVLFvDwEgGJqKTvHkM2ujgX7WvxWmqORNagD79SK0V0dAyuUHp7VePIp9LO5lW X-Gm-Gg: AYBFou1pUQjhjrNdrpeC8cHqhRz4QQpVIJyYMt9IAmIjJD9kW/wP0Zkc9djiyEwt8py gtLVvQBldRnfd19C7fNWuiG+QtWSuTlfthiQzW+MpeSYaoz+dbnCj90GLnWxO1XdZk7JhR/AsYU ALGHLpwVDBDLkq5Qd4WcX536posRzrXBrh+nhwRB0FTmwcLAFPsOE73zrD+QHKalzlJFCZ0CifX 25C3/MlhtNhxk+kDksSbo38AxIBbRTBgJ+LTEZiptU/HJlCbyaQl7WFtSRGp3R0GnoYsCIjzqHv DLNIzS97O2mL98telPURMBE88XTihvrlwtdoV+g14zgEkyHr9AMPYHr/FExpwZ7vo0ht3WO7Ujn U8SuxoaAA14kpOO+nJ6G8NPsLr1HIjwF0CcFgoQCI X-Received: by 2002:a05:6102:5813:b0:7a8:2a34:433a with SMTP id ada2fe7eead31-7ac1b824983mr3177272137.9.1790183517159; Wed, 23 Sep 2026 10:11:57 -0700 (PDT) X-Received: by 2002:a05:6102:5813:b0:7a8:2a34:433a with SMTP id ada2fe7eead31-7ac1b824983mr3177255137.9.1790183516625; Wed, 23 Sep 2026 10:11:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Farman , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , Matthew Rosato Subject: [PATCH v3 05/21] target/s390x: Access S390CpuState atomically Date: Wed, 23 Sep 2026 19:10:59 +0200 Message-ID: <20260923171116.31276-6-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX+ohfLlKj0X0Q a++rf4S50TyXV/qdxQQozAr8Jnmkjl/JpAQptx2AI8SJCDC06uPbkkVj86f8togIAA2u0diGizF YVvU4z6XJL3orNfV2k5oeLS/x534sXY= X-Authority-Analysis: v=2.4 cv=R/6WitRX c=1 sm=1 tr=0 ts=6ab4085e cx=c_pps a=DUEm7b3gzWu7BqY5nP7+9g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=VnNF1IyMAAAA:8 a=jkZ4ftcXAbePN3d4lLkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=-aSRE8QhW-JAV6biHavz:22 X-Proofpoint-GUID: 0Hzr9ivP3l2wqdFB9UrJ4rDktEnNjQ-b X-Proofpoint-ORIG-GUID: 0Hzr9ivP3l2wqdFB9UrJ4rDktEnNjQ-b X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXz7/oGkW/lj0P 37riaGByQOFS33bHCbicDsRWDV5deT+tixr78NnmlSscfTb06+Qin3rCi8mpkD00wS9e1xbDuhS Gvw4kZw95VylwU6eZsF8BelCGybgR1RsrKNIwU0vQzGHWUDs17ThHjlzupt0UpfxKVItRo9+xyq NLwGeRjRxvXi7IgX2tIe8dzZef5e8MM7VLUOHTmX2yVbOIeHo+KunMQzdnsqAVdPn48X4YUY878 X8nyUBwIce0JYE35PFS0uVH1sl7ZDSq2c9VfMXNIOqFpgh7WlkuuHLHQ7HWTvsl4Ppz85YMXq8T mSA6rKXbqU+35UqNO7l9YQKEx1LurJeE5FTP2rMbeYa1pb3G1BZr/a9O9XImgiG8TK8Uw4y5meH tY0uz1fOarFJ+ej1cMkW71IFtQdECqzrV8+Nvb7tP2bsgjcyGktD4dHCIXQnwuzZ4P4PusLOqPj e1lXbAiQgtKt43HKDNA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183619166158500 Use qatomic_read/set() in the S390 CPU state accessors. This avoids non-atomic reads in s390_cpu_has_work(). Reported-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Farman --- target/s390x/cpu.h | 2 +- target/s390x/cpu-system.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index bf9f6ed1de2..ef73b15218e 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -855,7 +855,7 @@ static inline void s390_cpu_set_state(S390CpuState cpu_= state, S390CPU *cpu) #endif /* CONFIG_USER_ONLY */ static inline S390CpuState s390_cpu_get_state(const S390CPU *cpu) { - return cpu->env.cpu_state; + return qatomic_read(&cpu->env.cpu_state); } =20 =20 diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index fffac09f241..d38de4fea2b 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -272,7 +272,7 @@ void s390_cpu_set_state(S390CpuState cpu_state, S390CPU= *cpu) if (kvm_enabled() && s390_cpu_get_state(cpu) !=3D cpu_state) { kvm_s390_set_cpu_state(cpu, cpu_state); } - cpu->env.cpu_state =3D cpu_state; + qatomic_set(&cpu->env.cpu_state, cpu_state); } =20 void s390_cmma_reset(void) --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183615; cv=none; d=zohomail.com; s=zohoarc; b=e3oreOprjZhWK5Fjk3NlcSZ0DtojDqQu/gNRX5wxZVLJrM9QZf1SXEntrpTWdy9QqcBToOoJs/RDLzY3Vo5/pvjTwWuc+fv6A9qObZGhwqpkhM1qsOr6wtG/hh8XPQCJ3VgjcQkhdLYtxK6YC3lVf2D7MVpdI8Oryrts+OsLIP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183615; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=UKujglBWbXyx/peTL8xZJFCROl5Qun7zX9GPbm8YSWc=; b=PciVKFK4o17YAYFLY6YdW0Z1/XufjIB/DNW8gkmQolZ43rTJi13eDT+mvSb67OX13zMhwtvcAs4TMcQqBURpVDrm3HWH5r8C2i3e/nZ0/oHlFEh/9QrRn1m+nd70Tji37yKSYPOd9crc+lIu7TDwbqxZh9RNaEW9M/EDPJ4hO50= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183615984618.219155114774; Wed, 23 Sep 2026 10:13:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QW5-0003rx-AD; Wed, 23 Sep 2026 13:12:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QW4-0003qq-2R for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:20 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QW0-00016R-V6 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:19 -0400 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTsZX2470361 for ; Wed, 23 Sep 2026 17:12:05 GMT Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfjv12mb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:12:05 +0000 (GMT) Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-78d25a8ff32so424147137.2 for ; Wed, 23 Sep 2026 10:12:05 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4886848636asm7952508f8f.6.2026.09.23.10.12.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= UKujglBWbXyx/peTL8xZJFCROl5Qun7zX9GPbm8YSWc=; b=BYunODPnvDgTrmX8 AI/uGa59BRQ/sLvV+G6BbNVixM7sXRAftKeZ6nyMBVO8VDoK1iCdLXs2a3rHqd8p q8BesJd3VT/j/xqE8NHgGCCBzY5weM9cdxn2dXAtiYNVk1MtZQp9I1M7/Taa2U4L pYGpCBxeBPX/+s8+piU1B+CcYUa7kQlcz9NmE2imtYweP+nyYX4e1KXM1j/v1e5F /T6Oivfa782hIw+L5QPgQTeIgM3quiy1eUk0VIU31pkcUd/5zgg+YqVuRbrEOeWh xOnuX+yme5cfaubay5P32KeaR5V1yYS1Tg3f0+3cYkKyiBd+uQHjrTllsv8JiOYb NbQpxQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183524; x=1790788324; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=UKujglBWbXyx/peTL8xZJFCROl5Qun7zX9GPbm8YSWc=; b=JtWuW//GBA/1zlf334gkFQdd26cPgIyIveg982mOR9ntVvqNE3gd/ef+jsyCjKqtlO efOfoWXSCdbPmcmEH5X2FGU4RVO7TXYI0FNOgdO9xV9H2pXMSbpShuMskiFtD0EaOWqy tNs7z7Ansp/AedJZMyxRmHRsRwULKLQJgZezYzs7eAnTGO+FqPrNn/2kxpVmq5I7uLJH zRFGZtCvkJYfTb0iCpMBLSZCzBhssdMyIeoqsp/d9FCIZA2sO2RXZUZwsiXjjF28Lz2v BiPDtB/OTHtHqrIwJJofK71xfeX1/4OnwlM6ya/rwGxA10yw5aByM96AHAnsEgFwn2cH PSCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183524; x=1790788324; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=UKujglBWbXyx/peTL8xZJFCROl5Qun7zX9GPbm8YSWc=; b=QlzVnprkcGxiB9X2oVuzIS/oPsr8XtLmDnZkGB2VpApIiaABjwzQvS5iUBNztaeD8e BOzFRCJaDLTNX0xwYG6eculSO8yRJ8/M48RWoKuuAXXJBcn2c6eGBYrxI5NYrkiCsXIi kN8HvfhDRhSpT9MZlzlpiPJN492QRIU5wNKsERsD60tvKt/Cu2VH+wCb4BEAKyYj27Mi 10NKbupru3vgsgeabj6O0L/Xm9lk7wEUKrMILPg+640kh7ssBWxBrd/q8GuW5/y+ue/u tjvwl6pi9QOsHGxVA+P1/Y7fQu8LrUDyGlx2857ZN4wJ8Dg0MVVSVBvw3OVcjohHwlqF B+/Q== X-Gm-Message-State: AFuF++m2u46JZCI8oGKCU75HnjZe1Zg6aajjxbJDLUP+2b+DmFpfmTzN fJ3bU8ETpxtKJw+y+AEj3uSyLCZkmYKk/B+fylYx4BSKGO7AT3Ajsilq1jG1/oRH/bKB2k8tezW p/cFGR9TgaVohMfTlgeVS1Zr541+6XVM8I4p5dLgUMAXRw3uNDaCCHM505EJEgkM+YaHV X-Gm-Gg: AYBFou1x2eRpn3CawfBkzBhAIFATU4E04DwBCAP+GHCUp611jJCvQkksDJ/hbYW+Yqj wiaWIFnMNTCtlulSU3Lt3B5F/atf9bVut306aPVK4+72y6hHLSPJSZclSrHO6umMJ7sTXg+7J2D TN9gLsmWMXDTHOsl082uojLnsJHpHvkYhnmPJljm4wJIrpjGT7PvYV6w9LuVjRPOrPMoFB/Wwln BCCptpoO11FQIVEQipIJUPwh6++CVNDa4Bx+Ii2fdpgMbXamEK5umhOkDXdBoL7hJle8xoa8dHq ZJfq/heYyonALzB2P2LvzAlQrp3kqP3Lznj6dqGSd8g1cbJ8T3RY0Fb7vSxiAFdgbVoOHOs7670 Bfousvt++t5LWJX5YF82xIfiD0e+C65PXBXw0O4ZL X-Received: by 2002:a05:6102:4b12:b0:7ab:d3f6:6225 with SMTP id ada2fe7eead31-7ac17ad2eaamr3347534137.0.1790183524263; Wed, 23 Sep 2026 10:12:04 -0700 (PDT) X-Received: by 2002:a05:6102:4b12:b0:7ab:d3f6:6225 with SMTP id ada2fe7eead31-7ac17ad2eaamr3347506137.0.1790183523743; Wed, 23 Sep 2026 10:12:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 06/21] target/arm: Un-inline arm_set_cpu_power_state() Date: Wed, 23 Sep 2026 19:11:00 +0200 Message-ID: <20260923171116.31276-7-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX4T4tuNp+tcPX bc5qAE/JbT4/5TI6qX/TeNaCPSwHe6S1c+Tbn/4AmVEZoPMaGTBsj72WO+iTqWR6TFYwTc521BH GnWe0tepGs4O5VOHnziTBYYAnfhdlqey8I+EsZcJvp2ot2de8nFdCn1OYNiH3GgD17z8OEd+CF4 nCVrsc8ybjgK2QE2D6k7hpF3ZfAzsORA3T9BXQYmckGEBqWxrG505qqp7RrVQXAciX4zBUaK5mK DID+t330GIYTzq7ZmyIzZMzskQjujTSZ6JuZa7xZx3fKudB7Xz1UB7lMJRT7/B9wUwzJsBBk7q9 I7/vBbSyTnSkvSFlrgjubWy3qpmW1OyfGbhgf6ahB5KSaLoXk6nMyI+aU5FubfflLTjWSxtcONy NAaH9o1fynJ08wOO7a+MkA5HipXk+b2MCgdS8bwjDwvc1J0hn35mw7xP5Y14zV6f655aVhqTbKx xYSQE2admMEGiEtcD1Q== X-Authority-Analysis: v=2.4 cv=aIxlOr9m c=1 sm=1 tr=0 ts=6ab40865 cx=c_pps a=DUEm7b3gzWu7BqY5nP7+9g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=or-B4SToQ6AIma83kDAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=-aSRE8QhW-JAV6biHavz:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: Nc2ReZwU9FobI0JOnJ_zk8XS-mCQw-Z4 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX1i067ix+pquW c63FrlGoqPtAsE1CXfRLw2wIFfbR77aJtJ6t7/l7J6YNy8ay1LQgsX2zhUXwng/9tJeUdRibTXv /AnoPPHqnh2abHOTkMIaOkCbW88B7AA= X-Proofpoint-ORIG-GUID: Nc2ReZwU9FobI0JOnJ_zk8XS-mCQw-Z4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 spamscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183617287158500 Move arm_set_cpu_power_state() from the header to arm-powerctl.c, keeping the power-state helper with the other power-control code. Restrict the call in arm_cpu_reset_hold() to system emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/internals.h | 8 +------- target/arm/arm-powerctl.c | 7 +++++++ target/arm/cpu.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 1775835ad50..1efda543270 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -2082,12 +2082,6 @@ bool arm_cpu_match_cpreg_mig_tolerance(ARMCPU *cpu, = uint64_t kvmidx, /** * arm_set_cpu_power_state() - set power state synced with halt_reason */ -static inline void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState state) -{ - CPUARMState *env =3D &cpu->env; - - cpu->power_state =3D state; - env->halt_reason =3D state =3D=3D PSCI_OFF ? HALT_PSCI : NOT_HALTED; -} +void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState state); =20 #endif diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c index a06be5cc997..213e7ae056c 100644 --- a/target/arm/arm-powerctl.c +++ b/target/arm/arm-powerctl.c @@ -45,6 +45,13 @@ struct CpuOnInfo { bool target_aa64; }; =20 +void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState state) +{ + CPUARMState *env =3D &cpu->env; + + cpu->power_state =3D state; + env->halt_reason =3D state =3D=3D PSCI_OFF ? HALT_PSCI : NOT_HALTED; +} =20 static void arm_set_cpu_on_async_work(CPUState *target_cpu_state, run_on_cpu_data data) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index f58a1db843a..76aa47ac503 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -351,8 +351,6 @@ static void arm_cpu_reset_hold(Object *obj, ResetType t= ype) env->vfp.xregs[ARM_VFP_MVFR1] =3D cpu->isar.mvfr1; env->vfp.xregs[ARM_VFP_MVFR2] =3D cpu->isar.mvfr2; =20 - arm_set_cpu_power_state(cpu, cs->start_powered_off ? PSCI_OFF : PSCI_O= N); - if (arm_feature(env, ARM_FEATURE_AARCH64)) { /* 64 bit CPUs always start in 64 bit mode */ env->aarch64 =3D true; @@ -671,6 +669,8 @@ static void arm_cpu_reset_hold(Object *obj, ResetType t= ype) arm_set_ah_fp_behaviours(&env->vfp.fp_status[FPST_AH_F16]); =20 #ifndef CONFIG_USER_ONLY + arm_set_cpu_power_state(cpu, cs->start_powered_off ? PSCI_OFF : PSCI_O= N); + if (kvm_enabled()) { kvm_arm_reset_vcpu(cpu); } --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183845; cv=none; d=zohomail.com; s=zohoarc; b=JekgW6YJYmvwuXIwVt8VLSH8gF5w4xoMtZVCNFar7XLXmUYqXcR45SApqhkOCd62F3zGZdEbC6i2UsY5uwFKM1idtihvgUZx/7Fp5mMawBQwX3KMCyTU10IF6fdbrn5QEPue1irVd1N7JTCwgrQtPhMoDsLmVNo/9Vihv0rGKrA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183845; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=NVL8DScROpX5FRrNBTXD1YKsAIvozSDWDpA2JU39ztQ=; b=TpYTAciL+XA6zwtZvIxtWtJy/eF4y6C4EIwocru4WvWEkDPCXLxKEGxXOGBECuUiYZ+PMLW+IrjvjesW4TiRvmp6WyOhY7R21/kxA9bfSU7Qxf5bFL+n/o4u2vUQIZIxE7onuNNGIIwrMce3DxgtRYmuV4h5JZ74e0qT0/Hs2ps= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183845694730.0227333789546; Wed, 23 Sep 2026 10:17:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QWH-00046z-3B; Wed, 23 Sep 2026 13:12:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWD-00041x-57 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:29 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWA-00017W-9E for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:28 -0400 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGUFhl3281277 for ; Wed, 23 Sep 2026 17:12:13 GMT Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gv9bqju7d-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:12:12 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-78a5a291af3so1073393137.0 for ; Wed, 23 Sep 2026 10:12:12 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5b9f253sm925835e9.1.2026.09.23.10.12.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NVL8DScROpX5FRrNBTXD1YKsAIvozSDWDpA2JU39ztQ=; b=KqsIMxWsjMjCPuvQ s/Ey/C5w8+Y6MuAzSR83k3HYC2CmEVIkUT+dBFOTLlBNoKBSldRwWw+UUVvXsCZ8 Ec/77yhf5bEfd131oKax8SulKDDYvUjp6V4p9SOmMJj7SlCneigjkGOJjjCKmCG+ WUFtgqM4pLBL8GKvQllkQijfgt9OcSM0gy4XCL1ug6wws4Qf7a4AW7u4bZqLm1xV upqeul1sNyYYtCQ8ERBu0clBGx6GfN6Iq4lvKTXihWVK+tGxmSAM0NhebJU7yfVw WOj3FZVT8sngaPNnRjSgqJQLJeqIbrMbnqEOZ+oPEWChVbihBMymF/wkKjwaRnT8 IrxSzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183532; x=1790788332; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=NVL8DScROpX5FRrNBTXD1YKsAIvozSDWDpA2JU39ztQ=; b=gVhzWYFkiyYiWpGWYHL+rKaq+/tc2d0otEFD4R9WP99mjNRKO0c6JzzIYmvVAqrKc8 BCecmUr5rMiCv8/F/m2ivgoP8qi6KPtpVKMOandaY+lnQWUrzv0wn5cK5mGP9jZR3AhF nnA+nvgUK5cDgveT6cZGaGrmONrpfK4N6A0JgrAspncmHCuJ+dW6fGy413Q93Kcj3wtE PH2CJXKeEuy6o0EWChwYwyl1ZPWlPm6YTNwsQPbJw8TCVSDtXx/2V455XG+w/ObI+Scl zUjHdO56Tslxy5JM8IVcHO0TcT+aXSr4DM0Y0DmJdD501mw8xwtvg2MjaPJurH8w10To oLmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183532; x=1790788332; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NVL8DScROpX5FRrNBTXD1YKsAIvozSDWDpA2JU39ztQ=; b=EDwJ5DZiPB4VYXm8H47Bw6n4yia38Knyolcko5rmXIdwKmeQl1WJ8RZC3fkCskA+vs 6oe0BgWAPu39MPYiVPCGfzMcYKgu+W7GN+eYcW7rRjc9hUMmwX2PgnsyRUSPxkT75YLO 5QOqrn0L1R6PKeeW3Q087TycIPWWxMbreEwPWJtWY52XyWLMPmG55+n2M/HPTiAZVhD4 /uIfaEh7fKsa+KfHgRoMdPlG4GMiNbyOxsu14IoAopTUTvj4Wpu0P12mg9LkXPKFA8/F GZ7bUC/FW7Isu9gFto19iqChnG5mvyLKXw5Pq9DtDb3wzNO9WmaDSowk/zI1a2Ot+QGq x0tg== X-Gm-Message-State: AFuF++m/0E/cRaSwm8mCyFIl0zchK5Zz7Z6vp97c5nuDRUKEQNBa50H8 igRfofExlqnyRZwzvywne+h4LkyQxdniSeXwWKsCZGj52W+1b21bsKZdk6y9uFBKHNVP919IJR5 YBoT49x5Bu4lP/j0YNHBLIJxjufhRa6EY3O2aegxpgcGgbrhaXvXqCJuow9GoreDrlsFv X-Gm-Gg: AYBFou32+kLrv3h0C2Ps7cKT/8d+stEWw4qL7MpQTvULUovPm+IuUD0p/P93Fw1sDGN nFYpBCf9pg784zmWjPM5SiCgGrxb7hI1LDu29j3EsmcpgCIs4i/fFiI3RNfor7dOi+wm0C+16TH fUHl9JWmKrzT3WpxUWQPOJjrmhG3gQ08+A38pqlRG+5byFtkIRe7cfGVQ8yXe5yH7HqF0w65Y+I oagWZj5czAYGjqYcbuDSegGK9J3tARIkoEMADYt1m1V9twMJsyI82GA+tWx8laWS29JsnMAhInw 3iJUdubHmiRj6tRKUuH/1fkjv6+GQ4imhWh5H5X9FN7d5WaPkjW6Cor8JON2tsTmliko5OnRvOM 2JGujSFObflVvkFHvYZdq3Au3+u7Yr+dKmlO8ula7plKkrkNMWbk= X-Received: by 2002:a05:6102:2c0f:b0:7a8:1837:9eb9 with SMTP id ada2fe7eead31-7ac1dc3d3d4mr3241038137.27.1790183531857; Wed, 23 Sep 2026 10:12:11 -0700 (PDT) X-Received: by 2002:a05:6102:2c0f:b0:7a8:1837:9eb9 with SMTP id ada2fe7eead31-7ac1dc3d3d4mr3241020137.27.1790183531501; Wed, 23 Sep 2026 10:12:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 07/21] target/arm: Kick vCPU after updating PSCI power state Date: Wed, 23 Sep 2026 19:11:01 +0200 Message-ID: <20260923171116.31276-8-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: k17U4FW2vegLg-HjqBkSRTU_cYPVAjVS X-Proofpoint-ORIG-GUID: k17U4FW2vegLg-HjqBkSRTU_cYPVAjVS X-Authority-Analysis: v=2.4 cv=WZuZ+EhX c=1 sm=1 tr=0 ts=6ab4086c cx=c_pps a=N1BjEkVkxJi3uNfLdpvX3g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=ZUU6x_L2PbSNHYkWwXMA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX7E13lhTgEBjg GdSamxQo3HsdN65asNfwaMNSDKtkEqD7RsEdPEMcuBMPQrMyrVkDDQS9UVOez3zhcIiw+XNWkHO m1BokBzFVEz7wGE91dqHHmkGveO59JQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX60r1Uv4Fi/Cw hWLyiuuzeLuOfMmpXTdzxYnKtiHTx4vHgxZrD3FylnNrmDehzvLV+/06MrruGn9p8JYFUYkTF6P LfJkJfOC0Y0Qfat900fp/bPEWijzgypjssu87wlvfvn28mAdiVmsYzV+q/6+gAhCEhhDCM8bzr4 y3ngjuZ7Tu6kZEkjwGIL10h6vdZAS0rgtkBE6dkvEDTWHAl91OAgIPFrgzL79TWqfLAcQFsZyLf 1F2p7Oqvuu9vpVIt2eUvZKvGpQFmH/2zJ5ihZTm7+eUBQVuDJG5LQE9LjExtB7D3UtRYxDwHi5n 6aB5DizSEmdL3y/Zox0FeXGtcLZMdKyLI2fHf7L19Kg4N+gloBxGmsedofQ31um9wECwcK5zNI2 UnoDGkpnznqlh01egbLqjii0ZHhXb4D0LM2M+6aV2MOXgP5CgmiQ0Kz3WUCvMpAR7AN5UmASMKN jIa8g+/doQGKrmJXNdA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 impostorscore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183846747158500 PSCI can update the power state of a vCPU other than the caller. Kick that vCPU after changing its state so it observes the update promptly. Reported-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/arm-powerctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c index 213e7ae056c..1bd8a549cc9 100644 --- a/target/arm/arm-powerctl.c +++ b/target/arm/arm-powerctl.c @@ -48,9 +48,14 @@ struct CpuOnInfo { void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState state) { CPUARMState *env =3D &cpu->env; + CPUState *cs =3D CPU(cpu); =20 cpu->power_state =3D state; env->halt_reason =3D state =3D=3D PSCI_OFF ? HALT_PSCI : NOT_HALTED; + + if (!qemu_cpu_is_self(cs)) { + qemu_cpu_kick(cs); + } } =20 static void arm_set_cpu_on_async_work(CPUState *target_cpu_state, --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183623; cv=none; d=zohomail.com; s=zohoarc; b=J4IAXBu8JpIwXNcpPycnpj0BqDAv246CSPzl+4FtTLpyzVdazERYSLC5UKR92SR3A3eVtgalOMQTO98hLtIjSYcVuSQqiA+vp2Jbz18w+aYGOmPviUnQYPh4jTp3d2FRItl9TB+DXqd1tA4Dukc4nIqO38kteducrHp0YvRgWSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183623; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=cPI4u8D2Q9v1+gVhdHXRvH7AunA7t3f8oFHcIsaooIc=; b=CNqojv92gDXpZM93h+hrvA+4yCJS43BFO2VtpjVT3S/bv4aUgxVGOl7NT8lvoRs6WSZnenZsbl5nOVI9K6KXrvtUxVYdVog3uVS0is6wujKibpbK3X/cgdTVVa38inZ05HRx3/yoy7cBBz/dTH6ZneltjfndIvELPq055sUXu0U= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183623587831.698660375415; Wed, 23 Sep 2026 10:13:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QW8-0003ul-CD; Wed, 23 Sep 2026 13:12:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QW6-0003sd-69 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:22 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QW4-00018P-KQ for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:21 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGU2cq3106203 for ; Wed, 23 Sep 2026 17:12:19 GMT Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfmwh0wp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:12:19 +0000 (GMT) Received: by mail-ua1-f72.google.com with SMTP id a1e0cc1a2514c-97e9909eeeaso294036241.3 for ; Wed, 23 Sep 2026 10:12:19 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48868486461sm8168991f8f.8.2026.09.23.10.12.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= cPI4u8D2Q9v1+gVhdHXRvH7AunA7t3f8oFHcIsaooIc=; b=RlHGiP1sPjt6raDb 5g4UxVyePqgD3anuIE0//FmTjsL6VSXtuZ1nDvG23KgHtYQWvhYS99ILMB57e98/ //KNBbynArxiTSVIpbs1KX0kjU6VgdcQAeC+1ZBCapbynJqIuDa8KexUea6dWtyP fc72xpOh3YuXkbMd8dFse/yL9EJsu7UGOibg/5IRT850H1Lcg8zVZQXvsZSUhFNh +H7XFQtUKHsrtTo8qUnZ5SH2dXMmstc5Ztao6s0VHLh8WRe2EJ/KMguXzrbOeiFD s8MJUAkleXGdBEHPDAKjUgviZH7DdXv+fIur5rSNy/VL1c/qTtHshGR7NSDlytK0 3lznqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183539; x=1790788339; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=cPI4u8D2Q9v1+gVhdHXRvH7AunA7t3f8oFHcIsaooIc=; b=RoTQGvkgd3G7FF9rcw7VbjI0J3JM1YHtNjuPZtYBoxnCu1dXF795xILFlviRsSI+IA ARuqUHV0eRV2zujc5eKESpR6ZqB6m+wNuL/qHFsKjfQVu24fNJKohjk1D5qxmtepKYoY wo6Sm6umAek6G3pqbR4Llb1nHxyDqvIUAaTTjmxNcDlFN3VbyjpwJD+bjU7mY8H+onkU cMLoxTg23RdiRTj+8TC0UZMdM0kKPLb+kvmELQiw2e8ygJ+wSp6Yu0Cvi5wZW0oswvku vQC2nfeP+A0ATjEPZNiXmEh19W01TiTzWgUkLXq6E4CXtIjrpdYqaRxAoFuKGKw4Auud jjxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183539; x=1790788339; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cPI4u8D2Q9v1+gVhdHXRvH7AunA7t3f8oFHcIsaooIc=; b=cK0h2EKRFmZe+I4hNm3szTRjPADm4jyJbUQXq9BVhxe5hkUgzkIgkobJuzW5PdSWEs VMG1WtssCSlcE3ljfOLua9f1FJ4zSswgaFAV3fUjfxEVY63hmR1Gaw4P8R81V1DJr7Im V5IouBmcXQK+e27WfPm/HOEsz3WRsT2tzLQkkDbBwVEbmADiHcT8tqxUX5w8Y5ewDkCI 88SX1zR3usma/zga7VVhQDJTllv6YYmPUNB9U2zqKbgmlhHx1pp14phm8uB4onExtwDp CCoNNzR2gr6iDAlc0OqNw0fq+7rpCFN62mRYEw5Brh7ujJ5kd1xKoJ8MKlcGEa43KecC iQCg== X-Gm-Message-State: AFuF++kZDiW6F68eJNoMRCpxYAJlUj3zsNtsIoKDzrWk+yr2iZj15gqA 7INKZt5yJMc0NyRQFwLpqGN2IR6h6PthDLnYbhig67uuIMuu0XYBzPR4Kc33bkSR8wUR4Ups2Df dWxYb066Hwy+lkWtl0ZLjXR8eLODSuyzFXFBt5PNQLSmyZDJw7pqoNqFbA9MCTu8jDtw2 X-Gm-Gg: AYBFou34N2FYVkokzSQKIOotsbqTBpnVj6hMPaMNFld9gM9F4ArpRVIdioO2u37Ta4p 9Mau2N0Rgtj/WHSdLfzqMOKw7RNGxgz/lBC7oTYJ2MKYAy/WkaQ7v7q8irWQH97DxJAbe6dN5D1 4fnomp8HIcy7Jk4oix/9pC2DH70eYl+Cr8AZxsUtedm9FJ52nH605Z+bGthTI8/65gC8lEBsr4v R7dHEJnTT/c0EHzkgZftfE/X6OBuCrSsmGKMQVQuKDIjlN63a/ql9igNgExbSbPV2p3l+FgHmxu DWTCMC7I9rMUHb8Iioex4SGUaMzBqCSvul8+pYlBWXelRkdwNP0G1Zmj7DKN8fIbzeW61/rKgB8 t0/qGJ4kfPJlReGu4r/4kOne6Kt1FtNABsykXqCUr X-Received: by 2002:a05:6102:390e:b0:79c:99ea:2c9a with SMTP id ada2fe7eead31-7ac1b61699cmr3225456137.11.1790183538999; Wed, 23 Sep 2026 10:12:18 -0700 (PDT) X-Received: by 2002:a05:6102:390e:b0:79c:99ea:2c9a with SMTP id ada2fe7eead31-7ac1b61699cmr3225434137.11.1790183538621; Wed, 23 Sep 2026 10:12:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 08/21] target/arm: Access PSCI state atomically Date: Wed, 23 Sep 2026 19:11:02 +0200 Message-ID: <20260923171116.31276-9-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXyxl6SF87AHKV ZaJrHY3pvYZlFe4GOFiv28Wlsq2IH+cembx8N71KCqfxZbSZO1ape1xBewcUPgqVuzLWBSrTyKw cQZXcfnK03a9t73MMjN5pXAXTYc14xwGqopmBFQTuJvFVwasGkWJKQfS0kjkhklMKtjgxMrS3yS O/t2BZrrmcTArdXjA+zs79TNZP+aMmYSnMsBnQkKmxjHRXFFD6DlQ2gboc9+MMSgR4FvLRy3mQ7 rm+7mLs0O6G2GUibuFO/gpp1fDppKI5GRqT+jjnIa3q2s6gaSPHXVs4LhxgZEyqnQNcKcIOHQqy f/QSuiEhVCoh4Q4p43ZI0sR18lzAaEvm4nl8RMOhRb7LIuG0h2ULfO+/nv+OWAVaBhclJv4puqO ae/YLai204HXP13XsaXU5vpRTsN7K5+8bHpR2fsJdisJkdPpNDc1EmEKCc9nXI/wIoRIGovfRAl +YQG96Hlz1u7Lo0C0Ig== X-Authority-Analysis: v=2.4 cv=WK/qzXsR c=1 sm=1 tr=0 ts=6ab40873 cx=c_pps a=ULNsgckmlI/WJG3HAyAuOQ==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=MMc1H2EL_fK9NYWBrJgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=1WsBpfsz9X-RYQiigVTh:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXwpOc4bdij8P4 273ES8MSmupfUfhVVHnOIQA1wzMa5YrMAPkgJrUVMRvnVxqTyRO1W3qY+4PCoqJ1ErSRGc/XQ/F YN6h/hTJQHyQbuPQTFpcgp5f5yOOZYA= X-Proofpoint-ORIG-GUID: XUgaPt30J4fz-lKpBTrx9-vv4Zu-IsJ4 X-Proofpoint-GUID: XUgaPt30J4fz-lKpBTrx9-vv4Zu-IsJ4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183625219158500 Use qatomic_set() when updating ARMCPU::power_state and CPUARMState::halt_reason. Read ARMCPU::power_state atomically in arm_cpu_has_work(), which can run without the BQL held. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/arm-powerctl.c | 5 +++-- target/arm/cpu.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c index 1bd8a549cc9..fcac26d9190 100644 --- a/target/arm/arm-powerctl.c +++ b/target/arm/arm-powerctl.c @@ -50,8 +50,9 @@ void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState st= ate) CPUARMState *env =3D &cpu->env; CPUState *cs =3D CPU(cpu); =20 - cpu->power_state =3D state; - env->halt_reason =3D state =3D=3D PSCI_OFF ? HALT_PSCI : NOT_HALTED; + qatomic_set(&cpu->power_state, state); + qatomic_set(&env->halt_reason, state =3D=3D PSCI_OFF ? HALT_PSCI + : NOT_HALTED); =20 if (!qemu_cpu_is_self(cs)) { qemu_cpu_kick(cs); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 76aa47ac503..5cfd3bcfc8e 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -149,7 +149,7 @@ static bool arm_cpu_has_work(CPUState *cs) * Only another PSCI call can wake the CPU up in which case the * power_state would be set by arm_set_cpu_on_and_reset_async_work() */ - if (cpu->power_state =3D=3D PSCI_OFF) { + if (qatomic_read(&cpu->power_state) =3D=3D PSCI_OFF) { g_assert(cpu->env.halt_reason =3D=3D HALT_PSCI); return false; } --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183928; cv=none; d=zohomail.com; s=zohoarc; b=HYLVnvhfNT5IXVqEpndzavqgNt4CkchVUoIehuEJ1LvxlStOtYrqgdp9yj7XhWs6FqvCnpPaLMjadBD+GeG8jHHhLqQrynxHrL5Ga2NQthlnW1i8AyGmzhQ1jDWnvLweLxFWmMneGs+4mDKAPUv8Qm4ptjMlgkgaZm2eqZxwTJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183928; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=J/A1qo79auMktV306/mjb70NRnck9MYGHu4ee3LXFWo=; b=QoDf8NV13MfJ9GeCvqK5EnHgGvHPBM+fH09I/CBvjpSGmbIMwiX+vXxSKNW1jiSmGkH7byTigfv7hMVH1SApl2YQ4vN69oA0qD65J0LSm77gJAEtdHGzMA9WzfCKT9BNBfl+/WB/GRQtPzw7B2wDbsIYHzzkLHIXdIWOkEJ4rhs= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183928636927.3351739012124; Wed, 23 Sep 2026 10:18:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QWZ-0004by-O2; Wed, 23 Sep 2026 13:12:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWQ-0004UM-Kj for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:42 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWN-0001AU-S1 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:42 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGU37I3106209 for ; Wed, 23 Sep 2026 17:12:29 GMT Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfmwh0xd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:12:28 +0000 (GMT) Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-790de8f0cecso353048137.2 for ; Wed, 23 Sep 2026 10:12:28 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5cc9a37sm608385e9.11.2026.09.23.10.12.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= J/A1qo79auMktV306/mjb70NRnck9MYGHu4ee3LXFWo=; b=Q4rneli9ZFElyNQE KnJ81vlgx8945zrENznprdXF6mXBVd+A6of0lMapYP2cseC1PFUw3vwYHhr/G1q3 VcU9hekHBmvGnqQHaA+yyWPZri3pY2gi42EvHuHujswzOKelXXxxXOr80vpp/+pT 2HCl7xLUQJtmQzvZllW7HVRLQB6EFI8ivh3FDAgbUh0BCGpfbu5HBAZSeB3r1DWF vuHPQhaEDWLq4QyVxUMtSKGMJk3+lio6+t/cEnQkEzWFXc0saPcABmI4sEIUTvIX X28XNjmTU2D08fT0ImHXKBWdRpTwxZHah+tvL6tmc4YL8QSCm4blueMTzUHOPA7L QrCtoQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183546; x=1790788346; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=J/A1qo79auMktV306/mjb70NRnck9MYGHu4ee3LXFWo=; b=S6Sb7Ya8dPOSWVEClZgRZB9jnfxQOe0MRkYC5oF5ym2S8+DlL6Y9JL/5pKtNcyr2JV aGr8HV4xbZtNXiQlOcsh68P77DkH7TwAeWtZfHcHAEieznf2pwR4q1gep8vMXtxzF4UJ gpex8bfk9G0qC6cwDMdxHO0or6GLDr3n1OntnM86JsSbYJNW2mio6LTB9pu0dGdov6H8 nmUa1W/1txqk2S2hHJ1B6fcfDq+gCFaf72caABVvBoEoeCvAhM0NAYAIwUkjYJd/KtLk 9pTIUd1xbbyrvc2yEBnB3O5/gNZqhMO1rvlUTy1jTQ9z+tF9RyzKIRF2ygXr7zPYaddL mqrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183546; x=1790788346; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=J/A1qo79auMktV306/mjb70NRnck9MYGHu4ee3LXFWo=; b=A7VDO+W+g2oF9VG5i2BGmk3W7c4TdXkKe6kpYTIbXUfGYHwGv4uELE9SUGCC7n1oxK 0GqwUg8GXN+nMSWJLQRqhMlZMn8RsTWGk4l4KA015RGORVtMtwCnMDCp7FjIZNeHPCxA nC+m+8IYeYWDjROV4OB8Cu8S6tpznjChbBL4k6CBd880/JaQZaxau1vhxdFW+HZBYZiW MR/yCBJ6jJdqUQ8xXAjiKB3h26oXQKLDDCVQPru8CA8cqPsyysXrWQqw37L9HUeD9NKd hl0N7TouJxqIc0Ox0JfywPCEVuy2MVgMHALhfPCKOohMsOMegbZ7w4JAMY3jwyFe1thZ /yFA== X-Gm-Message-State: AFuF++mBvLtCt7uJ7b3fJPZji3lWTz08MQOYxoL9mEHr9Vz1pFfqX8en /eKOYoxVR2an9hlfhf2oD8qCAsQky56s2o+kXpmNrnjS/+rccWBrzjAmOVFwlN9T7WSmJczIHXt aaVU9BkMQRp0QFrwDg/kBRzMNKB5gqY2Me4s+khG8bqDMzRYWtdeKaWLhsP4DYQYHBacH X-Gm-Gg: AYBFou0oIp2a3esW70QVfVZ5lUbfp33syjzCwTsHc8imS2ZKWFrXHGarAiqnwFXadQm lvAhj8CTEgRfdq0MrilelT+AlAhl+ARVlBXAZfj688crYLI6tKKWC12l+Aam73HGbr+xap+nWWE GbTp3es8Kkzj8ocNgoVEM8LtJTU1lD7vXHNL4+2spb+1KaGeSYW3VegGR6ycFBGmRcnJCQ7T1pi pKF9I5GmKD9sC7HIjplQ2tsycMBJJ2Ft9zwgSJRB+IICZfhX0OdIJEb+uaXaksQ5Isi+l23xLZJ tH9AdziyVLWkoo+BxNDzwJeNWh/nJJFpHIOKENNOTtNp2bvDqLCHKtTZTPIW5m9KnMv7Hkkyx2H D8iZrFXZgv6yRtZfcPoh9dkJrQ7s9jCdjPq7Rg4rg09/mdfdP48A= X-Received: by 2002:a05:6102:dc6:b0:7a8:10eb:96cc with SMTP id ada2fe7eead31-7ac1b1f54d5mr3038148137.8.1790183546096; Wed, 23 Sep 2026 10:12:26 -0700 (PDT) X-Received: by 2002:a05:6102:dc6:b0:7a8:10eb:96cc with SMTP id ada2fe7eead31-7ac1b1f54d5mr3038122137.8.1790183545708; Wed, 23 Sep 2026 10:12:25 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 09/21] target/arm: Access halt state atomically Date: Wed, 23 Sep 2026 19:11:03 +0200 Message-ID: <20260923171116.31276-10-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX3716HW3czeSH 90alzV+W3jTWEG/fm9yl/rJ4t2N9OzgrGWT387E9jaBPuO6XsllDVf9Z+gJR83RkaAJnJ9G6n52 794D6d6tj571eJhxmlmj30x2Y9xHetG/DotT8MGEwJtZ43vEs6jmNJrpL3axoreWVBk9ozJoDnj GgnZTwAAzJQ2sJUqteaYFIOgC1+5eA55MwZhRcpdnUqzXnQ6kMMyX4yl6hJB4DA7WU+QjERHk0a b7hYWKSNM3Y44HwQDUU96hM3HqXlXUyN97xSWGRALHP79jDScpWl1BcG/zlElWRVimR5t0hhAdD nkZ+JirVxpaPWiGWK0iVqKQOPi3ICOHn2YJ70Ya6OTpxwBj4YCmcJZpCFudsDttIpPOIzOXO6iY W7TYgNMjmxjQkdVyfd8HblSFLW1dVvuk8zy3Mf2rR6wyu+qkRDNTJuLUpk9OdPnJwdNeM1sCxbC VvX2Mb/uNwBnh8UtEEg== X-Authority-Analysis: v=2.4 cv=WK/qzXsR c=1 sm=1 tr=0 ts=6ab4087c cx=c_pps a=P2rfLEam3zuxRRdjJWA2cw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=BUppp-h3xPyjPovRqvQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX0ZG1pPtb3rZO VFt6DbXZ4xsJTKBxWZiNxWgTFbJYxtwqg3V6auNRzgM52xKn9bv62/ch6rA9XEoUdYQVOalbXBu 8a9PlhUQptIBy58wDWpNqZFF6kIpDPQ= X-Proofpoint-ORIG-GUID: Z8hxhpBckrgx01cA8RrdzX8Roc7H_Dvm X-Proofpoint-GUID: Z8hxhpBckrgx01cA8RrdzX8Roc7H_Dvm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183929403158500 arm_cpu_has_work() runs without the BQL held and can inspect halt_reason and event_register while other CPU contexts update them. The WFxT timer may also consume HALT_WFE asynchronously. Use atomic accesses for the halt state, including the WFI/WFE and halt-exit stores. This keeps the halt/wakeup protocol race-free and matches the atomic state transitions used by the asynchronous wake-up paths. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- v3: Dropped rth's R-b because of HELPER()s call also updated --- target/arm/cpu.c | 7 ++++--- target/arm/tcg/op_helper.c | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 5cfd3bcfc8e..090470da40a 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -144,20 +144,21 @@ int arm_cpu_mmu_index(CPUState *cs, bool ifetch) static bool arm_cpu_has_work(CPUState *cs) { ARMCPU *cpu =3D ARM_CPU(cs); + ARMHaltReason halt_reason =3D qatomic_read(&cpu->env.halt_reason); =20 /* * Only another PSCI call can wake the CPU up in which case the * power_state would be set by arm_set_cpu_on_and_reset_async_work() */ if (qatomic_read(&cpu->power_state) =3D=3D PSCI_OFF) { - g_assert(cpu->env.halt_reason =3D=3D HALT_PSCI); + g_assert(halt_reason =3D=3D HALT_PSCI); return false; } =20 /* * A wake-up event should only wake us if we are halted on a WFE */ - if (cpu->env.halt_reason =3D=3D HALT_WFE && cpu->env.event_register) { + if (halt_reason =3D=3D HALT_WFE && qatomic_read(&cpu->env.event_regist= er)) { return true; } =20 @@ -882,7 +883,7 @@ bool arm_cpu_exec_halt(CPUState *cs) timer_del(cpu->wfxt_timer); } /* clear the halt reason */ - cpu->env.halt_reason =3D NOT_HALTED; + qatomic_set(&cpu->env.halt_reason, NOT_HALTED); } return leave_halt; } diff --git a/target/arm/tcg/op_helper.c b/target/arm/tcg/op_helper.c index c2b09176cb1..643b1482523 100644 --- a/target/arm/tcg/op_helper.c +++ b/target/arm/tcg/op_helper.c @@ -398,7 +398,7 @@ void HELPER(wfi)(CPUARMState *env, uint32_t insn_len) target_el); } =20 - env->halt_reason =3D HALT_WFI; + qatomic_set(&env->halt_reason, HALT_WFI); cs->exception_index =3D EXCP_HLT; cs->halted =3D 1; cpu_loop_exit(cs); @@ -460,7 +460,7 @@ void HELPER(wfit)(CPUARMState *env, uint32_t rd) } else { timer_mod(cpu->wfxt_timer, nexttick); } - env->halt_reason =3D HALT_WFI; + qatomic_set(&env->halt_reason, HALT_WFI); cs->exception_index =3D EXCP_HLT; cs->halted =3D 1; cpu_loop_exit(cs); @@ -629,7 +629,7 @@ void HELPER(wfe)(CPUARMState *env, uint32_t insn_len) } } =20 - env->halt_reason =3D HALT_WFE; + qatomic_set(&env->halt_reason, HALT_WFE); cs->exception_index =3D EXCP_HLT; cs->halted =3D 1; cpu_loop_exit(cs); @@ -723,7 +723,7 @@ void HELPER(wfet)(CPUARMState *env, uint32_t rd) } } =20 - env->halt_reason =3D HALT_WFE; + qatomic_set(&env->halt_reason, HALT_WFE); cs->exception_index =3D EXCP_HLT; cs->halted =3D 1; cpu_loop_exit(cs); --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183594; cv=none; d=zohomail.com; s=zohoarc; b=FBJa95DbHZnJr9Mv+uTLEZMk7ohoHBpa7XMMW6n8HINMxHTSTR82E4AdbYKFEDci/QYlmXnXSm9jqfk8cgq175PJDqQmHaVmx7/3cHkXNgOl3/k+fxpur0H/AD5hd6zPppSsxBD/p8CKamxM3RBvFXym32nbgMq6JKEFn9UK5qA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183594; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=kRgYgQN0I68E441Z6FdMRIvgm0ZT03zmfUCw+g3PTWg=; b=Lw1fUm5HtF9RQz9xdMBrbW7aHmEzyhxBFO0illdhRAQHfRieaKKcm6EQl5r7I2lOkjT943r8BvYRM5C51y+RHLH3CnvbgCSAhWxZsOWoQK9N8lRzAHmFR4giq0wa4xPYTV0E9Rok7IM0jXPZq1QuRECtqANs6MPoOpNyMA/y90U= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183594569414.58086608511667; Wed, 23 Sep 2026 10:13:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QWd-0004kv-75; Wed, 23 Sep 2026 13:12:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWW-0004YW-90 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:49 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWT-0001BU-Jn for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:48 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGU37K3106209 for ; Wed, 23 Sep 2026 17:12:34 GMT Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfmwh0y2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:12:34 +0000 (GMT) Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-7915a83539fso1053749137.1 for ; Wed, 23 Sep 2026 10:12:34 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4886848646dsm7548518f8f.10.2026.09.23.10.12.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kRgYgQN0I68E441Z6FdMRIvgm0ZT03zmfUCw+g3PTWg=; b=JlLKVw0ElzDUVHJK Ni43HEFvUiXP2AWV7nFngcMz22cFMlCnfoc3+t0Cwia4Y9+WP8ij4NnrPRsf5WlQ d2fP/W9B95TUiZZm4kkY/mgZU0FXrw316l2h1GQ2uWh9GKrluD8Efb039ttAcQvR qlyXktrk17DqEQmKjS6IWJOD/vACBotomCV5U3TctWS9WtsvuM09ce+4fRkWGgpC 2ObVsdFGIDUgsVd5No8Sc+lBFERhXKFM8x/g2kBYLaep+IvCfhqpghNlq9Jl+WOa a0PL2SbXfeqG+A4qIDdVhN+5zMmsM0CdKerhtZ0069dlQVaRdpHeCweCk9UTfvbi td8HwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183553; x=1790788353; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=kRgYgQN0I68E441Z6FdMRIvgm0ZT03zmfUCw+g3PTWg=; b=d6mDxwgaJeZOCENJsn+KJ0BsyBNyb0L21h+xIVq4OuoVzu/rYeQJneCGAmQAA/Vs8m jfT7JdgpG6K2N78mTcMKVOxC/MtjcTHsYO7vrFWvxoTsNn/IQyRHARrAfobRxFs9zMjF 3LcP7hNQh1s8mzQ/40Jyk9KwAM89Zxz8wmy7iqgpo5iPQNPkJz0DIp3l7JL4MWbvZf4m RTcpmcjGtgEE6DJ3rox07badJkHG5Uc4ITyXjpvQCk+ajD3NJkhzSedbc8Nd8jDEmn/k aaBrUQg4zM6d9kYZ2yUJXoCP3tyhPSxCoV30geYQFC8Irgq1xxgDrwA2/CMX8U5QX0uT vmfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183553; x=1790788353; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=kRgYgQN0I68E441Z6FdMRIvgm0ZT03zmfUCw+g3PTWg=; b=W8/oq47mJKDGjvYH+NjZTyv8LyZLBdPkQgUx/BFps27CY4D624iSPIU4QARV4xTtQk seEo6b6NEFg1xJ3NgUuzcVwXxSSS0UgnP4R9J0Ibv/iOZFSdEqoo4zxQ3jhf+RdMwJLk Jaaa5dgwMvPIE0r/Jt4NEBDCHmfE12D+cem+CsFY87S5w+wfxKJjj/QhbxLj2e7pOIok E0AC4FF4ewSUlNVNR4lRAIKpSKy1DpTy24epA6IWq8vRzlusEjA3sMNE3jRwHh6XQ7lA xLo2qtb5DG486UkzTF42SgdKwEhaC2XVEN1XuhLMCkEpcLm0gTrpij7RvLqScn4kNiP3 WLRA== X-Gm-Message-State: AFuF++kuY5Euc/39pus6M98UBv+7Kb/vqfl5r204D1uOJOFTzN9Y5G1N 2C58MUhbfZl4ujFZOkVtMlGFaTgNAk8rEpDCFSf0CYNMPfxEWpxPxCDA3+jT59zqmGfvMK0j6VB Z+0DAaWjTpuWd4AGK+z99KRCS1UxUmika8p+VF4JBVZQyk2Wcv0S1Pfo33lbA/KmCHa77 X-Gm-Gg: AYBFou3ntEQ6LFAo7aAAWfADeUfz+Z3mcqoZWMhegdXOTS3RVsEHWxlCx+trXCNNxUq SMNtC/RzAknk1P+Ngk+blod2B52U/YLFfTxTUQqTBMI7A+62xkxDjPh03x50GvLuEeu4Sn8dRw1 CIWwKXH89LpdnRmG+KA8NqoZS/1dy5ldHpCovQ6x9BXLMWdBGv8nWY0KZHoHE+gTt7xmPytTAAH RTqthpvyq6V3KADCpiCNRPDd9SY9HRkLfH5SQfFkwZ6LNrtDDWgh1p2O9K+osJ/XSYiSb/+QEKM wOKfCfIrt5d7OwjUHqWEpkgn8vuP9v2/VwKkocevGgXAxQUl6yBjF3sk640Gns06ivLX8Ds7Iq7 3L/sXrsLlPYIKgX9GW1B8+C/7j0FWra1lgPpgH5qF X-Received: by 2002:a05:6102:6886:b0:7a1:f951:664c with SMTP id ada2fe7eead31-7ac1c78da3amr2579090137.19.1790183553515; Wed, 23 Sep 2026 10:12:33 -0700 (PDT) X-Received: by 2002:a05:6102:6886:b0:7a1:f951:664c with SMTP id ada2fe7eead31-7ac1c78da3amr2579062137.19.1790183553101; Wed, 23 Sep 2026 10:12:33 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu Subject: [PATCH v3 10/21] target/riscv: Skip empty MIP updates Date: Wed, 23 Sep 2026 19:11:04 +0200 Message-ID: <20260923171116.31276-11-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX9H+wpou1ekqU uQt7U0UufadhaNWIpIZnBguSxglLMsK1Urv/Rns/3ze0Kd4v+aHGDjsg8UpVk+w+YSuasBtvcPm bdjB3iB/JZGQtD9iEO/rLkPpabU81327BQSa+T4ueL3JZoyr18GK1pLcm3fGQULN7HLgM7EBvdX bMCNB4nh4Wm8O/tJ5QNQoLq13GoLHXVUeFLTcZ8AS36huH9UAQNdhoHtLG6yROpwg1AohuzaVK0 iYUKJjEWyUnWWv+3G95ztX8tWHq5imxvE6HcSUSakPQ9fkWQIphrvtsKCgzttWvs3IXycJWGKfL oAd7zzDZ+3d7Td0BoJsVEQtpnOBnQHyNRo3yuqzlXgWH4IcMUyJBEv9aImCbr/uS+dvc8C7hOq0 qH801sbWSXxKaNy1pyIo6OH54tKb6Aq9wVsnUiHPBmHL3VqG1sURI0XMS+cZkdV3RqOYivNWBXJ CQwe7mKs9FIjzg7lwBw== X-Authority-Analysis: v=2.4 cv=WK/qzXsR c=1 sm=1 tr=0 ts=6ab40882 cx=c_pps a=P2rfLEam3zuxRRdjJWA2cw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=EurB-bMe9Chw_IDMuCwA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX48e6AZF4AZsh QiHOsbe1Vfoc6BhoPEcWoANIjAI0rM9mF+ehGbjAGCE3SmVv3bBJxHnQf2nsB4sfmH4xlYo1Omx 9v6Hs2Z0f7rYiaNAId9NcoqDTWBGing= X-Proofpoint-ORIG-GUID: 8OqJfbTzi4uD0cZeknyzl_3dMZxrnSyE X-Proofpoint-GUID: 8OqJfbTzi4uD0cZeknyzl_3dMZxrnSyE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183597703158500 Return early when the effective mask is zero. This avoids taking the BQL and processing interrupts when riscv_cpu_update_mip() cannot change env->mip. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/tcg/cpu_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/riscv/tcg/cpu_helper.c b/target/riscv/tcg/cpu_helper.c index 07d92226527..be64f9ee8f2 100644 --- a/target/riscv/tcg/cpu_helper.c +++ b/target/riscv/tcg/cpu_helper.c @@ -580,6 +580,9 @@ uint64_t riscv_cpu_update_mip(CPURISCVState *env, uint6= 4_t mask, uint64_t value) =20 /* No need to update mip for VSTIP */ mask =3D ((mask =3D=3D MIP_VSTIP) && env->vstime_irq) ? 0 : mask; + if (!mask) { + return old; + } =20 BQL_LOCK_GUARD(); =20 --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183648; cv=none; d=zohomail.com; s=zohoarc; b=RvXrU2dCNBH/3Ec7Dy6AD9iWGRvxb22tHvLG9sBdAaQCWspVS7QfZ/ByzZ61tdKe5ptj0wQGtMJTfMtcs+45zGpKr7jftHsd8fNS2Mri4vcLMxVkXeYGUeHKFvb6JVSzJF1wplKeuzYjiN8jYdkCsr5qXETn2orrJRUw9FPJosw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183648; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=a93quepVzsQCmaXrVnT0S6jqUGluReByWnrx16eheic=; b=cjfkgw0sRRTCRzE9ujxfAhop98Q5pwg+FFCQ8VdKrxBOfCWN9iJ9vqFytNnGF3xPkeFYBDupvGiGCtUHIGEzaJwHGIx/TkshzSmOLBptm7ZH+w5pu1FnhWS3Mb8deYDVFrn0S2Z2fK1HQEM9rUd7Bwxg6iX2+MVMOvn3uWm5tkk= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183648400581.4875835628766; Wed, 23 Sep 2026 10:14:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QWg-0004wN-1S; Wed, 23 Sep 2026 13:12:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWd-0004mO-J5 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:55 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWb-0001CD-K8 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:12:55 -0400 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTiv23081886 for ; Wed, 23 Sep 2026 17:12:42 GMT Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvbx7j2cr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:12:42 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-97cb2f3c6f7so283654241.2 for ; Wed, 23 Sep 2026 10:12:42 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5b47da1sm1928535e9.0.2026.09.23.10.12.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= a93quepVzsQCmaXrVnT0S6jqUGluReByWnrx16eheic=; b=QwSCJ44k7kPTdLIo /Nd8mS2uRzYML0ElVbR+XPyVynOiCdGxaRlF+GagE97dTkJWJazJIOdnJ5pwVLgO Ps8OlgscUpQni+ficn2RRIlmGtRNw5+/mcBtX53JxhK+BPykV5aot7JBf0FdXIrE ffdVfRLHVRolMCpF9lADdMCgO40vD4ApjcqY7x99lP9gi+VphTCGWUz8Oc+n228w V+El4I4haz92uIBSORZ3zvaYDYgz//ZiFiuoTuXSdij+fUhgno/eqTb4Sv4rfmG7 9Lbpuks4AOabLwNC72Wb/novW+gLRIVokLagAIdD4XtlBRTYBPJIOEVgTpKbZ4IK qneOjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183561; x=1790788361; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=a93quepVzsQCmaXrVnT0S6jqUGluReByWnrx16eheic=; b=HHqsawnormiDvS7shu8pwtV05mmF33UTfbhsH0YqsH0P1V6WBUs9+K9HdLQz4ie495 ygETQIGbhP7m6Y3fPcsMI2MVHHMMlOwqsNK6yzK4Uy59LgCl8gJgEtzuSiByHi+Sr7Mg JVEtJMhFxdsYhNtmao3wL0O24s6JCL5/jk2asR+8CFdnXTOYkvHAfZckzvUX+0S/ztb/ O8TGEJGvAo8RzofIOisRnF5GvSAuoe357C9uFfWJuqWX0EGEIeOtCEmNp1NoAgUYLY/u bV5kwVEw/17oHQOy04TyWZOe46IO8PzVOoQxqSsT4lmiWSz8rNvSIwjma3SwqpC/dNXB uF6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183561; x=1790788361; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=a93quepVzsQCmaXrVnT0S6jqUGluReByWnrx16eheic=; b=qASe6x/13MYpSnEnyQQ8fiZWfvZqC9ZcYCcocDRpv+FteOmRccmB86MK+1faVURURi czzEf2W/CxKN5KqUg8mQZ/GuVXZskjAq8GbsuuOH5wUqFbKB09Nhjha4Gm6NI3Kdxj8P RiCHT4FDLx9puPX2irvq+R9dGbatBTIzCToYKV1p+wXomsAv2Zc5sVnDJJx8HwsCvZHH giz1PazCaiMoNliDImzh3l6zHWooUeYZxUQNX6lCM7SIpgK3n8cEHpIV4FAwwdz0KLhg xHP3M/uDYfCr1YbcXzCZ/Wbo9FCBfGiAi2dl7TJuPlrXuJHzSBTRtAkzadLkB6M3hf3W P85g== X-Gm-Message-State: AFuF++klCg/yPwxeMojqO3m/yIvsAgLJBWQSZpiPLEAUTTIFd5KjYiF/ qqDXJNwVuY1HCwAy0yZ8saNuY28CD4Nx00g+lmQbxSu3DW7gSdenf94dKuQ2zrYYMvfMTDmRcBp CQxKIgTG74Vz3iDpvVYc24lk9lSN3pZng89Ah9Sq63j4gmSMahfj7k1xfRZfSk+xfokqj X-Gm-Gg: AYBFou2adse0FISB1ZzrurYcKQKt7k6ef+Cs3c7B4zuYt/r0NaXhvWyGXe+g1FCvO3z 49Ox4p/MJXz2vxhyo6+Q9Ke1T+TwADPiXzL6AEtfoq8M9CYM6Smmf1vKbLoyS/7YaIKVRtl6jNu kh8EEcyIVgvokzVF/65wy3DzSqcMcQui3llH6Ot9qHuSEEcwXyptNlkWMY6p3tmOlW7JlL/YzTd etISUeSmaqB0JEWz5JfNvi7y14j0/+P5Lfr/uMFeNZwRz4CRyeSCuS6ZNS+EzbsklIYATNYeamw yiwg+qTuMmyOQ0qYwQLoNH0RzUvpiadP+kOdw7TKGRdmVV4+KVSlCSW5Ov7Gx31FWP1agqp28CV aMpIaOnAbYsCygzlA0O38lsA10PkpelrRv2VCAQhlgvCemeCvcAU= X-Received: by 2002:a05:6102:54ac:b0:7a1:f980:e934 with SMTP id ada2fe7eead31-7ac1b621439mr3137139137.16.1790183560994; Wed, 23 Sep 2026 10:12:40 -0700 (PDT) X-Received: by 2002:a05:6102:54ac:b0:7a1:f980:e934 with SMTP id ada2fe7eead31-7ac1b621439mr3137110137.16.1790183560488; Wed, 23 Sep 2026 10:12:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu Subject: [PATCH v3 11/21] target/riscv: Add riscv_cpu_get_mip() Date: Wed, 23 Sep 2026 19:11:05 +0200 Message-ID: <20260923171116.31276-12-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: zi_QDv3IcM9ZKXFslH1gUp3F2js6xtNt X-Authority-Analysis: v=2.4 cv=J4s/fwnS c=1 sm=1 tr=0 ts=6ab4088a cx=c_pps a=KB4UBwrhAZV1kjiGHFQexw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=CJh49rvbU3Czu_A6mFUA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXzxKTkRziDMMa Y0XiWhtvQ8WI/NRHu2TiReUJv84cEY7Yi3hdOJtMtUC8i+bi+S+2LgeYt+7MOZC7xAlULa8W4NX d2SJ49MmZPdf1nowiBtMKsrq0OGJDTwjzWLePqpdg1rstmqKmipY7XKNzXXE87Xz5vIqzl/09qB 8U/7Wf/G1yogzWTxmkyr0IUegrGF5pv1Zg46tgU/t5jfdWnrGuA81OcCrG7G0YzktihBooDDxnL GWHvvpS+ub74mHv2sZBe9Be2QP1DyBEbGROPKfpZZr4NEVws74ggMvdIndYOOLURlzdeGowSrPl UsJDXlOrbhqSBBouSiqKjlhK+2fdWUWUfgjV7td9cIE5hf5IHeKpGirlVeDHLjgApQtELssuFXG KTXiALOFjxNqb0k6FJdPPznOWo1kvSuuTT6iESfpVcP3yJxDjRmBNyQR+AncXTDaVxCX3UhPMEo 9QMjdxzH1Cy7FNQdq/Q== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX3zS38RcgR9pX SPl4Q9w0jF+eDdrZ/VFBImB/ebgrcMivegoYsckoIA+ihK8EMaNslc5KNdpPsWV6ubf9w0kStI4 zRngvwq0fLBVVEEl0TKKvYgW6r7tuKE= X-Proofpoint-GUID: zi_QDv3IcM9ZKXFslH1gUp3F2js6xtNt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 spamscore=0 impostorscore=0 priorityscore=1501 phishscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183651669158500 Introduce riscv_cpu_get_mip() and use it for MIP reads in interrupt, CSR, and ACLINT code. Centralize reads of env->mip before changing the accessor implementation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/cpu.h | 1 + hw/intc/riscv_aclint.c | 2 +- target/riscv/cpu.c | 3 ++- target/riscv/tcg/cpu_helper.c | 17 ++++++++++++----- target/riscv/tcg/csr.c | 6 ++++-- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 8c8ffe94cd8..be8c937bf5d 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -684,6 +684,7 @@ bool riscv_cpu_translate_for_debug(CPUState *cs, vaddr = addr, bool riscv_cpu_exec_interrupt(CPUState *cs, int interrupt_request); void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env); int riscv_cpu_claim_interrupts(RISCVCPU *cpu, uint64_t interrupts); +uint64_t riscv_cpu_get_mip(const CPURISCVState *env); uint64_t riscv_cpu_update_mip(CPURISCVState *env, uint64_t mask, uint64_t value); void riscv_cpu_set_rnmi(RISCVCPU *cpu, uint32_t irq, bool level); diff --git a/hw/intc/riscv_aclint.c b/hw/intc/riscv_aclint.c index 2d133d0dcf9..4bd359c3380 100644 --- a/hw/intc/riscv_aclint.c +++ b/hw/intc/riscv_aclint.c @@ -438,7 +438,7 @@ static uint64_t riscv_aclint_swi_read(void *opaque, hwa= ddr addr, qemu_log_mask(LOG_GUEST_ERROR, "aclint-swi: invalid hartid: %zu", hartid); } else if ((addr & 0x3) =3D=3D 0) { - return (swi->sswi) ? 0 : ((env->mip & MIP_MSIP) > 0); + return (swi->sswi) ? 0 : ((riscv_cpu_get_mip(env) & MIP_MSIP) = > 0); } } =20 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index da4c1a090b9..62ac4507ed5 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -916,8 +916,9 @@ uint64_t riscv_cpu_all_pending(CPURISCVState *env) uint32_t gein =3D get_field(env->hstatus, HSTATUS_VGEIN); uint64_t vsgein =3D (env->hgeip & (1ULL << gein)) ? MIP_VSEIP : 0; uint64_t vstip =3D (env->vstime_irq) ? MIP_VSTIP : 0; + uint64_t mip =3D riscv_cpu_get_mip(env); =20 - return (env->mip | vsgein | vstip) & env->mie; + return (mip | vsgein | vstip) & env->mie; } =20 int riscv_cpu_mirq_pending(CPURISCVState *env) diff --git a/target/riscv/tcg/cpu_helper.c b/target/riscv/tcg/cpu_helper.c index be64f9ee8f2..e524798d312 100644 --- a/target/riscv/tcg/cpu_helper.c +++ b/target/riscv/tcg/cpu_helper.c @@ -526,6 +526,11 @@ void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env) } } =20 +uint64_t riscv_cpu_get_mip(const CPURISCVState *env) +{ + return env->mip; +} + void riscv_cpu_set_rnmi(RISCVCPU *cpu, uint32_t irq, bool level) { CPURISCVState *env =3D &cpu->env; @@ -554,6 +559,7 @@ void riscv_cpu_interrupt(CPURISCVState *env) { uint64_t gein, vsgein =3D 0, vstip =3D 0, irqf =3D 0; CPUState *cs =3D env_cpu(env); + uint64_t mip =3D riscv_cpu_get_mip(env); =20 BQL_LOCK_GUARD(); =20 @@ -567,7 +573,7 @@ void riscv_cpu_interrupt(CPURISCVState *env) =20 vstip =3D env->vstime_irq ? MIP_VSTIP : 0; =20 - if (env->mip | vsgein | vstip | irqf) { + if (mip | vsgein | vstip | irqf) { cpu_interrupt(cs, CPU_INTERRUPT_HARD); } else { cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); @@ -576,7 +582,7 @@ void riscv_cpu_interrupt(CPURISCVState *env) =20 uint64_t riscv_cpu_update_mip(CPURISCVState *env, uint64_t mask, uint64_t = value) { - uint64_t old =3D env->mip; + uint64_t old =3D riscv_cpu_get_mip(env); =20 /* No need to update mip for VSTIP */ mask =3D ((mask =3D=3D MIP_VSTIP) && env->vstime_irq) ? 0 : mask; @@ -586,7 +592,7 @@ uint64_t riscv_cpu_update_mip(CPURISCVState *env, uint6= 4_t mask, uint64_t value) =20 BQL_LOCK_GUARD(); =20 - env->mip =3D (env->mip & ~mask) | (value & mask); + env->mip =3D (old & ~mask) | (value & mask); =20 riscv_cpu_interrupt(env); =20 @@ -2064,10 +2070,11 @@ void riscv_cpu_do_interrupt(CPUState *cs) bool async =3D !!(cs->exception_index & RISCV_EXCP_INT_FLAG); target_ulong cause =3D cs->exception_index & RISCV_EXCP_INT_MASK; uint64_t deleg =3D async ? env->mideleg : env->medeleg; + uint64_t mip =3D riscv_cpu_get_mip(env); bool s_injected =3D env->mvip & (1ULL << cause) & env->mvien && - !(env->mip & (1ULL << cause)); + !(mip & (1ULL << cause)); bool vs_injected =3D env->hvip & (1ULL << cause) & env->hvien && - !(env->mip & (1ULL << cause)); + !(mip & (1ULL << cause)); bool smode_double_trap =3D false; uint64_t hdeleg =3D async ? env->hideleg : env->hedeleg; const bool prev_virt =3D env->virt_enabled; diff --git a/target/riscv/tcg/csr.c b/target/riscv/tcg/csr.c index 061bc9db77b..a0e32f14276 100644 --- a/target/riscv/tcg/csr.c +++ b/target/riscv/tcg/csr.c @@ -3816,7 +3816,7 @@ static RISCVException rmw_mip64(CPURISCVState *env, i= nt csrno, if (mask) { old_mip =3D riscv_cpu_update_mip(env, mask, (new_val & mask)); } else { - old_mip =3D env->mip; + old_mip =3D riscv_cpu_get_mip(env); } =20 if (csrno !=3D CSR_HVIP) { @@ -4549,8 +4549,10 @@ static RISCVException read_vstopi(CPURISCVState *env= , int csrno, hviprio =3D get_field(env->hvictl, HVICTL_IPRIO); =20 if (gein) { + uint64_t mip =3D riscv_cpu_get_mip(env); + vsgein =3D (env->hgeip & (1ULL << gein)) ? MIP_VSEIP : 0; - vseip =3D env->mie & (env->mip | vsgein) & MIP_VSEIP; + vseip =3D env->mie & (mip | vsgein) & MIP_VSEIP; if (gein <=3D env->geilen && vseip) { siid[scount] =3D IRQ_S_EXT; siprio[scount] =3D IPRIO_MMAXIPRIO + 1; --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183926; cv=none; d=zohomail.com; s=zohoarc; b=b8dG1q2R2yTReNef90f/3YmqHw6glMMsuNJK5MM4KGWmKwpsm943NPNl48oOIAa06hpkC1zdzvyWMIDOUDDwRTA2XqZD9ffElAAnncvO5Jqqppp+8L8zhr2pz9gMRXiTHmaiUeFuTxbsFeM0hMKwkwhhyf+1PvPKXAVctpgLs1A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183926; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=IeLVm5/+AbWfhQYlNgRIjGIoDIVppu1o783xUoR+s+A=; b=OI1oTzn+ah5y9ZejAyeYutO8iK1YxRs3m1xoYsrz1+s1rYkYAd/7oF/7Go0IB9VpVgKawRAIgQieB+m4GFRAhBE06uXFLCJrCAVIXlC3QIjjzptWCn1dzWGcTMgYWJO8YsB78pb8/ebIKHDLgE5aM3FBhIHtE3i5YJNDJA8HJf4= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183926881924.0650589740163; Wed, 23 Sep 2026 10:18:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QWn-0005Jn-NG; Wed, 23 Sep 2026 13:13:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWl-0005Ah-4Z for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:03 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWi-0001DO-VF for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:02 -0400 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTsZk2470361 for ; Wed, 23 Sep 2026 17:12:49 GMT Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfjv12sy-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:12:49 +0000 (GMT) Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-97e99615e0dso62376241.1 for ; Wed, 23 Sep 2026 10:12:49 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5bae53dsm875175e9.4.2026.09.23.10.12.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= IeLVm5/+AbWfhQYlNgRIjGIoDIVppu1o783xUoR+s+A=; b=Av6laJltTdL/EMLE iTVMtsWtI/PWMZnlA9r2vRbBaHC8TR+yoKjcPz/xnGOEsHt94p+EtoF0QAyo1bhh 2NqZstN0xsTGEVACBsNvsseVAO17NuOlJi6G62Rbn/qg9ILOCD14sqY+UiFy0WWO cBrYZkFNGxOhyKr2WP8T1dTyX3Nne/mYPl2TQmrhp3DyR0VdPB8iAGHsZ2rtvyIg 2Do3x/qPwMs9G7+DVxYwMawury/u68Kt4sM7roZiSh1mojfKl0kfnqZCAKDV1cAl uxbgAtnAkTTgqQPxvp4hyhfKegHlTjUdFqpkJoUPkfD3WRoQXxbwYjsuH+qway6E UmEzAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183568; x=1790788368; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=IeLVm5/+AbWfhQYlNgRIjGIoDIVppu1o783xUoR+s+A=; b=JsPekU0DZhXuLZfM3+wUgqr4YWRXcj2TsbU2wVHdmsYKqoqbjV+tyxg4+p2YXqBhYK Jqoji0ZxXNQ36jEKxM4MIZrS6+CibmRP6adXykvjrFiJ3Dh9pPAW0374EeidkT6B9pQf aJjj9+Pli9OL6q1AyV3qaPLYOezZfpIh+2nUpCSfAdGxdt8BofMYBO6Ogp7nJhBnTwyp oWEqg/hP9NhtgqqBVdOBAJOWaa1PzQ8K1IMHwohRJjEtK07W9ej+pzFwo0COHhDedVh0 ci3r6SB0xNtitk0q6qjrhe67cvbZRshhr8VkZC9xhZ5uijemgnZZftk9XH1v/CB4x739 +AOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183568; x=1790788368; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=IeLVm5/+AbWfhQYlNgRIjGIoDIVppu1o783xUoR+s+A=; b=nx8jS8F5fRfqCTkIqR/pALnE7aZ1qeU84/u1uNzI/e0xqCOuInFj4ej2OyKtAKMzJI a2qbPyS+xsWeEtVCCVU/R/ObG1qcTbwsFE5zjLMhH6P73XhgqtVtcQdPqJ+FzOyDmkq8 HoNiE1rZJ+0SVXHLgHSjZFk2cp/3JvR8kSwuahCyem71EBO6RKHL0NUsT2QVBHNNlyZo hx1oVBo1ZBMaPalUutLdgLH+vqZty9Z4zM96rWWmLIUsT8DQNpSZLaXkoN6TnEaPeKd3 EGTIyewEyhpYfQAT4CIRvxC97qANBufO+zXQE6kUCjM1KdW0og8kYrkZ3zcqUknImPMX dKHQ== X-Gm-Message-State: AFuF++lmB8CjLou+DwmImhmJagWl5heIoMxbp3U8yVJKBSKDAUHJyMhg mFU/9uN7be596/+gEgodfwvG3Spz6COwf12Uu/79c4QclteoZVxwbYcCaAF1C1hVyqMzUxFIlLZ ntbjVDBBIiOtFnWkfu3pwE4NVZoWp9j426avnlIw/mn6/CTSMYwHWn9J0Cdb9Ju4yF+CI X-Gm-Gg: AYBFou0w/tAMXPPQLcmyaDCGKfWZ4CLHfK4/+kBaew040JNb9azKpSpKunuWLm/F1MI Fy+2CDV3XJqK4bvAN7eM3ohdVoOcqkosCFhMwgkTLdi07Fyv89saLVsyruD7RAAoE6d4p2MDzDT Lzjk28HQjOVZX0kQW+AkqGvdTqRo9Y2LRxugaAX+uyzt9FBmUy9V3oxVCkWka4jXG65LuhZ/Ff1 ImbzB2c1okyGcmKAnobDvyPrflaxuXWXYLBIXCXkp3iRPL2RDYc/ksB6NjeZp37TpzJs1jczch3 VyxSMs1b/njC0mzY5//+0sL2WA8mUDF4FR6bwv2SoUrxw4Th+u5GGMjImuIRUbECJS+cGpfxJCA fxeK0YTwLZuh1n1k3Ci/BiCVV4VRLK9U1gx0TaTML X-Received: by 2002:a67:ef8e:0:b0:7aa:d0a9:c5aa with SMTP id ada2fe7eead31-7aad0a9c60dmr4313404137.18.1790183568418; Wed, 23 Sep 2026 10:12:48 -0700 (PDT) X-Received: by 2002:a67:ef8e:0:b0:7aa:d0a9:c5aa with SMTP id ada2fe7eead31-7aad0a9c60dmr4313381137.18.1790183567911; Wed, 23 Sep 2026 10:12:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu Subject: [PATCH v3 12/21] target/riscv: Access MIP atomically Date: Wed, 23 Sep 2026 19:11:06 +0200 Message-ID: <20260923171116.31276-13-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX4g9/GmFHGRe9 wyPgDn1af1l/nqNIJmxK3e+uT5Selohq/q4nCvCcUzRE2H+MtnQEtAUNh3CQm1C1kYzP1lQt7d5 8lvqEipb4li/sYGWH1ARIcWKXs6t9qXIhcyNTevXcusXcDiMHleTxLxzwxvjQ2zwjRUs2ati110 wbf7guR68cm/iNTHldGlzMzyVKzX+53P86ReyzeIyEaTLizsoVmlLxjrz0rOyvKCoEtmQec41L9 cSs9KXzYnlUQt8BKCEvfH09d3fw4IcE0jonl1Z59tV1HqGjJosrvEOpF9WssANN8w8bZXDGjhls C2XFrozBN/bBrtzy3m4hqLTi8eLv4xhC+be95MJu1SVmQUH6wDFg80r3Ip9ddW5mDoxm3cPPzYC YoLm5bfC84WlQ6YGywvM+rWMsj9eEHZfsZhvlIUqNxExOlAPZKG7VSozNU12nKIMH9Eg2w8uM2D P3A+Q7OX0YHKaXPPZXw== X-Authority-Analysis: v=2.4 cv=aIxlOr9m c=1 sm=1 tr=0 ts=6ab40891 cx=c_pps a=R6oCqFB+Yf/t2GF8e0/dFg==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=-7qWTPA4ftCRTD5zRq0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=TD8TdBvy0hsOASGTdmB-:22 X-Proofpoint-GUID: gbsEqcb3rf38SnHoXoPo97_WjN9cRcuT X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX78tIiGsHvQu+ XsHMiN6gTxIzh/pVeqAOuGEfFGFjJ0pjMs19/YccUd0VYbiK7oVEwKNxWFDlOMldwHQyKfrhwm1 Y7g1SWJxmHyWm9aNc+fgkYe6bMC4KxI= X-Proofpoint-ORIG-GUID: gbsEqcb3rf38SnHoXoPo97_WjN9cRcuT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 spamscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183927308158500 Use qatomic_read() in riscv_cpu_get_mip() and qatomic_set() when updating env->mip. This makes MIP accesses safe for riscv_cpu_has_work(), which may run without the BQL. Reported-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/riscv/tcg/cpu_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/tcg/cpu_helper.c b/target/riscv/tcg/cpu_helper.c index e524798d312..2081875a206 100644 --- a/target/riscv/tcg/cpu_helper.c +++ b/target/riscv/tcg/cpu_helper.c @@ -528,7 +528,7 @@ void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env) =20 uint64_t riscv_cpu_get_mip(const CPURISCVState *env) { - return env->mip; + return qatomic_read(&env->mip); } =20 void riscv_cpu_set_rnmi(RISCVCPU *cpu, uint32_t irq, bool level) @@ -592,7 +592,7 @@ uint64_t riscv_cpu_update_mip(CPURISCVState *env, uint6= 4_t mask, uint64_t value) =20 BQL_LOCK_GUARD(); =20 - env->mip =3D (old & ~mask) | (value & mask); + qatomic_set(&env->mip, (old & ~mask) | (value & mask)); =20 riscv_cpu_interrupt(env); =20 --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183645; cv=none; d=zohomail.com; s=zohoarc; b=Dn6RMDm7Y1CxI1bX+hlhVct3nguuSl36qPs4IYQIZGrN2fvDIFzhmWhAKZFL7kfnIuQO0vr4Y/3DeCHzz039OK9sCxFmjMhTH4PpQ/jzcRSRmTUrV6llO+Z/vZJgw4sguaFUVhQ2lvF0KIA3ZJV7hzHKqbUXWyBa+UHGDrfhMPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183645; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=kDFRggGBgd+2DtAqNLeUqcVcpYvkyK4ydCRh++BAI8w=; b=QdAV+0qkU0WEIDrZAb6QZhFD5aip9RiwmBL3cKodLeVY0xfMe2Iak7bsfPbXstRrKFAR+YeiJOjpjPEp5HKiFnbl43k4EWHGCyvtBT7XnALD0tEHRCCtiFIlJV10SWWBX0KMdCJ5xKk3Qcm5SdNPQf9dHfdH/IV9KmCUiBcREvY= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183645650437.1864994387787; Wed, 23 Sep 2026 10:14:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QXC-0005wb-Gp; Wed, 23 Sep 2026 13:13:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWr-0005bh-Pq for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:09 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWq-0001Ee-4a for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:09 -0400 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGUFCx3281270 for ; Wed, 23 Sep 2026 17:12:56 GMT Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gv9bqjubs-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:12:56 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-97e9e2deaa4so1102955241.1 for ; Wed, 23 Sep 2026 10:12:56 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-488684862a3sm7725749f8f.7.2026.09.23.10.12.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kDFRggGBgd+2DtAqNLeUqcVcpYvkyK4ydCRh++BAI8w=; b=MG1L9yb1SroUlmzd IEAy9uDQv6t4NB5f5hrPDui5SVyuJ3pgr8gECdQNzECU+q0DsHM/acz/lx2lundN wrycXat23eTCpR2bFGdX3Wxn2YZV9QvpTtWjqMoVnJ7JCFV9E4IgiU6Y1aAQAfpl EDl+tCTXt9W0COLJwCoToXeeq8D8SzEO6SFBdy5EElPaFK5h2DqxSj+h9Q7E0IYs JvNiLsrRN0klott2Kh6KikpzEHdLsQgBMnDFX1F8CE2zARURdZTf/9ezsjiTRNqc 6Q9YmivgBWQi2bIPX/7ELwHDkQi4CyyGH+kEQX1rw8+WZg483To50X+TtjHBY9tf WsILYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183576; x=1790788376; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=kDFRggGBgd+2DtAqNLeUqcVcpYvkyK4ydCRh++BAI8w=; b=IKkpb51tQoyYXu+mFJRzBbZxDPadESHE0rduUAGi6wsJjRaqRBq5j3YxnMLMYnF6Nw QUgZpXWWqMmBHbDTV466tzgS+N+RSjOj/DPEOVlWnYhb5MAnQG0urhzzZLb/RJ87Wc/f vva9ZLQA3vgfidHK4OcXANkWfdBM6s3OlEOClfa6Ya9MlVDgBWTAQt6Xa2S+4UlSd/AT mtFcaIBgqpmHzChWhNplEPD3NRtgHjh3iFLXj5AgeuuNF7U2W/CKgH0P6yThheSScwPi 3xtwftRlHOOj4/cGp6K6+ad6ci+n6D6I4P4ZIZFMjX6+nodYl9+HkEMpeKGKJjjBQHZY x9hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183576; x=1790788376; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=kDFRggGBgd+2DtAqNLeUqcVcpYvkyK4ydCRh++BAI8w=; b=eeih7DVBZBJ5AmpCqByUDciMIySjpYNFHRwziNIsf5Q9ZAwx7ol7dZWX38iwMU9RCx HVJvI9yQx60rs0N3RtB4VvPhYVaPA8xtqnNjsOAK2HMDfK+Ez8VX3y79wxR4gQjDHyKe 3sJGqAN00GjdeKyYTeMP/qYyN27tVpX016InVD8S9p6/2OOSEdio4Ns1Hu1fbuK21OY4 gjpjTShVr/UL40hwFY3GoSPo1/O1xQGDVyLxmR0Ti/7Ck9jW1p1JUndNrCUkmq2U4v+P 1sIlC6Br+6lFVsIIL+g2py1I5NX3CIyHu4Bw2uz16pIOs3IOjnI2lKILBy+twelVVmUC NPRw== X-Gm-Message-State: AFuF++nluyH2z0LeRnDCr2clFHOJvOSyGDErdlnfUzosBFqCSK8H30R7 3hdyVGf/TIhlAB+6G/ZgnE549WCT+zZOPDEOYuVZ7opjlek5HWfxQ4rz9gN5VuupVL2YhU697lI BrN9QxKa/QvzI9XelfbzfZxQTJOulU4v1OTlQbLdRebJlz6p8ZKNIhkOWu4qmBCN+FAGD X-Gm-Gg: AYBFou3n4KZTT1NEBMm6uaMae+3TLD/2L4s7Kdy898HSPsXYy7/eJ+F81alKuvfzT0C yIrs1VU8AEf/qxY0KvLbwI4mz3x/pJuOL2A1+HsSjHIpA4ZjgSH1esOMWAUtSFLd0g+tKYPZ7yY hHkkvSjSztXug3D+1FShhqqs4mxzS8JaqBfx7WdBG2eDt5Oac3o1yzWGgHLm4DNSot17y9D4Pno Zgi5FgFfBAzbARXp7B8VeJNi9aZXQekzXh08IL/n/ZzhWLRKCew+2vONlbByVfPmZcpkjM0AEwR YjCxiq7wN5ncXMAvfiXAI3oP3D84ZJLDy765YEJDxLAe9raHVQ8icVMBBGg/V6eT1NVP1qXFy4Y mkQkPnalfm60jajyhHPboZUaFFuYAUvVVtvMK3F9EDJaat+p2MC8= X-Received: by 2002:a05:6102:808b:b0:7a1:f7e2:aae9 with SMTP id ada2fe7eead31-7ac1d914ac9mr2634358137.27.1790183575775; Wed, 23 Sep 2026 10:12:55 -0700 (PDT) X-Received: by 2002:a05:6102:808b:b0:7a1:f7e2:aae9 with SMTP id ada2fe7eead31-7ac1d914ac9mr2634330137.27.1790183575375; Wed, 23 Sep 2026 10:12:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 13/21] accel/tcg: Refactor poll-while-halted flow in cpu_exec() Date: Wed, 23 Sep 2026 19:11:07 +0200 Message-ID: <20260923171116.31276-14-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: On9ivABxVyjNIKDwVdi4K-ESkDF1xVVw X-Proofpoint-ORIG-GUID: On9ivABxVyjNIKDwVdi4K-ESkDF1xVVw X-Authority-Analysis: v=2.4 cv=WZuZ+EhX c=1 sm=1 tr=0 ts=6ab40898 cx=c_pps a=KB4UBwrhAZV1kjiGHFQexw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=xF3Xt6V14tk6trZ56bgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=O8hF6Hzn-FEA:10 a=o1xkdb1NAhiiM49bd1HK:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX/FBdqNE3qYfC O/n/FlEb2Dia/RkEPRjt1seCtXQYnxsOmkdmWw8oIwWmQVStcUGwuGQaIBHvfb+XUBsGLJOkS4H sdMrZMv6psoeb8HB2O1QD1lqNXTXSFc= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXz0QTNxP3wy0S 3iID86Pzm+SK4sVj9wcJ3OyS1yzzfUNg4LK3huuJsM6eWeMezIC3UjbYdy5KR1Khb2Aw/fS/KHc huAhphGgRL6XRBD4ar1sEOTk0eBh+eVrqeMseQAt/7xvYfpG1gh0XLZNhqCY6D77mixtc0rbrSa g5Sb9D6jNEBNvWMe30XGdGTdgyYy07DV6Hn/ZFf7ZkLYEnhSdjnvYLsdYX5Gs4ySlK4d+rX6T9V 6mpxbU1Ma96cKYG8+/L5O1mc2JIotTVhvRTMHEaP7HZ4zgJPsMucQwqzIZFVvfXI/i7hjEplxAv Mc13v/pVcX7KZV0T4zH9vKuySfTZ/CQ+6mIFlPA6d8gWdYXnLp4wvmWprleTHXRG9Ck/brRDjAT B+oCdYA4IqilUDSHCHpwO4sOYTQyf92zrhsVJ4AdeJ+SOoJCI9j+jjjjDncw3v7wnUT1caBK8Qh 5G2NyIRmLmB6MHkV8pw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 impostorscore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183647554158500 Invert cpu_handle_halt()'s logic to read in cpu_exec() as "if halted, poll for async events and find work; if no work, return". Rename as cpu_poll_while_halted(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- accel/tcg/cpu-exec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 46b723cb734..76182803592 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -654,18 +654,18 @@ static inline void tb_add_jump(TranslationBlock *tb, = int n, } =20 #ifndef CONFIG_USER_ONLY -static inline bool cpu_handle_halt(CPUState *cpu) +static bool cpu_poll_while_halted(CPUState *cpu) { const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; bool leave_halt =3D tcg_ops->cpu_exec_halt(cpu); =20 if (!leave_halt) { - return true; + return false; } =20 cpu->halted =3D 0; /* allow execution */ =20 - return false; + return true; } #endif /* !CONFIG_USER_ONLY */ =20 @@ -1027,7 +1027,7 @@ int cpu_exec(CPUState *cpu) =20 #ifndef CONFIG_USER_ONLY if (cpu->halted) { - if (cpu_handle_halt(cpu)) { + if (!cpu_poll_while_halted(cpu)) { return EXCP_HALTED; } assert(!cpu->halted); --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183699; cv=none; d=zohomail.com; s=zohoarc; b=NEx65LJ1DFB9FpsaknAO2PQB4hwp0OUeIxzOtQdJ6VpjbWv3ePlNdEYDBwFIBdFC5MIpt3/0xrDYT2WSkUogcCKk1f+oNUN1hNVcmVyYDnsEl45uZ78HNlNDvXp6VUdPiwi9WYM7+b33cHpYHecrp1e7rDU2J5p8wnnsaEn+dzE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183699; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=TmpLRtcALdGvnoiA64jtGQ7kzwpnFEecY1PS7YhgtmQ=; b=TzWP5g4/ES6t2B6oHErRfTh44dCPH8La/i/7PmPRP7qEfdiKVkdQ+2NE+LlkGYkJfW2djf5IWky5z5vgfe5/mRzCh+dFqnLDG7MbVIiWkrOTMpJZyWYK1HnqUMlrh44xDm67UyIuE/IJl9oX+fwyYXL5sG5qS0WyeSj83KCRB/0= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183699685259.65672967318926; Wed, 23 Sep 2026 10:14:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QYF-0007I8-Lg; Wed, 23 Sep 2026 13:14:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWz-0005qq-Kc for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:20 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QWw-0001GF-Qg for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:16 -0400 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTbmF3798584 for ; Wed, 23 Sep 2026 17:13:04 GMT Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvhsb0c15-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:13:03 +0000 (GMT) Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-785827e6073so352674137.1 for ; Wed, 23 Sep 2026 10:13:03 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe0c104a6sm67021345e9.0.2026.09.23.10.13.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:13:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= TmpLRtcALdGvnoiA64jtGQ7kzwpnFEecY1PS7YhgtmQ=; b=nisyyqOohJaiCiNO ABaJBBqubUMyIYSOyjSLV2qu5z0Ai29jUvMiRipfBoGL9G5PO+8Cr+NcuuqAaC+K HVBdnX7CG2Q5qS5S+c8D/KAbHTnmhpV3UCf+DGjy4T0+NB/hn3dGDlrl963nRxpZ 9LvJ4UpAiJt19ooaPDl2o28lso3OZXbHStZK5ZjfEj/stJtO3hUHJnlAnc9gZ2fs qIZz0O7YOphJLorPFSusfDfM+6cbmisRgqQ9bxNTbs1RWJjhmQl9hSQw/LecufW0 xmDSU7FSy9BBafzjVXm8gULzW1LdVkf+YlsS+yhVHySOMG2TghduQpNr05KfFOxh ArLL/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183583; x=1790788383; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=TmpLRtcALdGvnoiA64jtGQ7kzwpnFEecY1PS7YhgtmQ=; b=fJ2zIzg7/Xtu7i/u5Oi+FaRqjeFL0C8IQhdBP1Z6FkDdSHrGP8Eg7KR4voefhlmsnt mTes0f6+2MdCwnJqaklRxG2WfwvtI9xjnbK72++2AuxhZ40MBHu5G0iQFLrLVjlnht+A Brh8+QB3SDUGaiHvahWGOfd2316phqls0VXtCAxAjRFEVBKOoczkI2RujZD412U2RC7P Tjc2JR3oyyvKDU/i+IRW3s0hG9TkYXr7duJ2XCtUT1MPre/7CbA8aWMz6MaCcpZCwgh8 MyTGSwqXPnk57QZfKQdLNuCNt3mkR4emoE1WKi5Cc1/SawpXkiAffH0ZEGfWsI1YjqzX 0fbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183583; x=1790788383; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=TmpLRtcALdGvnoiA64jtGQ7kzwpnFEecY1PS7YhgtmQ=; b=gBSz/gR3Dl0wZsSGGA5CopBPl1lHLqU56z3TNvIgLLhH8/4Av9LUe+ws74NS7hC4EM firZ/bhBiPWijl34EFMBiFIx7kSDtFSiwUHxdHhfUq8NOcYizsugHpXMH7G/LCUJ/yeq 8LOP/lWzTEB2wtGY5x6rKypMnN9uF+KPZxumKlBA/GhPhgHWz4zzFWEKnrsY0IoKB8mt qmsG93B+pKLQcwfOpkYiffnB1Niv+Mnp/XxVnbBg0XHCKp5bXcokJvnA1Mbsyv9dKxaw 2PMieKRh7mks/tOc3RhFb4SRVI5os+FtH3etVv62UxD6IkeaPYRU0QWRgOo2wUeBs9I/ NOtA== X-Gm-Message-State: AFuF++mUIeX5lATo+Ba8fue/qJJDZtHYU96Fw7Lf8Bbw59kGDai2Yo7R NmUp7+plM9jPBDKQ7M/aG0GirIS4oaTro6KiXtevDtf5pJHJL/kj+wo5bLq9RP4h/EUPYfXCURD XXjLUeAuHObsUqmg5WrdHeQXQO1I3lkKHCb5MkKQDtq02EvEq2tukqJrJUSJuNYdGDwCR X-Gm-Gg: AYBFou0y9gpGOGQ/uJahSjxXfPPRm0Oa4IPYFIXbLv1C9JbXF+ES78eY0uBa5/POjz+ HBn4iv98obucW8Q2wjwsu94H0o4g7FupDvgySE+5dEi1qVqS3NPn7VGffpLQQQax+CnMlj0Em+4 bKfaKXMSYuJI5nnFFhMbE2qs2MVY9gYQr3unImRI3ubGq3uN6Ssk/f/IlqroXnjX+YOvSXoExPk Nf+F1zqhsMJs9lUt9ahUffb9mvQ9HWweoE8MtQblXcU52n5WBUZWHnpw3AHKfCXwpO+CUnbk2J5 h90NzyQISYcq7ByENYngphJWPfSBqE8teL1hGAXDK7W3+Oi7LVXBwDf17rrsGX6d295CTh0ws9r aKeJCEa5/ogs7QfZbA/US9oYORFhovnFM2wtFTkzT X-Received: by 2002:a05:6102:38ce:b0:7a1:f7d2:e84b with SMTP id ada2fe7eead31-7ac1da2dce8mr2818768137.27.1790183583153; Wed, 23 Sep 2026 10:13:03 -0700 (PDT) X-Received: by 2002:a05:6102:38ce:b0:7a1:f7d2:e84b with SMTP id ada2fe7eead31-7ac1da2dce8mr2818746137.27.1790183582641; Wed, 23 Sep 2026 10:13:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 14/21] accel/tcg: Introduce poll_during_halt() and leaving_halt() Date: Wed, 23 Sep 2026 19:11:08 +0200 Message-ID: <20260923171116.31276-15-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: bqwNdGyPP0bWZ6-SLcmNTSgU2aXgO7SF X-Proofpoint-ORIG-GUID: bqwNdGyPP0bWZ6-SLcmNTSgU2aXgO7SF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX9LqkyNgEozDz UYtVX2MuJCN8/rnvLPjPUbLCzO/l08wKLdAc4TrJav4bo2L9j6uqNLGK+XTRXxmU136dLMqyovk +NfaYB6+vSGC9tkmj63EjLPU5mjjp1klA8Uj8n1fijQnXAhFvZRWG0BWtN/4/5bMWsYXR12cu3s +BtgndrpaG+q9J+uNGLJhBTKxdPsLF5h+BXhm/Q8me6lX5OdXLFf1j0QmeNIqKGZNIckNBKSX/o ++iqODTD8SCQ1kzw6LfHuvVLl1azY1KsVn9vyxXdNC1c50GElaZN53rTqwdWSM/rDpLrvdo+6KG 8P31BofiqbCYXicq6ts7WqnoabuqIRBX6l2fw+UatLVWrUneAWDBe11zF6uQboUhXMBACXkKqba OW1LHVpDgU3BEdjIgxnHJJcsXHPdKCwOKElDp+UfbHQlDYH1w3FBq8doCeqnujpDChM1yERBceU x4F7wLPKcowIaN8qpwQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX6DM6Njguoucq 4awb0+u6XUqIqFWQ/vHpXcud2ZOEX6opQ8BUG7Co0BiiDQiydHWRGS+LE5huthIxpKnzGGtZrOd WDTsA8raHhwc4REZEBwZTVikZEA1YS8= X-Authority-Analysis: v=2.4 cv=f7vdl+yM c=1 sm=1 tr=0 ts=6ab4089f cx=c_pps a=DUEm7b3gzWu7BqY5nP7+9g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=DbqnPDNGgojIjNu1nyEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=-aSRE8QhW-JAV6biHavz:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 bulkscore=0 impostorscore=0 adultscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183702027158500 Split target-specific halt handling into an optional poll_during_halt() callback before cpu_has_work() and a leaving_halt() callback after work is found. Keep cpu_exec_halt() as a legacy alternative for targets that have not migrated. Require each target to provide either cpu_exec_halt() or leaving_halt(), but not both. Inspired-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/accel/tcg/cpu-ops.h | 24 +++++++++++++++++++++++- accel/tcg/cpu-exec.c | 21 +++++++++++++++++---- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/include/accel/tcg/cpu-ops.h b/include/accel/tcg/cpu-ops.h index 3ff6e6810e0..1ee5d3d8bdb 100644 --- a/include/accel/tcg/cpu-ops.h +++ b/include/accel/tcg/cpu-ops.h @@ -169,6 +169,27 @@ struct TCGCPUOps { */ vaddr (*untagged_addr)(CPUState *cs, vaddr addr); #else + /** + * @poll_during_halt: Poll target-specific events while the CPU is hal= ted. + * @cpu: vCPU context + * + * Called when the CPU is halted to handle target-specific asynchronous + * event processing before instruction execution begins. + * The caller does not hold the BQL. + */ + void (*poll_during_halt)(CPUState *cpu); + /** + * @leaving_halt: Perform target-specific cleanup before resuming + * execution. + * @cpu: vCPU context + * + * Called after a halted CPU has detected pending work and is about to + * resume execution from the halted state. This callback performs any + * necessary target-specific state transitions or synchronization befo= re + * instruction execution resumes. The caller does not hold the BQL. + * Either this callback or @cpu_exec_halt must be provided (but not bo= th). + */ + void (*leaving_halt)(CPUState *cpu); /** @do_interrupt: Callback for interrupt handling. */ void (*do_interrupt)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exe= c */ @@ -185,7 +206,8 @@ struct TCGCPUOps { * if it should remain in the halted state. (This should generally * be the same value that cpu_has_work() would return.) * - * This method must be provided. If the target does not need to + * Either @leaving_halt or this method must be provided, but not both. + * If the target does not need to * do anything special for halt, the same function used for its * SysemuCPUOps::has_work method can be used here, as they have the * same function signature. diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 76182803592..edb719b0d10 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -48,6 +48,7 @@ #include "internal-common.h" #if !defined(CONFIG_USER_ONLY) #include "accel/tcg/iommu.h" +#include "hw/core/sysemu-cpu-ops.h" #endif =20 /* -icount align implementation. */ @@ -657,10 +658,22 @@ static inline void tb_add_jump(TranslationBlock *tb, = int n, static bool cpu_poll_while_halted(CPUState *cpu) { const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; - bool leave_halt =3D tcg_ops->cpu_exec_halt(cpu); =20 - if (!leave_halt) { - return false; + if (tcg_ops->leaving_halt) { + assert(!tcg_ops->cpu_exec_halt); + if (tcg_ops->poll_during_halt) { + tcg_ops->poll_during_halt(cpu); + } + if (!cpu_has_work(cpu)) { + return false; + } + tcg_ops->leaving_halt(cpu); + } else { + assert(!tcg_ops->poll_during_halt); + assert(cpu->cc->sysemu_ops->has_work =3D=3D tcg_ops->cpu_exec_halt= ); + if (!tcg_ops->cpu_exec_halt(cpu)) { + return false; + } } =20 cpu->halted =3D 0; /* allow execution */ @@ -1059,7 +1072,7 @@ bool tcg_exec_realizefn(CPUState *cpu, Error **errp) /* Check mandatory TCGCPUOps handlers */ const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; #ifndef CONFIG_USER_ONLY - assert(tcg_ops->cpu_exec_halt); + assert(tcg_ops->cpu_exec_halt || tcg_ops->leaving_halt); assert(tcg_ops->cpu_exec_interrupt); assert(tcg_ops->cpu_exec_reset); assert(tcg_ops->pointer_wrap); --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183961; cv=none; d=zohomail.com; s=zohoarc; b=BuMXFrflODQUumDfZOUgpmNBMPfav164OBBh0X1Rmc/Z71HdvCP3e5JCt3iD9uRHkBp60Wbf1Dlu+TojjaB3P8vjJ5blw4IQq86G8VCptU9gDZKiQg9Y6OJHYpQOnwY0bT6EH+iC4NV13HotlB6+5e/LVSafJNNFFqxoArE5fRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183961; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=kNtz7Wsg4/5oYhsduTgWMHFHx5o63oBFXK1BI+bPv0Q=; b=KFVSzayL59QVRx8L0/eb4rL7j7+FUAWwvMGoaUr8+lVAvrg1L5Z8UAEEJB6Ku4vs1EXPxFWxDcZeDjLN97HHCVqzIZuGMuR/mpqimqcEGAyuz7epNsab50FKPv+LewQZ6a1bHsI3MtjjBbjTTYvUbuXQpjFqyX6mDYw+NW4uy7s= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183961426103.43130209035178; Wed, 23 Sep 2026 10:19:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QYZ-0007tc-C4; Wed, 23 Sep 2026 13:14:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QX7-0005yc-9K for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:28 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QX5-0001I0-Hs for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:25 -0400 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTfxC3081857 for ; Wed, 23 Sep 2026 17:13:12 GMT Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvbx7j2fe-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:13:12 +0000 (GMT) Received: by mail-ua1-f69.google.com with SMTP id a1e0cc1a2514c-97e9909eeeaso294263241.3 for ; Wed, 23 Sep 2026 10:13:12 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5cd4271sm926755e9.5.2026.09.23.10.13.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kNtz7Wsg4/5oYhsduTgWMHFHx5o63oBFXK1BI+bPv0Q=; b=HAREu84GgSQzQC8F hsIPKrtpjf49b/kXo1YJDNYOmGrKQRoi9wUcyoLsGHcZXGKN3zzGtgGDbNH5xx3v pyYIQBcNIZZl5UfG0Q+dOAU0FOgVkF6byXqEmbQSSEf+3Djk8UsoHO6k3DB0AvKA tRxwWmaEd0ckv28/5XQwA+0+6Txlo3sp84Eqsbg2+KpUStto7SPTSyNAfP2rXrL3 Nn3Rw+v7EMCBxcAnR14YhC8ROe5PR+NSW/YSNYXIWbMReXeDcyoA62ysMeBAeaDA T+PNTbWdiw7azppwISYvRNt7qGXVWYnKDCP2RIpHcdQzE29n9GHvpkAO/xHh37JI nkarSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183591; x=1790788391; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=kNtz7Wsg4/5oYhsduTgWMHFHx5o63oBFXK1BI+bPv0Q=; b=IlHH60i0y9lSMQLfqYQfIkZgO1Zqs3WoVMsArUHKFXmLqOOdNAm2Ecj1XePk6ltL5C CSdSH9HQjG4eFRZIqHqJQtrk0DSZ870ZQHl5ywTt/gIj7hO6wk2iK2ZyQSkWfgDEMhtw ZBNaC/mQc6FlPgF5nhNYNi+IRochMSajmu8ofRAOWKPCj67gWfRIIKBlO5DwRVQu/UnV zsinZBvwcp4MTwEZkbJoPX2XDOQLZe5boUcksQ/kY6FPvVJefWbS+QmDjNxfYW6mFWeR 2Vq+FbniGIo7qsvla83kFSDcu3QzVLQThT6SYHDOq7/2anuWXLfR0/u47endysfzscRe AMHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183591; x=1790788391; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=kNtz7Wsg4/5oYhsduTgWMHFHx5o63oBFXK1BI+bPv0Q=; b=QcwQZ/OQauVbffNJUUMQu3kWBaLBl++kgKnmucdYx74N4P1xvi4K3oILHqge4siA1r VxCwMEDD297bYt7kEzl2v0lGMV/Ox9hBLoGs368FR0gyM89n/ggwmjCbT90qS/WgJbo9 jXmh+cdr5dH7/rGZi9r9BvjLf43xQ0LUDfieAxuWL1nA5hbJ5TwXgNtzbjvcqHNITn4k QjfjjjnqSLGlpmiGRst4Oa9yyHffU8L/bjWxmGshBNmG/xTpGB2kQaTAVB41E/Nm/N4O DRK3lFwNrG8ayT+iywfpYViS/AWR2gMp/Y81uX8Zyk8r+EjZU74gE9LtFpYqYrqpcpbZ /lMw== X-Gm-Message-State: AFuF++k8g+wETXJ0y6wTbuzl211HbufHNc+aUT3rZzfOiwXdXRRs1ILJ /il7zWBbdoSRFXmwFqLB97rnUGYYVTLTQzvE1to+f/NlLgGg4UNYLFnNCS8ztC+s+ol0DGkaPWy LaaBU6L3sAczfxyLrAY+x1UjPRuklfwp4pMEevtcp1JuCseXZFuZx0YX2W/kcdZTUXdVX X-Gm-Gg: AYBFou01oZFrAeyxaDkN5GK75ob/+khrqyADObNbNJC5zOvYFHMxrNpZc0tsm6ZXLth vZHN+ho0MdNy5iWlg4nIxvHcJjalnmdFyFoMEGdcUPUzFJDyFHPXJ62Ac8Ub7vAXPFp0pX02N29 Ha+ZUqbjTgvx+YlhGbWi4DUU3tkoM22v/+WMd6P/UASMlZJdYe7agei3kt3AGrHeGBrS9nUY/32 NTEOYpGBM5nj5MqRl+0UklukKZrJ1r/DH9MJYJZv1N9yyW6FuSRTRtUCZ/hZGpkg0UrR8/RIA5D utH8yGpNxzaWHPdkExKbcW4Lkc6qQJRrhhZRALca4zN/oQ752ABeRZ/g4RdvXYMHmUHU7/XW8cl JLDiiqLzje/9MFStskb6xG/n3tYZ2GsOgn+xt6sUi X-Received: by 2002:a05:6102:5121:b0:7a5:4d80:a913 with SMTP id ada2fe7eead31-7ac1abd2294mr3118746137.7.1790183591123; Wed, 23 Sep 2026 10:13:11 -0700 (PDT) X-Received: by 2002:a05:6102:5121:b0:7a5:4d80:a913 with SMTP id ada2fe7eead31-7ac1abd2294mr3118728137.7.1790183590672; Wed, 23 Sep 2026 10:13:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 15/21] target/arm: Split leaving-halt handling from arm_cpu_exec_halt() Date: Wed, 23 Sep 2026 19:11:09 +0200 Message-ID: <20260923171116.31276-16-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: S7fL2gD6L471qBqAuG8FwZZAvyj70i2Z X-Authority-Analysis: v=2.4 cv=J4s/fwnS c=1 sm=1 tr=0 ts=6ab408a8 cx=c_pps a=UbhLPJ621ZpgOD2l3yZY1w==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=snbnvTbt-5-dSQZ-83gA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=TOPH6uDL9cOC6tEoww4z:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX0EewvQ+6cnVp HVLikyrsCEK7CjFlrcZOJIDn9B/RfRaZxPf/8y/991M8HECt1OSV6vm4cithXDlUB8jnlDwkqAt yg69PkKIMh+YtbmIo9bC/51qyTgeSc/o9BON4EUjw8Hxju/jm/cB8yW7FkD+4GNcRprRbelXjks Yi8gC4bXH2soEkL0BhYi7caqvc6dmtYLy5R8NLtlv++U6h7TLeCyq8sMiTmgzCw1i/n2vdP+yb1 wXLNvLbp0OxMcI4TnLZxjNAMLvjfnH/kvpSXDxp92ajg66SNN5ethDMt+gCErZOKPdUrfTr3QQ1 84erE1whRpD4AnBpeOyuZ10TklMoqjxdUKISobKLfYxOHQ3hfV/uACFy4q9tz7fC+P252Ko9eaQ m+fWCl/hfYaze6zClqLJaGQmGxNz7wHJc+GxEteUDdj0MQcC2jN/kKBV3onj50aoDaoW78CBVli VwRv2VhFEC+djkOG5zg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX29fQe2nJKvt4 5T5MBSaatMNcSJiFjrctZGWIQ2m+QXXN+NsZwEdw7TqanC2TDfVPRE3csx04OPzfBHj2xycvcKq rwJBR2jfRaDs/Ce9HLUmPaPKHDNvnm8= X-Proofpoint-GUID: S7fL2gD6L471qBqAuG8FwZZAvyj70i2Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 spamscore=0 impostorscore=0 priorityscore=1501 phishscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183963505158500 Move WFxT timer cleanup and halt-reason reset into arm_cpu_leaving_halt(). Keep arm_cpu_exec_halt() focused on deciding whether the CPU can leave the halted state. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/cpu.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 090470da40a..0885a8eb03e 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -872,18 +872,24 @@ static bool arm_cpu_internal_is_big_endian(CPUState *= cs) } =20 #ifdef CONFIG_TCG +static void arm_cpu_leaving_halt(CPUState *cs) +{ + ARMCPU *cpu =3D ARM_CPU(cs); + + /* We're about to come out of WFI/WFE: disable the WFxT timer */ + if (cpu->wfxt_timer) { + timer_del(cpu->wfxt_timer); + } + /* clear the halt reason */ + qatomic_set(&cpu->env.halt_reason, NOT_HALTED); +} + bool arm_cpu_exec_halt(CPUState *cs) { bool leave_halt =3D cpu_has_work(cs); =20 if (leave_halt) { - /* We're about to come out of WFI/WFE: disable the WFxT timer */ - ARMCPU *cpu =3D ARM_CPU(cs); - if (cpu->wfxt_timer) { - timer_del(cpu->wfxt_timer); - } - /* clear the halt reason */ - qatomic_set(&cpu->env.halt_reason, NOT_HALTED); + arm_cpu_leaving_halt(cs); } return leave_halt; } --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183718; cv=none; d=zohomail.com; s=zohoarc; b=hbLm+cjxZT+mRN/gi6SXb4z3a+DTwzY5r+GvpxiFXSeYjKTaIoGuA0JLjWsup3JHgcVNWP5MQ3SYshyn4wrTSxekDEl8tVWJT/+3yG+W3VBCISTROjZPeLWZufOVe4zJjzSgZEtP3IF3lLeSblh2ihYS+/uNqnb9+ocJIk/RKj8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183718; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=htbXqjnNdfHoIX28CTRI9s/yb9X3TP6JwahLbnmhFgs=; b=cuV1S5tXGw7CeVIBLOQCuBTxL08XFTpe9JJZQJD1psqCJimkrEImzmRg+oWbhzoAc6nMYvJ1ehLxNgCpPuHG0Aa/otC8vivZmbbCNxAotnMIi1gzMsqczzx5qTfADT4AcEkfSHZb8TieK5kqv1WFhoSl/R5nn6Vq0xsDGun2WBY= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183718367874.8251777133795; Wed, 23 Sep 2026 10:15:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QYb-00082q-7e; Wed, 23 Sep 2026 13:14:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXI-0006Bg-FJ for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:38 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXE-0001JI-T0 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:36 -0400 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTsZu2470361 for ; Wed, 23 Sep 2026 17:13:21 GMT Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfjv12wu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:13:21 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-97caca2faacso180664241.2 for ; Wed, 23 Sep 2026 10:13:21 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe0c50da7sm47282255e9.3.2026.09.23.10.13.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= htbXqjnNdfHoIX28CTRI9s/yb9X3TP6JwahLbnmhFgs=; b=m4Z67HR3Ft6L5z1e oN82u5QzLkuZrRWsNWYZfkP4Yilrpx4t0DbAaghWBCTbN8ap37UPw8bwma0Kv7f8 7UpAhM3HbvwVmV3Kru7+s0QShTfhosKVYCGfBeUFrXXNEq9f7R+tsvf1ey93fJOH PDZe0MZIl6gas7/whFPHexynrp1ELJMUwRUPkpL7UGVoTerd5MDuJLOoQtbANN37 uzFDXdTdaEMEZsvZ9QQ8QVOqJwcOC9s0wpTy9avoFBlNu5BR0e+2d2Kc/BmZtPkl /m4l1Wy+JI31X3TS1bnJyti71PPnNfogjdEB+pWYCQJkVg17W9l+Ws16NB0uEa3Q i23jGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183600; x=1790788400; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=htbXqjnNdfHoIX28CTRI9s/yb9X3TP6JwahLbnmhFgs=; b=MJblQU9QBAr6WXNGJTTkOFUyfbmbInNBIJxh/qAowQPOxW4VrC0KYrY0W+tRBuzm93 F3MUviLMPH1vH77a9VHe4YxDooGwadITOsT8ARiFPmMRwi0vcsyda9GgDb3gyc1Hl+WD 3xatLC8STqdRaIutARIw3T5z4GbYVH6VPkGiowuBwt53Krs5/5kXy17muZXNnn7euQp0 tBnGbjGSeC5pg9id0zfeDaGa8cyikbpBoV655G4dRh+tDh5Uh0EDQKDpnSeWkQJYdneP Jk8fnI7mYRUP36uuTg3wgLx8HvgVmsiH+c6NXoBqguUmLy2sKNJ/D3V8xBihOADA6OKi rBJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183600; x=1790788400; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=htbXqjnNdfHoIX28CTRI9s/yb9X3TP6JwahLbnmhFgs=; b=Eip4/CIFCLdPPtLIefQ0GRTKxL+TeFDpvu9YcTvaZXMN2bXRWdeYsq/yMfPe1MLGAN tYTHRvP8U+cGeSwctgfFCLrZFRiTFJPWG5KoLOn44N7maAth7ZFyB/39oXl27uenApj6 Gc0pPpZSdM+GKip1CK4wAnFsqxAlJ70kAWUCqxf9mfwEVtM9FheuX9gVTlvRYoFMAZyY ezIx2M64ihX+TPZn0ITJTxf7/+lVR2MrBSX9CjSHSl5RlYVJY1yKorCTebZYRTxSGygp n73Ywm9zaCesYXKgmxo9qZUfhdMrPQFmaL1caqqcr97Uv6ZpsL/++id8ZA81eUjNrSeG Ec0w== X-Gm-Message-State: AFuF++nB9qOXPY6CfCF34UIdrEFC8NSlhNB1D96opkBxmMyTUTJCgzCV GSoK31dsnRrNjrmw1u0TIkJERRL0GGzTNbFIYm/eGxzQegt7Gzo7EM1eZR1Yy2tzDYI3LWcZ/PA rWn3Zi1rgRiyvFUAZsmOdOUahDBzSNEESYJi/uHpno+Ll65y0KcajqYomNS18Y2M8EJsJ X-Gm-Gg: AYBFou0dPgUEsaPvVU8N8DvxocDcr58lcNHHjYuHM91v28cj21uMs7yoBbw6w+Vr4lA 42/Ofl7qQob+Ddg/sjl+KiZ3i8e6PH8sASBT8y1z9yVCTakBw9Pl5L0jZU4Dj0BLBns2a71Plxi 0ypMhBYusRlIWhCrwFkwfoFD/QC7G1tTnkqJ87/tNm/T45DYnXry5PrwtjbB4+9si85ONYXe5fn AMjFlNjVJ47JDMM8Yy/Uvr7SnRJXec5ByOkUgLKehjXY9S2ciB8zCAxK4SWV/X0JAVyMfHtiPi9 UQahyVwnFuaCguN2t3dbgEWNg0RPO/2NrmNa5HLKA/pwwWM0XIkyFOwwO33dgqMR5+jmaXV8G84 SVOCMK4hsBu3yLuQERjU7TACsklR0oOOUX1KyGJ2w X-Received: by 2002:a05:6102:370c:b0:7a3:833c:49a4 with SMTP id ada2fe7eead31-7ac1d4f01edmr2824605137.26.1790183600343; Wed, 23 Sep 2026 10:13:20 -0700 (PDT) X-Received: by 2002:a05:6102:370c:b0:7a3:833c:49a4 with SMTP id ada2fe7eead31-7ac1d4f01edmr2824577137.26.1790183599884; Wed, 23 Sep 2026 10:13:19 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 16/21] target/arm: Convert cpu_exec_halt() to leaving_halt() Date: Wed, 23 Sep 2026 19:11:10 +0200 Message-ID: <20260923171116.31276-17-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX1WyXC4YSZ9a9 tBlLOvB9BO7K40RZkD/rA+Fw5q14/zz4LXlgbnXKOyUBew+fWyxd7135DfMymRP+1MhPlBZFq9w ihncPeg18i3u/Ar2oOlG+QSnOoqGICi/J1KqTEU/x8xqCZsDtgQv5F6w3KO6cVXaRxbUOQDpE3c WeDVfsGq29LAIYEOXoYkI1NjJSfd6Wd6wmnP54YP8w6J0eIjFoWJmq5I1h0e7spfFptHTgcBOay 0Bg5HKEamf6uBIpCmp4K8ByKZYxvRxtaxmz6JQVhbZq+I7Ox1EH0Qj1zGtFIFf2FRoStam06PVE aGwRlyX15y2MBdMCvH+nwculvwHzN8CF8VLM62RX1mcKRX7XipUtQ2jSS3i9RErAeEgiw0ij0NH q3XbBo4IwpymdtaSM+29d6bRaj2zZjQaRcWsmuJPGrBPVYMZKwqpWX+d09PEEzWq3E0fiZNiwQt nPRkhOPwPB0KROo6vjw== X-Authority-Analysis: v=2.4 cv=aIxlOr9m c=1 sm=1 tr=0 ts=6ab408b1 cx=c_pps a=KB4UBwrhAZV1kjiGHFQexw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=AtaPWBxvZOLBLR1XvpsA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: Lzk6CYaiqGhCrK4C6VG657xsO9nVLJGu X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXxRIFXW62eZIl 87ajgZ8pgJxHL1IR85vLyDfgZy1H13ycuH5DkYL1ds7sBaUdDY4MGMAFUpInrjg8SkxFrIao2W+ eIQiyW3Z9bYhPnDx6gxRwkOPXGQr4gg= X-Proofpoint-ORIG-GUID: Lzk6CYaiqGhCrK4C6VG657xsO9nVLJGu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 spamscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183719894158500 arm_cpu_exec_halt() now merely checks cpu_has_work() and conditionally call arm_cpu_leaving_halt(), which is now the generic flow in cpu_has_work_after_processing_async_events(). Register the leaving_halt handler to use the generic target-agnostic flow and remove the arm_cpu_exec_halt() wrapper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/internals.h | 3 --- target/arm/cpu.c | 12 +----------- target/arm/tcg/cpu-v7m.c | 1 - 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 1efda543270..cfe932d0e5d 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -431,9 +431,6 @@ void arm_restore_state_to_opc(CPUState *cs, #ifdef CONFIG_TCG TCGTBCPUState arm_get_tb_cpu_state(CPUState *cs); void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); - -/* Our implementation of TCGCPUOps::cpu_exec_halt */ -bool arm_cpu_exec_halt(CPUState *cs); int arm_cpu_mmu_index(CPUState *cs, bool ifetch); #endif /* CONFIG_TCG */ =20 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0885a8eb03e..81f1f8b5052 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -883,16 +883,6 @@ static void arm_cpu_leaving_halt(CPUState *cs) /* clear the halt reason */ qatomic_set(&cpu->env.halt_reason, NOT_HALTED); } - -bool arm_cpu_exec_halt(CPUState *cs) -{ - bool leave_halt =3D cpu_has_work(cs); - - if (leave_halt) { - arm_cpu_leaving_halt(cs); - } - return leave_halt; -} #endif =20 /* @@ -2617,7 +2607,7 @@ static const TCGCPUOps arm_tcg_ops =3D { .tlb_fill_align =3D arm_cpu_tlb_fill_align, .pointer_wrap =3D aprofile_pointer_wrap, .cpu_exec_interrupt =3D arm_cpu_exec_interrupt, - .cpu_exec_halt =3D arm_cpu_exec_halt, + .leaving_halt =3D arm_cpu_leaving_halt, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D arm_cpu_do_interrupt, .do_transaction_failed =3D arm_cpu_do_transaction_failed, diff --git a/target/arm/tcg/cpu-v7m.c b/target/arm/tcg/cpu-v7m.c index 48b31d5eac8..1093c6cbf63 100644 --- a/target/arm/tcg/cpu-v7m.c +++ b/target/arm/tcg/cpu-v7m.c @@ -302,7 +302,6 @@ static const TCGCPUOps arm_v7m_tcg_ops =3D { .tlb_fill_align =3D arm_cpu_tlb_fill_align, .pointer_wrap =3D cpu_pointer_wrap_uint32, .cpu_exec_interrupt =3D arm_v7m_cpu_exec_interrupt, - .cpu_exec_halt =3D arm_cpu_exec_halt, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D arm_v7m_cpu_do_interrupt, .do_transaction_failed =3D arm_cpu_do_transaction_failed, --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183857; cv=none; d=zohomail.com; s=zohoarc; b=nOknUWeiaXty0cT6Cr+LCJJ4Cje9kJzYw+oZiIweB0kI7opmwn8sO82E5W+5/qQW/zslur6OWIEB+kPJENXIoX70xbC4Gr0g3p4/z9Qy16UPWfEtHWeGn2pcuiqNk44VA5YRvJl8wZVsFL8Dtj6UkTRn58apYCisCEP94RcjKnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183857; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=l6Mgb7WSMEr3uGW/YJJ4fDEAGk+u6GelQD4cQHsXAfU=; b=Cy1Qin2E7TJRGGyQ1dLTnJrOe5G4irh33RSR/x8dhYWoShKJeA9UVj5h5qMArWUj07HADGBcwUn1vx7Gw7vP4C/lNsOSKzVn3gt05kSjXrcgepdV+llDXdUb3tPl11Y4zRDZGs/5lNzQ4vuD5FYS143prCZeGeyhXGzpyWyZ9MM= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183857358305.0923311463341; Wed, 23 Sep 2026 10:17:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QaX-0001bC-Ow; Wed, 23 Sep 2026 13:16:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXP-0006KO-Lr for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:46 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXM-0001KU-JQ for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:43 -0400 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTisT2470183 for ; Wed, 23 Sep 2026 17:13:29 GMT Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfjv12y7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:13:29 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-7a8a773db4eso438720137.0 for ; Wed, 23 Sep 2026 10:13:28 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4886876c119sm8895703f8f.15.2026.09.23.10.13.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= l6Mgb7WSMEr3uGW/YJJ4fDEAGk+u6GelQD4cQHsXAfU=; b=f/UcJ4hef17o7Ihs dCb0N/0GNCEFQIvNfubVnDhE0AuPP3nceLIaIRUmnNDlKXcJ32PKasJGI5JulpdS F8pIJHerFwDy88dsVfJBlZrzw99siJMpKHZUFwFIrkNyirAX7EM1Q/WGIr/dNshp jxyW5lRASX9vuavAxq4uj+JFl7roeSotW1HSV9IzRGPoA7EvJDctCX8g1TF2GKGt gVUwPJE1/aX/x06s5XKUmrUl397OwmFl2SsZZXoT9XtpH1YyNFj5++rOHPws7da/ hR/CMFOzcPv+6K+CouNK7oVmLyqQ+sXxArpMGXdKokUNMSLdpzT4zrc/utYX3n+z ZfNcBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183608; x=1790788408; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=l6Mgb7WSMEr3uGW/YJJ4fDEAGk+u6GelQD4cQHsXAfU=; b=JI0scpYtv3BhzjeqZwM4LjF4MeayDckZnkpiI85B/rqNYAdiSk/oLz3OR8+NE6brp+ Xuyrekgx8Zd993UI4yh9xCPcGQMDij25vZAoO5XRXXou4nc4lnr8VHAEbSNdzkf1rZIA B5socl/UXk9FWKwh+4osHBYVdT9AqpVt5A1odIt1R/4rciPbIGfVjHJ6dmmq1HJthwcq ISKvOensuDseAPnPBEf6WvB8psiWIvhL0kQXiI8sMpg3Ra0hSxqXhgwRTtcw4pXbFYZ2 c1cxJ9yrx6iFAbKWwBOzVNveLeHKnsk31OY6KugcWt8dZRUj2z5ovvSPJ3l/AkGaF8eG zcCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183608; x=1790788408; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=l6Mgb7WSMEr3uGW/YJJ4fDEAGk+u6GelQD4cQHsXAfU=; b=amy2IXsgnvdz/KVYkTPVf8tZXetDORQPtzFfZoLtqLy7GMuU8/2uXMxxBAIgcNFSB2 CjasX4HRmIlol5PH0UMW8oFKiMlRPe26H/MtCob2w7lXfDhIE2zspvoRE5vSznDn3yPA 1qvDuZTiRMt9ruYTME+sEjSuaCHC0ehNM1Arpqvtqk0K76iJLUxEr+MVWaO+SCcaK/DE 63Ab/3BeJaV3zL0ld4ADw7396wBR4iHWp7lSAWvrr2UQsaTp0Os2N3DBh5Giwv2nj5pj FbNBMcE77okoWJ0gezKYeQI+R2MZSSZqYbkyxuA6hPc2kOb4e7Pf+LMPVXbSYHbnEaLJ cKgA== X-Gm-Message-State: AFuF++kZh+EvzRhY4OBKYKeaCNADJFMOKvlxnW3EgRTCyBjnrRqmxgfQ CowMdG0YgtUvwvzVazB6sLxymQTtPMq5ON8oQbUTla4qZfRLC2lhnz1GAizg3rkN5i33ioHWfzA f/MgVNWB6Nd5/pQd3POoz+bOGivxVBr+lqvpPJhHO/dNK86aq96zdzhkwFuWuUpkAakTF X-Gm-Gg: AYBFou23U8IApBcx4YOMYnPmR25nUg2xN/G8vQ9Ul33EryHC2ZuuhdBgKDV06TuoQGB b8lh71j+IzBYT2VQM97k7fX6oZaAauCjsU+uATek78pKhBv8X+Wfd+War1z99cMB/E2ZUZSFlC6 +66d7p2G9uWPu6DpAynO1F+hUE0XwBV/wnb8o1R8+o1bl5z/Z8kAutMQujR+dEDlh8/uFEmr1Nf 7q3s7K3+AsgoD6YVi9ImBO0egu6Qtc30GM+xrmV/lW9tgvhjuNep2UnSdMbgjAIZGRWBWpvr6IQ clMsG/upi/b3lwV7v9/RTT2EiD7UgaA5Cnl3lcfPo5PRLLsNFmnwkMVOuck4EadjFO5bCI7NnGe p7NrU17Z63h0/Pjq5jZNitvMQzo5ulT4Sc/KcDkdH X-Received: by 2002:a05:6102:512c:b0:7a9:1f19:2d40 with SMTP id ada2fe7eead31-7ac1e6594c7mr3146546137.32.1790183608035; Wed, 23 Sep 2026 10:13:28 -0700 (PDT) X-Received: by 2002:a05:6102:512c:b0:7a9:1f19:2d40 with SMTP id ada2fe7eead31-7ac1e6594c7mr3146521137.32.1790183607545; Wed, 23 Sep 2026 10:13:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PATCH v3 17/21] target/i386: Use an acquire load for interrupt_request Date: Wed, 23 Sep 2026 19:11:11 +0200 Message-ID: <20260923171116.31276-18-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX7fuuJRLqM1nO Sce/CDXnTr7EYNnzEsmBAY9MhJPF83uCT2B8OSQVnyZDxsbzDPmWo2TCg0vf713F4LcIMOZlO9s cKbuLh8LEMsIXP4wThIepHhrxJ7fFDRy1NqCW4wV4ZigvQh8OorL808O7eO9zoetPMdzuZ4Ditk sTad1eOU10PteNukiikb7TlzzrC6omyFuLUMgX9VhRGvTy7fCks9ADAxZk49L6BaP5LajXqfQjv +aSF/XFxaEPYjY3qrgo8hKzXN0xQbTFipsbEp0YLM5mc66PRITJWwsNQEwKdouVhRjLuvxt8FtN jOVBYDyGEIr3bxNhryEO/E5KuRaIZgqzyscp4YMum+HtJF6VlFKEDRTx4/aHGTVUDRJfWyLjLj1 EzuF7EoewQ9z9Om+tj7i8kIf0DhKpTBQ6X0/Yn+wpi6HLXnnlxXrMJja3GvQeSun1dRj2WtDARL BoYnRkQoPtwMgt+6F4A== X-Authority-Analysis: v=2.4 cv=aIxlOr9m c=1 sm=1 tr=0 ts=6ab408b9 cx=c_pps a=5HAIKLe1ejAbszaTRHs9Ug==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=8gObA4T9cFbzhFTk6d4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 X-Proofpoint-GUID: lPlL5-e-gwG5bvMSwATwe_FR_5fLkzS4 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX7hUh7QEdxNIV nlgpV4kXypm6wDX54yDHK7crnqXXzgTt963Hhmic37Pvn8idbnL+aMO6H3188q7p4Itsc58YN6F 9aWr2LgLRwfLNTBENW/tJASnVFp8Wos= X-Proofpoint-ORIG-GUID: lPlL5-e-gwG5bvMSwATwe_FR_5fLkzS4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 spamscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183858892158500 x86_cpu_has_work() may run without the BQL, but currently reads CPUState::interrupt_request directly. Other threads update this field with qatomic_or() in cpu_set_interrupt(), so the direct read races with an atomic access. Load the interrupt request with qatomic_load_acquire(), matching cpu_test_interrupt(). This provides the acquire ordering required before x86_cpu_pending_interrupt() inspects the CPU state. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/i386/cpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b97f144aea5..ee1aa3a5a70 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10640,7 +10640,10 @@ int x86_cpu_pending_interrupt(const CPUState *cs, = int interrupt_request) =20 static bool x86_cpu_has_work(CPUState *cs) { - return x86_cpu_pending_interrupt(cs, cs->interrupt_request) !=3D 0; + uint32_t pending_interrupts; + + pending_interrupts =3D qatomic_load_acquire(&cs->interrupt_request); + return x86_cpu_pending_interrupt(cs, pending_interrupts) !=3D 0; } #endif /* !CONFIG_USER_ONLY */ =20 --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183853; cv=none; d=zohomail.com; s=zohoarc; b=NXb/KkhkGqpRgZAmFH5AVUnCtSuCGjyTL1T5VRjZCxPfFeLFHJ4zokEZsAXwt5K5Bc4Bo6Am8HHI5re8mB8hVYLK48jvUyW5txPtH4NbQ3PZXpBIsJOHJfP8rabbo+hGv0oFu+BkNCuNm0PdyvQx5Qmrt/w73AQK3p8b/7n3JtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183853; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=/5gPZ0r9el1io2TJV/MmocNJREFtJ5CHkCI5Btb3anw=; b=ZFbDcFVkg8/vyzB3gaz+eq9LmlPcqwnzKYFEche4PJhBwTXz7LgQwtj7QzmbOoV6GfO//gTySlPNiB8Qunnx2/NoiXlRFw96FMmeKrCRxGxt5w1saRNWls6KlmoJQxAsoVinYLvYFfumqZcDTqhGgP2EQBHwxkjYWD18niBph/U= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17901838536861016.7304160619934; Wed, 23 Sep 2026 10:17:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QZf-0000bD-MK; Wed, 23 Sep 2026 13:16:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXW-0006Tw-DG for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:55 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXT-0001LV-JA for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:49 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTh1B3938136 for ; Wed, 23 Sep 2026 17:13:36 GMT Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvbwma2qw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:13:36 +0000 (GMT) Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-7a9378b844dso413527137.1 for ; Wed, 23 Sep 2026 10:13:36 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5de187asm317215e9.7.2026.09.23.10.13.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= /5gPZ0r9el1io2TJV/MmocNJREFtJ5CHkCI5Btb3anw=; b=puIIDaR63fI+3uYW 4W041okidglmLhaedEalM+0c9Abq2Ulva1r/iFZAIWYWMynbEo6wGxrhMRQR6osd T7avsjHucBZcCIp4PMifaa3wwBWPZE1nFXq0uht2afJ5Nxis5kfw4q8MlredVs6o ZN0jKjpC/Ki7DJocls0cD+1tT35n/s1ogq2/bPR6QQIeEwkVLCo46ULFzlPTMGPj ncNNI0MZTORgw+SCKXdRbtfEmNt5xLEMbxAaDnioO9nMzXGRe9U5Y2zWXPVCt+rU Mmj1nHU2F0sV2cxskhO/qiJflsdCG7+NP4aFD0yHDHt2KfD0Du9lZSJDHmaraJfo x5E9oQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183615; x=1790788415; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=/5gPZ0r9el1io2TJV/MmocNJREFtJ5CHkCI5Btb3anw=; b=BjWtUF2A39y/eMkVM0Rwkq6NnytT/Yi0y/23z1W/EBzJGbKZp+fcC0WwG4lanjhcDI ATwR13j22Gf+wDu33iwr5YL6kYhrXIcgO1n3ZpwxnKmKYyha/kTkONkG1oE9XVm9JJQj EzR0K/Z4H5Gnem5Gs9+7Q2xuIDjslsrZ3kH5ntUU8gV5yZR1g0TTqfecimFwMzTwULmE ghx6GrWwteyrPXuKBgZnkxNdQvc9F8/HCTIvmOrk+JvwIfKhunA6TtIInSayZe0LE6SH 4zy3fE2AYtNEkQqC/PXbfFoMKRZiwPH/qX2y+7WNOrfKgJOwRk3IH9yvrI3fAI68Y+ZH V0Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183615; x=1790788415; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/5gPZ0r9el1io2TJV/MmocNJREFtJ5CHkCI5Btb3anw=; b=qzh979sLf1DP8eJoimI31quuYo3CODmMfguTG9WS3qX3w5oUU0eHnxn+9vVDk/mLR3 fiCzexFf05F1N1yec2CvTmX8GIc+Yabxm0RwuhVmZ1Md2fumme5Qud55ggYmihGZfCk/ 8VAh+2QqD59Kr8yTHJYAWATt+IAsmZ96Dug9/ARRE7u2NZng3V480Qb0w0KKdAOYgBni rDErQ3sFtjzgqEy1nvZUw+aCt3Dbc5veLs82JKG2vzqjC7Y9ewWD/nXTlDpyiXaETR04 1ZbTXQ7w/i4IlEc+Cl7shU0caZNSdYYnY8A9SfcH7KqILZx3etDAiIqMAnrqfcmQHsNz fXxQ== X-Gm-Message-State: AFuF++n1eAenJGVlxQYtxqJUvUdf7HIBeqgPN5IKhPHbf7g1VlNFjeAF lMfpE2S5Smq6IlUm3Wfs3udAQif0RhmSzNEsB5cTudJf5Uspyx6yiM5i2ZimJbfxJzSCmz1m8Al A8HD0h7/2G+esZW0wiAb7J2uogj9UwBTk1oApRlsRKQ6CgDBEG0zX8gMGbch4fqSAQPf4 X-Gm-Gg: AYBFou0yugy278N4D+DoyHYWIBGSmlgyIQQnHRHvqK0uqzf3Wcj6lie6KZbpJ5QiwmS caCMXUZsqU6sw0udRqeod2+QlQ3E6chXOZbh15tNsWflCmLoTIV0tye9IGzmZHbSCx6ud/kdZbI Iy3fpMWys1Tresryaq0WnJBMFk38iQDTNY7eJ2gtZKZ8jM9eDOQtAViBF/2PmzBWvrnM9LFGAt7 dzXwnEjMFTixfvmAc/pYCUJbiizU/C5rxs6Kz47QTldf4qVc0fZEKzXE40GXFwUifXOHjtqDx9V 09+PUDSynXurMlxr4HRM5QWPNsVCRlgAzJLAwZnAmewtJvg7ZoE0QyzfyB6GX3cbRINIoqc+GZ/ Ol/nElm5g+cWa6ugz12uKogcE3c7JQtsa4Q9nVTWo X-Received: by 2002:a05:6102:8083:b0:798:8ca:3452 with SMTP id ada2fe7eead31-7ac1aad2aa1mr3022017137.1.1790183615285; Wed, 23 Sep 2026 10:13:35 -0700 (PDT) X-Received: by 2002:a05:6102:8083:b0:798:8ca:3452 with SMTP id ada2fe7eead31-7ac1aad2aa1mr3021994137.1.1790183614917; Wed, 23 Sep 2026 10:13:34 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 18/21] target/i386: Split APIC polling from x86_cpu_exec_halt() Date: Wed, 23 Sep 2026 19:11:12 +0200 Message-ID: <20260923171116.31276-19-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXzqzuRCMfp4T4 nZe9TLHCXprbKJqsG4CuO6Z4gmm5G8yrZ/Xy//wYrNWDksn+pGVt2T65dHQLEZht6LBFIL/JhBo CtUygTuh9QBaItx40VHMLQB+9dY8wPs= X-Authority-Analysis: v=2.4 cv=R/6WitRX c=1 sm=1 tr=0 ts=6ab408c0 cx=c_pps a=DUEm7b3gzWu7BqY5nP7+9g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=h7OMh5kjI76PbTVxvEwA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=-aSRE8QhW-JAV6biHavz:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: UaUCudZ1D1YbLCJzN55O2Je7VgpTmgeP X-Proofpoint-ORIG-GUID: UaUCudZ1D1YbLCJzN55O2Je7VgpTmgeP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXxe5VdlpJSBh/ XfJo9+RyOu3Z8wPgWXOPzO4rXe7ze7w7LyKQ3oFAUyBlGAEv/aCOlu9W8tnkxT2ky3E6EZES4OL OsMEq+Zk78Hir7lOkirxavAtSchfHNgfw9PcysUf83L/7JChlhVaUw/iOGHOBqhpZXDiBJJgSfG M9S6DX22/3UxkXNELpgl4kjI+XPpiDvQrBg3z1eD1xfCTzUf3c9qULsEsvgg6R0o9JNcyPjNTLT zz7+dFq3BaBaugfZrOJAnD3nZ2pmoPXPqlOwPVWU1BPt+HjBHoKPVnsXz7j1844JsoKmQHRBDnw /ZGHUz93VetJD2FIZlSaPxBhJggxxP/Sa3N5qNY05s/Lp1k3paJquxLBfH52AUxLVURl25FGG6x F2bBL6h10DaaV+rbYHJt4amaEofg4GFvyzNslSZ2+/ed3LzBhIuBCdmGP0DFbhWNxULdXjknvLO BpxPTa/m2MIdxgaCEpw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183854941158500 Move APIC polling into x86_cpu_poll_during_halt() while keeping the remaining halt handling in x86_cpu_exec_halt(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 + target/i386/tcg/system/seg_helper.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index f4b2ff740d5..58e8ca0bc1b 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -37,6 +37,7 @@ */ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY +void x86_cpu_poll_during_halt(CPUState *cpu); bool x86_cpu_exec_halt(CPUState *cpu); bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); diff --git a/target/i386/tcg/system/seg_helper.c b/target/i386/tcg/system/s= eg_helper.c index 8c7856be81e..9ce608a0bb7 100644 --- a/target/i386/tcg/system/seg_helper.c +++ b/target/i386/tcg/system/seg_helper.c @@ -128,10 +128,9 @@ void x86_cpu_do_interrupt(CPUState *cs) } } =20 -bool x86_cpu_exec_halt(CPUState *cpu) +void x86_cpu_poll_during_halt(CPUState *cpu) { X86CPU *x86_cpu =3D X86_CPU(cpu); - CPUX86State *env =3D &x86_cpu->env; =20 if (cpu_test_interrupt(cpu, CPU_INTERRUPT_POLL)) { bql_lock(); @@ -139,6 +138,14 @@ bool x86_cpu_exec_halt(CPUState *cpu) cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); bql_unlock(); } +} + +bool x86_cpu_exec_halt(CPUState *cpu) +{ + X86CPU *x86_cpu =3D X86_CPU(cpu); + CPUX86State *env =3D &x86_cpu->env; + + x86_cpu_poll_during_halt(cpu); =20 if (!cpu_has_work(cpu)) { return false; --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183936; cv=none; d=zohomail.com; s=zohoarc; b=eMEhwm+NfFuQFv3xoLkg6f0V6Jir5kbs3QVJKJ2pRUojqF+uGZJWVOo9Cg0e1zHdN7sQFOsqBD3gzMMsE0W/73pF0aUgMhvLw8d+AQvP5FbDOnbMDhVzS8JvjaVzyaSRyHiCEXBtDpFYTyZvuat3mN4G02AHAgyp4qvjNtkXNNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183936; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=NMMUYlRFOEu4Y+0NjhX8Ge/q9RoTfSWrF7SafoChtWc=; b=RTi8gqvOYxIpThYMseDkmijV1EAhAdULTUrRzgXuXOWYi+Y87caflyop6DUix6yC7LmYc5wh8ar8WEmsMsKTHA9ZP/TYoBNOfszPxc8Kbb3rPpcdo67ssYIMLRnqf0sJ3zhpNu+V0LN4vfvUY+i/mANxioCvzRO7rnIVYfmphnI= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183936074255.3837208633438; Wed, 23 Sep 2026 10:18:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9QaS-0001NO-Ue; Wed, 23 Sep 2026 13:16:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXd-0006Wy-4N for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:14:01 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXa-0001Mp-DQ for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:13:56 -0400 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGU1ZO3106099 for ; Wed, 23 Sep 2026 17:13:43 GMT Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfmwh15a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:13:43 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-7a8e3cc28e6so61351137.1 for ; Wed, 23 Sep 2026 10:13:43 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4886877970fsm8890958f8f.24.2026.09.23.10.13.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NMMUYlRFOEu4Y+0NjhX8Ge/q9RoTfSWrF7SafoChtWc=; b=fJGYs3VPFpDR1GkG 5Ms5UCqNUru+3di6NMJKOgYye1y/etGby4orSJZ8Squw2YJMzvGKAixxBYvCPKZ6 ZYYr+cwooZ69oxuGEWYI2fTaBcr1KPyUgoBwaZFaMm6tGfIlG82N0iil+OreNiuw vFEH5HzM0Yu3mB9oDzFXRvvt9pGwkJrMYzDZKHju2eJkVFBlPAN8mJ6SkSztdS4R 8dduiOk6buUQyL5DwkywCHd/ICJkCH94IZPaTbK8okAR7yOX8Ggg+pt+TOlLlpQF UzaI8IawwxJ+4p7bydE95scWMDRbdG4+RST/1mkRiXZcqsFLQrt2rbLrwF/k+At0 PEeNCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183623; x=1790788423; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=NMMUYlRFOEu4Y+0NjhX8Ge/q9RoTfSWrF7SafoChtWc=; b=AIsQrkRNhMMdmBF57mxstSIWACBBuSwFevrAkdpcXbew7nof6SitDnfK7/+b7hZdnU COSwHWpTu2naw/h8S8obV4fLJ8+BcmKVC3z0hgaq0CF4mOitLRumXF+QMzGWJS2qjWPO Q6cMlhqvKBKTORbjg365zKs5ea7QYFCp4BkRE31mBw7+7Z6DwlDn//RWcKYwPPFrlcry OnXa3W+NM9Tcp1r8EovpWi60eyJMThGO3WPRhM5lvs4EcWUCS3lIiv8IHkG2GEgLeZ+L 4WrV9l8tQpxsL9NT9sJf1pC5ANurGaaeZxgXGcD6BR7DV/UDxz8Tx4x21NXVv7TUPhri l+cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183623; x=1790788423; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NMMUYlRFOEu4Y+0NjhX8Ge/q9RoTfSWrF7SafoChtWc=; b=Pu/GdJce1XJ1JDnDBKYkBS7j49ENAKVHkidmJ6KD+/lhaObLJmiDxf8Oc+5+lEmINU Nr5v18x8Gs036I6G4h2QGxNDxZGh18dt1PoPRXQs6M3L6VbbVUzBMBjEVY3kKPUnTo12 rvz++rhXP4EfP3Y/ISNCgpVIeNhdUdEM33xj54cATFAzWoXyuTW2fSYPIQ+laCrbgDgG BctuurSymxo/1l2/4poPDt/hkWQvrRfM2wKIORzAlG7Dc7GLZvGKKvzVzaj3V8DEk96x twCk/tutpwu0nfmuF1Wv27SGlSmWwpuIUKHmWQ361iSMYPR2lenWqOpYw2tW7po8edAq fYtA== X-Gm-Message-State: AFuF++lLGfhpnABEy7uvKAzYWEg4Zo7ASPh6p4M3sHT1NZVhunCy+JUs OOssDwzUX04aWKLuR+WBSpv5ndUXXpY7EyENV+wnHIziOItzSwiE/KiPlLDEwcH3e0l3pmQrO9I LdPDCGcvfn3X85DUp7ZiFOqZ65PABQkVuDqJ5VbqXB7bW+tvO3s5MFjrrmhEW+3tX8Gf8 X-Gm-Gg: AYBFou08eL9t68x2dhCjv51NS+PdBdoVxlx49qnxA/1phCIevJSaomOgSZgWJnOS0Vp yuLvCB8R/cOw2aa1VCNZSpRxjPiF7tD6UB00SZzYs/guEVqEy9Ph5YTTPEG3uo9La5fqwFTSZdj j+t6VsikTAbZTaupPO5dKkC9NlCGpxRIdrAU+H2t/BwS6tBMWdUgbtdIzcg/x1onRHZSo9OzVbS jStXpO5KzJGwMtOJ7KR09Huz64rZqGbWVrgikWdCkCVcCPU8rUlshRUHjKuYyFnH+ZnX+JNByQu TVaNOJSNXQVUeSJm3kr37o0zr0Xv9j3mg9h3f9bgKUOYLcSX6hCDb9r0Gw85J/5Qz/T7vjSL3fD U4tRIEnhOqrf0RjBzG80si+gsO1cYH4Sn93wALF7q X-Received: by 2002:a05:6102:8192:10b0:785:6b42:b7b0 with SMTP id ada2fe7eead31-7aa9df8e032mr5426520137.4.1790183622740; Wed, 23 Sep 2026 10:13:42 -0700 (PDT) X-Received: by 2002:a05:6102:8192:10b0:785:6b42:b7b0 with SMTP id ada2fe7eead31-7aa9df8e032mr5426502137.4.1790183622364; Wed, 23 Sep 2026 10:13:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 19/21] target/i386: Split leaving-halt handling from x86_cpu_exec_halt() Date: Wed, 23 Sep 2026 19:11:13 +0200 Message-ID: <20260923171116.31276-20-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX5CSNfHJkZE0W PkZEB4NfovU2yTDFLpX8R4XLlOHSUdTlWwwLn5GuWw6LmXmyiU+i5KyMBfLMRKJrFf3y0iQACnt b02xJl3VZTBll5RJQvRcQGR+7/MGww1m/hqE0irBsPB8MDkDRnn3ISi+Q4NZItTiOqY7GvLpCmN n0G//j+ZtuYowRekDNPGfn779ZL3ZuGkBiom9pn8RCpMaZi7ka9vg23KIuRppGDuHb/ye5fmLx2 3ekW6jECZtNQ+aRauY54mbvCOC+9RJ+0Q5CuAg7OGlR3hVjVbLmUaLlrzzdkyXYk5T8QaUve/h9 hRUTEgv75JGIHBcvIbXcwp2VDGPub4/eq5vOQog89B4w33D5w/MGv/WCSwVFzSMJjWcW+bp5zt0 XLrLCnumFEDXGZyHZxYsWL5CZa1Ja0JyhxpQuEKhN5UX97mfbmGvo5GSefuSMkbFQ+J95Rau7Ss WvLtvFQkBiZtIrS8JMw== X-Authority-Analysis: v=2.4 cv=WK/qzXsR c=1 sm=1 tr=0 ts=6ab408c7 cx=c_pps a=5HAIKLe1ejAbszaTRHs9Ug==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=GiXQl85om2WzCxkx9rAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXz/vo8OiIqBEM yxuJZVcHiYU4wws1e6rsClj9jP2vp7ayikjRN535RHCuXo7Afjo9NjB73bqWy1SmJvOSV4/IQ2R YM0v5X2s+Pn0WSkVXfoEXDHG1KrBDjk= X-Proofpoint-ORIG-GUID: wGvbV07DR3siPlA4i7DX1A1g019xe9UA X-Proofpoint-GUID: wGvbV07DR3siPlA4i7DX1A1g019xe9UA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 bulkscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183937310158500 Move debug exception handling performed when leaving HLT into x86_cpu_leaving_halt(). Keep x86_cpu_exec_halt() responsible for checking whether the CPU can resume. Document that #DB IRQ delivery through do_interrupt_all() runs in the vCPU thread and does not require BQL protection. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 + target/i386/tcg/system/seg_helper.c | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 58e8ca0bc1b..96accb30a80 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -39,6 +39,7 @@ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY void x86_cpu_poll_during_halt(CPUState *cpu); bool x86_cpu_exec_halt(CPUState *cpu); +void x86_cpu_leaving_halt(CPUState *cpu); bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif diff --git a/target/i386/tcg/system/seg_helper.c b/target/i386/tcg/system/s= eg_helper.c index 9ce608a0bb7..566b3d4d80c 100644 --- a/target/i386/tcg/system/seg_helper.c +++ b/target/i386/tcg/system/seg_helper.c @@ -140,22 +140,31 @@ void x86_cpu_poll_during_halt(CPUState *cpu) } } =20 -bool x86_cpu_exec_halt(CPUState *cpu) +void x86_cpu_leaving_halt(CPUState *cpu) { X86CPU *x86_cpu =3D X86_CPU(cpu); - CPUX86State *env =3D &x86_cpu->env; - - x86_cpu_poll_during_halt(cpu); - - if (!cpu_has_work(cpu)) { - return false; - } + CPUX86State *env =3D cpu_env(cpu); =20 /* Complete HLT instruction. */ if (env->eflags & TF_MASK) { env->dr[6] |=3D DR6_BS; + /* + * do_interrupt_all() is the normal TCG exception-delivery path + * and runs in the same vCPU thread context, so #DB delivery does + * not require BQL protection here. + */ do_interrupt_all(x86_cpu, EXCP01_DB, 0, 0, env->eip, 0); } +} + +bool x86_cpu_exec_halt(CPUState *cpu) +{ + if (!cpu_has_work(cpu)) { + return false; + } + + x86_cpu_leaving_halt(cpu); + return true; } =20 --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183924; cv=none; d=zohomail.com; s=zohoarc; b=dZ/GBUCK952yAYvTxUDtsOh3qUH9mwFn3kZpRgJcCPa66bquPo61ujUISjspvwaVvCdihdaVairOxW3U2DGxGHVEMhqeSydFdHejh1YzcOgOZu3TjHcPXh7iTKuXpahhNv5BtCGHG9n7F9UNz0msu23gpG49zFMb4s++AIZb+Ho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183924; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=VscxCLnI2dGnGBzBwxcHvgdrFWZJrGl9KKZv7JgH7Xc=; b=DCOjxfxEAiPGqfUMr3ZC8qOvoF8EALvSZe8NC6Hp5FL+etiJCYxeCu3F9cpTn/l8CHXz95/okS7vd4Gfs21HGVp40vjVzE1L9l9+GRub87eaPARr1MraPSYPxlwej/qxVbmY1+D3Crv7Q5cWmLnVqz6BShHyb+8F56r0Uj4UGXY= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179018392459565.63577696164771; Wed, 23 Sep 2026 10:18:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9Qaw-0002cm-5U; Wed, 23 Sep 2026 13:17:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXl-0006g4-Ou for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:14:12 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXi-0001OQ-Mo for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:14:05 -0400 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGU0rf2470628 for ; Wed, 23 Sep 2026 17:13:51 GMT Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gvfjv132n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:13:51 +0000 (GMT) Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-790e3ca4c85so373503137.2 for ; Wed, 23 Sep 2026 10:13:51 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48868886e45sm8590301f8f.31.2026.09.23.10.13.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= VscxCLnI2dGnGBzBwxcHvgdrFWZJrGl9KKZv7JgH7Xc=; b=X8CfVDa6uMDQ/2jq TFs5twY5EcHA+4Ngete2R3F+/zNXqH/rJ1r880J9xud5fc7AZbZBWEYfniZLatc2 1QJak11Q6AmdbUe4kySQg76ygT4tPN0IM7RYGsZCTRQanpkNOSnBNIASyTX4i8JB qbH5wPZSbbx+UzDqtYrWevXlFBrZvm8JX8BHCzKHUZ6/RdGlpcObZkBk2GZz7NTV QuCJiahkD7irE5pJSLwAIbaHZ4fD5T1FzWAum/v799ZstZNXGBy3Iia6C8gF3ezm i/0JGfAkF+bSsxi9L5E37CwC9roAS/sShrS+KbdZv9ya8/7CeLrN/qXknnr38ZLc VW2SXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183630; x=1790788430; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=VscxCLnI2dGnGBzBwxcHvgdrFWZJrGl9KKZv7JgH7Xc=; b=b5eCe3asfUCsbeQmQKlPCd7eVBSVvkI2I3uSIAfqAdCxDeYkVlLw8UfmQ/xLQe76o0 omtcMHvEBEj4LH/UraPhNMIIiIE3t2Uk8DydR9XcbP9sfpquqJgCjjWI+7/jkZ4J8IFT +hAJKGVP+ajBxHIJx0YHDq3O/U1eupmZUAUj6aBKqH4LHLJjwn7vlxJCh41qmDKOpaI7 k3Ze3UQ6JyozsgFS2aaxOy9gmFCV4pV5jX3e5l9fjza+XtbqEVL7Tpmz5uBvr3+pFuF/ yjzfH6+SQHrXpdtQlKC2NbPMLmIOp2yshXtW6lXTdR876PHoRiVtrAtcgbyKmvph70Vn ePdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183630; x=1790788430; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VscxCLnI2dGnGBzBwxcHvgdrFWZJrGl9KKZv7JgH7Xc=; b=EN6Lr4rXE9HY2uoF6c+QjzWpK1B/tzDNl+kH/yeSrIvC13fEeyiqBYf7ufttupRRKy mUKmK+FvDVo4BEFvPsPwGuF+DwxGwNauNdZu4SJ2YPPLFGuMDyFvxcTgqkVI08/zf2Or GcjQd933TFn/g6l5hAGQpSGUFb213aq1kEHhIcFYH6flHQALIhmm7qDcmI2ocEVxDVKz uuNDiHOiIWHEvp8Z3BqX4EdXLL06ZEM7lXdGGbT4ZAwxWTFln5La5wdoj03mkrofzSyR a5mwanwHyhklLqpPfemG1TaziSLdZkXP123yv7TVMjKZJlT0mpMXdXBl7wipL7Y8FNbx CdWg== X-Gm-Message-State: AFuF++n6ga0nAlMqZRmntEfLqmfzoqDZuwXA7fo/VRDGymLaliG8aa/J sdTW8eGuKzdhdwoJGZaXlXYRYnsSljj6sl2FUlTj7WlLIK+IdJTCV813n6N+5y0lopPWvkLHhcD 6ui+mNumMhsoPxZOX0ZfM2rCVu+CeIoYchxmK3VoSQwzxoaWl4M5QOapARBinTmSVxR+S X-Gm-Gg: AYBFou06WfEN4lDZ+Ubw7VWYcMT5oHngpOIP0wBmBqnzxhtjDfK6h5VzgS1GetjqHwj lPZhcXl/nrk4s5sVeYK2Ctj8m38zhCouRuqgNeMMou7ih3+Zi+kKXddcwEyF24nx9z5M+8MrfO6 eP7YzpVWvqKfwzE9sHhU91D8Wd7UcvbBbnp3+hy/deEx9LDVqrnvcqyZXkrY1jcHyww7Ows8DsU aYVBleVcc2n9aDGuILWfi9EXSj/YYN2S9jV04WX4myFDlxxFH0zpnL9/r2+/7DY6nf2rIZdCw0N 9HlkNFmZA0dl0WfV/Q/xZXg05nOEcnedu9gHIoVmAOM9IEcASs//vWHSajjV9UcpSa+U3mfhq38 SiCweKtLQIPlzCLEaAqDIJI0tqEoFwNOI8fpBqFzY X-Received: by 2002:a05:6102:f97:b0:7a1:f7d2:e832 with SMTP id ada2fe7eead31-7ac1d4ed253mr2983808137.18.1790183630247; Wed, 23 Sep 2026 10:13:50 -0700 (PDT) X-Received: by 2002:a05:6102:f97:b0:7a1:f7d2:e832 with SMTP id ada2fe7eead31-7ac1d4ed253mr2983785137.18.1790183629496; Wed, 23 Sep 2026 10:13:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 20/21] target/i386: Use generic halt transition handlers Date: Wed, 23 Sep 2026 19:11:14 +0200 Message-ID: <20260923171116.31276-21-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfXydltwkAOtaEA asYqFL36MpyAzllLpxB3yqQMZKWFaG/ENU+TEMHk+mUQlSW53fKIJ4AePWOjMfnnAdqirdIxg2J IHgtKUv0uuUDxel0EMy+ds76a7EVYzuowBAdjEBJnXv4C1+h7PFAvWFMS+CkAWCBQjPtB1Qmype xQW5s/oHO7NCl7fPm0beKNLg3O3IDeOU01Y0KNvye7sB2EPsc4rSfVaWrAoyGtgnMHKGJQ9Fksv yCe1kWRKg5RiQSUuNWfMgao8nUUCsj2SVxrOVmzuw0DIHN6lxL8SYpUEj+COp+WECLtLYsp5Jsp asXzYmY/QlpNLyjHE4NJrQI4WXdcg3XiDdhO9TKN6oCPfwM5gvnXXwaV5LLuSVRehEv74WuqZ2c FCZZ/167cT8OIA+zRJPATAPVa+UhfIoDLB/son/DHDmhuWAoP63G4/j0b2rgPT8nF2hhWlrYBto yJTYn6JqZuqt5gboTPg== X-Authority-Analysis: v=2.4 cv=aIxlOr9m c=1 sm=1 tr=0 ts=6ab408cf cx=c_pps a=P2rfLEam3zuxRRdjJWA2cw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=xWu8-Agft_6X_INOG6MA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: i6vQaRJYfa18GzdqKs2gE4V_8s0f6sh_ X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX598xyo2FUNU2 nJ1iRGQL+e9SwGy7jciivhodjllvMAQSIaaTLOBeXCIoRa+WLfRYeWe9KDuFvZcMtsL5czEtI9i 6IFY+cDSIOo/jnDNoloUo8kFcEbjJJ4= X-Proofpoint-ORIG-GUID: i6vQaRJYfa18GzdqKs2gE4V_8s0f6sh_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 spamscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183925553158500 Register x86_cpu_poll_during_halt() and x86_cpu_leaving_halt() with the generic TCG halt flow. Remove the target-specific x86_cpu_exec_halt() wrapper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 - target/i386/tcg/system/seg_helper.c | 11 ----------- target/i386/tcg/tcg-cpu.c | 3 ++- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 96accb30a80..4d543556a9f 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -38,7 +38,6 @@ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY void x86_cpu_poll_during_halt(CPUState *cpu); -bool x86_cpu_exec_halt(CPUState *cpu); void x86_cpu_leaving_halt(CPUState *cpu); bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); diff --git a/target/i386/tcg/system/seg_helper.c b/target/i386/tcg/system/s= eg_helper.c index 566b3d4d80c..e24d01000ad 100644 --- a/target/i386/tcg/system/seg_helper.c +++ b/target/i386/tcg/system/seg_helper.c @@ -157,17 +157,6 @@ void x86_cpu_leaving_halt(CPUState *cpu) } } =20 -bool x86_cpu_exec_halt(CPUState *cpu) -{ - if (!cpu_has_work(cpu)) { - return false; - } - - x86_cpu_leaving_halt(cpu); - - return true; -} - bool x86_need_replay_interrupt(int interrupt_request) { /* diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 6f5dc06b3b9..2fde412394f 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -180,7 +180,8 @@ const TCGCPUOps x86_tcg_ops =3D { .tlb_fill =3D x86_cpu_tlb_fill, .pointer_wrap =3D x86_pointer_wrap, .do_interrupt =3D x86_cpu_do_interrupt, - .cpu_exec_halt =3D x86_cpu_exec_halt, + .poll_during_halt =3D x86_cpu_poll_during_halt, + .leaving_halt =3D x86_cpu_leaving_halt, .cpu_exec_interrupt =3D x86_cpu_exec_interrupt, .cpu_exec_reset =3D x86_cpu_exec_reset, .do_unaligned_access =3D x86_cpu_do_unaligned_access, --=20 2.53.0 From nobody Sat Sep 26 20:00:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1790183924; cv=none; d=zohomail.com; s=zohoarc; b=Q78urNig4WBDfwR95zj2rPrtjWopNhP81KTsebmtCi3cOCaSAMmPZK0OQq6GgxNFLIi3Op+t+viKhrZqydKeOqqj+0orKbCGXdALo1x8Cf6jYUtUVxqr42U7R/wpiJ5nUQwUO1nQFp7VMVSsMSnwejFBA67OwOdGnnCGA4MChQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790183924; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To: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=lW+1jiRUBpF2NHL9D17Hw5Js0SG7MzZxs3ZLjhXtYFI=; b=lM+DtXrD4IE+M/sPdvmTueoNwHm1JVUFJuBNhiSCTiI0JAGbmaGTls/jnRJZcv4zHzKpiBP2Jtnesu2FwNnf9DoQ8or+XpsXLLwsrr5nbFdmTV6K1M+0bEn9dxtA9jG9dEjXvkhKkOhGHyVeOuUpguNz834jHSMMlT5knN/7oPU= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1790183924619407.4300303758739; Wed, 23 Sep 2026 10:18:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9Qau-0002Ox-NE; Wed, 23 Sep 2026 13:17:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXw-0006sr-B5 for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:14:18 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x9QXs-0001Qj-RQ for qemu-devel@nongnu.org; Wed, 23 Sep 2026 13:14:16 -0400 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68NGTqwk4051893 for ; Wed, 23 Sep 2026 17:14:01 GMT Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gv78n36tr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 23 Sep 2026 17:14:00 +0000 (GMT) Received: by mail-ua1-f72.google.com with SMTP id a1e0cc1a2514c-97cb2f3c6f7so283953241.2 for ; Wed, 23 Sep 2026 10:14:00 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5ded2b7sm235525e9.10.2026.09.23.10.13.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Sep 2026 10:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= lW+1jiRUBpF2NHL9D17Hw5Js0SG7MzZxs3ZLjhXtYFI=; b=iPqV/t7AdrwnPZ+Q P4hJxuSTrEhHP5iNgbTlnDpY+1roRzT+n9Sn/IzewNZmXn/rN/tF5V4197F9Mk5c VIgqt/TxLfEb8UJyrPR7ldY1+kGKOcNPjxK4kuS1gz0FiUyjjFjY1cuQ9zcQSP0T Iy5QbmuzBOO9GYdhc9js1GoUIuVivyGtlhGBVEgxJK9EWuAL4r2AxNTSfx5y7fSa 0qOfZNWS19H9X63Dwf/NL9d8qU+lL6GlVjY4PZYYJ7Vrm4wf3KF+xMqmVNeEeydC sl53VHgzLOPYWX+4bVLSWzdJ5AwCJ2sJlQQj6T32hF8GKvBg6SmHdHB1jV6r9vaE wKs6Nw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790183640; x=1790788440; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=lW+1jiRUBpF2NHL9D17Hw5Js0SG7MzZxs3ZLjhXtYFI=; b=SLpVPjjsYCDW0T0EbCzMMNcb0a7gPXzgExi5V6CjhsN2fjVmi8vu8V0iynKIwjMrGL EX+NMHjnyUxCcD5q2+i5bxyXsHRVXz1NqhfY1Xm6exB5zsLfbzOA1xgDjl+4k3WOPUoV uCE9Y2Fc4x8R8jY028LwqS38kygnr+0cIXWlb2j4WkubQYcdMam3zYSSttY4CEfwkGqU qC8KWMr4Zw9+r6JFKoQz1JdFS3bPy98NNBsSDwXF0L9N42YBDuyz8PLUfOT2JYTc36/M ATzj8SCnLMiGeOu1oFKWiChXp0+80HEmXAVLCZ9+h7H3VdOPs69HxAuZyub75tz0PXvS o8Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790183640; x=1790788440; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lW+1jiRUBpF2NHL9D17Hw5Js0SG7MzZxs3ZLjhXtYFI=; b=1EeVLmam0+J4i9lagqvrirT+gTx3FWGERDln+Sxbb+/4EfNSuufSWnwnwteYZST3uh piMOGe6QxF4pG3JX0iipSw31Paz2yId29tgoJjnttcOH+Fx+DWeCnC+Gma7qcaUNn9w5 63bUQ6/XMjDHiHQY6S24xeH9aBX39bjMcefAhlZmTUfgxAOLPqKB92bJOnjsXS63z326 EJBhNpgzkkCX8NHuoMILzeYxR1eFH4S75sd/ThcLv2t6Zd43aVJOauolmXXM/TZmTs3n OkzP938Tsmj04z61nGsdIAYjpMKpD4+OcTI7wbnoThlyt534oydx0bo+z6/mtlnmFkfs L0JQ== X-Gm-Message-State: AFuF++nmVQdxGgBmB1x32idu06xqywadMeV8W9QgvGMuwpxx68+sUAz9 Wnxm77oEEmR2Aj+fRom0uXbFzs0SgBXTyoYJaCM2+TbT3/4V1SE4A+swSGSSnSBlsQwUSCrOdHt nVCcbDmqY/YS1h9W1JNlaFQwgCicxvMVQbuFO1Kfe+xVtwquLEj4raH4Z5hKBhBARjeq0 X-Gm-Gg: AYBFou3rPMlf/0E4W8mYvMFexuW8gYXSARzkUNMO0iIV1u89XMQGS4W84PEapiFKkSm 8wlxwSKNXe3AIEk1u5j2s1/10vk0ZGXlKUB+ANGFSjJKwbNnlywqYSJ9ElFzObxfXp/iGrzI+vH VncUV/khbGz0/3wElFOY9Sw/5+ec9IIRkfN6tIIN0Ldl2fzvXrqtYmZQNrobDqDyGKDjtUFAnCj VN1IBrtFwt3/E/3kuAOJLpz9HbmxImnVI7BpvFi9KauKXP9wZhqzZo2wQvgARHSQTogJjRFUGMW 3cm0y/ygBf+N4bezxQo8wqqNJRaUSbbjWQu7yJGYhkRrJTid9UzrFUN9uxLBEC37k48KvkY5rE+ GRrt/Ro4Gv+/VGshOyNW8woFVviJT48U/ZwC5qg0P X-Received: by 2002:a05:6102:8083:b0:79e:221f:708 with SMTP id ada2fe7eead31-7ac1aad3128mr2913360137.5.1790183639640; Wed, 23 Sep 2026 10:13:59 -0700 (PDT) X-Received: by 2002:a05:6102:8083:b0:79e:221f:708 with SMTP id ada2fe7eead31-7ac1aad3128mr2913334137.5.1790183638951; Wed, 23 Sep 2026 10:13:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Rolnik , Brian Cain , Pierrick Bouvier , Helge Deller , Song Gao <17746591750@163.com>, Bibo Mao , Xianglai Li , Laurent Vivier , "Edgar E. Iglesias" , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Stafford Horne , Chinmay Rath , Nicholas Piggin , Glenn Miles , Harsh Prateek Bora , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Chao Liu , Yoshinori Sato , Cornelia Huck , Eric Farman , Matthew Rosato , Ilya Leoshkevich , David Hildenbrand , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH v3 21/21] accel/tcg: Remove the redundant cpu_exec_halt() hook Date: Wed, 23 Sep 2026 19:11:15 +0200 Message-ID: <20260923171116.31276-22-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923171116.31276-1-philmd@oss.qualcomm.com> References: <20260923171116.31276-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX1NbrNYZfFww0 HTOfnPB9Hmo2F5bD89WHulYJmYy4TK3ttNvanJHHbvSTsSL1ec+NtVUg3Jv5N1yTQ9BVS9599mt NsmYSKM/5zJgow+VUprMKzjODSHpXd0= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTIzMDA2OCBTYWx0ZWRfX3ThB/WYhBZW+ 2ZvWbDusRhuYwNhWYX2g6dOdhsTK7FPSKj1cRO4NfZ237ou1TGDJAlWO5XSpHlQrVUsOR+njRJL 2vYr1IO07WNHVGH99rpXR5A0yqYRd4aMB/bakYwbewN49MO0RoSYqICDZiqFRvvPrNEQPav5em1 zVFVmp8u2X+64Cj/ImhZhwl2GsBf2AL9BDNoi85Xz6ImPniNE2MDM/0dmem1WJoejjelKOPjiXh sBY6mG2fchh6Ecvwgl/FVDfcBAYIqPNjGh06L/ImpmeITiuta7ckaTiSieGtMY4320J8Km+TYkB ybccekZ9soy32TaZQP9Imxr5OQMT43+z6lA+57hY6Pw1EYLt5O2c5tfbk2HZ+FRSJtZ6vVriakA VQbvl/Z/NC3NAHHB4/kf8xSVWXQsYN+G1zDFCmISrds8BxQqkUSqIPLFBdiJ1aGBcL+Hgji8XQs 5j7rzaP8LJhWncnKdOA== X-Proofpoint-ORIG-GUID: NbvAgHd4vcTxI6GvutCRyAzXSq0dpsd4 X-Authority-Analysis: v=2.4 cv=aNFlOr9m c=1 sm=1 tr=0 ts=6ab408d8 cx=c_pps a=ULNsgckmlI/WJG3HAyAuOQ==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=Fma_We6Em7EAR7gKL-MA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=1WsBpfsz9X-RYQiigVTh:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: NbvAgHd4vcTxI6GvutCRyAzXSq0dpsd4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-23_06,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609230068 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1790183925756158500 All remaining users of cpu_exec_halt simply alias cpu_has_work(). Call cpu_has_work() directly from the generic halt flow and remove the redundant hook registrations and interface definition. Make affected cpu_has_work() helpers private where possible. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/accel/tcg/cpu-ops.h | 18 ------------------ target/loongarch/internals.h | 1 - target/riscv/internals.h | 5 ----- target/s390x/s390x-internal.h | 1 - accel/tcg/cpu-exec.c | 23 ++++++++--------------- target/alpha/cpu.c | 1 - target/avr/cpu.c | 1 - target/hexagon/cpu.c | 1 - target/hppa/cpu.c | 1 - target/loongarch/cpu.c | 2 +- target/loongarch/tcg/tcg_cpu.c | 1 - target/m68k/cpu.c | 1 - target/microblaze/cpu.c | 1 - target/mips/cpu.c | 1 - target/or1k/cpu.c | 1 - target/ppc/cpu_init.c | 1 - target/riscv/cpu.c | 2 +- target/riscv/tcg/tcg-cpu.c | 1 - target/rx/cpu.c | 1 - target/s390x/cpu-system.c | 2 +- target/s390x/cpu.c | 1 - target/sh4/cpu.c | 1 - target/sparc/cpu.c | 1 - target/tricore/cpu.c | 1 - target/xtensa/cpu.c | 1 - 25 files changed, 11 insertions(+), 60 deletions(-) diff --git a/include/accel/tcg/cpu-ops.h b/include/accel/tcg/cpu-ops.h index 1ee5d3d8bdb..4195a29e1e4 100644 --- a/include/accel/tcg/cpu-ops.h +++ b/include/accel/tcg/cpu-ops.h @@ -187,7 +187,6 @@ struct TCGCPUOps { * resume execution from the halted state. This callback performs any * necessary target-specific state transitions or synchronization befo= re * instruction execution resumes. The caller does not hold the BQL. - * Either this callback or @cpu_exec_halt must be provided (but not bo= th). */ void (*leaving_halt)(CPUState *cpu); /** @do_interrupt: Callback for interrupt handling. */ @@ -196,23 +195,6 @@ struct TCGCPUOps { bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); /** @cpu_exec_reset: Callback for reset in cpu_exec. */ void (*cpu_exec_reset)(CPUState *cpu); - /** - * @cpu_exec_halt: Callback for handling halt in cpu_exec. - * - * The target CPU should do any special processing here that it needs - * to do when the CPU is in the halted state. - * - * Return true to indicate that the CPU should now leave halt, false - * if it should remain in the halted state. (This should generally - * be the same value that cpu_has_work() would return.) - * - * Either @leaving_halt or this method must be provided, but not both. - * If the target does not need to - * do anything special for halt, the same function used for its - * SysemuCPUOps::has_work method can be used here, as they have the - * same function signature. - */ - bool (*cpu_exec_halt)(CPUState *cpu); /** * @tlb_fill_align: Handle a softmmu tlb miss * @cpu: cpu context diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h index f9a0680fe0f..2e31442453e 100644 --- a/target/loongarch/internals.h +++ b/target/loongarch/internals.h @@ -38,7 +38,6 @@ void cpu_loongarch_timer_cb(void *opaque); uint64_t cpu_loongarch_get_timer_counter(CPUTimerState *timer); uint64_t cpu_loongarch_get_timer_ticks(CPUTimerState *timer); void cpu_loongarch_set_timer_config(CPUTimerState *timer, uint64_t value); -bool loongarch_cpu_has_work(CPUState *cs); bool cpu_loongarch_hw_interrupts_pending(CPULoongArchState *env); #endif /* !CONFIG_USER_ONLY */ =20 diff --git a/target/riscv/internals.h b/target/riscv/internals.h index 5d84e4de960..fb2d8b3e17a 100644 --- a/target/riscv/internals.h +++ b/target/riscv/internals.h @@ -201,11 +201,6 @@ static inline target_ulong get_xepc_mask(CPURISCVState= *env) } } =20 -#ifndef CONFIG_USER_ONLY -/* Our implementation of SysemuCPUOps::has_work */ -bool riscv_cpu_has_work(CPUState *cs); -#endif - /* Zjpm addr masking routine */ static inline target_ulong adjust_addr_body(CPURISCVState *env, target_ulong addr, diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index da60b2b1fd4..df1297b5c67 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -248,7 +248,6 @@ bool s390_cpu_system_realize(DeviceState *dev, Error **= errp); void s390_cpu_finalize(Object *obj); void s390_cpu_system_class_init(CPUClass *cc); void s390_cpu_machine_reset_cb(void *opaque); -bool s390_cpu_has_work(CPUState *cs); #endif /* CONFIG_USER_ONLY */ =20 =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index edb719b0d10..30a9a8aed42 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -48,7 +48,6 @@ #include "internal-common.h" #if !defined(CONFIG_USER_ONLY) #include "accel/tcg/iommu.h" -#include "hw/core/sysemu-cpu-ops.h" #endif =20 /* -icount align implementation. */ @@ -659,21 +658,16 @@ static bool cpu_poll_while_halted(CPUState *cpu) { const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; =20 + if (tcg_ops->poll_during_halt) { + tcg_ops->poll_during_halt(cpu); + } + + if (!cpu_has_work(cpu)) { + return false; + } + if (tcg_ops->leaving_halt) { - assert(!tcg_ops->cpu_exec_halt); - if (tcg_ops->poll_during_halt) { - tcg_ops->poll_during_halt(cpu); - } - if (!cpu_has_work(cpu)) { - return false; - } tcg_ops->leaving_halt(cpu); - } else { - assert(!tcg_ops->poll_during_halt); - assert(cpu->cc->sysemu_ops->has_work =3D=3D tcg_ops->cpu_exec_halt= ); - if (!tcg_ops->cpu_exec_halt(cpu)) { - return false; - } } =20 cpu->halted =3D 0; /* allow execution */ @@ -1072,7 +1066,6 @@ bool tcg_exec_realizefn(CPUState *cpu, Error **errp) /* Check mandatory TCGCPUOps handlers */ const TCGCPUOps *tcg_ops =3D cpu->cc->tcg_ops; #ifndef CONFIG_USER_ONLY - assert(tcg_ops->cpu_exec_halt || tcg_ops->leaving_halt); assert(tcg_ops->cpu_exec_interrupt); assert(tcg_ops->cpu_exec_reset); assert(tcg_ops->pointer_wrap); diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 12e86021663..7d1d036e1d3 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -265,7 +265,6 @@ static const TCGCPUOps alpha_tcg_ops =3D { .tlb_fill =3D alpha_cpu_tlb_fill, .pointer_wrap =3D cpu_pointer_wrap_notreached, .cpu_exec_interrupt =3D alpha_cpu_exec_interrupt, - .cpu_exec_halt =3D alpha_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D alpha_cpu_do_interrupt, .do_transaction_failed =3D alpha_cpu_do_transaction_failed, diff --git a/target/avr/cpu.c b/target/avr/cpu.c index f8409f32ab9..a01e6fa4751 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -246,7 +246,6 @@ static const TCGCPUOps avr_tcg_ops =3D { .restore_state_to_opc =3D avr_restore_state_to_opc, .mmu_index =3D avr_cpu_mmu_index, .cpu_exec_interrupt =3D avr_cpu_exec_interrupt, - .cpu_exec_halt =3D avr_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .tlb_fill =3D avr_cpu_tlb_fill, .do_interrupt =3D avr_cpu_do_interrupt, diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index fad526ccfb5..e7defcca8a7 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -783,7 +783,6 @@ static const TCGCPUOps hexagon_tcg_ops =3D { .cpu_exec_reset =3D cpu_reset, .tlb_fill =3D hexagon_tlb_fill, .do_unaligned_access =3D hexagon_cpu_do_unaligned_access, - .cpu_exec_halt =3D hexagon_cpu_has_work, .do_interrupt =3D hexagon_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 07b49e51326..7b1309a7c38 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -270,7 +270,6 @@ static const TCGCPUOps hppa_tcg_ops =3D { .tlb_fill_align =3D hppa_cpu_tlb_fill_align, .pointer_wrap =3D cpu_pointer_wrap_notreached, .cpu_exec_interrupt =3D hppa_cpu_exec_interrupt, - .cpu_exec_halt =3D hppa_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D hppa_cpu_do_interrupt, .do_unaligned_access =3D hppa_cpu_do_unaligned_access, diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index f22f64efb80..6b765797393 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -123,7 +123,7 @@ bool cpu_loongarch_hw_interrupts_pending(CPULoongArchSt= ate *env) #endif =20 #ifndef CONFIG_USER_ONLY -bool loongarch_cpu_has_work(CPUState *cs) +static bool loongarch_cpu_has_work(CPUState *cs) { bool has_work =3D false; =20 diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c index 4b1d44a1644..7ea2a1eb933 100644 --- a/target/loongarch/tcg/tcg_cpu.c +++ b/target/loongarch/tcg/tcg_cpu.c @@ -327,7 +327,6 @@ const TCGCPUOps loongarch_tcg_ops =3D { .tlb_fill =3D loongarch_cpu_tlb_fill, .pointer_wrap =3D loongarch_pointer_wrap, .cpu_exec_interrupt =3D loongarch_cpu_exec_interrupt, - .cpu_exec_halt =3D loongarch_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D loongarch_cpu_do_interrupt, .do_transaction_failed =3D loongarch_cpu_do_transaction_failed, diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 9b52ad5fc23..c7771cbf643 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -710,7 +710,6 @@ static const TCGCPUOps m68k_tcg_ops =3D { .tlb_fill =3D m68k_cpu_tlb_fill, .pointer_wrap =3D cpu_pointer_wrap_uint32, .cpu_exec_interrupt =3D m68k_cpu_exec_interrupt, - .cpu_exec_halt =3D m68k_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D m68k_cpu_do_interrupt, .do_transaction_failed =3D m68k_cpu_transaction_failed, diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 389a5124b12..6013a8def8e 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -448,7 +448,6 @@ static const TCGCPUOps mb_tcg_ops =3D { .tlb_fill =3D mb_cpu_tlb_fill, .pointer_wrap =3D cpu_pointer_wrap_uint32, .cpu_exec_interrupt =3D mb_cpu_exec_interrupt, - .cpu_exec_halt =3D mb_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D mb_cpu_do_interrupt, .do_transaction_failed =3D mb_cpu_transaction_failed, diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 0fead20d651..c069aa1c0b7 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -716,7 +716,6 @@ static const TCGCPUOps mips_tcg_ops =3D { .tlb_fill =3D mips_cpu_tlb_fill, .pointer_wrap =3D mips_pointer_wrap, .cpu_exec_interrupt =3D mips_cpu_exec_interrupt, - .cpu_exec_halt =3D mips_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D mips_cpu_do_interrupt, .do_transaction_failed =3D mips_cpu_do_transaction_failed, diff --git a/target/or1k/cpu.c b/target/or1k/cpu.c index 66c00c0930c..42d9351b6d7 100644 --- a/target/or1k/cpu.c +++ b/target/or1k/cpu.c @@ -266,7 +266,6 @@ static const TCGCPUOps openrisc_tcg_ops =3D { .tlb_fill =3D openrisc_cpu_tlb_fill, .pointer_wrap =3D cpu_pointer_wrap_uint32, .cpu_exec_interrupt =3D openrisc_cpu_exec_interrupt, - .cpu_exec_halt =3D openrisc_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D openrisc_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 6c626843c93..ef59c56f416 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7496,7 +7496,6 @@ static const TCGCPUOps ppc_tcg_ops =3D { .tlb_fill =3D ppc_cpu_tlb_fill, .pointer_wrap =3D ppc_pointer_wrap, .cpu_exec_interrupt =3D ppc_cpu_exec_interrupt, - .cpu_exec_halt =3D ppc_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D ppc_cpu_do_interrupt, .cpu_exec_enter =3D ppc_cpu_exec_enter, diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 62ac4507ed5..c0ce7eceb2d 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -954,7 +954,7 @@ int riscv_cpu_vsirq_pending(CPURISCVState *env) (irqs | irqs_f_vs), env->hviprio); } =20 -bool riscv_cpu_has_work(CPUState *cs) +static bool riscv_cpu_has_work(CPUState *cs) { RISCVCPU *cpu =3D RISCV_CPU(cs); CPURISCVState *env =3D &cpu->env; diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index b68160af830..260ac6d89e7 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -286,7 +286,6 @@ const TCGCPUOps riscv_tcg_ops =3D { .tlb_fill =3D riscv_cpu_tlb_fill, .pointer_wrap =3D riscv_pointer_wrap, .cpu_exec_interrupt =3D riscv_cpu_exec_interrupt, - .cpu_exec_halt =3D riscv_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D riscv_cpu_do_interrupt, .do_transaction_failed =3D riscv_cpu_do_transaction_failed, diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 9b8473d71cf..69946928995 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -227,7 +227,6 @@ static const TCGCPUOps rx_tcg_ops =3D { .pointer_wrap =3D cpu_pointer_wrap_uint32, =20 .cpu_exec_interrupt =3D rx_cpu_exec_interrupt, - .cpu_exec_halt =3D rx_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D rx_cpu_do_interrupt, }; diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index d38de4fea2b..82c89080a17 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -39,7 +39,7 @@ #include "system/tcg.h" #include "hw/core/sysemu-cpu-ops.h" =20 -bool s390_cpu_has_work(CPUState *cs) +static bool s390_cpu_has_work(CPUState *cs) { S390CPU *cpu =3D S390_CPU(cs); =20 diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 85afc5dec9a..e7f81fabff6 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -384,7 +384,6 @@ static const TCGCPUOps s390_tcg_ops =3D { .tlb_fill =3D s390_cpu_tlb_fill, .pointer_wrap =3D s390_pointer_wrap, .cpu_exec_interrupt =3D s390_cpu_exec_interrupt, - .cpu_exec_halt =3D s390_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D s390_cpu_do_interrupt, .debug_excp_handler =3D s390x_cpu_debug_excp_handler, diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 3bbdee301d5..55c73a1da35 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -312,7 +312,6 @@ static const TCGCPUOps superh_tcg_ops =3D { .tlb_fill =3D superh_cpu_tlb_fill, .pointer_wrap =3D cpu_pointer_wrap_notreached, .cpu_exec_interrupt =3D superh_cpu_exec_interrupt, - .cpu_exec_halt =3D superh_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D superh_cpu_do_interrupt, .do_unaligned_access =3D superh_cpu_do_unaligned_access, diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index ae9bdca9df8..1529f9570da 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -1074,7 +1074,6 @@ static const TCGCPUOps sparc_tcg_ops =3D { .tlb_fill =3D sparc_cpu_tlb_fill, .pointer_wrap =3D sparc_pointer_wrap, .cpu_exec_interrupt =3D sparc_cpu_exec_interrupt, - .cpu_exec_halt =3D sparc_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D sparc_cpu_do_interrupt, .do_transaction_failed =3D sparc_cpu_do_transaction_failed, diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 84a05e3d363..82b56c3cd56 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -223,7 +223,6 @@ static const TCGCPUOps tricore_tcg_ops =3D { .tlb_fill =3D tricore_cpu_tlb_fill, .pointer_wrap =3D cpu_pointer_wrap_uint32, .cpu_exec_interrupt =3D tricore_cpu_exec_interrupt, - .cpu_exec_halt =3D tricore_cpu_has_work, .cpu_exec_reset =3D cpu_reset, }; =20 diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 7c25b9ab707..99c8bd4b5fb 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -325,7 +325,6 @@ static const TCGCPUOps xtensa_tcg_ops =3D { .tlb_fill =3D xtensa_cpu_tlb_fill, .pointer_wrap =3D cpu_pointer_wrap_uint32, .cpu_exec_interrupt =3D xtensa_cpu_exec_interrupt, - .cpu_exec_halt =3D xtensa_cpu_has_work, .cpu_exec_reset =3D cpu_reset, .do_interrupt =3D xtensa_cpu_do_interrupt, .do_transaction_failed =3D xtensa_cpu_do_transaction_failed, --=20 2.53.0