From nobody Sat Sep 26 19:12:10 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=1790263497; cv=none; d=zohomail.com; s=zohoarc; b=I3dDF+8sgWPcWWw+d/F+nouLjQhenEhqSsk6uFTBhyKnWHDdBDPNaL2RbjqWrEoxpoSZL/cI78vnEOoEblMjlkpT5tVRJmP6bYcURy/0xfzZ1J6pa5furW5q8kmLhLlm4F0krUrbXP9qXG1NwIJaseeMWCwRhc4jTmXICuLe1t8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263497; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=dQILwiHqWZbRwJUdacbj8UhPl0PEK7itNZ24Grwywxo=; b=LfWoXYDqYkQPrDZxLb/1MBE4AbPPAJ2mW3VZZb8xfV5yj9BelG3ePGJIuHHLvO40UTk9v/FVTIEx/ogWqMQsicy8w264JdY5JPkXvgaYt4oqFfPK3Cb3+0v4WNOV5gfm1rcOfQ11pnpvnMVGjQj3MGCkOLNbOAwzbTQFaJFYGDs= 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 1790263497025536.4295880663126; Thu, 24 Sep 2026 08:24:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lJV-0001mi-Gn; Thu, 24 Sep 2026 11:24:45 -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 1x9lJR-0001lr-0g for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:24:41 -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 1x9lJO-0000Df-4O for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:24:40 -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 68OF8jGb2032256 for ; Thu, 24 Sep 2026 15:24:29 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 4gw68e03jj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:24:28 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-97e9e1dd7fbso1708299241.0 for ; Thu, 24 Sep 2026 08:24:28 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe0c4054fsm119172245e9.3.2026.09.24.08.24.23 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= dQILwiHqWZbRwJUdacbj8UhPl0PEK7itNZ24Grwywxo=; b=k7G65o9747OqAMxw /oqKfG1J7ZIm/5FTVsrUP4eXdBziooKpWA0sREgsdsP045KKAeDr7dp6FrixmIop XQ9o+vKfD2SPsjo0ptp0zmUbs1ZNWDgcniYXCJ0L7O7n5RIM6/W7EJ+ggP9PjsHS Q6L5HcXToTwUHnV3/WDBAAYnmpktGRBu7vFEgKAYrrlVo2u/NIAiCDM/SkzOP6Qs WT5iseYwuNJEV35p68UB1Wl+Zz+h6pe7Ie7vhCvMoG8sLWdwT9fOAFxQ6K9tGsWJ G+dM1XLQhWwpkO9Z5vAax1axxHGKwaWtKl+sidyssvQWCcGvUeL6sEmBOE6yMWUQ /bcSRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263468; x=1790868268; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=dQILwiHqWZbRwJUdacbj8UhPl0PEK7itNZ24Grwywxo=; b=AA2NZpawpFb5bs53EndtGAYT71PFVlon/dmkaFkMH48pnJ023DhwUcZCKpoQbWPs8r AF0xVjE9+11p49oNK87eiAKxyA0SL6q7enl7hBU+Xp1xCoSnAbWSqbhldHQsyB8Aqq1K 5m0rUvpcDZKN4rKj5MuUIPpv+0KOeA5Qv6pDwvWMOYssJk7jSQbzSK86liKvRL45UmmK GWfKeICUIsEwL1euDpGp3OyvUg5n0f5f11q+oyqBj23RJLJzwv8+hQpkjUr643nIR1pb cvbYL06QN4v8Jw/iGpJRe1EOfGemP8PoIhiQ5zyNZFynRShOpbo2fOrMwGFalXEJb14g /m0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263468; x=1790868268; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dQILwiHqWZbRwJUdacbj8UhPl0PEK7itNZ24Grwywxo=; b=RyaN+UT0OFP6qryfRRSmea7J4SWByfNEKJC3ge0uUf6KStDmueP7ny0KTFewAz5zbC WwgMVJPXvVzyJx6gUNJSEphqKJc42CQSQOuYniT7JEwNOWyh6VKLqlmUEMBZMxhssliM jqgRsgO2DM+EQlZSlNuD0sYFY5NEnJxJXC1s7f4r9HrkmV6xmLfupL1BsEWdjKdNPLe/ JxYi1K4iNz8TRtJ40E4ZJpCf8HjHDUm1epH2Jc3B7zE661LNZaSsVoRBAYDFIHrfEECx z7kIKpCXLhe/7gaCp4IY7ZFenduL6v9/UFUx6oFPGMWQqsc7ySeOG/fF2LIIZxMCQCrD ARWg== X-Gm-Message-State: AFuF++nrYXUT5Cycu+KduovcUG1qYOwP4WJ6+v/chuD6MjgW7NIBUvwR saubBEDYo/qcZxM+OUFD1xFTJXuAL7WVbf/86yvT9JC3cwjjLH2dasc1Drg9vQYyXDbP+iqB7rE LaHdJcuBEP2T0gMC1fxJ6t3QHj4EDzgN6WEJEYf3VIWZt2vVSuP4NAjYg7T0+9AoEaA== X-Gm-Gg: AYBFou1LXzbq9HAqD2BWwJDOQx2Vex4nLu4kDD/BTeZ5mx7B8+rWz0EgtybVPlXSGv1 5hN87xU5oNckNqJ5SwI1pE63tc5P578X9eYS+4KFKzRK+iPqJrq/9xYZOkuAz1HtAipXhfnesT0 UyME4uv8bLUlnQVPVsDmyoeQh9+z4u2kQuOKMiBV8rKLyCDIqnXRyGHmiomqpIZ//k/yCg1t36K IyZ3m4uSUW5AXFtgVTVh0Z/nBKwnnaMZ35ObIofm1/xVOz4eiK0l89q48rzHAotf7x1Cem9Yb3v EcD2VfH9UNq7NafuNbuldwk1xeCkLlNtzf9eP2DVYhwKn/ezS0Agbjhg70WwFbltAaOY+et218C mb4zZkYvHzJ4atYqNlQsTc3wLndgaEjkV2pjB0ZRd X-Received: by 2002:a05:6102:3ec5:b0:7a7:198a:c2bd with SMTP id ada2fe7eead31-7af1e2f54d4mr1588193137.37.1790263467793; Thu, 24 Sep 2026 08:24:27 -0700 (PDT) X-Received: by 2002:a05:6102:3ec5:b0:7a7:198a:c2bd with SMTP id ada2fe7eead31-7af1e2f54d4mr1588175137.37.1790263467052; Thu, 24 Sep 2026 08:24:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 01/18] target/mips: Fix zero in gen_mxu_d8sum Date: Thu, 24 Sep 2026 17:23:36 +0200 Message-ID: <20260924152353.36209-2-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX3w2q56GaNn0p AsKcIoqUAA8O/m0SOGag+jthEccMUIVTdQ14x2IOSmhT8fXtdcVW57ZR/679TS+4ulUPsEJ3zwQ Yr2ar6ZVvWddoc0Yi6I0eNVevfoXArYAnh9boI1zEuqinn7k9qnlMFSA1fhfCJVIvc2vW2KVq2Z njPebErIz0nMFPSyqd6CpN1JBNJm+n1LYxe7gKTJmfMauwY0LUd4Ra6yqS813v3Qh/5PB477e1D TrEGgzsn3OSoBJeDqsX3i+WaR2MfPYkev6Er5/InNUjXc554DH8I/mdSdIRE4ecbs1BOm8V+Slu yqxKarOZka7lIqynEdgadO9aF2l2Yb87z+QFEePNeMtPof2Yz5RH4ha1Ofy4Q1buLqq7LQk0Kjk txXJ4VFjshFGOGAllEYDtbc5vfr3cwK0FjP+4I0IeL9SINxIl/3FCc/LDswBaIKCrSaTNHtao2l BeJ45BZhV62GsNBX2rA== X-Proofpoint-GUID: ornAAjSi6I2FSS-R8no88e9bp_CS3xhy X-Proofpoint-ORIG-GUID: ornAAjSi6I2FSS-R8no88e9bp_CS3xhy X-Authority-Analysis: v=2.4 cv=XawcX455 c=1 sm=1 tr=0 ts=6ab540ac 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=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=UbgK6sZ85PiArCHPYcEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX6SDwsLmP2iJd hlUse6duxEOmMYmT3TkfPsqBDy+NkoCq3Ilou9Z+/HV50THoYhkHqXKHq5Ty/1K34atuZnxxxGJ dQvbWeXBXBVqqg5xM0QniLCPnXwbltI= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 spamscore=0 impostorscore=0 bulkscore=0 phishscore=0 priorityscore=1501 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263499712158500 From: Richard Henderson This is obviously an attempt to set temps to 0, but accidentally passed NULL to a regular move. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260914230901.1781309-2-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/mxu_translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 7961b073144..9559b8aada3 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -3109,7 +3109,7 @@ static void gen_mxu_d8sum(DisasContext *ctx, bool sum= c) tcg_gen_add_i32(t4, t4, t2); tcg_gen_add_i32(t4, t4, t3); } else { - tcg_gen_mov_i32(t4, 0); + tcg_gen_movi_i32(t4, 0); } if (XRc !=3D 0) { tcg_gen_extract_i32(t0, mxu_gpr[XRc - 1], 0, 8); @@ -3120,7 +3120,7 @@ static void gen_mxu_d8sum(DisasContext *ctx, bool sum= c) tcg_gen_add_i32(t5, t5, t2); tcg_gen_add_i32(t5, t5, t3); } else { - tcg_gen_mov_i32(t5, 0); + tcg_gen_movi_i32(t5, 0); } =20 if (sumc) { --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263559; cv=none; d=zohomail.com; s=zohoarc; b=BL/D+yREm6K268wm0AWhlQzG3uogPWZBhBA6vDl6E23bxdzMo+mYj8sKgkhUYt2ISXd5in+WjQGVKrOI20n28uEcaV1JrBTHjdl6qLxfLge4P5Sq+lGoRRLf0grFpOx+m26oUOTWSypUhWPwp+Q2t3YlmuqkRs8F7uq6nP4GGvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263559; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=LuzzBNNYUkquyYLmfrOKR0ofZqga5fNjsljg49B3N1Q=; b=GbA66JuXlqNS+XjDWcnjhAiQt8yh1Y281VJgp6+wRE26E+F41m1BlUNg7K41faOI+rdF/WgnAGIA4LNc9tGV7StnGdAUwy0iQLTlEqzgKRrNvG1idtX7Oe5t7DRWwB+t4jkFG+WIKYVsBh+hBwBwexuihEZo72YT5dyeetsJQpg= 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 1790263559418508.0939897207795; Thu, 24 Sep 2026 08:25:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKG-000208-1F; Thu, 24 Sep 2026 11:25:34 -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 1x9lJS-0001mJ-6C for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:24:43 -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 1x9lJP-0000Dy-C5 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:24:41 -0400 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OEW61Z2322316 for ; Thu, 24 Sep 2026 15:24:36 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 4gw5q8r7se-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:24:35 +0000 (GMT) Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-9806756ea40so1682788241.1 for ; Thu, 24 Sep 2026 08:24:35 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5df44f9sm69935265e9.11.2026.09.24.08.24.32 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LuzzBNNYUkquyYLmfrOKR0ofZqga5fNjsljg49B3N1Q=; b=PTL6lU9oCCK+6Lz0 1ui038RkL6XHsYDeYa1mDWm9zEyMrYiet9JUkFog70VYXlwPVWhaFVEdsZlKYGUy x3hdtKaEIudk306nCEKuPGx81RSfrxffsMIcLph1SZExIUE3zufamspJqQFAL2AU 1oGQ24OJrqL9bGOPAsuBziBy9/An9CXCHuuqujXFEE5jfqnEtIEq9eK1NJb8UXXB /Y/bcfE/T+icoZjPrQPEFZwSyO04lsUDeWAnpsd5BQICBwM8mnGauyuisMggotfX jTfBVv6QjtuPqkEio4CM77SmXr3u7ZXWK/WUuYlgs1093Jme35v/Yjgc4dXqgsks 2ufe2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263475; x=1790868275; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LuzzBNNYUkquyYLmfrOKR0ofZqga5fNjsljg49B3N1Q=; b=elW6cGCtYLKvbre0ls4yKlWFPR3J253XmP/yLQ1fUa2WXIiuaXDgxXQq3x/BSuLeGc JJ3eX7/u+r2w3IV9L+UPwfKOTo6TEQiRI4EiZ/bzsrcqlxkKkmB6HUUq19G3+IhpHhjp DW4UNrqdSF5e++n5B+W90iF6z7raBZwKlzuQoLv3v1Hhf1bQJjre7ztfrDrIv+26ES0D L77Ij6GVaqIHuzLx3SvPqeQ9j6/xgrT+3Jnl0OS3s4gMkp3DqEe83TdvP8gF5NqCrIpL u05yIm16SNdaIkP6fuOjWox+613M6zQKdzY7UHT7hf7k7L0J7djlrLrwxgnXsHl0b3sL tB9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263475; x=1790868275; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=LuzzBNNYUkquyYLmfrOKR0ofZqga5fNjsljg49B3N1Q=; b=SeQX9krbc3tWu8UQ8WxxXkQmPnAR9HTfbIgYEvBd5IZgMdeP+6vweacaA2QQsPyR2S 1lVVy1LIvoPcDWg7qBa1NXdLMOH5FvLR3j4u12/HKfucn5z6Z8DSS0qcDUyft/nYuELu 5gV/DsfOjlv+NypBtvPaki8pksMyRDfAJued0onb8CRgqnQb6NHoDp6ncb2p71kVlVw/ Q3NKEhNGHOw0Fk6m/qhdjP3zgJD1lDY3/AOsUULgo1IGcVgF2DN5tWcFbVMVhSgOdVOZ rYakcdDhU3pEaKfSbscBbRr/c2KbGZRH7o5o6FK5dq2sKpAD5SICKshePItvYNTdKxbz ASRA== X-Gm-Message-State: AFuF++kwmN8hDiUDaqq5O2d5AhRVPEDqlCD9Bjzy3BUMStCegUHG2fdL m8hV9Q9+d79lhFVCHLEnFVxIvHAXadSBuNd+t7+O29gDTLQMmyhgkNx5hdc0VtoM5+gB8SH4WU/ rUnIy9gLDt14cuW/dVQBYIMvcPljqQUBHVXw53W2SdPK75RQ9qA/yP1c+H+uwPQbNfQ== X-Gm-Gg: AYBFou2MIQAcpr0E+ncLcrzsaYQvP1iCSGpVdzYRhmmrgkDsvSvR6ckWnbRpSDTlTXX Pki6TJU7EGvTuo/Lci6fSRnty7tmlVNXT5Z47U4cuk9CWzRKnJ+CXfO3T2x3bIU1u4GSDcHx+Bq lglG0CxzBkNMv4p83LFkWJadiOfaIb/Ke1zx4u0DyezTAL/xHfJ2qg+3EvyzpVAk0kwPcQhYwip 27SuGMgyFGnFfcdZBnX+th3M/NLSjk8KT9MWE6sslTOgWbsJzmNdIXLzDg1kp/cFe9QAwIZ4MhW BWXeJJd86JFSb//Wto4JoxOdVfnyRAebo+ne//xEcgbr7iX+P/C6PAz+rknO2RRLUQ0qNTedGUJ CtItMGA1piqASp1/qY2a/otQZfQ2LhVI0ZUVGC8ZA X-Received: by 2002:a05:6102:2ad4:b0:7a1:dca9:8563 with SMTP id ada2fe7eead31-7af1cc97bcfmr1510494137.12.1790263475212; Thu, 24 Sep 2026 08:24:35 -0700 (PDT) X-Received: by 2002:a05:6102:2ad4:b0:7a1:dca9:8563 with SMTP id ada2fe7eead31-7af1cc97bcfmr1510474137.12.1790263474708; Thu, 24 Sep 2026 08:24:34 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 02/18] target/mips: Drop zero optimization in gen_mxu_s32mul Date: Thu, 24 Sep 2026 17:23:37 +0200 Message-ID: <20260924152353.36209-3-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX1Z7MjI3xeloq IZ9TQYqom91EiAhK5ReGVdCTmIRXDtgyXMBfnMlaVVhZpUQfftny0HvHRCCpbZcQvI+fwVftk2R YulowRTygsPYgjupEK1GOk8B97Z/rRY= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXzpxQq4fZg3i0 hlYOAgIm1Gjpkr/AX6OEyF93X9WoYvjcqLXlw69WBnZRxuVyuCMfN0qmRsNRAI4WOUvIfK4n2+1 G1ZduAVC9WNdY7ztUNgytgm0uGHGxvejSht2ezZ08TjKQRiUwi5ywZyUgaGjeUfE+Q/PgJAD3W3 vaEmeMVVyUyXWE+bTM7BBpOM+chpWucpNpf1azpGz1y4wE5jYIetLcHRRhPFQ5o3ntcLB5v1Ltc sFfagCBu9WaqW+manulj+FE4HhrdU1ytb+fuoHExfygRXhV+WcjhmEscMXdeOSrc+vLkTXOuL+D TkwbR0offRUNFt+RKSoynXB8upRXKIexVJTMx8EDtZmFQVdJDHwENyk5hsOcBxGfEfYI5rj+dNe I7bleDhS9zoGEAprX28cqbM1GVj0E2Us6lKyBoR+KgXqd7cDIU0mHTxREghr1Mzh72BsXdWnseV aMZ9HRmkaESDSRG6FBA== X-Authority-Analysis: v=2.4 cv=SYRi5fRu c=1 sm=1 tr=0 ts=6ab540b3 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=ZpdpYltYx_vBUK5n70dp:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=UbgK6sZ85PiArCHPYcEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=TD8TdBvy0hsOASGTdmB-:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: PUVz_a-9VustC525UAvXyqPht9DqndfX X-Proofpoint-ORIG-GUID: PUVz_a-9VustC525UAvXyqPht9DqndfX 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 malwarescore=0 suspectscore=0 bulkscore=0 impostorscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263560242158500 From: Richard Henderson In the unlikely event of the architecturally valid case of using the zero register as a multiply input, this will be folded away during optimize. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260914230901.1781309-3-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/mxu_translate.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 9559b8aada3..f30883f976f 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -964,18 +964,13 @@ static void gen_mxu_s32mul(DisasContext *ctx, bool mu= lu) rs =3D extract32(ctx->opcode, 16, 5); rt =3D extract32(ctx->opcode, 21, 5); =20 - if (unlikely(rs =3D=3D 0 || rt =3D=3D 0)) { - tcg_gen_movi_i32(t0, 0); - tcg_gen_movi_i32(t1, 0); - } else { - gen_load_gpr(t0, rs); - gen_load_gpr(t1, rt); + gen_load_gpr(t0, rs); + gen_load_gpr(t1, rt); =20 - if (mulu) { - tcg_gen_mulu2_i32(t0, t1, t0, t1); - } else { - tcg_gen_muls2_i32(t0, t1, t0, t1); - } + if (mulu) { + tcg_gen_mulu2_i32(t0, t1, t0, t1); + } else { + tcg_gen_muls2_i32(t0, t1, t0, t1); } tcg_gen_mov_i32(cpu_HI[0], t1); tcg_gen_mov_i32(cpu_LO[0], t0); --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263582; cv=none; d=zohomail.com; s=zohoarc; b=eql7iw0goJFh4kkRMpJnEQxtk0JncYm4errpq7hq0cWQJcuIEMikxb1U51yio+w4ixq4qQUZJIRf0et7cjXpa3tj5jGUdBdkbEt28x7QfJnmI+W+RT5WKetH4G+l0xy8JDP+SpduD4KUSzQFialauBu8jlK7+t462WexPrVb9Bo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263582; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=GOW72uFGUBB6MPEX7SpsSjVfsnBYgSzUVnB63yf2WNM=; b=JHn3Qz8OUVIwWh+TCmht640MIfBbqoZH0kWDFwslw9UTJVXAT98faF98BZ/iR+yPnYULoUajcUj5hjKNDVgicC4cO7MtEsrzPpkpJMr2u+ow6cokpPo+Gbcr6PodXUgkzAAKlfWXCYN0WHuGVgP36vA4bnn0dus5M4UYY/8rS0I= 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 1790263582330822.2476514221876; Thu, 24 Sep 2026 08:26:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKU-0002M2-RR; Thu, 24 Sep 2026 11:25:47 -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 1x9lJY-0001nH-IV for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:24:52 -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 1x9lJW-0000Eo-Cm for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:24:48 -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 68OF8nNR2032527 for ; Thu, 24 Sep 2026 15:24:45 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 4gw68e03n2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:24:44 +0000 (GMT) Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-5c8337b12d0so819950e0c.0 for ; Thu, 24 Sep 2026 08:24:44 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-488682673bdsm15356445f8f.2.2026.09.24.08.24.41 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= GOW72uFGUBB6MPEX7SpsSjVfsnBYgSzUVnB63yf2WNM=; b=dZ6VThP6vO+zJXxm U2HOVx9YrJtuPY31qsNTFm91P0bEWUOFXfN7Lxd1m8cJR6u7EoGfn7NaNPzgDfaL NYYpJtWC4sinho+n57DQTbbAlsUKn6g6FUe5opetRAIdWozAT6guBWIMPdOyQyYC 7JgWmUvdQ5pvnYma/Xdw583zcr3OT9O/tQxJldArM6juP+s+I7NXsmD4TywfG20Y Xf6EYNS6Lb7X2Z30Q7MTgko73IxSrZclgi8PFBNnNPBQcv44EsEaoS4O8kDz362o 8k3oKrxs/++dZ/dkRupTCbcqgLGSymO0iRiIa8AG5dK/wK/C5g3Bx7GEUz2alm77 lU2cHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263484; x=1790868284; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=GOW72uFGUBB6MPEX7SpsSjVfsnBYgSzUVnB63yf2WNM=; b=iJOSkcq48HECdH3GEbfcIBKXWBWgJot/IK5BQP9FQQIaAPK45qVRokKP/WzLM+KyOr x+EMk7pdb4Bh5kIklkJv0jwLoJBew0D8+m5a3sVCogUSF98CHKpGsLdQtfdTwpOELwpS oLR4Wh01B+Vpi4AFjMRL3fbUCgvb94TVGBTb4Em5OVnirq4FKyxV7o0seNHDG4TNUjcz GBIbloykpIE/IPAhbRYDvgwR8Vsk5suy7v19/Qt9y6MDqbyvBS+xIEP0NtxkrhNi3zN0 9wAoAVUXXhdh3/Jt6OYgLhXUeSdkHwrb3VykdNYLhRy0kmiWQi8mYJCW/yRuKp6E9Ae8 tb7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263484; x=1790868284; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=GOW72uFGUBB6MPEX7SpsSjVfsnBYgSzUVnB63yf2WNM=; b=cAQHEJA+q+gz66NfIqti+tEoSkhSp3uS08KnGuZvEQuTTTOraIQ+Zs3a0iIhUnG69T rzcZNtURs47RDEPLD3qwJUOwavmsatYybkdLDbdeht5Cxrn8Bn+WAGVzEvdk7h0GAoqW BClyl5pOqTKoR5hGfLdii+yndNjFpJO2iSPrH/yJb78FcGkeZaJzlGfhxAGoCMfhqgXw kME3+4ml0w1hjDJ90+PliULg5sMMilhYJZShDUShIxnxPoT7Wt5p70BrxxMrkjmfBGXG EgdGUDuRj2K6KNKo4u6ozAi1HhU6LhRSAsp4Emimn7yQpRZCX9t+djVqxAic+ovPheZM DXsQ== X-Gm-Message-State: AFuF++npVSk1t5MVJgRkQLpzVMhyjAs8OR3SMdXWOjB3/UKeo9NNhBOw imP8vZgCAkdd7haLev7vR3zXPFSxaCre/k9hXNQ+3Ef2wxUr7q9bHkS4bBixL5mz4XTIbt2m2PG 8/qdbMhMzzZeOnB1WLvayD0sQm3NhpPgBJpYrJsYtMa8wELt62OmRMt97o6yGsUp2bA== X-Gm-Gg: AYBFou2HVFhM4oQ3/ZQwu9V8O+UplRKQoDuogfngTU5UPvieBz3O4X+gxxqLG68VYl4 qLzpFDl4cu07gI8dHEFZ/eVsxBL4A4lJnOH5va+3M2tEDvG/FPlXjXAeA3simPM1HvLauhXmS7N BB5qbaF6ToPGTr8esPANpE9raibRIkuiwnZVCIMxWI+fmg/12GCnzPLL+21lKHEiLnt4TfEqKZJ u2B5sKjT7esZhy91t3rJmM8cziI/uwxn+kRxUNtH7hgLV/58FVGRpc7q8Pk5YjFjTS63Fj9hPW7 GQsapA9zZgeYiZyl+eQDuv/yipxdFKC9uZAM7OXg0TlG+pVlft6cPvhQjLq01vDgZNbpffrjU6c ev1DGITnPHIXAoczReCv0NcTdoO0i9OCEfcUZhGGF X-Received: by 2002:a05:6102:e0c:b0:7a7:a382:6bd7 with SMTP id ada2fe7eead31-7af1dadc05bmr1298003137.27.1790263483612; Thu, 24 Sep 2026 08:24:43 -0700 (PDT) X-Received: by 2002:a05:6102:e0c:b0:7a7:a382:6bd7 with SMTP id ada2fe7eead31-7af1dadc05bmr1297992137.27.1790263483022; Thu, 24 Sep 2026 08:24:43 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 03/18] target/mips: Split out gen_mxu_logic Date: Thu, 24 Sep 2026 17:23:38 +0200 Message-ID: <20260924152353.36209-4-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX6/Fa8FwQvSAW tkDxqzfxujla1qKMMeEsIulFbTbJPm+bXTRyn1+8wW93JUJi6BsnyOAfh1ypohVKX3z4Dp+RB+D JJM98bpDNb1ytOQVfukvu+oRCak1SSFjslKBRQwY7eSVqnS50RPygp+0YmccDXgw1wligTtWG7v jIQWhfujd0MmOEADPItaq35AUaHfZzo9/aQfkhj3LxaTnAL9wWD54keDwZvtfW2ulJjNWnhsI+D LFYHy7w1PvSgJfIEYpHgFT6dqsX26xHQaW6M+5xf5m0GOe7JHUCTl76at4p8Wy63MYMLqf+l4r7 P0qQOn32J4ZKRL+bDGLCMGT5cXa+h0PH+FwHfSHVKms1hvjcTkelT3RIJkZoLCYbPYz11dTfKnk YomfzUyTCgqhQBGLNhQ8PrZfl8SKD6KlOiyu1Kcf0Kpl4djGfqTNuRVpdj9/ai/ehRm5pjb1Gm0 WJ9+z24hCrEyP+HM0IA== X-Proofpoint-GUID: rdRqLxh22Uc2V7PTKNqALbmFzsdU-NAe X-Proofpoint-ORIG-GUID: rdRqLxh22Uc2V7PTKNqALbmFzsdU-NAe X-Authority-Analysis: v=2.4 cv=XawcX455 c=1 sm=1 tr=0 ts=6ab540bc 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=_K5XuSEh1TEqbUxoQ0s3:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=1JvdxygaRBgx84FT6-kA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=XD7yVLdPMpWraOa8Un9W:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXx2QxSRQrWlRo n7Xucwj8nSPM3LsgwZoB0z+gFzcyoI71sEMEp0Se+llQZxCNxM85a6oA9p8oLL92czlhXQdpQWx waAQKDT4I45Mdp9yLVuagBVujJpNzmQ= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 spamscore=0 impostorscore=0 bulkscore=0 phishscore=0 priorityscore=1501 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263584130158500 From: Richard Henderson Split out a helper for common expansion of a 3-operand insns. Drop all the special cases for 0 and let the optimizer handle them. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260914230901.1781309-4-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/mxu_translate.c | 122 +++++++------------------------- 1 file changed, 24 insertions(+), 98 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index f30883f976f..3f8acfcdb8f 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -1685,14 +1685,11 @@ static void gen_mxu_s32stxvx(DisasContext *ctx, boo= l reversed, * S32NOR S32AND S32OR S32XOR */ =20 -/* - * S32NOR XRa, XRb, XRc - * Update XRa with the result of logical bitwise 'nor' operation - * applied to the content of XRb and XRc. - */ -static void gen_mxu_S32NOR(DisasContext *ctx) +static void gen_mxu_logic(DisasContext *ctx, + void (*gen)(TCGv_i32, TCGv_i32, TCGv_i32)) { uint32_t pad, XRc, XRb, XRa; + TCGv_i32 t0, t1; =20 pad =3D extract32(ctx->opcode, 21, 5); XRc =3D extract32(ctx->opcode, 14, 4); @@ -1701,24 +1698,25 @@ static void gen_mxu_S32NOR(DisasContext *ctx) =20 if (unlikely(pad !=3D 0)) { /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to all 1s = */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0xFFFFFFFF); - } else if (unlikely(XRb =3D=3D 0)) { - /* XRb zero register -> just set destination to the negation of XR= c */ - tcg_gen_not_i32(mxu_gpr[XRa - 1], mxu_gpr[XRc - 1]); - } else if (unlikely(XRc =3D=3D 0)) { - /* XRa zero register -> just set destination to the negation of XR= b */ - tcg_gen_not_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to the negation of X= Rb */ - tcg_gen_not_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - tcg_gen_nor_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], mxu_gpr[XRc - = 1]); + return; } + + t0 =3D tcg_temp_new_i32(); + t1 =3D tcg_temp_new_i32(); + gen_load_mxu_gpr(t0, XRb); + gen_load_mxu_gpr(t1, XRc); + gen(t0, t0, t1); + gen_store_mxu_gpr(t0, XRa); +} + +/* + * S32NOR XRa, XRb, XRc + * Update XRa with the result of logical bitwise 'nor' operation + * applied to the content of XRb and XRc. + */ +static void gen_mxu_S32NOR(DisasContext *ctx) +{ + gen_mxu_logic(ctx, tcg_gen_nor_i32); } =20 /* @@ -1728,27 +1726,7 @@ static void gen_mxu_S32NOR(DisasContext *ctx) */ static void gen_mxu_S32AND(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) || (XRc =3D=3D 0))) { - /* one of operands zero register -> just set destination to all 0s= */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to one of them */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - tcg_gen_and_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], mxu_gpr[XRc - = 1]); - } + gen_mxu_logic(ctx, tcg_gen_and_i32); } =20 /* @@ -1758,33 +1736,7 @@ static void gen_mxu_S32AND(DisasContext *ctx) */ static void gen_mxu_S32OR(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to all 0s = */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRb =3D=3D 0)) { - /* XRb zero register -> just set destination to the content of XRc= */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRc - 1]); - } else if (unlikely(XRc =3D=3D 0)) { - /* XRc zero register -> just set destination to the content of XRb= */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to one of them */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - tcg_gen_or_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], mxu_gpr[XRc - 1= ]); - } + gen_mxu_logic(ctx, tcg_gen_or_i32); } =20 /* @@ -1794,33 +1746,7 @@ static void gen_mxu_S32OR(DisasContext *ctx) */ static void gen_mxu_S32XOR(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to all 0s = */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRb =3D=3D 0)) { - /* XRb zero register -> just set destination to the content of XRc= */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRc - 1]); - } else if (unlikely(XRc =3D=3D 0)) { - /* XRc zero register -> just set destination to the content of XRb= */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to all 0s */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else { - /* the most general case */ - tcg_gen_xor_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], mxu_gpr[XRc - = 1]); - } + gen_mxu_logic(ctx, tcg_gen_xor_i32); } =20 /* --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263606; cv=none; d=zohomail.com; s=zohoarc; b=TkT15JZDdgqyHPp9BZpD0D79bJz0MbGEKoh0duLRQVIfw/X38oG/uw/wMDBUmy4VBGaHuhYfSaGm1hdT0NAjs2PM+1A0lmCAJ8UuJoQgfyu3AWi06JzgMGVvJJEHAgnog+ABDYVcgIhDPdjzXjasL0xxo2u0iDXW1yMHTV7SLms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263606; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=38V3STL3tSJ5OL4pSTft0xjYD2BEjAFZOvKjLqQ6Ans=; b=OvJ5lpSTZowVnK1I2+oyVAKcaWivfcEndkLhN7qJtz/TBVZe2/ct4oFDi9mm3DsaAACXc2WR0PW7zVmsEAMzcLo9MzXxNOBA7RSvHkcput0GBSH0jEzIg2yn1mf4z1WaV9WRwOJWECZ0xNdC8PEiWKvvu2Luu53J3KJ0kG92wcs= 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 1790263606635864.9647565008497; Thu, 24 Sep 2026 08:26:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKQ-0002G2-4q; Thu, 24 Sep 2026 11:25:44 -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 1x9lJh-0001tV-65 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25: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 1x9lJf-0000FH-Hf for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:24:56 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC4gj02594260 for ; Thu, 24 Sep 2026 15:24:53 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 4gw1tjh8s3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:24:52 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-7ac2663eba2so1627496137.0 for ; Thu, 24 Sep 2026 08:24:52 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5cd4271sm114985825e9.5.2026.09.24.08.24.48 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 38V3STL3tSJ5OL4pSTft0xjYD2BEjAFZOvKjLqQ6Ans=; b=icy27tcZrSP/vd4g EMXYAb6s9Kp0jZiYSzqtt6PKR18P6s9orckc/gUqT83dSihbDGf8rnQrGFV4Dg4p /DMF+5fY58Qj1b0hKatcwYjpokHfcODECRvEFJveVgkqiOA1N0JUriuT75FkoKr5 4gSUAcf66B1RKYyDpmavQkU6Im+L/pn+IxZqO3py6djfaSNVg9ellkxBPqhl/Rjq dDpC6IsbHgzQAhiR4Dt02wkwmw+jbYWGb/sr/xHt/Ocfd6uYNiKAd8ZqEE2WiuhG jmIhxq1ZKBiSnrPK4y784qbMLjQiZUCRW4u5tuJnFRBCZ/mMxty9LeEiPV1I9DD8 am/KfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263492; x=1790868292; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=38V3STL3tSJ5OL4pSTft0xjYD2BEjAFZOvKjLqQ6Ans=; b=Ab1BNhMnfJ0P7gusUcZ2bnNNI9fDMJhwfbV9eN51b9pqA70M8MiDhnmrWFuNMWo0iI miT/WrAQv7Ufj6lY6NJw8TLx367qWY0UdxkJv+LuLkjlIOU+iVDfAKthiV/M2HCUY4Xv FRcGWcw+pSYGYi4n5pccDCo/B5UC+zAsLg0hvnF6QZQO2PCp5/4g4Z2h390o0EvAdMzu FjNwQLoCWVL5V9TzFWbVJ50gVA7ONHrwn1ygHzagI1KmTQauTwD/02v/qHrKb1g3rKke 4VJkDQD6raiFNylcA62ClvA/oE1Wba2Y8qnvQ23BUFq4dlB3Z2Q4XyT0jTk9oq/VBOTV AQ3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263492; x=1790868292; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=38V3STL3tSJ5OL4pSTft0xjYD2BEjAFZOvKjLqQ6Ans=; b=N0d1I3+9+Za9+2QxFnvflOb9jvhwAsALHn/L0m//0SxJc7VnmNEqi9wWRaREo63Vwo 9CHZ3c35XbOkcnpJ+yLMG41puxY4fOtK/nWBG9QkxHdEYlO+YFQ//7cFn+EnaQNqs3rI znK+L+oGbuO5zWu0cWLZzqOYGrX55TgtFhUJXJD+Sfj0ckVErk29D0bKS1a2N46CrBAn uN2F0iligLsEKK6MbSQUQW3uELAzbDBCvp13TPn5Z+Cv1vBxTsI3cURg89Ppuz766hr0 Fh1Z77OZ8JLfB5ZDOegV0xfiMInMm+5NDtgKz8z81QPOUayNjwxq4DS8024miKRXtFzR 5y1g== X-Gm-Message-State: AFuF++kpzkEdcznDeba/udO2N2SyZo0X6KVV3phCrlKRo0XtQ04Y4hJt geQpy+pR9OU5kn2yL09OXSFDeXM5QSSrrsh4bv5HoYoGM/iQl5ZhFX8DM1FyEx9SOhZdWQEs7ia As26Ld5BxrEfQhHkHf6CJOPxqPzxcZuqiYYk8Yp2mzzQzAayampLSPuYIbphVJ9qZjw== X-Gm-Gg: AYBFou2niIXqKuJY7RiCHfwDN1CwvOS7JFJFw1ZG/jGWk7wxgN6p6/yJGipyW7+zWaL /kWEwj7vYgVeg7J1CJSUqmQP8x/tdvpvJMpZLDAt3qK8O0HGwD1HaFplqRiyjQv5SsH+t06Evjy J3hS2VzusrneyWRCfpnDiIEg8T5W5wEtkb0wyw/T7FLWFZdOVH1bEMs/0sLChhO84Ohv43wKqHR Xf0spBihmpVZrw8WotOAkDkD2eTSiSAgjwnGYvJNVP3Ifb8cXY+B6KA7upQvwoANJC4Q4p8Dwsf ZVH4vqI+W7n3eExmaJPy2MsgyTM6YWFkz6KtDrkMk4I5sFiKuhbjr6YsDw5RiEJfCPerb3URVZI nJIG7tqk3ZgRJNvuyCoFI2pIIRxJ6szLU3UsZkngb X-Received: by 2002:a05:6102:f9a:b0:7a0:3902:52d7 with SMTP id ada2fe7eead31-7af197379b8mr1522184137.0.1790263492308; Thu, 24 Sep 2026 08:24:52 -0700 (PDT) X-Received: by 2002:a05:6102:f9a:b0:7a0:3902:52d7 with SMTP id ada2fe7eead31-7af197379b8mr1522169137.0.1790263491578; Thu, 24 Sep 2026 08:24:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/18] target/mips: Use gen_mxu_logic for gen_mxu_S32MAX_S32MIN Date: Thu, 24 Sep 2026 17:23:39 +0200 Message-ID: <20260924152353.36209-5-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: -upKQelahWpiLYbADJaFoL2t_iGkmRQg X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX3Y5qUE0DLwmQ ZW+96TutKhWiOYXb4bMhYgemlyTx8LFq28A6LWnSWWcP8dMZ6nsVPgsL0CCSn/aN9CtMrkzoMUa fHATBhzg3xQlUgpj0WucW2gEKbg9jjCgZKX9pxuJT5/EcVAwxK4LjMSeO+EH3S+uVthSEway5b3 2I7yWvsp2kQ1sHSd0H2e0NsT0B6BjFS96+3a0+hxxotjK4lPxrF6mGsL8vJCGBALwafvPAWELTc 2AWzG9sj/Vko6hwVB3d4IuC8sVEOC9MuelFOpEEpMhA4DBeYr0ZvAuhy+m2nRPOonlCEPA49J6X 28VXyjGKmsoRDQVKjKLVXAfP7FxxFMQzAVn9ity+KKoaIFSbGry+6G9WCviwZKYwM+Er6cL5wN7 q0tNk9quY1sx4FLSmfHk9d+FAcXIurzupoKkiGDIAb7iDG944lziVKuBJuOlHCyUzQftAgZZaKw TDjWJ134Zwp34dkDT3g== X-Authority-Analysis: v=2.4 cv=cK11IVeN c=1 sm=1 tr=0 ts=6ab540c4 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=_glEPmIy2e8OvE2BGh3C:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=Aj8ARz31FktZ6VJZM80A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: -upKQelahWpiLYbADJaFoL2t_iGkmRQg X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX9Gb7TInHrIUY 5sQqHzgQwKH0+grpZWxvI4kHDAf1wgn+eQDagBQNlLz6W/QnoEOVgYXUVcKxpHIPF01V0EMO9NC VzMDJ9ZPPAOVaSkOIQvgEVL/PL4yAP4= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 spamscore=0 malwarescore=0 phishscore=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-2609240063 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: 1790263608232158500 From: Richard Henderson Split S32MAX, S32MIN to separate functions. Fixes a bug in that "0" was passed in one of the zero reg cases, aka NULL, instead of a proper zero constant. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260914230901.1781309-5-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/mxu_translate.c | 47 +++++++-------------------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 3f8acfcdb8f..4b2c264f031 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -2045,45 +2045,14 @@ static void gen_mxu_q16sxxv(DisasContext *ctx, bool= right, bool arithmetic) * Update XRa with the minimum of signed 32-bit integers contained * in XRb and XRc. */ -static void gen_mxu_S32MAX_S32MIN(DisasContext *ctx) +static void gen_mxu_S32MAX(DisasContext *ctx) { - uint32_t pad, opc, XRc, XRb, XRa; + gen_mxu_logic(ctx, tcg_gen_smax_i32); +} =20 - pad =3D extract32(ctx->opcode, 21, 5); - opc =3D extract32(ctx->opcode, 18, 3); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to zero */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely((XRb =3D=3D 0) || (XRc =3D=3D 0))) { - /* exactly one operand is zero register - find which one is not...= */ - uint32_t XRx =3D XRb ? XRb : XRc; - /* ...and do max/min operation with one operand 0 */ - if (opc =3D=3D OPC_MXU_S32MAX) { - tcg_gen_smax_i32(mxu_gpr[XRa - 1], mxu_gpr[XRx - 1], 0); - } else { - tcg_gen_smin_i32(mxu_gpr[XRa - 1], mxu_gpr[XRx - 1], 0); - } - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same -> just set destination to one of them */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - if (opc =3D=3D OPC_MXU_S32MAX) { - tcg_gen_smax_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], - mxu_gpr[XRc - 1]); - } else { - tcg_gen_smin_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1], - mxu_gpr[XRc - 1]); - } - } +static void gen_mxu_S32MIN(DisasContext *ctx) +{ + gen_mxu_logic(ctx, tcg_gen_smin_i32); } =20 /* @@ -4328,8 +4297,10 @@ static void decode_opc_mxu__pool00(DisasContext *ctx) =20 switch (opcode) { case OPC_MXU_S32MAX: + gen_mxu_S32MAX(ctx); + break; case OPC_MXU_S32MIN: - gen_mxu_S32MAX_S32MIN(ctx); + gen_mxu_S32MIN(ctx); break; case OPC_MXU_D16MAX: case OPC_MXU_D16MIN: --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263607; cv=none; d=zohomail.com; s=zohoarc; b=FU2L1VZno2WaI7btm6LKudN6i4xE3gFyzFVYv7X51/LBWEe97tLNtHBWr2sxyOh/DPxRh1mrQQatunh08PHcnzoqVnxVFX0ZeAK7nyxC/6h26s/RJ6QbBt7uH8n3pzQVvD0o8+G2DFre4RO5C31g80x5xgXtTn+FvSaFDmWSZmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263607; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=t+IG37ezKLS7L6iV5pisKu46qfW34BXm3idgzkkBU2M=; b=CGJLTNi01NncGpzo3jBMLh34eQpmigj5UH4L2WTnbVxphYCNl2dV1mh76Fxc/Zdmj1mOEbGxzgLllTcYEmf3FTlxMghC0giszXTnkl1bR8YuhQPlkWE9RjlXPvfOL8s/Z5FGcI7jySnVOHkI+kz7X9XusEorfNNePNASMjcLc0A= 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 1790263607254330.97913745442236; Thu, 24 Sep 2026 08:26:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKu-0002t1-0y; Thu, 24 Sep 2026 11:26: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 1x9lK3-00020A-L4 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:28 -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 1x9lJk-0000Fo-Vz for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:02 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC4VaE2749204 for ; Thu, 24 Sep 2026 15:25:00 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 4gw1s919g7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:24:59 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-985374f150aso14511241.0 for ; Thu, 24 Sep 2026 08:24:59 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4886877a247sm16120226f8f.28.2026.09.24.08.24.57 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= t+IG37ezKLS7L6iV5pisKu46qfW34BXm3idgzkkBU2M=; b=es3wMESVP2haUtmP 6Gkcfjgksf/8TU+tNsF7Pp4+RBemeQC+Y+WWG/A9jK84ZFEV/0SpbHyfppoyTfQm lyOsQKe2sh3cTXrxTMlJG9LhbOL7RTC0ZMpvPBLvBQCuoVB3mlVyWU4mYqMaM7kY vhvxydMxU7AskOSuEJWZxxHN6jyTvXBYKnO+PdEtbjIofsqW5ZK8l40jpKf29qXM aVjzZ2cVX0h/+TivkOSnhuwEeyOQacPoawSOcjSC4sfbKPdrZA0jeIeNLJ9OEmsu Uy9EvQBI0GJrH2+SwjogwAwuPXbYYV2e0xmpgYYRVXaAIIJOQkL3IDi14BPl9lWx 8xi27w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263499; x=1790868299; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=t+IG37ezKLS7L6iV5pisKu46qfW34BXm3idgzkkBU2M=; b=R+2rg71yHAQXdOn4TwWjQfaOF+F/3Jmn130feeu+gEuu5c0DLejw6Oh+oQwf5OZx6c kTXZU6na3y2jPPhjdn8vSUe4sw4pKotj+gPOR+e6wPk8PVch5jYX9JOeCu3zb+74zJfk N+r8D/P0RmhDTdyW1dQeH7atXPVjP0RbZ9gKGVHnqWhpIk1956WjbWIyXQiFK/uyjcBW e3W4Ckhq/C+we9fCmlAcBjmZcym5MOspUM3ur6VEhen5cgMpT2FwcbYrrjXU18Y1FMRP Ryg2bKeYV24WINNp8k5Nif708zra2BW9wcyDiZVqlmZiS/6ERNXZt2XZEGEJ+6YsugW4 LS/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263499; x=1790868299; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=t+IG37ezKLS7L6iV5pisKu46qfW34BXm3idgzkkBU2M=; b=E6uyVtGU+TkMu0PniVS5i2HFhC9lGamGF8TDaSPKk6/QbSCmSos7IkHopY9kditM7z gY5Jzfh2kA+ivjIZdbz3y/DMJE1NVSOJ280zV8GSZbGlOpDsqXhvyaNBLJrKysqddZ66 dIm/CY8oLV9QDXjC4Cz5QQiPOtzxRpvNSB/IgFEOHL/1vXpXrN3+CRhT5RfTBNkNC1Qg 2eP/RtywrgPPQoKAJO4WjtHipkr5c13EzrwxCgUmjcodzGfZ1dFrvMqWxS7vpjhNtNPg AaPHi6upz7yl85w6iSktSaYMxksUjczsbjrBFLCiQWB9hLyfYcKcTeA6rnXW0QWV9179 gfgw== X-Gm-Message-State: AFuF++kx7Cuyb5vRkq7i9U3V54c/tEQ3XVz4b1QxXzvwBlXvU3vFy40c Cxq1XgEehUTLklbrqKAWWiPsjwvwi/ZN9fPqQ9JXtIXvsyUfK/HzMWyjDg3ly2tKCOyqZVdOTrt nPEJymwlX6s2XVhNhtH+GvpQp/pTjE9VAdENFlv+oFN8DDq0tgjnijTOugWzzmF6jYw== X-Gm-Gg: AYBFou2KCbKNALZwd1InFhsOLwvJd3aEZ2vBpgC7soVvqPMGH0smVaC6siTDybI53xg YX7v4kGJXPaRcniEEJ7vjwFxSiywcA7wWGuPO5aDUE2v/kgA2QkcFGvuCoAuMREF9532mvf59e7 vuoIGIWCJawayfNOK1sXVMzVgZbuU77t/H+JZ9STlUoh/1GIPWm+gtImKxcsSd/p9rp3PCnO5Z2 uyzKB1J0lKx8ELpce2NlL3xCbgNx8oZJgEK3OFaQ0IQ07VytGtZAE4NGC2YgqPKREU14XgxnUY+ hrtoDns9RAUHeGXKqnqhr6x00jiJBu73x+BfHwp0OymxifuhV4Xg2C+NChrC07Qgvx7S0lAaNk9 eCSsqRtVfThpyzRCJUz14lejdi307dt71DdQASmO4 X-Received: by 2002:a05:6102:3ed4:b0:7a1:f7d2:e80a with SMTP id ada2fe7eead31-7af1eaeabd3mr1320462137.18.1790263499184; Thu, 24 Sep 2026 08:24:59 -0700 (PDT) X-Received: by 2002:a05:6102:3ed4:b0:7a1:f7d2:e80a with SMTP id ada2fe7eead31-7af1eaeabd3mr1320449137.18.1790263498502; Thu, 24 Sep 2026 08:24:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/18] target/mips: Use gen_mxu_logic for gen_mxu_S32SLT Date: Thu, 24 Sep 2026 17:23:40 +0200 Message-ID: <20260924152353.36209-6-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX0ssQ0Kbkaoo2 gucYc9A324BCiafSYZ+B2w7YEDz7K2++4w+Bo7f9QcDBNKoKtHthDs3PBW+nKNL2mdZ9eqGQjqM AHIiDpr0G7J1Hr6GgJ32wtPduFy8aKv/g+lyecCTJ43znRgw94yzh+ljMZugzTLwlPPDMx8Bhqw nSEF/G0UVXlChfke3uWmEzMOpI1iEBo2E5t7T33z54FjGhwDgFvRLZBTrRHMfudBAPEyJ5ZPp70 FZBUHxw+ZooeZILEk4Q4MfmwDdwQoELSNWeXjBVrBxmBuyJVBc3rlvosnCXbAAKaKOIeQJUYkZE 4AY2bExOJwbrcoB3Jaqcf5WCM5gAGYkwW6fxYMjsz/dxIm5DaSwgSc6Ey2SG5Pj/1YiEQhkDmuW INPT92y+xHzwcg9IvbZhUL/KHkkMS5LTZR0uILeJmg2oTPw7+Uj0s3pBX9Ur9LMcB7NuNSWc/iu gokkJxplcgZF+UIDzug== X-Authority-Analysis: v=2.4 cv=VPxIDNPX c=1 sm=1 tr=0 ts=6ab540cb 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=3WHJM1ZQz_JShphwDgj5:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=XNZCjgkWDX52U-mK3XcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX98MY1A0FY675 WnLwijUpdMHTNJmnjehOv2tqZ7vJ0yyJ+Csz5WaGaZnl7XHlyOzMaSY78n5h1GoetjQHfSD/uAU MSNcMV2MweMKB26gccQzlfaRTyPpUpY= X-Proofpoint-ORIG-GUID: y6ba4gsJP9nwMc2hLweB7dRKrnAXS_12 X-Proofpoint-GUID: y6ba4gsJP9nwMc2hLweB7dRKrnAXS_12 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 suspectscore=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-2609240063 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: 1790263608226158500 From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260914230901.1781309-6-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/mxu_translate.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 4b2c264f031..293eeb46c23 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -2313,34 +2313,15 @@ static void gen_mxu_q8slt(DisasContext *ctx, bool s= ltu) * Update XRa with the signed "set less than" comparison of XRb and XRc. * a.k.a. XRa =3D XRb < XRc ? 1 : 0; */ + +static void gen_setcond_lt_i32(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) +{ + tcg_gen_setcond_i32(TCG_COND_LT, d, s1, s2); +} + static void gen_mxu_S32SLT(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely((XRb =3D=3D 0) && (XRc =3D=3D 0))) { - /* both operands zero registers -> just set destination to zero */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRb =3D=3D XRc)) { - /* both operands same registers -> just set destination to zero */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else { - /* the most general case */ - TCGv_i32 t0 =3D tcg_temp_new_i32(); - TCGv_i32 t1 =3D tcg_temp_new_i32(); - - gen_load_mxu_gpr(t0, XRb); - gen_load_mxu_gpr(t1, XRc); - tcg_gen_setcond_i32(TCG_COND_LT, mxu_gpr[XRa - 1], t0, t1); - } + gen_mxu_logic(ctx, gen_setcond_lt_i32); } =20 /* --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263660; cv=none; d=zohomail.com; s=zohoarc; b=Zg7a6AH+6VPwW2W/b8aS9fxUR++xKA5t+4yDqh6R/arJfnXBt0IIPRwUL/6QDCV98LF5MAEzZzlzB1cuH6ZxT0hnNxNqLSeE9np+bNlL+tFbYVdBYMDOJwJ7Qmzl8btvB5B3Rvw1rgstoHq616enaAqOTKS5sOTK23600GZWAHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263660; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=6zg6YVJsmF34BPPBLbzJK8zQve2DoCG4As1F93Ln7MA=; b=guWMNjuPU28Ch7/z+ZcdPobrXuRdkATrC2i2TMSNaFal7GrR+Jy3fRwSH0jiHTSlD6fME1uy43Vt0nXbCoxeczti4Iz8yseB1igK8h8TQ6/aJQuu7/oqChkUlYFd1vPjQaiJ+h/fQ1nyExs1esPp6ThG0ZXiemvxK5SCBHEsCZk= 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 1790263660550754.6791473126797; Thu, 24 Sep 2026 08:27:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKa-0002ZE-3c; Thu, 24 Sep 2026 11:25:52 -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 1x9lKG-0002E5-Aa for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:34 -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 1x9lK5-0000H3-IG for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:29 -0400 Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC4dLO3134223 for ; Thu, 24 Sep 2026 15:25:09 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 4gw1rahbu4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:25:09 +0000 (GMT) Received: by mail-ua1-f69.google.com with SMTP id a1e0cc1a2514c-9806535f8ffso855814241.1 for ; Thu, 24 Sep 2026 08:25:09 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-488688856f0sm15251030f8f.30.2026.09.24.08.25.04 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 6zg6YVJsmF34BPPBLbzJK8zQve2DoCG4As1F93Ln7MA=; b=Q5MomlQc8j3fdd8T rL13MqIoy8BV29ln5twyRd25yPiPeGScZRtn9SjvKTUH7zvHJwBQAqG+/iHT2Stf Izsn7RxzaEjYcj2ppvL5ZFdfR0IItq2I6Kd5Ourn8E3TSyQY793qKuXyGBQOU7Ol s1xh1ffqUfMSREpSuZCnQIJLp1suyzhS/EIa6IuTSBqcjtVpNL1NR6qlm9Cgvpcl ssx3zw4RiZ1hxxH07Drah3JLijHN1ehhTWZDHgydnNup/JrMVFzfjcceaIT3ZWWW wJxXCUAl/v7ACWnWuMDHsCS92aDfGzJKghrZAKufH2r7WG6zk16g8VK3AGJWo9Kw ZvcBXw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263509; x=1790868309; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6zg6YVJsmF34BPPBLbzJK8zQve2DoCG4As1F93Ln7MA=; b=O5pXXbzkNRagLuEYFtO//PCH12FT4al4OxTsVaV9V3vt8KgpvFZDS/ONsf5D7sLy1J ci3yq8ZgEt4zOzpXzyZjFJukdtMFTpINsKpdEep4mwoc6yp9maBecgcbcWVxTQD3tx7R K22DSY0CwPy5JjcVljDwRaI35r1Am11Yboq78rJwMNLQuPQDyPg4teryJy0h/b1jMEv+ dpT6v6hVdhw4Dw5UxawR9XI+Pvuj1mccqp6E03JjIo6Y5a6UbWuouwTtLNDMGoIv/k+1 EvfGBxkOxzafZXxW67P5QlHHfd5bNQ/YTAeXaEpB7IrucwutrpzB10c7p9t7W7OJvU7H G8uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263509; x=1790868309; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6zg6YVJsmF34BPPBLbzJK8zQve2DoCG4As1F93Ln7MA=; b=QEtH6yC8g6nwnPN/EZ3QXoTM/FBIPnYOBww+A/T0uS4ipV09H9px3HsLG+6gcJ+bKZ 48MRvBmSYl1Yfv4j16qxXU1uAVBhTH+FypQyRAnGLdIngrBd4EHTu0ViGlE9/KQV+2yy cnskfEsl1TL5aISJrQTaS9jFjTCaEA7xrIpQwZMCDyG+BOShtbbfxs+/t1YT8n1Wwj8A jHHUJoHxnJLpONgm0b4D09QwSMegTkX9/PLX1tLPRj6/vWAX41/iYY7EDHkY4Om/nMW3 8qQIdKHIpNGFLuSgmS2Oj8JffRFzrZC9OXzQXzbSAYQO+6DZqeYpHfYdcK+360kaxbLD PlZQ== X-Gm-Message-State: AFuF++lLbSDQSdKSztY6HNmFbDwuwSF9UjFtFJxNaxtmWwixlkW2huoI P4QkNCI27oioZitM2Uwp0u+AX9vIxt5nyTMZZZSrA8qSBqEP2gITQHhyGYrmbQoPTmOml5F7fM1 I6Sr6c0q+wMkwH+P/qcK7efxzuTThZtoAl47JGzRpjGGyyWIEPjmBnaXfLm3hNJN+VA== X-Gm-Gg: AYBFou33TVPmfk4At5Mi101FxiDctbqaPmO76vLavvo2T7HU52bdCV2P1D4TDmy+T7K eEhSuSIaHy6Kxm8YFh6xWQee5cZ9X8ksGw9hS0LH7jJzVCBJcLavnCVdvFV5+K1qGJvXxS0fQpk 1tAH75mZplUBgkLSKb3tCq3FKsJKJ9XikL2l0rvPUQdvsBOOG08zP1fI0sfqDRbJ8NuOn7z+kza WWvyk/RlCCT40659ETvPmXhhBkzYxWoH4AFGl4VvgkR2nrUvNix9gH7JXXeTYXAWo+BiRxvAzye s/QEKluxvTDFbsg5X9EJXDL4hB2ElsW1pAr4TTxcttY0AugNVtH1ioYVkpr8asJ3Sslk2ayhfga /I9wYeGQA/hPRpumhm0GgRyGSS3ELpztR1eWd5jXt X-Received: by 2002:a67:eecf:0:b0:7ab:d498:aa69 with SMTP id ada2fe7eead31-7af1eae9c50mr904326137.23.1790263508597; Thu, 24 Sep 2026 08:25:08 -0700 (PDT) X-Received: by 2002:a67:eecf:0:b0:7ab:d498:aa69 with SMTP id ada2fe7eead31-7af1eae9c50mr904318137.23.1790263508161; Thu, 24 Sep 2026 08:25:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 06/18] target/mips: Use gen_mxu_logic for gen_mxu_S32CPS Date: Thu, 24 Sep 2026 17:23:41 +0200 Message-ID: <20260924152353.36209-7-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXwEECCC41VqJj ZGubhbTsMY3zt55VA33IenlROeUoElKZACkeighEQVTHPZZFWbGbiWpHm7rMxmgSfGU30AL7NK0 8q5S6SvezJzBQr2Mkm7tHHtf+6VvoJAr8bi5uqQuTp1YPJMq9qkbSDPvCdoyeHLE2pguzKPlmlo w5g9aStWSSnTF0BJeTMoi4jxPnGUgGdAldnKbF4MoaVusMB1AuM72Thc2321sG+JmXw3+EElmH2 zidBKPEF7ovs9fOHLk7Hes6d83HFhk3HZZMuC+VbJLuvYnJFZ/zBiR7g/hg5GeYYD1bPE6DBgQg SJ2Np8LIx9KN3li9lBNuJ5pu9kFVQ4flSPdbSb6zRTp9f3tvKVSZZD5kzVsURD9AbMtuErhdX04 JtledSzrWYydps7/bOoVhGakp4rqc5qEjN4Ygp66klMBjgXBelPoarllcsDyrA3B5hweYiSGRho hSFOTzfF4GfiZpJOGrw== X-Proofpoint-ORIG-GUID: KXiLjX4a-BmHBK_k59ZIcXL_CGLC1n7O X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX/SzmPvEbIuvZ 3eiL9Hkc6+CaKniF6QV2v0mU2zhFbaz7Ywix8wCmx+7qPVwTWHBagGjJS/Tg1NqODU1u7zN7sw/ IvTXuiWj8n+d+RbshXdqMROWi3bXGXQ= X-Authority-Analysis: v=2.4 cv=fvpJ914f c=1 sm=1 tr=0 ts=6ab540d5 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=Um2Pa8k9VHT-vaBCBUpS:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=XNZCjgkWDX52U-mK3XcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=TOPH6uDL9cOC6tEoww4z:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: KXiLjX4a-BmHBK_k59ZIcXL_CGLC1n7O 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 adultscore=0 spamscore=0 malwarescore=0 clxscore=1015 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263662373158501 From: Richard Henderson Use movcond instead of a pair of branches to perform the computation, packed in a new gen_cps_i32. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260914230901.1781309-7-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/tcg/mxu_translate.c | 42 +++++++++------------------------ 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translat= e.c index 293eeb46c23..a38f4da12ba 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -2640,39 +2640,19 @@ static void gen_mxu_s32movzn(DisasContext *ctx, TCG= Cond cond) * Update XRa if XRc < 0 by value of 0 - XRb * else XRa =3D XRb */ + +static void gen_cps_i32(TCGv_i32 a, TCGv_i32 b, TCGv_i32 c) +{ + TCGv_i32 n =3D tcg_temp_new_i32(); + TCGv_i32 z =3D tcg_constant_i32(0); + + tcg_gen_neg_i32(n, b); + tcg_gen_movcond_i32(TCG_COND_LT, a, c, z, n, b); +} + static void gen_mxu_S32CPS(DisasContext *ctx) { - uint32_t pad, XRc, XRb, XRa; - - pad =3D extract32(ctx->opcode, 21, 5); - XRc =3D extract32(ctx->opcode, 14, 4); - XRb =3D extract32(ctx->opcode, 10, 4); - XRa =3D extract32(ctx->opcode, 6, 4); - - if (unlikely(pad !=3D 0)) { - /* opcode padding incorrect -> do nothing */ - } else if (unlikely(XRa =3D=3D 0)) { - /* destination is zero register -> do nothing */ - } else if (unlikely(XRb =3D=3D 0)) { - /* XRc make no sense 0 - 0 =3D 0 -> just set destination to zero */ - tcg_gen_movi_i32(mxu_gpr[XRa - 1], 0); - } else if (unlikely(XRc =3D=3D 0)) { - /* condition always false -> just move XRb to XRa */ - tcg_gen_mov_i32(mxu_gpr[XRa - 1], mxu_gpr[XRb - 1]); - } else { - /* the most general case */ - TCGv_i32 t0 =3D tcg_temp_new_i32(); - TCGLabel *l_not_less =3D gen_new_label(); - TCGLabel *l_done =3D gen_new_label(); - - tcg_gen_brcondi_i32(TCG_COND_GE, mxu_gpr[XRc - 1], 0, l_not_less); - tcg_gen_neg_i32(t0, mxu_gpr[XRb - 1]); - tcg_gen_br(l_done); - gen_set_label(l_not_less); - gen_load_mxu_gpr(t0, XRb); - gen_set_label(l_done); - gen_store_mxu_gpr(t0, XRa); - } + gen_mxu_logic(ctx, gen_cps_i32); } =20 /* --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263666; cv=none; d=zohomail.com; s=zohoarc; b=hWr/LsjPHa/U43UA5gC7YLerfzNYDdFNpI8kDSSabqPHkLWza9UhNhv+JkDu6mT8FvV51zbLN4QJdhwB55lJkMFrmMDtZBr25bEs3zTuTZUVTyqvpATBOq2UJrOccuo+NBGCSZ098TC/zDfnay/gBWrfjV7gbxfXY83s4cCUd+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263666; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=3co/zBejaVOJ7G1mNfffL/HGKMkldTHz0Hzlnc9AK7o=; b=BqgnGrTXMGRk+oYgo+1IBmeJy1TdvazvkzmKpDi/4QD8sMLCNCYiPkDGyq/042jebL5Stafrww3mFH4/HOT64QoyUtM1Jsv57DK1VNwA0PJJTliXwHuH3+4DbogwaI3zrfZbP+hEXguY2x+ZEF4+w4e5nLxzBt+NtZucHZ8A0Mw= 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 1790263666038811.891356723605; Thu, 24 Sep 2026 08:27:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKX-0002QS-TX; Thu, 24 Sep 2026 11:25:49 -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 1x9lKG-0002E6-AX for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:34 -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 1x9lK5-0000S3-As for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:27 -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 68OClKNY2224968 for ; Thu, 24 Sep 2026 15:25:18 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 4gw4650njs-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:25:18 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-7a532e31dadso2112963137.1 for ; Thu, 24 Sep 2026 08:25:18 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe43fc27csm67712665e9.2.2026.09.24.08.25.14 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 3co/zBejaVOJ7G1mNfffL/HGKMkldTHz0Hzlnc9AK7o=; b=Q6+zmWgoBqLimTsG ykN2qOQvOh3/sSZWW0hoMlRI46s88u46gFRmJs6z8dS65I9sEC8e9lzelloqLDHo kV2zW2Z2rglC33rd6ddP6zJfw2YGXLQK0qQ9GGrecmeoP/jphg5W4eZk8M5t13BN nKx14L/AoS0WvxQg/4jyydzttfzj6hh8t82wDludOjfa0Gf0uWUbQ3Fku7tb4Oe3 TKvGtQStbvDUKEw2MUtlvJL843E22gPvLtjgBMSOx0JuqJ3xLrnMt+O0bktrFZuJ Uk6pd/9GOKblW/S9x0tUSmfsw/aHUPNDiuX3g1/FsE2OKmXIGTIf+0R+5fhM/y03 bFmpqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263517; x=1790868317; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3co/zBejaVOJ7G1mNfffL/HGKMkldTHz0Hzlnc9AK7o=; b=Dx9lSxP8UGehuszjOceWnDmp8RkjiFEl6xU17+PnLkruYpTPVRyRgZ4jjkRIp639gi qvpVPDT3bg+UtdiW6QnLAez03C0MR1iD2X2jbepxoPxSjlDN5q/qUMx8efEPUcBc7Ysc 7EkkgO2feeQVCxEYdO5t1UNAuXjnLNnQbVx968xnRMLUPAF27eCR15Zq3aJwwLDqb3dP gLLAoiun1quMm0nW93scic4i/cESd8O88Lu3Z+GaRV1D3wgcL4NiupjG7sdPHS5q5mpT lwHMckUu7P5DvUXORJNuQVj/AqQh6387GWaZFlWnHV+Jz4Vs/9q3efcQyMA2rE8hAd/i bUMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263517; x=1790868317; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3co/zBejaVOJ7G1mNfffL/HGKMkldTHz0Hzlnc9AK7o=; b=qMzFTLWD0CV8NsF1WTZJ+nvTnKncULACFfs3KMxCz2MMyg42j3d9khkuOeK8XCX/ec srmZq9/cSBRuevTNQLI5xPdoiVOceT4g0lNWZyL1tJjKTjZxY74iiDp2kFLT30hQpJt/ vC2f9rNP70Kcn0eIJuOJveSsdhk0dP7LgR4vk0Qm5yUZwR6OKDQ/DKWu0lfCl5hPnU4v StVPX3R7uAIbGD/uZSRwWFTIRoh2EscMCRqhm/qQ493a2jj19jwukDzhXHFpgUKXq/hR t2UYRuikiWbEsZr8pc3d2GUZAog9ORqmduOWoNbJ2SVxPmbWx8LGuVcv7JWgm3pZV85w vEFg== X-Gm-Message-State: AFuF++licVzMIFSO/ljh5SgjwLzZLjj/bVFc0R7n0BiE/NBt4cZ3UfKn nyj/utkNFu2bGRKTu/pVrI21usXLR1ZO0kieMXjVyBkDckHSjukKg/fARA6NEcXouVbQJlnQe/6 cQxSI1UNv3byiLyskqPbgzCMq463H1h6U1FRHXoUML3r7y2Sw9IBOsup1Kc9th2z+Hg== X-Gm-Gg: AYBFou1ufRx8G+KDfT1y00LdtmyM3JfvUm4rb1wmS62/F1uoxtTy60QWg89vaYSBl8E Hidy8QEPyrDXsx7OvBzVv1vdhOHWy+SxFUDOtjuauQLUF5qgdsqg9Ri46IxqkGOyiK9+3PAZmMB x2o0cpk5Rc+dsZWCBNlekCaPVr0VAHzX5QZEOEBI8I5l+CVTgEG4NiO++bs1M/sn5HqxZ9gzNlj CnJqobo4nSAwliG53Kfh0Fi7fknKJvTTQ10YeU4b8d5Dcp1SitBNcSS/aNH9Aoyl6NMYACnmoZ6 suyMcdFpMhUciYGnqbtBTvD+wDmNV5ciUlXBHrvbM53XLjTmBuYBReQp6bSvuDsbRH3nxo9Smu6 rzqAD2sCyKYJ1i5iPOtMz1juvl2JgGT9SNGY5XHdt X-Received: by 2002:a05:6102:f0b:b0:7a2:2068:6e37 with SMTP id ada2fe7eead31-7af1cea8396mr1452942137.15.1790263517195; Thu, 24 Sep 2026 08:25:17 -0700 (PDT) X-Received: by 2002:a05:6102:f0b:b0:7a2:2068:6e37 with SMTP id ada2fe7eead31-7af1cea8396mr1452917137.15.1790263516473; Thu, 24 Sep 2026 08:25:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 07/18] target/riscv: Stub out kvm functions Date: Thu, 24 Sep 2026 17:23:42 +0200 Message-ID: <20260924152353.36209-8-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=Wrq+otfv c=1 sm=1 tr=0 ts=6ab540de 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=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=skaBmtu4QlQSHV9KHZIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 X-Proofpoint-ORIG-GUID: AsQyjfOsJHd52EosCq4iWoqru2d7OeJ0 X-Proofpoint-GUID: AsQyjfOsJHd52EosCq4iWoqru2d7OeJ0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX6KH/yyc1iiil zYSC4Ui6fygzghn3JWukb74++QEDEYMqd4hrAa6QFkGUG+AQdZ35iGkEZ+WCj3BwNHWh5y3Pztn VrY0/kMf3vghJtOaIjpS7tSgy9PQUqiWvtdsoPM2O8jm/O2OVyCN/7f8Kx0AfN6BR3xcRKyJFrd s3+u7fu1IuRVW4i1evlIbQVFiNacgA1tXusibrGZ0K/ovqNZT55nnFM54T1XIYyxgrgm02TXtze zKCISlH3h1olXQtZeQnuugmRSRJG/Uq6/RISfffNjUsKi5gIKiCvxl5cItznolu1rZgcFrc094a UOOFnxGCrJGhFq/coNjdQXGISRrPjYY4RoRy5RI03ET49DdEIE5cbuhZ8bFkrIlOHd8Ydim9f2x hgjIbEkEVGYl27viINo3f8T+PVrJA8WAgLCXupTpnRb1unjr0UwhEEorrepI07GhaqCGNbqE86J 4oheMmUfl/pwSzAgrGQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX0eaUox3Al66I tf0utf80+RFD7pPbr9KbE5WNDiu2zBM+LXrsD9rRUoRjx+26hoivdoHGD1lplvuD6jv6T1xUaFZ 3rTHmyxFhksTnAlQnv5pdQXhD7qQgZo= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263666432158500 From: Anton Johansson Functions used externally by hw/riscv are stubbed out for non-kvm configurations, allowing a single compilation of hw/riscv. Reviewed-by: Pierrick Bouvier Signed-off-by: Anton Johansson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260918-hw-riscv-cpu-int-v5-5-f98c5a244636@rev.ng> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/riscv/kvm/kvm-stub.c | 23 +++++++++++++++++++++++ target/riscv/kvm/meson.build | 1 + target/riscv/meson.build | 3 +++ 3 files changed, 27 insertions(+) create mode 100644 target/riscv/kvm/kvm-stub.c diff --git a/target/riscv/kvm/kvm-stub.c b/target/riscv/kvm/kvm-stub.c new file mode 100644 index 00000000000..64e39c96d89 --- /dev/null +++ b/target/riscv/kvm/kvm-stub.c @@ -0,0 +1,23 @@ +/* + * QEMU RISCV specific KVM stubs + * + * Copyright (c) rev.ng Labs Srl. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "target/riscv/kvm/kvm_riscv.h" + +void kvm_riscv_aia_create(MachineState *machine, uint64_t group_shift, + uint64_t aia_irq_num, uint64_t aia_msi_num, + uint64_t aplic_base, uint64_t imsic_base, + uint64_t guest_num) +{ + g_assert_not_reached(); +} + +uint64_t kvm_riscv_get_timebase_frequency(RISCVCPU *cpu) +{ + g_assert_not_reached(); +} diff --git a/target/riscv/kvm/meson.build b/target/riscv/kvm/meson.build index 7e924150912..75e35b21506 100644 --- a/target/riscv/kvm/meson.build +++ b/target/riscv/kvm/meson.build @@ -1 +1,2 @@ riscv_ss.add(when: 'CONFIG_KVM', if_true: files('kvm-cpu.c')) +riscv_stubs_ss.add(files('kvm-stub.c')) diff --git a/target/riscv/meson.build b/target/riscv/meson.build index 42d0f6d538a..e1b51d2bd4d 100644 --- a/target/riscv/meson.build +++ b/target/riscv/meson.build @@ -19,6 +19,8 @@ riscv_ss.add(files( 'gdbstub.c', )) =20 +riscv_stubs_ss =3D ss.source_set() + riscv_system_ss =3D ss.source_set() riscv_system_ss.add(files( 'arch_dump.c', @@ -33,3 +35,4 @@ subdir('kvm') =20 target_arch +=3D {'riscv': riscv_ss} target_system_arch +=3D {'riscv': riscv_system_ss} +target_stubs_arch +=3D {'riscv': riscv_stubs_ss} --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263583; cv=none; d=zohomail.com; s=zohoarc; b=l1vKaZsmD79siOyjCAiyal5Ei5ImRxW2J50Km8lbW4Hi9CvL7XjcfeSSrYD2h+X+YRV6S4Pcon+tkSrIVYBVuZbMp47aHjlvPQCaBejKwu9d1DgKklb+aJSKclRNE4HP7hY/m0HGALIhKo4ZN7g5Beh4hvkPRk/1qdU1tBPaFGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263583; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=hLmlzZJchkbDZhe/EIIO5QNMzFDuNzDtJp3BDnPJjYw=; b=Rei8gcupqYuG1YOpVydUwscGQ0ODxnj6uIbHAxCjW28hQl0oUbBqvbPmAGeck5LG+yIBGWQHlLdJ+dRlbD8GeI3BDCmhkd0hLun0qEjjrMgPdLaTNX6p9xIf5ds/ieUxlbYiHJUVVF5u7aoJ02u8cB5ZaicydS8KpnkB1QPLXYM= 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 17902635836001006.0790278925869; Thu, 24 Sep 2026 08:26:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKj-0002bH-At; Thu, 24 Sep 2026 11:26: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 1x9lKM-0002Hf-IA for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:40 -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 1x9lKI-0000TA-9J for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:37 -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 68OClKZ22224973 for ; Thu, 24 Sep 2026 15:25:32 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 4gw4650nkg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:25:31 +0000 (GMT) Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-78a5a291af3so2014620137.0 for ; Thu, 24 Sep 2026 08:25:31 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4886876c267sm15341263f8f.16.2026.09.24.08.25.24 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= hLmlzZJchkbDZhe/EIIO5QNMzFDuNzDtJp3BDnPJjYw=; b=ibLHnj7lYf46iLp5 D1eIoZ2ZvPQ7xkoBrMWT431no9sdBL2c+8phhT8dBGkdz7MMpwqf8hAoExLkO6Bs E+wxZS92FN4Z+WNfc9skxsjDfmktnrt5ajIcdZQJX1htr5ZWqsSxdWQBCc0MlaQk vDYcwRmUXqUM3U1htOSxPKLGcOuH+cMSss+vnPXfNdjzTDZXL79KtlHrpS7saUkO aqxVDAXJkCi60eCxnf+SwWa3wP6fguTJt00A05aNVxY3IRh+E7l6El59ttldLmlH x+EK8Urr4WgwS0A4EFZP2RHdOn2OfNHxuo/CvvfFuuIBv81RO2N20ZWBj4btcnVS 9SrDsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263531; x=1790868331; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hLmlzZJchkbDZhe/EIIO5QNMzFDuNzDtJp3BDnPJjYw=; b=fQp225ItQWc+MGoqfhYfvn3KmPp5y2Qct0hukP844UEqi7nNVmvh/TFc6yhI99zygO wnvXhHMud68Ox60YbvwwV2i1i0Jvtq4jJaWh061qXtRATidwr3a1TeOqb7dE1+dd87pk j6BbM+YtnG8AtLpRZ4zR7+Vlua+p3A3XOVVZ+5In4CbpEDKno3rxCpsd+O39ga7oVTWQ Cqp68wyb+gWLm/caYKrwwM321DpjaIJeOfy0Kxu5upGhLETg2OEC6OuIKCZ6BfrTTn9F I9x9/EwDTTltmj2msvDGAh1nDBOhkXeJiJWF4sf1LQBAEBZ3yZVDKWvGf9Fl0Drlayv4 FS/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263531; x=1790868331; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=hLmlzZJchkbDZhe/EIIO5QNMzFDuNzDtJp3BDnPJjYw=; b=Nsxv9cjJi6aKitjY7aetKXW+tiDlEbD8fGt4uCoOGC+ffWvRL/DJXn9sGubKl5GLk6 4ToCJP9JgnK54FNysXnC0Mdx17SraVXpUBBz/0AcMMdClyUndAAFvoAwJAd35L4dcLIA uGvR9M4/h8ygeJxcxuzpEVnznE1YIs4FQRGyyMQMsTQza/j8XD3MVG0pRmQ7gtZZDih9 RSb/kG3RnJZfphUg1NcH8PwEfw8FFD++PE1akJB/fnpJdnMe8vaHJc2jOD0v7Fibq+6E Z7TO2K3b/HB3iD+ORWYjdl7aKM00NxQYOvutSUQGuDT/58OKlN/V3V1TfQSIB/rIi2cm PBXQ== X-Gm-Message-State: AFuF++kcZILHOyWlaK1qiKDY+R3N6d4LbKY0TtDjqBGwxe6gMTZM/Pgt tSFFWN+n0KiTRS5ADNG4YVHfU6BCKVYihyrVW7yvyCE9Q4vf4PVzVVQ3pA9+rBa9tCNvBexFHgl kquO8+JGgZQiO04O79DWh85JLjn5eHhyFZWm5HuUVZ5mUicYkASvxin+n71/Ph3fh6A== X-Gm-Gg: AYBFou0SLYCMbEsMEiSQYJIKusi/jlweYPVBNbpQ3k1Sk2A4SL3wZ+DSnduc2DQ6P/x v35kRpVf4lYjmJR69A1MqOdnOs4HHcSNxi95MDpBh8w6tsGoy4emhJMLHgky2gfE8uCLwZ5sSAF v1qMQAe4Ei28nkkZXRN7+x2ML/lYXiQqkocHDXUpQ0hatm7TrVMfywDAzBdCG1I2qWFV37KqUTb NLOdr774byIByq6it07jJ3NSY5miCm+sUF47t9jtMBk6i2tgUmjEvgwHue7q3Rs58x4y2XSg2SA OmepWv4ZeaaruVmL9r+aTS/c9wb9bSmnPqN0MQf27jkkefe2lWunOQnUJwfPTOYb9Om/WrvJwZG w0dj+MjCZ1hKWXabNHR56Iqg4tl8kJpnu10SEKREB X-Received: by 2002:a05:6102:3fac:b0:7a5:72f6:3a0b with SMTP id ada2fe7eead31-7af1ce9e845mr1578111137.14.1790263526041; Thu, 24 Sep 2026 08:25:26 -0700 (PDT) X-Received: by 2002:a05:6102:3fac:b0:7a5:72f6:3a0b with SMTP id ada2fe7eead31-7af1ce9e845mr1578088137.14.1790263525331; Thu, 24 Sep 2026 08:25:25 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/18] system: Document has_work() synchronization requirements Date: Thu, 24 Sep 2026 17:23:43 +0200 Message-ID: <20260924152353.36209-9-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=Wrq+otfv c=1 sm=1 tr=0 ts=6ab540eb 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=rJkE3RaqiGZ5pbrm-msn:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=XUsUnerbLd2lX0N3J0UA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: 1qpBPggjbZt_3peIgVtF-Iw-uBLh2Qe9 X-Proofpoint-GUID: 1qpBPggjbZt_3peIgVtF-Iw-uBLh2Qe9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX33JccSlfZibV 8kZ/dhvnuQUO4LA+GtSy7xrgqFPKb+aZ9+dzJKrPLfFaTldjgCLtxX1Ytc9AjzU2QJ5lwAq6DxG a/dHgzOmBFjNPhpJMbFAzQO5hQJUD876hQr/HP2ewxIgREF+HnpJUQJOFXp/WvmNfS3cFYVnO8Y 8RsxFBWHNvp688TKEgSAE8mI+TLWheiCZhhNi1YMmkElkB/mCQCmj3NcH4hpBV5d+tdCFO0a/nz fv8sGx0SiUfT3Eu1/uw9VkQU9ohhQQjPzWR0BupYERZ8rsTU6TwujKkIkDTr7IuczmdmJMK3tbi icPBwvbpLpp9BX0NMhObTSu7MTh0ec72kWKRQMvokq3O2dj7a+PCN8qXcn9aRE5muzLzsIuJhXX H/qibNoRa9Fv3NlkQBZfGuhaHHeFrR17DLSYg6hqo15NIc8pACu3QbdZIxHDm9+x3HjbaRKwj/i 0cmHF/h3M+Yl9ekuU9w== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX0StLtBwqsUIh qgv1dHkBXhc0TXxLDmF/mDLcFXDvxdiX1eVxWAY6mHyC/dLWaBUlNkN2zaoaBrolKx7ShJZMPu7 elCDLetMCydmelrupsrhlYuikiAg/TA= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263584142158500 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 Message-Id: <20260923171116.31276-2-philmd@oss.qualcomm.com> --- 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 19:12:10 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=1790263612; cv=none; d=zohomail.com; s=zohoarc; b=KrGPiwkZvLFf8ryG+O+SOUqNDqmymd5dQVAPp4eMOpuVNlaMZLWpUi1XCUoRQ1IrW9F7hXE4mTPNv6YtbcPVrcV5TpxhqqQr/B01ltFY+Z8HTc9Wklr4Pi3lKJrsizglbkKY3E8ZJ5EuMf9fsckmNNUo3xen5ZQALQ4PN1zbUfs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263612; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=1T2E2E4LzVsurXQ5tc5NvsY62ajqbiRq/66FwyhTEe8=; b=OdFNPz8707tR8I29hCjBY1Bn0YXMwOfsUbwN/OgsmogAlfKQGBZwjtZBEaK1g5EvIY2eeZC8x+0o4YGSCpTKGuDVBa8+j8Hl6um5BHg3CQnk+j5trmrtMrSCOqA+cKLRs6/yuxoIl96aeAVAMaMujk17IGCxX1ecLPtTRiK2vi0= 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 1790263612830212.23703535384584; Thu, 24 Sep 2026 08:26:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKv-00031Q-H7; Thu, 24 Sep 2026 11:26: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 1x9lKM-0002Hg-Iz for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:40 -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 1x9lKK-0000Tg-6D for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:37 -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 68OC4kFb2385712 for ; Thu, 24 Sep 2026 15:25:34 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 4gvsfgu7h0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:25:33 +0000 (GMT) Received: by mail-ua1-f69.google.com with SMTP id a1e0cc1a2514c-9806756ea40so1683787241.1 for ; Thu, 24 Sep 2026 08:25:33 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fdf99df60sm113775895e9.1.2026.09.24.08.25.31 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 1T2E2E4LzVsurXQ5tc5NvsY62ajqbiRq/66FwyhTEe8=; b=HXmJUazHqh1PWDoc y7Th/0YeHq3Om6d62zCVI45JqnUJDsh9q/4k7LuNERmgLLdZw82ikqAsLwkHSECL 0T2On71BSAYpmSN8SU1KCqqIVRA371oDoO0qYHXinuaCzywXuudx4sIFqxyJHvvL A89T7x8xunLrk3eT+coLnQ12l5Ykq1l4b0H5LbLy5R9o7hllgsStp5uu9x7Z4Qdc Nh0rlwExK5lA33Y5pbFfepaYTSQrCtvXVYsTqbtoq1Q8ZgVAEKCabw6tksPNCALV 39iAjoQrqkov9hRqv8CIAX8534kPjWMgpccYJiEUknU65LWMJDFp+OVJy8PUFbBP /CRz9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263533; x=1790868333; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1T2E2E4LzVsurXQ5tc5NvsY62ajqbiRq/66FwyhTEe8=; b=Vv66oUnFOO8XFOy0o3BSXoKSyoHX7e+WinzWFrakDpsnuBxmRR4tAOFWCLX/riJG8q bQULJwpae97eCgkguFSyKD8md5EGwYxNrKhUNRlfU8kideBDtTWDGi1CBEqBfV+N3sTh rmt5TrIp1koXiZ/NIoEY/0PdsdA7ivAomI0Uf0xaD20W7nJMp0noouSM1bR7TJQ0jw0q 81hgjeNPM+VNw5sVtmai7/kvHkcLPl79QFQRLeUdXCDm7lfPI5ysChtr8N+VzdyEHzW8 ebTE7pjTF9g5XltxxBpMZ6xTI+CxEooFr4evG7v0Ms+6l/GXAhDm8dUSAMg7vsuZ7Hlp /BaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263533; x=1790868333; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1T2E2E4LzVsurXQ5tc5NvsY62ajqbiRq/66FwyhTEe8=; b=p1jjJGCPeBUgufECXFG+0F4ciffIcWVp9+3ScQCXNjRbPZRFLlI9HenW5klNHdLH9M lTyTvXSN8PoOdBcXx5cYNDnZ0UhesaLkiZpiUDDRZQdZK83r8jnsvwEXuxo+h/m6CCyc 018IvG7c1SySLrckw0L41JaKfthGhdVp593KCZBTpmSet+/184dlebKYFZjcTLo+8EEp AjT+lYdENkO9ncqzRMwZJkZ5TVkRLY9KJSZ+9K6G5wIsmpqTi9EdUcQagr7hOisa4Jj4 oHcsrVNbrrYsI7AgmBtzxj8fJnUrv/8KtYhZhQkZa1tGt5ty0nJ4kruDUyBAkf7pzUk2 1PZw== X-Gm-Message-State: AFuF++mt1DMr82CXOnUXIL6+S8/wGSmfHLPUa12ZNWVjvNYZSwDk9DOo HYg9zUWBgnAXhodh7hBaqnKGFciGjcrBBs/k7oHnjERbHVzJdKepBsUuFfZUum9S21lhIr1vinH tiulJiA8rzNJXZZVx/IeWDMfq/yJ0hZ6yPkRN4JmDwxpEAky6ReUTq1Gw+YIfk8Pb5w== X-Gm-Gg: AYBFou0Rxh9r5QjrIQDR+M3vlTiVSAvJ7kijZc1KxCESaRXAuRS/FNVF80s3DwACqEl XHH49rbwJKq/6Rl5b5i/HnNRgfBM8RalmlXd8cdk14Q6mZfgHiCKnVAFJk7hUanrUyX/4xYD+x7 KfF6KBtdHURgCbspXq93u1SUmDv8gMffOlxnIbWk9emjFVxLUCAzuViwgC9pC3aJkyaixIYIafk hyVDnPZwNBIQXPghQxq/FBxxLiVZorOU4SPh7t5F6UJp9nYa7czj4M1hK7sRgV1NQmE67sjtSoW pXZNpqpyYKPWToiCq6WP7OXmcj24Q5bzdsEoHPvlJHd0KAKA5vzcaCpExNarDIAxUes2agmgKB4 WXqQZzkMGJ3oVz/9Yh4pSVEViLeFokAGYUTtkBUow X-Received: by 2002:a05:6102:390f:b0:7a5:7282:1998 with SMTP id ada2fe7eead31-7af1cb9c29emr1466360137.11.1790263532890; Thu, 24 Sep 2026 08:25:32 -0700 (PDT) X-Received: by 2002:a05:6102:390f:b0:7a5:7282:1998 with SMTP id ada2fe7eead31-7af1cb9c29emr1466345137.11.1790263532223; Thu, 24 Sep 2026 08:25:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 09/18] target/s390x: Use s390_cpu_get_state() consistently Date: Thu, 24 Sep 2026 17:23:44 +0200 Message-ID: <20260924152353.36209-10-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=YfoodARf c=1 sm=1 tr=0 ts=6ab540ed 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=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=VnNF1IyMAAAA:8 a=z94vmTcaOVfBjqTZL9kA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=TOPH6uDL9cOC6tEoww4z:22 X-Proofpoint-ORIG-GUID: xv_h02ZFiWIB5A-9zLqgjDoBlRO-0Ukx X-Proofpoint-GUID: xv_h02ZFiWIB5A-9zLqgjDoBlRO-0Ukx X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX94yS8lwRHNa4 tKRvfS3A5yFtz76cr6LQsJ0udPBi0aK7mG4UKBDcimAl1dSrxvAUWos0XQYjEjPWhG3pRrZtpyt WWI1fJJQaSEaJ0lo6oS18nhK6Nsongg= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXzMn6RYM0Dq4g 03D/rAmL/5njp4SQcum86o35yyk60Ib+pvHuy4U/chuij1KEXd0J5KkINfvziiRp1kTCClDylQ9 eQikdqWmH8IRj/R7qiQ2qtszgkwpiY2RtwQbmTZgh9kxE7HAGZPTj+ixMAz7ak3ueIUYHncAlmO f0B+il5kBJh4961XXBB8Jq7d+NF8a/Svt9DOLJm38lsFxT54dI5qJfFZRwyja9djMRtdEOmC041 hwNfAPNwWqbtyeHQLP8BFw9YRm6U5wKQp3g77GxOIcgVCvVBSgla3FquUBlCqh71gmGk4ZK3ZiM itHPySFQo9U8+DlDurwuEVqdvNshL0UqPLwzByQLDqnJTEQ118oTDrcP6xJaitIr/x+p+vdkvP2 8UxOy0S0Nyo/3c2NsB19/XII4pvs5UAmOu0b90N+puahxBjzoMbf50nA5oWQ7xnl/WC6+hnMHAH fIIZDxrnvYWMyQHVfJw== 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263614171158500 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 Message-Id: <20260923171116.31276-3-philmd@oss.qualcomm.com> --- 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 19:12:10 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=1790263606; cv=none; d=zohomail.com; s=zohoarc; b=I2AxJ97msBB8SoXd43Uuit/TABWAqeDDcAT8CqjrfmakaBkRXXahLjPoaPSHuh40wO6vEl0VS710ewqM4LjViNp8NKuCKv6cpn8Sb8nQhjC7GEbP99gl9vNamXX6F+CWI/G4stWITXo1qFUhngBnVtzaFoBPeafLC0YUoHYjebc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263606; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=/OiUUsinsyrWu3FDQXNEW/coMbkcm3cDaSzZv0h9N6o=; b=eVY/UPYCseKIgc5xHPryp0q9KRhwMj5/kg71nK4H4GeHC1R6OHHuopBUJLxFVtywkpjl2SBfe/snPgFU+EHN38nWiSQWJTOmduQ+fbP/NJLolndH9l82fdt0fMTmfMRDptJvz2xmGixg3MaZNBZ2ssi19bjjN5x91lcCCHdFp0Q= 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 1790263606657356.87185927253256; Thu, 24 Sep 2026 08:26:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKv-00032L-U3; Thu, 24 Sep 2026 11:26:14 -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 1x9lKT-0002Lq-IA for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:46 -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 1x9lKQ-0000V3-5p for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:45 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC4f3v2594257 for ; Thu, 24 Sep 2026 15:25:41 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 4gw1tjh8vh-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:25:40 +0000 (GMT) Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-790e3ca4c85so625340137.2 for ; Thu, 24 Sep 2026 08:25:40 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5dfa6a7sm116799885e9.12.2026.09.24.08.25.38 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= /OiUUsinsyrWu3FDQXNEW/coMbkcm3cDaSzZv0h9N6o=; b=Z822KmBJvCqVNvj1 pLlHhnybkoSx0RwK+UzUbpPspDpdfjTRcMBENs3xvabBnZRakXZ5pHSlXatco5tN 1DhKzYUfdBDIzDLRlMvumL7HdQ17gZG2YTGyZLRN9xRwe6RglxdjemIPnMe+9lXz vypjTuptbMQzvaieNe/WEdiEwgmheB/Rlm3aQ8LeqIqpRSiH/lYtA6C/z3H7fAyp Bsa2hI0ooLPSGSZADTVoX6tmnKTA3iuu5iWMxZm41VXv7dokF9a6fITspFbB3G0U LXdp8wG3WNgC+xs0HgrjLSuS40CmHzYodZuBdRyJA3WoRIpmFEzsv9KA0V2FWzHz YcRjxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263540; x=1790868340; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/OiUUsinsyrWu3FDQXNEW/coMbkcm3cDaSzZv0h9N6o=; b=feHRKt4dR+iqbDtGnb1FrosCndKXNwyg24OWCOVhYCGt0gAXlJcQwLdjxNRgjnuouH XtiEg4opVuUiGE7a9dD92xOIu7BoEySPvqkU87s4Kf0qSJ8yeWoddlwnRWCLcvJas3Tt co3z011puLQGZ4z2PGiAvmUu78os07+tQFWhsAK8oIX4lEQm1K9eltAHXaqPKBOP0ArJ x0eOzfMhEJLRFUg0HI0da5AIx65Rs9xhcInZlxyt6yEmfCAQAK7VWLMuJYUh/cX8RGKG 5/fiXjqCQLJosxwVwyR64ShJVpWPH+l8aQCKvXlQTM+vgArbmLuH29qkxcPQVCx3TGsu k53Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263540; x=1790868340; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/OiUUsinsyrWu3FDQXNEW/coMbkcm3cDaSzZv0h9N6o=; b=rDSNshij4JxQVIdpS38t/YyDxQhO0Qt159d4pRXNpJM+UeXqTw+UMDi5grgtqgm4ay R7Mxm6sg4vD4VqYNzX6T97n6WtuLnQhkEZHDdAyqHnwmYeSenGKNqdaZ1i38eZjWLYZh 99icZsYPkj3U6wvUxw53dhkTetgXAYkJ1hWeul6FcvwQjQDnZjtLVlOHzvOfqJ/j6TdF VUXxrELdsZHU3PD+VswrbueddaPaue6uwnyUsk2YAbc58DbCBYEAgkbtyQEcF2RJoDcH XqHIcCJV+8cSELFc5Bna5jRg1Mjh6NgRTeGh4T0sfk8e8tumkEDLazw89bDtiGt6mvvF ONnQ== X-Gm-Message-State: AFuF++mpaspcc+QMY4a0GiDkIMXObETU142XmhCmNpjPqtLGB7b9H90n OC+oVjBSxNxn+0KogbKYTBWRL6+nm/pPL3A/wXHEG0TgdKoZ5vI8lJH7bQD4SXMLz1x/OwOayzC Xz5IkwvqUL2DhWwCehyE5c9euRVV2AKHn8JWVVd/FKSo1WiIc04mr6IIKG+aDRtssLQ== X-Gm-Gg: AYBFou0g5SwR/XVIqdHD/YuVRoPG8kx/ZRa9/F6YaY+Hlxfbt6ogFM7sUpZXIluMqer IIqAVBQGDipcKgIjQ8ODvsrjSsK044raOTynaGmyQXtRxR3ujGPS+zSZp1sf842z+WZ8N4yzRdp uSDabQQFqABeWMBqsIu9yzX9yP1faf6G4+3uw/161WaLvhAi0NRY+F7OXIjmkAUST6e/1+XvGsE 1NKYc0E/9niFJeaCvOJEafzZrpwVPL5FLvs23X9nj/5l2TXjDZL0ndhYLZQqveJTXVKBkS1l5WV gYEo74bO/nCp9NPzilPCQdmzbRYWDq716lAP/LhU6FH63X7i5eotEE15EAHRfw50gpJg4v/Q/bL vdNQsxCzcoVR0yijXwYRRS0VnpYcv5b5x+tOxA1KN X-Received: by 2002:a05:6102:3912:b0:7a5:9a:3a31 with SMTP id ada2fe7eead31-7af1e0ef5f1mr1411008137.34.1790263539799; Thu, 24 Sep 2026 08:25:39 -0700 (PDT) X-Received: by 2002:a05:6102:3912:b0:7a5:9a:3a31 with SMTP id ada2fe7eead31-7af1e0ef5f1mr1410998137.34.1790263539234; Thu, 24 Sep 2026 08:25:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 10/18] target/s390x: Extend comment about PV cpu load state Date: Thu, 24 Sep 2026 17:23:45 +0200 Message-ID: <20260924152353.36209-11-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: RHkvHmOvbkCInAeASzMcvOyr5brApGgK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX1C7YZJWVufy8 lXJOlgSn8IZhhNTk7US7PzfOIop+cVOEWbrOEbbDyHOWeTtF/XC2yr6c9I/+w5JP293wi3lU7Gc wKGbpLhL+8CT1dZJZA2EHIRh6ykHY3u6H1SqJef5OFga041e39psDW5nMm1yyQdTiMNiP52FaH5 vNwQ4RWwF/8rJL2MYmVBoVN+FMQ1RBRTkfK7GAXUiGhubV9Pz/ZyS33EbnnXft3KLGeJ+w1D12I 6kdP9He8GY/94X3E4y5HKAaVIBYqVKKayN9qi4RxMKK3w3jupHpv+FGCrV9qB6Ejhc/btCaKyHs np8EbxWqvBaoOHLNv8NWVH32OWYOA4GayVWLcvu08kkMMFWlTtTxAHuG0iuPaxAWhKwdzwZwbfK zf4Q/62WYfgRREQq+WsujjojerCiJyLsvLAkmtXI0IBNvQ3ODhlDgOkZXH6U2rYnNu/C4G90tKm T0iw2NdCYpxygkW8Eyw== X-Authority-Analysis: v=2.4 cv=cK11IVeN c=1 sm=1 tr=0 ts=6ab540f4 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=_glEPmIy2e8OvE2BGh3C:22 a=VnNF1IyMAAAA:8 a=EUspDBNiAAAA:8 a=Zim2CNJdGIBW3M_IfOsA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=-aSRE8QhW-JAV6biHavz:22 X-Proofpoint-GUID: RHkvHmOvbkCInAeASzMcvOyr5brApGgK X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXwciDBHyC0CxD YqgX0Grk8Bq1i7wD1Q1BMdzIs7KE4m0A2kgO427Xk6rppUju2QQg3/Uo6BSK03EuanL2EkCB9wk rRJFj58nNzQaKq41mlalx/lceHgD1ak= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 spamscore=0 malwarescore=0 phishscore=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-2609240063 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: 1790263608230158500 From: Janosch Frank When implementing PV in KVM we chose to add the cpu load state to the mp state solely to have a way to keep the UV happy. The UV requires us to set that state before running the boot cpu since entering that state sets the initial PSW. Since entering that state in KVM only sets off the UV call which causes the initial PSW load and does not set the KVM tracking to operating, we need a second set mp state to reach operating state. Signed-off-by: Janosch Frank Reviewed-by: Eric Farman Reviewed-by: Matthew Rosato Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260923082146.62803-1-frankja@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/s390x/cpu-system.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index c938c77d0bd..f12ef1bd1cc 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -73,8 +73,12 @@ static void s390_cpu_load_normal(CPUState *s) cpu->env.psw.addr =3D spsw & PSW_MASK_SHORT_ADDR; } else { /* - * Firmware requires us to set the load state before we set - * the cpu to operating on protected guests. + * Firmware/UV requires us to set the load state before we run + * the cpu on (re)boots. The UV load includes operating so the + * second set state isn't really needed but KVM doesn't update + * its internal state to operating on load. So we have to set + * operating again. The UV doesn't mind that since it's + * effectively a NOP. */ s390_cpu_set_state(S390_CPU_STATE_LOAD, cpu); } --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263648; cv=none; d=zohomail.com; s=zohoarc; b=ekSyEr5Ioo7JvmZ2cJVNSrAIgeEg8iDPu0XPxzJbVOIzXmeD7MHNvigKwfA8ULl0zs3nkZ/Sal5g6OTDGEi/gDzAjhrL8Yu9s0bYjLphdKs4RuEginWd++0zGd0tUJSBhqyab8AjjDo3xlz1JuaitHhFOa7S5BcpO+z23YaeJBk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263648; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=olFpzbrCioYQ8hyoLYIJ1a2ZDTPKs6gs8QpMhuGQnOA=; b=jZ5d5VLWhCsDw5Hir6BivPDrn1sDeBSH+zNiPYkLjYZZjWN1r+uSLvshTwP1ufuuqn9zTfKdMFYRRbRAn2GDT/YlQkdbS4PZFCxFQla6SsxSuSROMVdMs/mVPRQfGdVK7a8TAjuMRX7ZE6GHsuqaMQKbVTh4XXSmAfAyRs5N2Ws= 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 1790263648813940.3816577542876; Thu, 24 Sep 2026 08:27:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKw-00034O-CW; Thu, 24 Sep 2026 11:26:14 -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 1x9lKY-0002Yf-N4 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:50 -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 1x9lKX-0000VZ-0C for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:50 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC4hpr2594275 for ; Thu, 24 Sep 2026 15:25:48 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 4gw1tjh8vx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:25:47 +0000 (GMT) Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-7a5ed2517b7so559358137.2 for ; Thu, 24 Sep 2026 08:25:47 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5cbd134sm74919435e9.9.2026.09.24.08.25.45 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= olFpzbrCioYQ8hyoLYIJ1a2ZDTPKs6gs8QpMhuGQnOA=; b=EprR/nThl/wlkeT4 1IevEZMpEq1srImK85SmLY2gH7hPNLWAxn7caVN33FLDTUpjZ/oFNyRNjyA9pgNN drXfZ0ZVBv6CGb375AHgLk3Cxt3ttEXWvGOVfmOwFBlFbcp+ZxQxKfxoVnw3aCg2 tDohlPXPuJKOpZ2tVrKe4rHW8W/7oZ8Mq/kt51bIqbOgV250Z++b8m7192RLCiol SlPA10dQSonakkaDRYbgzDpGDRZnc98uAzhu+8UPv1knM8HS3GSEPg4HdxLLlPOv kcS1YTyL3GRetxRBeCRqOU5LUxsU9EUOUryX/OCWetzbem/QnpFqV6br7BMU9hZU DNV0tQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263547; x=1790868347; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=olFpzbrCioYQ8hyoLYIJ1a2ZDTPKs6gs8QpMhuGQnOA=; b=TZWEZZ8WODaG8NHiaSlj7sVOSMXEEygHnf97eAYq6wusFJSK0Fk5xpu5NrgldMZhyZ bS05e0Wmw9MMqTDl5EnWW41f5U7bl3ualnbdLo/wncon+XXks+Qoe8PmlSIqIsVwwz/H qSPAv54YKaT1twcn7MsHD8kSSsUxlsmmCw7nNb+TdnyGu3bJVMxSQp/OgUQjRlmI+qVx WnvdddDdxyHved1g9lNS2igwZUbepbVvWKB7W9nAM4tHmN4EiGpk0XwxSf4xwlgHJkIH H01/DaosqpB/9G9SH8KavaqDDmXLWNtUjgp1lV+/Ym9c5qXrPW35H4BDhrMiPgPJDDUG FcnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263547; x=1790868347; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=olFpzbrCioYQ8hyoLYIJ1a2ZDTPKs6gs8QpMhuGQnOA=; b=eOgXEFGWDl+YF6JAYemHXGHbud30sOKpqwVGuus8ap/OH02JFEpr7dhRjl3Gtpjo9c rLJ9ORaR4l3XXr38RGbamoI1rrTcnhjDQpC/X5HOJ62mvCAgAJftNetz15TgoIxjb3U/ E+1Qv43aENzfaC9tKWOVwPxdPWTrOJpL6J5sOsKxnFrei6Vn9qfImx+u99Tyu8it79qJ r7absm9rZDRCLaOOvMmgJRTvYyvH9Mq3SHox9btiR8VoAiwmJKQ8zvMlSnzaZ2qX1M8E CRcYdXTjLzVmRALsZgFUg078Dh6+detr+3sxNezrvquEUuMprkh1mtkU7jVe6mYOr3fg OuJg== X-Gm-Message-State: AFuF++mAFeFwlxXobjP7Et9aU3P3kCWMvWpJkkvA8rHyseYe+551z/nY N3IPzZ4VjDWO/nN5g9nELdfKSkdozQijYelsOiIfIa3aiNLVRf2SM4EEGcctAGVSvP2ysSXdVGK t9yIMiQ60o1ZcNJ1/xlxoWByEE8y6EvwLzrgdGV9uRYqFcogZO1zCl2rEg4ziiXMWig== X-Gm-Gg: AYBFou2KwfOIm7BNUX67s8uNL2Rtb1s/dEY4xXane5kcGE88XXmE4rxFzktd3LFv64S d55lzWxBbKMotGMmsYRAjctpUwSZbdH5PXe6GHlYA3BuzXdCCiLt6IbRkp/k6Ejj+uH/Mve7WZn 0NpXhvhvbRBfIMIrYfuZKGERjr1UXKuY3i6vDKgu+M2CCs+HiySiRuYM2QmpNZSLVSZ/IU+Y74E 0fOpF60920ZkdYEuYxpQaDuyJJiqXWLUs+9Ep5l8gYb5446coVRXHVNFNxw0RlmxWpGscpT5Lrj 0ZfKpJ0j8St2UKlxaocKLaiuPsBYRnQ5ijxU8gtrOcoPUhbPo3Jli/AcJWl/yB1a7+2lGzgbN5S f+k1cQYZ9318+yn7pNIP7CHI4p7L63Kr3TqynvKdl X-Received: by 2002:a05:6102:a15c:b0:7af:893b:da04 with SMTP id ada2fe7eead31-7af893bda4cmr268695137.25.1790263547179; Thu, 24 Sep 2026 08:25:47 -0700 (PDT) X-Received: by 2002:a05:6102:a15c:b0:7af:893b:da04 with SMTP id ada2fe7eead31-7af893bda4cmr268688137.25.1790263546535; Thu, 24 Sep 2026 08:25:46 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 11/18] target/s390x: Make s390_cpu_set_state() return void Date: Thu, 24 Sep 2026 17:23:46 +0200 Message-ID: <20260924152353.36209-12-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: YyrmnliYPNG9mvULsna0z7LkhYiZ2-Yj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX9WDmpKwqSn1b ZcXMe1SqOG/jk+MDDkohQVd3QlcA5WnCbak4p86upbJVHhgB+IMxvEYBEoe/tAa2elmcf2EWFgb f8MFt2ryn365mfliVqRqPhPFtmowK46JN4lmsbk+I1xNyVYh1/0DUXFIt7eyOxFcS9mmk3Xxtef 44m7qfJ7GM1rqilt/ybm3zp3AyAguCoeq4Hp5Znbv+qilrL2FLNyxWmNUBj3SXTCVlIHPWUgEJq FSNvE5+ST4Xg6bF7P+GthsdinXcdajw6d40yH1JLrU27D7lKKtWX7WlwnGcAPB7gCJPEZf815ig UrUU1uiihIvtzWNvHBaN6Wgtk8IaaAsZEPMB9TDxLf2g8XU68Gv+RJ4wjmx1nu/HmqOxVoUFAP1 TLm/qrcVnyJScglNXUyqPM8wKSHfNCSXhs68wC2AM1GPcYYp1LHPZwNOyFd7l/WN7ubhNIdWKF5 /aUZRdUz+jKULd9Pggw== X-Authority-Analysis: v=2.4 cv=cK11IVeN c=1 sm=1 tr=0 ts=6ab540fb 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=_glEPmIy2e8OvE2BGh3C:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=VnNF1IyMAAAA:8 a=otiJeUf2ZByGLVp8V8QA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: YyrmnliYPNG9mvULsna0z7LkhYiZ2-Yj X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX9919pkeTPdrR MA4FophyAsF4h7SmA3+BiugsmG6V7FdRR21L5XvLBqB4oDDWqeZQuvVRFL0DTwTG6NKu3JpoADy v4S5vMqUI/WKSnBTebymTamtI1+7Ifk= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 spamscore=0 malwarescore=0 phishscore=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-2609240063 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: 1790263650324158500 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 Message-Id: <20260923171116.31276-4-philmd@oss.qualcomm.com> --- 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 f12ef1bd1cc..e1335d9be66 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -240,7 +240,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 @@ -271,8 +271,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 19:12:10 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=1790263666; cv=none; d=zohomail.com; s=zohoarc; b=LT7DbN48twBe+4O1aIf1OETkOQF5Q0wSQotd1/sNN0dt5PW1JbtWHwH8OwrYsjFQ909w2XZjgd22STPpdE2wT+zwhcQzLQY6i6Uk7yLMu+tOBca/5mx2rSwIt7GgEjtysuLgraeLHxLluTEbv+W4CqnxV54Xau6DAnFriOhhWuw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263666; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=iDSXtdj6wpqBdHZ9WTpReBMYjE3hBC8Iom2zWJALQjA=; b=XA3ORV4mlzZtOwPkO8APzH2Hx8zhSVEWi8KGKSEv6wodZ7HPlfGlch9OMOf+u23YdziPzbNnuw6BA/LUlzjD58fJIS0cj1ikRBWL/0cKDuFkWphLDTqoxzY4NQw1Zgi7vpB5qjha1Xdd+IwWeLhlLI9BKDkf7WbCl1A6amO7MjE= 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 1790263666773836.0528530899489; Thu, 24 Sep 2026 08:27:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKx-0003Hn-PF; Thu, 24 Sep 2026 11:26:15 -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 1x9lKi-0002fg-5X for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:05 -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 1x9lKf-0000WD-0j for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:25:59 -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 68OC4d461437085 for ; Thu, 24 Sep 2026 15:25:56 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 4gw1t7s9r4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:25:55 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-79285c98038so1896461137.1 for ; Thu, 24 Sep 2026 08:25:55 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48868266822sm16805690f8f.5.2026.09.24.08.25.52 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= iDSXtdj6wpqBdHZ9WTpReBMYjE3hBC8Iom2zWJALQjA=; b=Z+Kk8Zml9P/0uV3z oRSnWEU/vnY0Zo3nBa8xLHSROh6wwWC20LtK8kS9rdsbi+Zv3TNNo7lvl2L2xOpS qG2V3mQBAcRPFLO1b3F0Ic4XtlDR/Z9CmJti+oL6piUBeVntdwunBKLYGgNbJbsu iChXwcr/oQL7463/1/lBA+P3fvwQHycTxsMvTc0f4aX8gukMZzsQFfwbX2ewPK8G CfLC3PCAHpToc7kaBmWBSyLuwYqvbsSyCC1v72AhZhmoUxXd9n/VcjkJpeB1seC4 xBn69+GgRriE1Br1PkvKR7zt8rC3o5lYM1hAB7eq4XidoyEDlTiw7S8uyumsCvEI xEFb2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263555; x=1790868355; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iDSXtdj6wpqBdHZ9WTpReBMYjE3hBC8Iom2zWJALQjA=; b=LG95nAg+0k3zSIoPD4DPx1wWgrpY33FnYZPNO667Rlj92LaI/49wZ83/l6Xgw8GglR Cp0OmA+DASTjknCqrppnDzKnOmnO/Ir5roY/Ij3DqL8RbFstc/OXyxN6NLhxSVBgoElX Yz41k9re+e43rkbDKz5RHc1PGAcToJjtX+Fia3Pivkmt2euSSuhukaZDRTvMu2T0muND 36zFE40PJV7fiDreX1HXzgI2SiFousl+8MDx+D2K7qPGyFFSF0UXWnQMeOzI7VYCQy+7 N6ZPLMhy/DQ3owCtmXz3YinSSumktQKjfmFGaju3VOG7Du8AJSgoeuS84MPHoLAu8K3N zsog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263555; x=1790868355; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=iDSXtdj6wpqBdHZ9WTpReBMYjE3hBC8Iom2zWJALQjA=; b=EbqKsq7xixLXU5H3jxnIffm9Y5ICRjUIcn9HdwbqKyOZVcZoAMM7WQZ9Pmeqi4+V9p 8r1wb3HEjs3Xxta2r7m+O6Fb8jCzetxL4ALhvBqOZox+0kQwNQzJjRg8vu0T3XkiVsPw VJL/DrXvTVMiDFeH2KojnV+/XDh4R/sZOobr09csZR2ySyuKA+ibvMjRkDcysGcCadxE Msw1qJRHwTlEynF5kSVemSkkTzbNaTGJ6HSp1MJ32jRsVuZMRyvE0UezH9z6mzjJW17+ kh5XvtBtdPLX3nJHeAycspO+YWOgb+ghf2/yYUxHeJgdn7AfEQKjrFdtvTeE6QPg0jqA NyPQ== X-Gm-Message-State: AFuF++mhGBTpjLiRDctFCtRO3/tFek+tpPs5mb9P6imfuJ4+NjFKYJxM XieekzoxprEKwmYUy54cGs/a4OezhO0Y/e5AkN3W3lGvB9yrQsJlRpVjzEB1xhE6jRUFbsEfXmR cMhiJfHSbQrNKhTDxZ4xkVUxRrXhNs7/MojN4A7cD9PJBXkTCw82wW0QDQ+WwCLtP7A== X-Gm-Gg: AYBFou2bhXjeCYu8kbbISKvkAChLMCGm8gnR5Mx2QhXblJGRB3t1/MLsx+WI1m336UA ev6U8Ovb6uEFFERQ7cnDsN0HOZWy+ycIbbKRxLjoa8cDN6XAmTjq7SiomqL+qmQRW8gTf8f8IbO 8BkUYt821yYv6933qWivzujpjFlmebZZG89kWtt5wMnz6H+SZxVfjyjhBOYT31ZgyjBvfz1IGVh ZKWKwIMeMqBIU07yv6JWA515St6zTIGVQte9lRm/6jWCkMOuGeeZvY8e4UA+n7+Zv6rTrL4Ha18 +E+jVUz3rQE3H0mLicYnd6KVXHzUjyFFe2k/NgPJLhd+vJT38AZ8PDQZsZY8BjBd/Jf/1hsXBVr OqzZxeiNVhRprr1JcDLPWz9zmtr4aaEv62Kxz5QgQ X-Received: by 2002:a05:6102:3ed1:b0:7a6:b18e:6d24 with SMTP id ada2fe7eead31-7af1d6c2588mr1559314137.23.1790263555199; Thu, 24 Sep 2026 08:25:55 -0700 (PDT) X-Received: by 2002:a05:6102:3ed1:b0:7a6:b18e:6d24 with SMTP id ada2fe7eead31-7af1d6c2588mr1559264137.23.1790263553628; Thu, 24 Sep 2026 08:25:53 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/18] target/s390x: Use S390CpuState for CPU state APIs Date: Thu, 24 Sep 2026 17:23:47 +0200 Message-ID: <20260924152353.36209-13-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: CrwjTNllNN4b58suNM_13mqUyUyf89_9 X-Authority-Analysis: v=2.4 cv=U/MHnuru c=1 sm=1 tr=0 ts=6ab54104 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=VnNF1IyMAAAA:8 a=h1LczH6ptyU4K0ekaGAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXyNNwlD0Qfh8q +a6VGBt2hJJmDCJfGVEAdiRiS/oPDO0mE1NPlANphoGf2tUPplBkW+XaCUpPbaks0VkZhwcdRsD NwgMmxsE9n8X/Xtj2Hz6xCp765P9CoeesvCg7pYshOMryHgP6LHIi2nwdUSl6LoXyI/BDWpQYVz AV5XpMaHbJ9Bagds146ArWfmRRNZDrOg+JFCyQhZPB940M+q3yrORPHzP8+oa6fmp1FmXSXLI6a vYMg6+5/BZHkwgIgM9WfPfjeNWk3UqDwbNZ8XGtmN5Bk+jdfrGR95GFF4KMoVjDT3Aq1c1HRnaT rI7SqCKzIWQWxv2EkaCVxxG+xohjlUA+7FkfPshrKCSDyAnSCo2BV4Jjb8nsMTJ8K0XN33rilrq Q/eEouESqIgjA5ri0UpBTfCOaT5BNU4bBYx1SA36i1K88DiX91W6JXCYFlOLKiRcsEFOI+irFNT eUD/mmHTr5pkfy01mMQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX1BEC0TQ0Q7zX v58UPwZapjnWFmvI7yWp+B6JRd1RiOG0AS1gN696SA3X2Enb6ShSC945L/aR94uQ3OQt5NupWxt vfWMdDvKGT5yLymKXlEsCbbkLNgsIpE= X-Proofpoint-ORIG-GUID: CrwjTNllNN4b58suNM_13mqUyUyf89_9 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263668537158500 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 Message-Id: <20260923171116.31276-5-philmd@oss.qualcomm.com> --- 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 e1335d9be66..e15775875f2 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 @@ -206,12 +209,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 @@ -240,7 +246,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 19:12:10 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=1790263661; cv=none; d=zohomail.com; s=zohoarc; b=l/7jap9mQVeZ/gaawqzT6WLtw/fGuagmFLWSZgo5Gilh3gTi/xvcJvC24KGPfQLA5e8CFBLs67/SajtsjQ/TDGY7B1hogPsdg0xYpekO7M9kSiWHXnc2pkw8YGJExIOXJ10bWJQrP/0yHDWqecs88q/XS7294sKGPg98OU5NGFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263661; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=FGi1ihUaFztgINnLFtdEKYkgg3z445qdDk6Oy7Vbmok=; b=TC2efxQ9dOD9gCq8EuD0d7O6YWkpkQ59Jj6que6UFdKH1LNv6Cj1Vz8d/Qamx8XSbc/+2+BgvboEeQASxQLSH/CPKhuh+RH4J8xvH5WUBzfmkIEp+LGaN2v6uhgY6rO7INwV7yphUuhQlqP5hlk0FO2jKNbctcG9vIQkakZX750= 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 1790263661361875.9711483345332; Thu, 24 Sep 2026 08:27:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lKx-0003EB-Ev; Thu, 24 Sep 2026 11:26:15 -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 1x9lKo-0002m5-Hw for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26: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 1x9lKl-0000Wf-Rr for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:05 -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 68OC57oK1430271 for ; Thu, 24 Sep 2026 15:26:02 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 4gvvghasfc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:26:02 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-7909e307799so1882070137.3 for ; Thu, 24 Sep 2026 08:26:02 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48868889409sm12783015f8f.35.2026.09.24.08.25.59 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= FGi1ihUaFztgINnLFtdEKYkgg3z445qdDk6Oy7Vbmok=; b=e4sghe5Y0c69mxNR Qw//N2m4LQ4m0cnKXB/8mIa52SkvaCInckJ6Q/jx3IDi4X4QkUy3+MPwEUoVDKu8 m/bkaitJ4bguPfmjosQCCRRw3h3jseX53Fmmlu5DnVg036QsGJm0C+BKG09rbd6Q bgdpBfcvGBjWHMVBXJspptJj4P/9Me6gEz34qeojyBs4EkYCRwZ2DC4dKp+5c/YP Rtw56LcG7ZHyl1gN1Ae/VdXDJynLtcrcE8AlXaWdOVoFQdUawehmHoIohcT3zSGc /FZ1gcGtOlU7JwnlGP1Q9w3tonDjVCbAWgrUVtPjkd8NSrAh7LamSN3J2tSujBHH PefPIQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263561; x=1790868361; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=FGi1ihUaFztgINnLFtdEKYkgg3z445qdDk6Oy7Vbmok=; b=P3Rpm4/0gy8OMiDOxZQ4os9Y65O6rY4eKKNuCOYkm/OPAdpN7Z1esHwJa9VJ/3Z4FF VlxbaPrvpRzB2wWmcmDdrvhVrm30OucdSIlmmv51hPbq3Hh0d3nuIE56mnG3/xcYquQ4 LxaRKLiVhwrEmnKtee+YnvbS990w8CX6SFS1gtsdxzTIr59O60cKIQY4xf+tJFfb5tFa /fVrcPptc7Z/108DSCJyVKa/XoxbtinkdzYkijAaI5t1SSVqehhOCkKVj9bAdprAxL7h 5/O/ixUZf/cdgFJc0bacEO5sejOao6qmnrPbITPTyuBENno+oqekYqoGccEO/9vhf5Uh 8N0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263561; x=1790868361; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=FGi1ihUaFztgINnLFtdEKYkgg3z445qdDk6Oy7Vbmok=; b=aqLihhkJYtatTE9i3ZVDaO/OD/0d/yz+ZzYrZ3fXFGIwiZPaJ1TC+NTsWUICsW7a+e YorgGEYBNP+Ofd/VeMi1DuhdOldWqni0xk0wgTiuUGkwGSKDCpXMVHN43vnS7rb+S/6i Gk/cjqevBLsr9AKdSCIbvc7laR3BVmdnEfZo2gH68mI1DF3qUZrWWDBaeiA9+LbAgV+g bh65S7onrNJ/sfr6UW+K/VQtTWGkbApSN7n7D68f514SKGnDHrIrX9GfTAVSbKqk6yUV ZbsVBW5zyRPmaIuWKrTLZFw8ynvBdcNOvJsCHe9f0BwWTysA58T9kv69og6TyiF0WHJB cPYQ== X-Gm-Message-State: AFuF++ntRFTRtcYTBJnlmiflxA2Fq5Lha00YshSgWQ20aw7QqcnqVMJB wwtpTGq2fcXFCbQEjdQCX/KhMqcweX+s4yRLlJluV7nLk/uf2XXXu3o2vo6romeVq/znyR23d7q qDdePRY/Y/QcADTqky02vZtGy/TayCxw+epRWGpqov85FNrDS1ZG9GXhMZ/+wLhG2Lw== X-Gm-Gg: AYBFou0DVeCa19hkbv6RByXHkFkZuI1VwVavb7/yrB+Woun1KR1XTvw06xQxTtgSWlE eCnBPPAHLtpJG4w/1QRMbUdzkVO03eBliUWXgcboFjeqEOIafI0nKezsGfTnIIpqnfPRP81lQJT 1D7mbNY1ZGfZPTN/X0XGpn5wq1wQKuwx79ehVK4vFzzZWmf/PAQx+9k3tRxTt5Vv0yC6QDj3dk6 xysiMbiwr+74evGSioEEfzE8zRbEEgSeRC7Wuc8+/C2JrvFntA4XJ62jJh7AEofatCUO4iB1I0K PwmH4VCBhKcD57/jQTjtGwpbyC7lq+tkyrcMID10RVBS9rCHx5aqWS7WoriRI5f26eyqbV/o19o vU4gcSmaS4kjW+P3n28Wiwa+3USkD1sY+SCy4GUjb X-Received: by 2002:a05:6102:3e01:b0:7a2:1f78:c6fc with SMTP id ada2fe7eead31-7af1d09ddeamr1452865137.14.1790263561293; Thu, 24 Sep 2026 08:26:01 -0700 (PDT) X-Received: by 2002:a05:6102:3e01:b0:7a2:1f78:c6fc with SMTP id ada2fe7eead31-7af1d09ddeamr1452844137.14.1790263560682; Thu, 24 Sep 2026 08:26:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/18] target/s390x: Access S390CpuState atomically Date: Thu, 24 Sep 2026 17:23:48 +0200 Message-ID: <20260924152353.36209-14-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=KYhHIgYD c=1 sm=1 tr=0 ts=6ab5410a 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=YMgV9FUhrdKAYTUUvYB2:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=VnNF1IyMAAAA:8 a=jkZ4ftcXAbePN3d4lLkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 X-Proofpoint-GUID: z6Qu4ZfP-xZOkk467HiPSQ1udvYEUdVG X-Proofpoint-ORIG-GUID: z6Qu4ZfP-xZOkk467HiPSQ1udvYEUdVG X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXzhz6UHom51aF pgp6M0hX7D6YB91Dj6+tL7XlYRcCKg4ZgNxSWoqj7zEkLFtUl+v8i32NtfouQQa3do/bkAeN1Cv 12l8hVoKSxEkuspDLnL/sJi4JoGqmG4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXyGzzU8MV1cAx U2+XrQ0C9HWgtEblNmqNbItRTbvW3/WUWPyhWajWf/3W3eC+4Iv5gR5BrzAHZrWr5P7NlvLblal ljiV5mVpkRtgkm/LVosGOQ8cPjxUW9WCPNMp6pN1bdHNeaF4V3GDN9taMRSxsAgwFMcKnszn2Hz EAiqr9263VQzW77DMRynHEop26norTHrD0cxFThNEYt2hy0u5h2UU+Cx6j2O31nosWzXCHq7D0U jS+XKkX8VKHYtryCCqAiEDaVUyWJiqMSBVxd1kBYZ776G988uDz1leDRwp771XdYGhb4maaBYCr SPohCGOefCw9RzQc2yE+2M8itINZU3nxA5mqXREI8tNfyXLVapybOjHZhV+QqEtn/uMxfNdGGMq alYRPGjSN+ECtJLg4XUSro/BqVjbsI+XF3y3pKrw1J8VtJvcbVuiQN4g6yre6kPfeXZQ5oXOnID GLP/0SCaM9pFct18cQA== 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 spamscore=0 suspectscore=0 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263662373158500 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 Message-Id: <20260923171116.31276-6-philmd@oss.qualcomm.com> --- 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 e15775875f2..d963d9e940e 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -276,7 +276,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 19:12:10 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=1790263655; cv=none; d=zohomail.com; s=zohoarc; b=QfbhoC3R5yjmfpVNrXJvMaEjJUWWoq9HMCR1ZFBHh5BtD/CDxApu02X4bM2YJjpK6IT6qKK5dlAK9S3eOcoMU0w1/9UyXhDYKcyEN3XpK0GuLag4XJnmRLCEFaofM8x6Ohl32Rm8fuIEppF6Ua5NCQe+mV9tx+WIk+B+qiOhlks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263655; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=utaDzMciMH88pwSyIMbGGsHos0NQm+jbaJRbElWB5bQ=; b=V9A1KU75NpuNEOpHBswCDnFxCnCgVisdpRXQeIu/W9x6uRbVn3ibIxon/Ggko5QB2RWG/4RPW7umTmGxR/fTtAlFyW00XY2E1FhHIykJTy993rj0u4PFnf3XBfJTSAzC2fgcHDT2DvKc7zPNTHGbJKQPVEMm6jmZQTUeRy8vWLw= 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 1790263655120395.5297899702965; Thu, 24 Sep 2026 08:27:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lL0-0003P4-Ei; Thu, 24 Sep 2026 11:26:19 -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 1x9lKv-00031I-07 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:13 -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 1x9lKt-0000XE-4J for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:12 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC4hps2594275 for ; Thu, 24 Sep 2026 15:26:09 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 4gw1tjh8x0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:26:09 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-78d25a8ff32so679408137.2 for ; Thu, 24 Sep 2026 08:26:09 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-488684863d9sm15617050f8f.12.2026.09.24.08.26.06 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= utaDzMciMH88pwSyIMbGGsHos0NQm+jbaJRbElWB5bQ=; b=nDfWZgBWr3LBWFb6 amWYJwlXMdHFWpsjT9d9TfS++YbVDDp0leHyj08wVpXjmKmVIIkT6XB3QC7kV0Ws 0M+oXf7aOe2AdFk8OHAGeDm9nigNxJl7HnH7pmxZQBxIIukpvBtr0RxcXxgdWv/2 yL8PU0gvEER3vqnz+Y3SrasitUZVNevOVKZl/TDF+oZLJ7PomAk2+/yA9aNlgo9E RfhGK453+z3P9o3IKkL1SPHT4uBbQnJSnhAxGJ5T738+7MjhjHUF5KtxbW5wjZRX UAdxGmkGpOjbCmmBS9qsHA8rEt4emhvT2k2nwWxNG8qlItnN8xjwksUgGeow9oaM kgrzQg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263569; x=1790868369; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=utaDzMciMH88pwSyIMbGGsHos0NQm+jbaJRbElWB5bQ=; b=Ig1ix6WjSPBvI15Ms4/BsNjt3nPOAGEDCG5zhNHXRSddsr6MXww0eJQbuN8gxlo5Li 8GzGgBBL5ZPVJUfWzbnWuyLvLP1RbiyZsbzJ/NMZFa1KgG9t3prQBnBfkOHszpgMdXlU YfUfHKil67XFVi8EDZ6gU+DSV5YKW0bPTwY355l4REqdVJcJRzm+58G05GDskTELN73a WxCY4JZQsDhF6ptlvEPbxkR9nBPPyrCef8l+luzzsX1suOn/mV7GyWPZWQ8xkI6wQkz6 MuB79KKjX15DewjSu/clCgZEEcxTX2xFIwduyiVR6LwBImc2eH7eJm3lVePMbk5KJKYf 5xeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263569; x=1790868369; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=utaDzMciMH88pwSyIMbGGsHos0NQm+jbaJRbElWB5bQ=; b=vH0dYEwhW27U2PuIeQTJI44e8JD6T7jexBJkKPwn+gGDOJW8ibVZD//TpSHPKlp4BJ o4unRs280OjQ2JehvgJsAm2K74pskO5sgaiJa8nlRz24+BkhuUTzIwkU8ZjdcUzJejVJ JqWDtZSFOnSEMugKhGXf69jOymNYEDR1mF0hqk2s2tCnHKtenjdKb9D5cpxokyhjorX+ 9aG6vTmLRuRxnm7by4sja7PjQH0taKt9bRKSCEsGVQP14saeVWYVupO3UtpDPHkr3FQs bcqC0yaWJsQDYyXOGbeiXWdu0J8rJUuS7bk4ogrv9h0eM3EMYluquqGHC6g7nYLn+cBk UiOQ== X-Gm-Message-State: AFuF++nJO17FhSPMpLXARPfSTm/m/BVw+lXWzMOglE0E0130xzLejK5n lGJq/XsWp0CdqQjYGKfQ58dNNZxMZ/pvEQtTvElHwYgDZyHIiQ0jPAb7mUe5mIIRvmX8IIDcq8t VOkWEX3YWn852YFqnzrgU3HExhTNzwpvL9glZ2DnptnHgVxVB+6ONy7nRuS0pORtE+A== X-Gm-Gg: AYBFou37BDTtMzDdRmIIPmDSIb023dsvCT+Lu0n4bAe8LRaFu97LxiSEiZ0AUopg5ul t2T3voFkRcBw5CaBH3ASLM7TQWDyUGb7v3qF+d3nNidoJTcWgO/stsSoCLqVQhhh/VY+YuzYb02 hqzosd9aJxOJbh44hTmdyJKkDQpuIjUbejM1hrHw6UoTtQ/Ap5EzKc6j2uq+lupa376zx7ONSYI 3bQVmSaVZJjb6sgUxaRfPALiBc9a7YfZycnmESEA2sWKJxMJg9I/NQtTXJSpx+1enrrjEkZtxuQ H5eQXEy9mEespkv9ZOeHK4KGR1lquO4B51NbklKV1tj4VBXXAKPZAujpLnOfGo7kGHu3P4MwGU6 X9mSXBr9ag/zWsQ0kLRGqCHLPt4b6DRgy9Qar3ITY X-Received: by 2002:a05:6102:41a9:b0:7a6:b18e:6d5a with SMTP id ada2fe7eead31-7af1e4f6363mr1250340137.17.1790263568343; Thu, 24 Sep 2026 08:26:08 -0700 (PDT) X-Received: by 2002:a05:6102:41a9:b0:7a6:b18e:6d5a with SMTP id ada2fe7eead31-7af1e4f6363mr1250320137.17.1790263567557; Thu, 24 Sep 2026 08:26:07 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 14/18] target/arm: Un-inline arm_set_cpu_power_state() Date: Thu, 24 Sep 2026 17:23:49 +0200 Message-ID: <20260924152353.36209-15-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: j0S_8hhmANLrGAYDnbYgs2JIkdmVc7ZH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX7N9H9E4XkiLQ NqFrTAvKqEdT1QD5xRCgRBo+SWP1ArmHMS3Vt3EyOFv8tmNbzo1C/L6xz02Mijv2VBmovNlmPxH MVhX/6o2k0FsmamB85YNlFkX5obF5n15TC2bQQ8BrxE16bjUK+OILUYIBB0gHS6WZ7/BNScZiOD 9+Qf7U2eFaQiMjuusNAgnyAyRti4iRDyxs5f2zZckrLjPde7XqEZqtascBQtQiXhh7ZPoSx2kBt XdwsCHFcmz9oFXt6bqfjWhDB8y21dx29KBvB4BgQRhMBdXd5+25l5LnpNd9IWZ7RJZ9jft72dQe n3MjFw64nG7bOkYU3NNUyP2SFc4k9sRnKo0c6la6rFew940nbMZnpSyIDvY30j8k4XpU2QWsNea 2v70dbBm1j38b30BPbK8EVS3VMZwJrnfi5A+7sQCuoy8oNmYptoauvUqHM1C3UR/WAcowS29488 ARPWdjeSj8gV3CPb3MA== X-Authority-Analysis: v=2.4 cv=cK11IVeN c=1 sm=1 tr=0 ts=6ab54111 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=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=or-B4SToQ6AIma83kDAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: j0S_8hhmANLrGAYDnbYgs2JIkdmVc7ZH X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX1oBsZnH4OUKe /pkn7/JZFf/zZqJdpKTVzEvBA2FMHsc+5JemACT9Us1P6StWdRsUeeqUOicFBwo73pKG86iUjdt v5t9s2Kh6SJq5GOEsjp/eJq0uM3SKpg= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 spamscore=0 malwarescore=0 phishscore=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-2609240063 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: 1790263656409158500 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 Message-Id: <20260923171116.31276-7-philmd@oss.qualcomm.com> --- 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 19:12:10 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=1790263666; cv=none; d=zohomail.com; s=zohoarc; b=T46izGdKBrd2EH0CZOrq+jjftvZm+XvUF860HN0pM4rS/9wVzIsLjyuUr7jHgmeAv3wcbToTrl3GOrrfuD/cOXUtdCwNVkjbIZ7CZ1Lc5NftiivJrzY0p0U/2P9rhTITuFslwJ+GgeMHkXWJljt2x5oNmfour7v70R167Sl3pLA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263666; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=LspDXWFA+IgaJM8a94tPA51Em6Z9mhnhpCi38nqINP0=; b=aT5cL297Ir4AYtj2q1L/NQ9r3VaQwTHWwmPbt+tfDu22y7NwSLfTeujGR+unoqwPSapdsFRWqdc72b+pbAhAXMO4a7yQEGatyvgMP2Wgyf0yBOD33uwhKM+ohlBr/pQYv/ehd2OjI35VUv8HvmehCh00agxNCK/lv+m+Fq421UE= 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 1790263666256526.2842606469767; Thu, 24 Sep 2026 08:27:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lL6-0003m2-JV; Thu, 24 Sep 2026 11:26:25 -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 1x9lL1-0003Vf-Hq for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26: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 1x9lKz-0000Xi-Na for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:19 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC4WoZ2749210 for ; Thu, 24 Sep 2026 15:26:16 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 4gw1s919n0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:26:16 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-98304865f02so1773593241.1 for ; Thu, 24 Sep 2026 08:26:16 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe5cbd77bsm89740685e9.8.2026.09.24.08.26.13 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LspDXWFA+IgaJM8a94tPA51Em6Z9mhnhpCi38nqINP0=; b=VPVtHmf71lWJvlnb FTQKXxMeA3yssgXGsSYwdxQeoZP+QVFC2sncpKUipXtNUGZq1G7EvA+r0p+5s5Xl RrAx54ALL90ZnOZAm2LcZG9p/+ZB6KoqJhuiwsods8NVfxZLZ8QOSSwdc9FU/d76 fAfE53QAIyV969dr6SrBPvZT6ZvC/VTqqO8L2MU8yGKgOs2TAXPo5lCyxRa1MW4V He3vrG20t+ClWJL4RmYxvngyS1QTC2gfmYul4WfcIK8r1nvAlwiEJ0GqZFzdYlmm CPBDde9KWJwXdpNs4vSy6d1ygzIyFMlAsqS2DVd0ustKs6MKor+iNtIEFEd3Hjee KVTugA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263576; x=1790868376; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LspDXWFA+IgaJM8a94tPA51Em6Z9mhnhpCi38nqINP0=; b=iA2yXx4EA15yUw/yOjU0AuiwEqYyrNr5NDDIxak14xUNmSy0CtmUm7YrEr2XpwC8vC oYEj2rPusXrgHkCik7k+/9UQVtbL/5Wme0hhow0KPOGbga2CasGtOm1lPX5mOLZoY+bG G/qWYC6pXmxPi6t/NswVQKWDQfhVm6Rtix2zZn9d+CP8xuL2vbIeGx1Q75OGGP+cJQYf oJrIfhldEFJjURVVw1FVxHplq+bRAimkII0JDgc1/jXuR+KlLTrO7Lv/Ub2n8XR84IPC YwxFftSot6UVz3p+OUCGvyfGykgfgMWwyxxCEJBSplxcfUFjoCkftr6l//7vWZWK8Lg7 u0eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263576; x=1790868376; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=LspDXWFA+IgaJM8a94tPA51Em6Z9mhnhpCi38nqINP0=; b=dIqU9YnaNHRV6ZOjJPtfX22zjpcK3bPBgB/niykyvVVOuYIhW+C1YkRyzT9O4g6dLm SS33rTN+eFJ31ZABu8ePksSWp+vcFH7K/7clUSaNKgFq6vGvEMco9rNoNk27+B9zAkMi nenPP2yj9bgadXfNKm1hmJDY2EQnCxDMxf9C3h8DK4E50YFR2v21bvMoL5YUksj7gQzR J93+jx/30uh70zfZa2WoG5AsoaFTtUdUpgf8dEmIlX3mjG5LUmsc3vEZdibb6mlKLLe7 G4aHeuTZMfRN+R9TwRFttjr4r6cKHjmd+6cLHdZIQqNicwJ2lSIKbPOb+L2AXi5j5AtT RFiw== X-Gm-Message-State: AFuF++lKHBGLg/mv27jFG+vdhgzLUmaq/QKOTiWu/Q9VWp3mmGczpqC2 cAdaKHRP4O1XRJY1o1zyM+EYKMQxdCXXawWEHJeEtoLsyhoeXzphcOvdayKfpUGHHkyELf3fJvI o+XtYFvZZ8obkMjm3+CU3iyyZjfYXk1ZrL6d+mmp9rGu4Lchv0ZAGFNuTM1MOaF/oSw== X-Gm-Gg: AYBFou2g4MDrRQeXnEfIciYWiPcOguGSMIbIZAlPGt9YYNB1gjjUtDdWHDr27yLm/H4 rEoL/lRuf3FoZIzWfHryi6SwEb/VG+hU/wW0z5+kkfmixD1ZudaJYg6AJwqfR1YWr3loa1Eo1Qg HypIntFA/QapMyAwjcly5IBW0DNs/G7FLiSfaLpLakrfg/4Kmwjo/MqYGiTWrAr0nvvSktsKSgE dzEkRpo9mANb/Hvy7KABRnk0Tzn6lzrlTh0BsrtoPWXJ/+JHuCIoCwDou7+rZMy8LEoNUBqvuCh 7rWGqaD2yyF0aj5TdjTNr3eDCA+xysyrWR4aKgHWBZeOm+l0GCrv5yn5jaxu01eeRfPh5nL8Ikt tZnKmq/XeGDsZyN0uWq4zf/lvQdwGucErZjPrmqwu X-Received: by 2002:a05:6102:3752:b0:79d:cfe4:7202 with SMTP id ada2fe7eead31-7af1cc9e29dmr1606381137.11.1790263575577; Thu, 24 Sep 2026 08:26:15 -0700 (PDT) X-Received: by 2002:a05:6102:3752:b0:79d:cfe4:7202 with SMTP id ada2fe7eead31-7af1cc9e29dmr1606355137.11.1790263574989; Thu, 24 Sep 2026 08:26:14 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 15/18] target/arm: Access PSCI state atomically Date: Thu, 24 Sep 2026 17:23:50 +0200 Message-ID: <20260924152353.36209-16-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX4k0bvAVISP5v RWoeDVYo3RqOv0/vNGgajtdpWHZLTqMS02n0tzu2qHMt3FBMKCLpc2HRQta26esrMPb34Zem9+F 95yE7y3TiSW2kbU/ydi0jM9dMiKcOl5eaoqXwuDxgj9DiZKejavdeUjvifI+wn8h4vyBLotesfO 5NTThscbr1wcifakA62aoyVANhJJMG8X2phWrZS+Ea8XCe8+s65l0irxlYK6qn+tG01aVfIUjbX yRUHFLQnfrI+B6JmRZxY8e7DfxUHGWvQB3QZDB7xTG95zfy1bqE7SGq5xLiTV36UTBW2tocYk/P EEX+txg7fAwaatpmfZv9RGFlaUGDZHVPYbbJNcLAwRvTzWqqJKNUjUJbslQebURCKNKq8R/vZ9m YCDRPgg+TQtAcIjOMrVB1AiP5/bZ85gHr5Zb778Zxt3jhDqcYmkt9nNnxa+Xkq+PR/PUWYCDErn odrXUzgaAOe03voCp8w== X-Authority-Analysis: v=2.4 cv=VPxIDNPX c=1 sm=1 tr=0 ts=6ab54118 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=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=MMc1H2EL_fK9NYWBrJgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX85/A5RBln+ge 3lQNu0nSKpUkBgIzarp0RyHCE2AlmhQoEiEpPDlDGm04DGBgzmfzmpLoS46Oq5BASYu4abFjLxk 29GDaIaOD8vk6HN681jCC7jpZE0QOSo= X-Proofpoint-ORIG-GUID: FH3LFrkU0mOuedAVYb6_qAnTkH6BD5gb X-Proofpoint-GUID: FH3LFrkU0mOuedAVYb6_qAnTkH6BD5gb 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 suspectscore=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-2609240063 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: 1790263666418158500 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 Message-Id: <20260923171116.31276-9-philmd@oss.qualcomm.com> --- target/arm/arm-powerctl.c | 4 ++-- target/arm/cpu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c index 213e7ae056c..ef14a1f8a94 100644 --- a/target/arm/arm-powerctl.c +++ b/target/arm/arm-powerctl.c @@ -49,8 +49,8 @@ void arm_set_cpu_power_state(ARMCPU *cpu, ARMPSCIState st= ate) { CPUARMState *env =3D &cpu->env; =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 static void arm_set_cpu_on_async_work(CPUState *target_cpu_state, 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 19:12:10 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=1790263659; cv=none; d=zohomail.com; s=zohoarc; b=ev1+Cw44FsdH6t0DyTJ0+n45vR61xzwnqhfGqOeU+Ato5fRA/gwNZi8ljHxrqPtdkZ+AjIkpjq9kCNo1G5gO4DpHPNDzROn0bC+Wilcnd+fQXBJ9k7KL5qoQJ5vDGXp9sMgabi+Lb0XUJtQSmFaxtnAzPSPOVLTamZNmFB6BqME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263659; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=TV4EnFsha7rDOnfHSyGGOu9kiFQhAyq3Fkz+DerTdDY=; b=TaFWtVT+1rGRTZfP4SaqOMFyfbiOxFNpJmEnWZfGhT54unS02jY1XcOVUNaobmLyRb6VJVwqoFiTz8U0jCExWEYAVeda+xp1zuEFDcofWKgi+0P0iMOR8EtN+10wWzlJ2SsR+S/+g5zgpZS6x6wcIKevJ/7+1W9NThRAx6yI3rg= 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 179026365974191.8265980023042; Thu, 24 Sep 2026 08:27:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lLS-0004RR-RY; Thu, 24 Sep 2026 11:26:46 -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 1x9lL9-0003tR-3t for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:27 -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 1x9lL7-0000Xu-7o for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:26 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC4bWU2749268 for ; Thu, 24 Sep 2026 15:26:24 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 4gw1s919nu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:26:23 +0000 (GMT) Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-97e9cc5ac86so418111241.1 for ; Thu, 24 Sep 2026 08:26:23 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-488687791cdsm14708435f8f.22.2026.09.24.08.26.21 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= TV4EnFsha7rDOnfHSyGGOu9kiFQhAyq3Fkz+DerTdDY=; b=ZsEaKv0UETb7diy4 bQrglGTSYpF1iH/IkVBIpl6C/0YwbK2wEtpl4FuGA8bYdeQtrfqzCbZBxNBgGrxy rnUX+4OKfKfmmRKSC0mM8HFEbOlLEFAU9BLrPNNBeBINVgaM51jSg6v6PHTmIjeL h+oyS1z+HKKkVeCloeDTFADUVEuZn0RZduqSVV0y3Md+5KNunaqbDcORE65G8JHE OMJdoRlEgKLnnjEMXPbLjAplEC+hNnfMEO5CvPqiiw1aBkvYmwXhJFAfeVYk3hE6 x/wbnV661fKJacG/HWbJoa6ncozrOBbvBmT+3V5sVG9/qhybQY2p5nEmNy5itwsh 2GstMg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263583; x=1790868383; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TV4EnFsha7rDOnfHSyGGOu9kiFQhAyq3Fkz+DerTdDY=; b=C5/wey8xZl38/yI/XwEgTm/l0mnHTkFthe9NixSHFFuTx/LklwsTuZxjLk4qKLfpph D4GZjTSigEMExP+DbEoYT1MM5KlL5uoDqnOdAA7iuh8YpD+DwVFw3k1UCVPvy9Nd2Fgd CCZMANSt5qfBmBpUoxHrc2ti+NBPu6sDG/phAGphKebuA9TRpChHSTY7Ifh18SSN1d/o GX2RA6OeCurlYNQWIkzJBQEwyAFLcyRV6nYxNvyTGmVOQJsgr3QPcS3hzc51u6GTW+md Fy5+Atd0aOGsdojybUIE4ESq6yc+oUlHf1Zog51KQ38uxxLBn+5yHuyvwgUHH6cRDFV0 biBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263583; x=1790868383; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=TV4EnFsha7rDOnfHSyGGOu9kiFQhAyq3Fkz+DerTdDY=; b=L9N9OY6SokjmANkwsxkD7awEpONJq/jY+c914QPI8F0x73W3aDsNwkN9AWdDssFlzy h33J6AOrV4+Du8ZbBkpysOAdwV6ZqRJSfASPZyRulx1YyeWRUN7sCwbn2kNf35fFrPBW 95+fit11n4CtO8ZG0AaLKOf6f86lB+B3IQSKwNDp7p1Z18w3ozS/u3Yung8cXkwGsaoM XKEEUk61z7+0buTygERRkv3Vg7vkYSYnaz6GlHNTvXdPL8yrn8HY2FDCx7kMqT8zImb0 eMgYVrjCwOCDH+W8BIQUML5xIWJORWbjuTrPQuYNkRIHnBovSmq+UEEd12+Tf6bfEKSY zV6w== X-Gm-Message-State: AFuF++nu8DGpW1+CV4F1K/dleQm3+ATdB2Pll1nbAksKEjcmsZnJF2tq D7FKyIXYsrxGQO9GXludLwqmleftltdfFQse9LtnLG1Rji2V8KiNNzcFfSok76Ot2tedKs6asEm 4kjqXhnx+nkWebX5bAviqbKcWfxFTa/S7XGCSvTMk7cCoJxpXbdX2Zv/Lbe41m00faA== X-Gm-Gg: AYBFou26t7zjM57yNiu58jEh/6clfqRE+mmxiLm58PMvO+6k52Ofu6nfzPkQMemMhB3 zZfd4DFH5arjBKJRY8YC9wt8g4Fn2gStqDzt2BHpbj5RyWqWBJTg4W+B2VBz1SLAAetcR3cbwY1 mvsGYBf7JXDCBafDDIa3ja861gPBpColj/7eeUZ92ruM4Q7CPVN7uu6fI2Z8Nw9ZcsgCMhMSH13 0YG+XnBmPEGarjHzE5iJWcokWLTip9ojHMgdrdArXJgzD4wd/bJ3Ats2dlRlqegSXYtQZTqmdxo 2lKt3uHB6eZOJi2EqbsPNZ7iQrKa/xe8xzdzuldW8EM+xH7nfEArXYH65rs5hJO8T/jnrmaqqLA WZbAVmnrzM/5jHGtHXXKurZLra2/KHjkHR88aDGPF X-Received: by 2002:a05:6102:50a8:b0:7a1:f980:e938 with SMTP id ada2fe7eead31-7af1e4f6eb1mr1149644137.20.1790263583315; Thu, 24 Sep 2026 08:26:23 -0700 (PDT) X-Received: by 2002:a05:6102:50a8:b0:7a1:f980:e938 with SMTP id ada2fe7eead31-7af1e4f6eb1mr1149632137.20.1790263582669; Thu, 24 Sep 2026 08:26:22 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/18] target/arm: Access halt state atomically Date: Thu, 24 Sep 2026 17:23:51 +0200 Message-ID: <20260924152353.36209-17-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX3P6oMToJZQZ1 9VY6JLIsxTrNB8x4q+F/RkLeGmtGBttpapKunr6Qtw8M1vATP+AB2sNmKRVCCyq5sTJf2Gs0qJa B53tuAoX14XQPgqfjA4+2rvPqfHKyP8KQb3s1Zc3F3lWH0zGYgv/Bb2Yd5JamN9upMhG+4lMPvG +GL51Oo/TgROuOhDHV4wED6VIZnWwLriwmQVNNmTiMXU8na/NVPx3HCG0j3nG/RF3hXNxqHEPvq j/YlxZaheCJZPLQq9X0yOG936Fn2V8lwEVAT3LtsEcuehavV/EPsLoyskw7PaCC4K/xhQiQiEp8 /h/JoUCJp5VWxXUYsb2Q9CkSg/7WEFtf5tSr/RjcmuhrQhH3yVImoTMO0a97mei01Pg+72vWFwk k8BFJlUKHlKSo8aaS06RY+McOwd+6jLldHC2RHjPN3LHJQPNwI077HF93bOGNemoQX4s5DHkgNS vpYd394f0MIHVCv0VRg== X-Authority-Analysis: v=2.4 cv=VPxIDNPX c=1 sm=1 tr=0 ts=6ab54120 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=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=BUppp-h3xPyjPovRqvQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=TD8TdBvy0hsOASGTdmB-:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfXy1EJsQT/VZ// CVNEWGe1ShEh/nUPa+1Q3YPG7Ml/N1IoVXLWYQvc3YSMXdgBU0NoBTBzKcBUjGEKptbGeXAZyfl tPg3fmQQ2d4Lz80hXSV7HVF+otX1xK8= X-Proofpoint-ORIG-GUID: I5DaUyWM3o63hbkRSJ1USaBWT3M_H7EY X-Proofpoint-GUID: I5DaUyWM3o63hbkRSJ1USaBWT3M_H7EY 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 suspectscore=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-2609240063 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: 1790263660494158500 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 Message-Id: <20260923171116.31276-10-philmd@oss.qualcomm.com> --- 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 19:12:10 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=1790263666; cv=none; d=zohomail.com; s=zohoarc; b=K9rmIyCp4bFMJ6wNHkRW+8ynDj9AUh286SQkwSR4TOnWFy8XhHPLR0rE3EJ5Fc3Ip5LFl2EEA6SQVfliFiXaIYUFPk7n9mxTSqMneMhP/iNmZp1NfEWMY1g4pQNmVuIgQpImBcnHYRJDi/zQunDnJvPmrfMVMCNkWa+ZoIEihvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263666; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=NgErSkNw1Kcg7y8aZEKk46GFw761x7MCaXpzJHcfPaI=; b=InkNeKwCeOFSPPT8H9babYNQLmyxZGovA7N63xoosRJ3D+4EVVYPUlmCpCkzEf8CvWxYKh6VhGJXhNHTL/XT95PONgbO5LKsKXXTQvU06HN/3r76ShEJGLL/4843VMRnLk0HsFHeoWwG2yoa6nX/vRZL4YnpvBxRTHS4xD4ia8Y= 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 1790263666101254.64923240550092; Thu, 24 Sep 2026 08:27:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lLT-0004VP-DQ; Thu, 24 Sep 2026 11:26:47 -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 1x9lLI-00049f-A5 for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:42 -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 1x9lLG-0000YL-Ih for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:35 -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 68OC4lPw2285758 for ; Thu, 24 Sep 2026 15:26:32 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 4gvx8ajd08-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:26:32 +0000 (GMT) Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-7ac2663eba2so1628817137.0 for ; Thu, 24 Sep 2026 08:26:32 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4886877a19bsm16428480f8f.25.2026.09.24.08.26.28 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= NgErSkNw1Kcg7y8aZEKk46GFw761x7MCaXpzJHcfPaI=; b=YkDZ+gO0cHTDMtVO SPd0VJOhVbYu3C5Ov1aY9Uvkhhy6KcbHqvhcIfmkqbiCygOsw15fri+2bF+b2mNl 6AHfjxmbcKAWQa+KKlXjUNArqUXXAHatmpVXZQFYy00RqkqgvqxxwP+vzd9UiLvw oZYYicBA8zEFafH40nffLfuS9EldbX42vltrr51tFqZkyK/QoA2IY5aubiDJTLwV PauRb8x9mQLOyMFP3g5KNumvn70Ze812OJEu5plhpWC5QazLAOZ6WaALDXoU+svU Lu05gZRWgTuT06x4eL0Rgk4EU8fPfRbIMiKHcwr9e7ah7c9xOQOZe5qX3bJg4C1U IqhfyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263591; x=1790868391; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=NgErSkNw1Kcg7y8aZEKk46GFw761x7MCaXpzJHcfPaI=; b=FTBLXfLShCbnAT3Z7CpQ/c/WmQ+ZqeG+6yG8vd/Kj9T02tnz5EbWf7rb0Q6D3X0L+D yfKsxkrNqV6VK5iNDWVASVLBg2AJ8rRw4q+UfGNo2J/t4Vnpwe0rjXbtcKvz202XyYoX V0Y4KKFSijykkT7w4W8JpgE0TXp5K+zAORTJsbJEQmhJ0lq/iXCNNdDsYbZ07fOUATXH X4NF2xR/2I+CA0LP2F8Nk+h/kXap3EvBkJINZwvPmCWu1kVEPm4iscBi4nuoxF2LR9k7 8grPYx6gvXifUeh8k0brA1+D4hoYvMkfxy1SkQFS8j+3XVlg26k1YRPpUyqe2q3j3RZ7 lu5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263591; x=1790868391; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=NgErSkNw1Kcg7y8aZEKk46GFw761x7MCaXpzJHcfPaI=; b=ELPkDTqRGl4WT6Y/ZYJrJhpjXEuJvG2418TQ0o1bJQSwyPBhknE3KxoP6VDHNLE0I2 jlFS9Gq2gGkPp0ktFMXhRX6o8ELEI0ydN2c4kLw6v/nRHFligUi7gEBPaybRTFT+TzJQ 4wCD9gI14QrcBF9xBc73nOjI4bi4aqmXJmwVQUy8j4hMbHYltGgN8VZCyhDLwXJogAUX HpKdSv6VTsLccSe1fX6rhShShmzXXq5tylHd2GToR1WAn1cqYdwePsT8PmJLBp3So39p ynG4jpUfJka7WS4ZVvxANFJef3kuAAQF7SzD7+zxn5Jpw7ljY2HGhTfMhYYYbA58h4iP fWEQ== X-Gm-Message-State: AFuF++mKXoJ/WzbMGHvDoQ7zH3b8n9kZ9QhdwtiCx7eFOOCeyEUH/l2+ DMFGw5NEM7WZfmTcG+vF6cEYBOLS+XsQOkdA7aqEzSIW7ILZjjv6JIui4LS9N8GGmfoNHZTzFlX O+P/jPUDYqPY3iA+2bDLoP6QT8sq12pRDNuc5uRRVq7OChy5jzFaEf56C3cbS3BfIrA== X-Gm-Gg: AYBFou0paCAMAHOx3s/ZoIr3cBFEDWx9rWjZoPD/HwDLQqiEM4Ni1YxWsxSzIEcEqFT nU+FoKBnsDaX+SEHoepor+5obc0ksZ0gHZ29k5ROsQwAOhTY9cPWNsALVz2nQtxwjecWI3p6v/V 7uOLSedZn0XHNiw+e5n3Ulm7lXpvjWv5n7nCVu/7hCJntrP3qUB+g9TG9ZSKizw23BdaNTXenBP XsHJvKm7Kla08XBZtYf0EYzSUHoi/CPVhHok3E+Y6JT+3SpQRXeHSuYFteSHE3MEIFOUBW+ipJb il7btl9MTaGCYHVjiJzXCRaVGRB3PVTisekGIIIbYptptDXpEE9BirE1IEpTsehLOPUp2KarTNX E005+ehQkkesMeb53+zqqvXHeFODlpReqXDv8iJrD X-Received: by 2002:a05:6102:c86:b0:7a7:198b:674e with SMTP id ada2fe7eead31-7af1f4085b2mr1490665137.35.1790263590900; Thu, 24 Sep 2026 08:26:30 -0700 (PDT) X-Received: by 2002:a05:6102:c86:b0:7a7:198b:674e with SMTP id ada2fe7eead31-7af1f4085b2mr1490643137.35.1790263590212; Thu, 24 Sep 2026 08:26:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 17/18] target/i386: Use an acquire load for interrupt_request() Date: Thu, 24 Sep 2026 17:23:52 +0200 Message-ID: <20260924152353.36209-18-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX1t4KjHwE3uog xOU6696gtFeB6OW0xsElsrptrm/F9kdbTDMQ4eTiHY4GhmgQ7VeLOiKnrCCL6f0dgdDt8JBPcrd V2mkeN4zZHSJlWyLirZcdg5tFdcTYKA= X-Proofpoint-ORIG-GUID: tB6MaplJ-PUSRo7-9AvLZwY-cdzoFKU5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX1Z4F41NMOCdL zrDcsmsegxMu42MS71JCCoE64R4kPqylkHG9nXbNP6OzmFtGzXUabTtfjl3PvdiHvD157kPbpAB KSNxxkKMNC27/wzgSmBspxS+QzG7g57EiEAowNr/+ijFPhEOiPvB6O1o0FKFXNTnJ71aLYug2xs hDxVx2gZBgxmy2XvHtsbqnbXixxEuPGtwrSdp5ntRi2LJ6KL+GNrEUrZ4lA7P/XjuaaGfxE/140 C7ueUfpY8eGFIWbLgaqon6RASW/wS0OsdXPZT4thl8gBF+6uVWGKaXEgthl59tqidxf2jItGwbX Sf7JT76R64WqhmZLcmwn5VJPyWFgwVFAxUHjKqMwIiizdsniECqvzGsrWn4HVsVXqLvvKZeF6pU lGCyWxhgt5TI1J+U+7VwTR6Nosv4BZGab5na8OUb0IfwsN4b+GHH5MvzMxQ2ahP6XP0PWeKaKK9 Ox/gDwLX22GArhKV2mw== X-Authority-Analysis: v=2.4 cv=a6SlZkSF c=1 sm=1 tr=0 ts=6ab54128 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=yOCtJkima9RkubShWh1s:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=8gObA4T9cFbzhFTk6d4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: tB6MaplJ-PUSRo7-9AvLZwY-cdzoFKU5 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 spamscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 impostorscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609240063 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: 1790263666415158500 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 Message-Id: <20260923171116.31276-18-philmd@oss.qualcomm.com> --- target/i386/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b97f144aea5..f3bc6911c10 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -10640,7 +10640,9 @@ int x86_cpu_pending_interrupt(const CPUState *cs, i= nt 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 =3D qatomic_load_acquire(&cs->interrupt_re= quest); + + return x86_cpu_pending_interrupt(cs, pending_interrupts) !=3D 0; } #endif /* !CONFIG_USER_ONLY */ =20 --=20 2.53.0 From nobody Sat Sep 26 19:12:10 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=1790263660; cv=none; d=zohomail.com; s=zohoarc; b=FlEDKp5YpWfnvb9AXxl29sej5SPK3yhYr3lRLdyJUH/nV6r9hOeW/CP+JmV5x4gfZMSrW5hKbSil4G9bm0p6utR59sddeuirxuttaw3QN1G5o3+oNNKhbtEEEvnjCFsDuJeo7gLD8bSERadKUAT3/soqU/66aOX1ihJcFHzRm5c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790263660; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=1Yi2Xq8xePL9IFa/hO0y+R8c/Rr6KsL/bzE+yLfsjuk=; b=a9hz5xN9pyvjz/4MIbyC8ENI6dN5NJ6aK/Tqau6JegX3MfKzaDpT+0+FXREwTn4pMZdLv0nb6Z6E+6gyk0E/RNz7WBdIEwUAPDrvRnZ76EyucWL7+UyklfPx0PIhHjYhM1T+56W3w+aZA7CgPrz5ZmLU3bi7gPu4QbhlO6Dq3rE= 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 1790263660764213.25579234162774; Thu, 24 Sep 2026 08:27:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x9lLW-0004kL-P3; Thu, 24 Sep 2026 11:26: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 1x9lLO-0004EZ-Lz for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:44 -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 1x9lLM-0000Yy-OO for qemu-devel@nongnu.org; Thu, 24 Sep 2026 11:26:42 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68OC51OR2595126 for ; Thu, 24 Sep 2026 15:26:39 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 4gw1tjh915-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 24 Sep 2026 15:26:39 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-7a532e31dadso2114197137.1 for ; Thu, 24 Sep 2026 08:26:39 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fe0c3731fsm141492695e9.2.2026.09.24.08.26.37 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 24 Sep 2026 08:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 1Yi2Xq8xePL9IFa/hO0y+R8c/Rr6KsL/bzE+yLfsjuk=; b=Suy9Xux7YnEjBxZu AK7AUnzfQm3vUMu6BEyKb/eoC6ZgGzHc05Esjh+IXg/BDULep1VUrC/8KTKpaM8J 1kW59Y9kiNlsJMNVTAKEUPGeOo5WJQMLKmSIFTwAZHSAW2udW5hZB4Fp+zg+LGqA kydKJYFw0EwjBg85kP5ijxdY9KCU6+tlBiVGBJjCx86ys8K0SOqKUM8ef+jaHax1 Fsk09uEtjw3IrDkPq5puVlPvMr5UQDBC6yv6hmcvS50t13T/W7o5xUpK9lFm1BO+ YcVHGgg1r1tjK2/z7z01KVuSLpc4gCfjWm9/rZHwy5IOwswUgiuAF4iyo+DMf30x VirDEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790263599; x=1790868399; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1Yi2Xq8xePL9IFa/hO0y+R8c/Rr6KsL/bzE+yLfsjuk=; b=e7kwi148pTqs5FSRQa3iCxRfoCxT5gn5SA387hbGi0xBstcizHL5Onyw7cziyd+Viy HJ+Xjh3T955erzp7kQSBuydTStzjB2NJJvxHvcp3D6R/d6o4lO7uOihFTkTOP3V5u04X wLgzizwJvABFwxhaN93hrXZMDcg/Jzz8d9gJcjHwZX5u7x+ScTeetwer0D6y1o15JtB4 NJJKsF/fyylQ+lqq3Z8wCduu5sfih4TnjYICm33nUcVCIxC4Rh85q4mGgnspRbIBUmRE vwJzXn5JdMbD5hYYUi7wSuRiAsTInT7CWH/xI66VzDPLC5iklgBDqDMpe/XLIFmTwDyl nCBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790263599; x=1790868399; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1Yi2Xq8xePL9IFa/hO0y+R8c/Rr6KsL/bzE+yLfsjuk=; b=NilKIyFDWM464ppYVGIHLoH2jSs818DhANhTcCIY2+JcqFKr0WeNanDvmW7bAy3nkR Bj3CLOty8inhkHGSR8J8oNp9Vf68AL3I5sJ4mleVGm7Eq2MIpEbvbS9RWJFZjOt/L2vJ 6lwsscV6DST9MmPkONaXtFJqCvpqZubFh+jF6doWe6hqmPokKTEh4rRz0487JVHRbvac s7Rc1M9se/g+UElVRb/HEv8APHPFrl2hJ1Deg8OBomJWF7VXbC2oR5A6cIDLEFFBkLlQ ofdFBwq1A9p1/mngAo5hPleMZYWUATaKsxPIzBoFpXMz62wWhK6TJvcM2FnuVlQXZ9jT NJRg== X-Gm-Message-State: AFuF++lD6Fk5KXnO8w6B9xbBJdtxNyCs7zLeiGRfMHVtxGrhs/pDKCD6 j17ymvS1GWYJfo819qUPknvp2J008rNBLKuKjRc/1mk7qumRyWoNid/soUXOwP9KvMUojp0V1XF XD/u6Tc2bFghYiFfJmn0cXzFCT+9+aKhcux/0ZG33zMeita842xMqYFhENQehsY1jmg== X-Gm-Gg: AYBFou0K+95aIyBhQPGIp+3zg65By7oeneaALGvRUs5C3hXass1dZfUq/WYezA5JR9D wxoWTa5ZOhzV87+ka01tp+vW75EjeK1ATqVAtM754KjiGP5ytmQlSGLC+ADh10Tqr0G1MQUTzqG oveJOs/8eRVmgbUEbA2mNTRTrNutYUmadUOLZd4IrZsWTE474VM0dkUuobva9M3mrVqdaxDCl+l 5aV4l8D38Jp4LIpWPyWB4nB6ymv8IfUcjWqblaucn/fULeZWbHNUv1+GyJkSBi1Cbx7FXOLEpEy bRiWt0WTBAbr3/HCDZarXwnWjVjAaiaMWOZzbjtFAf8Xqah4h101Pnp21UdUIiCGCYscE7B7Fjz ZZOx70ugwWGDAtC7uuKQQFq5gxTdbvlQeLWypUQBb X-Received: by 2002:a05:6102:3e84:b0:7a7:79c5:d3a7 with SMTP id ada2fe7eead31-7af1ce99adcmr1679679137.12.1790263598764; Thu, 24 Sep 2026 08:26:38 -0700 (PDT) X-Received: by 2002:a05:6102:3e84:b0:7a7:79c5:d3a7 with SMTP id ada2fe7eead31-7af1ce99adcmr1679656137.12.1790263598069; Thu, 24 Sep 2026 08:26:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 18/18] target/ppc: Stop vCPU thread before calling parent_unrealize Date: Thu, 24 Sep 2026 17:23:53 +0200 Message-ID: <20260924152353.36209-19-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260924152353.36209-1-philmd@oss.qualcomm.com> References: <20260924152353.36209-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: b8rbUwkSFI5LXnBZ-r4kLC-D1bW80-bL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX0MVQrVFI1Aqv LCg4hWe5LvT9ZsPIiZ4l0noTWrZStXUvJUlpxyoFKQ8TF13dmBpNL1NjNrewc9vnTC12oLnPE6b TtCgfGPenOxTn2Qz7AATRxHfadeAu27Z22/zkZk/XLpCcw8UmRaDxAVxiE0OQP9+CR48HbfcpDa JJbY7N9o3jz3lBLF6GIB7DrCO8tocu49/I5xEfb1EKD3G0yUGKiO7r/KnixYKuW8uVrNSi8G3tg Q4ozShyiHhjCaZPrXfi2QKhVn4Hj7lDkKmFdo4qopQEKKcUknfEd0IwmtjO0Sos6VI9l0dDIJL4 SIVQ7NX68jOjmqYYmJ+2wmOQ4OnezuGH0uBtisf2o0cmyNsr+iuW1kGAqWB5mC84s2hvUJ+AYxd mHcYjo/Pihs8HfTinZH65h/Ido2qTA03sa+yzg6tT5awmU0hA5fUJciiGPH1zx+NqGT5t85WevA 4Mg8sctUykvkcvnmNNg== X-Authority-Analysis: v=2.4 cv=cK11IVeN c=1 sm=1 tr=0 ts=6ab5412f 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=_glEPmIy2e8OvE2BGh3C:22 a=VnNF1IyMAAAA:8 a=69wJf7TsAAAA:8 a=EUspDBNiAAAA:8 a=pGLkceISAAAA:8 a=Mypnz8zva-T9gF3EKnkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 a=Fg1AiH1G6rFz08G2ETeA:22 X-Proofpoint-GUID: b8rbUwkSFI5LXnBZ-r4kLC-D1bW80-bL X-Proofpoint-Spam-Info: AW1haW4tMjYwOTI0MDA2MyBTYWx0ZWRfX++4/LNwKcesL QYBFNETQ7b0lcaHJmgg7x77FMYnO6HU9I3a//aifexdis41JG1ofbNxzTtmcqoeqB3etqI1k5sv MBJPjBfvoXP5mZoXGPZ8NP36FoRHvsk= 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-24_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 spamscore=0 malwarescore=0 phishscore=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-2609240063 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: 1790263662431158500 From: Shivang Upadhyay During CPU hot-unplug (e.g. via dynamic reconfiguration unplug), ppc_cpu_unrealize() invoked pcc->parent_unrealize(dev) before calling cpu_remove_sync(CPU(cpu)). pcc->parent_unrealize() calls cpu_common_unrealize(), which triggers accel_cpu_common_unrealize() -> tcg_exec_unrealizefn() -> tlb_destroy(). This immediately frees the CPU's TLB tables and structures. Because the vCPU thread had not yet been stopped and joined via cpu_remove_sync(), the vCPU thread was still actively running its event loop and processing queued CPU work (such as tcg_commit_cpu / tlb_flush). This resulted in a race where the running vCPU thread accessed and freed already-destroyed TLB tables concurrently with tlb_destroy(), leading to Segfault (due to heap corruption). AddressSanitizer build reported a double-free: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D121930=3D=3DERROR: AddressSanitizer: attempting double-free on 0x7ef8= f3438800 in thread T14: #0 0x7fe8f74e5beb in free.part.0 (/lib64/libasan.so.8+0xe5beb) #1 0x7fe8f6cb8f84 in g_free (/lib64/libglib-2.0.so.0+0x41f84) #2 0x558bf6a391b1 in tlb_mmu_resize_locked accel/tcg/cputlb.c:249 #3 0x558bf6a396b5 in tlb_flush_one_mmuidx_locked accel/tcg/cputlb.c:296 #4 0x558bf6a39f91 in tlb_flush_by_mmuidx_async_work accel/tcg/cputlb.c:= 390 #5 0x558bf6a3a200 in tlb_flush_by_mmuidx accel/tcg/cputlb.c:417 #6 0x558bf6a3a22a in tlb_flush accel/tcg/cputlb.c:422 #7 0x558bf73f31ac in tcg_commit_cpu system/physmem.c:3068 #8 0x558bf6987c55 in process_queued_cpu_work cpu-common.c:378 #9 0x558bf73a9913 in qemu_process_cpu_events_common system/cpus.c:402 #10 0x558bf73a9a46 in qemu_process_cpu_events system/cpus.c:421 #11 0x558bf6a65974 in mttcg_cpu_thread_fn accel/tcg/tcg-accel-ops-mttcg= .c:90 0x7ef8f3438800 is located 0 bytes inside of 65536-byte region [0x7ef8f34388= 00,0x7ef8f3448800) freed by thread T9 here: #0 0x7fe8f74e5beb in free.part.0 (/lib64/libasan.so.8+0xe5beb) #1 0x7fe8f6cb8f84 in g_free (/lib64/libglib-2.0.so.0+0x41f84) #2 0x558bf6a39a91 in tlb_destroy accel/tcg/cputlb.c:345 #3 0x558bf6a16354 in tcg_exec_unrealizefn accel/tcg/cpu-exec.c:1094 #4 0x558bf693d073 in accel_cpu_common_unrealize accel/accel-common.c:117 #5 0x558bf6980e37 in cpu_common_unrealize hw/core/cpu-common.c:279 #6 0x558bf6980dfa in cpu_common_unrealizefn hw/core/cpu-common.c:267 #7 0x558bf763ef65 in ppc_cpu_unrealize target/ppc/cpu_init.c:6965 #8 0x558bf7872199 in device_set_realized hw/core/qdev.c:618 #14 0x558bf756068f in spapr_unrealize_vcpu hw/ppc/spapr_cpu_core.c:209 Fix this by moving cpu_remove_sync() before pcc->parent_unrealize(dev) in ppc_cpu_unrealize(), ensuring the vCPU thread is stopped, has finished processing its events, and is joined before CPU resources and accelerator state are destroyed. Cc: qemu-stable@nongnu.org Signed-off-by: Shivang Upadhyay Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mukesh Kumar Chaurasiya (IBM) Reviewed-by: Amit Machhiwal Message-ID: <20260923121444.154175-1-shivangu@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/ppc/cpu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 6c626843c93..b711f9c0a85 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -6962,10 +6962,10 @@ static void ppc_cpu_unrealize(DeviceState *dev) PowerPCCPU *cpu =3D POWERPC_CPU(dev); PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cpu); =20 - pcc->parent_unrealize(dev); - cpu_remove_sync(CPU(cpu)); =20 + pcc->parent_unrealize(dev); + destroy_ppc_opcodes(cpu); } =20 --=20 2.53.0