From patchwork Wed Jan 24 10:16:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765627 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036320wrx; Wed, 24 Jan 2024 02:18:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuuIooDY7Hs1zNGHlKAIdVfbs551tQINEcq8dIjRL6zZYPO5DcR1kAq4zqvlY9j7Nv07Te X-Received: by 2002:a05:622a:180e:b0:42a:2f9f:e4e1 with SMTP id t14-20020a05622a180e00b0042a2f9fe4e1mr2730531qtc.12.1706091481995; Wed, 24 Jan 2024 02:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091481; cv=none; d=google.com; s=arc-20160816; b=pBD2/G9CczMP5Qu93b4doOuFCx8yTzM48kcx1Sy2jZQjxEpDLCxuJ3fNMHN2fTfqo8 HfqqPB+X0uRtBiY2U7Le0Epz/aVjWPD5Hfc7iUoY+Kp7LhMk/MKENmAQV/8uoXBJz6fx 5PK+nV2kJmrDL29OZhgtpwW99qxN4SGwaImeNcS6RY2AS4Pn6HYzF7iJSjiu/7w5ldv1 W6OtIxMEbI7m/Ro2V9VhZmhZQjTjVLH0terFHeNPXtd3BCO6sLD4LuiCq794N8O2k1Hf D75+gRLLxH/ofAMRmrx23ncR9TK1ukHl2+upG+H3YBNQnuNqqNO9YhmmR+m3E/aEsLnn 0RuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aG1VmNa9qyKWKkyTkfP1qaYwJsyZK0k+Eh9BTsafnvQ=; fh=NbVuPqdWflDAvPSkTKr6NNYNDd7OZZnC8VcS2hE3bCE=; b=tY6PVor/YIhvRGUoK66sgUhHDaCSFpJr0zDvF5RQw3NWjpqoTJplb4yJ2I50ZSUh2o 48wD3Ijy/+inHc/93RkTvmJhpn3SDQczuhMn4IyeKkfXHsqeo2ukbp9oow6CWHD78c9S TyvT8DQhzGMUODCTZoXoJNFpzXZb0XxP1oJrxgC6uf5iTjV58bxytHBZvyQfnH/sZIF+ bIlGMmYYIMa+q8H0nqZVQJ2PBnV3zeMkUxSy/M0eqhmoFRp7E1BWHqNR65eg50EK5DuP WdfC/uzC5UoLX6gmT39QktQr4eOpS4nD3VpXR3/4E0KmpNmSK3pIupunWKj3iyA48o8U +nkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VzLi3jxH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u21-20020ac858d5000000b0042a4499a6besi5264028qta.587.2024.01.24.02.18.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VzLi3jxH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaJQ-0003Cz-TD; Wed, 24 Jan 2024 05:16:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJQ-0003Ck-6e for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:16:52 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJO-0003nP-Aq for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:16:51 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a30359b97a8so345924066b.0 for ; Wed, 24 Jan 2024 02:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091409; x=1706696209; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aG1VmNa9qyKWKkyTkfP1qaYwJsyZK0k+Eh9BTsafnvQ=; b=VzLi3jxHhxEo920rGX6gRIDmRiZj2AkSHCaXwZKpN+TWCS4+yhHuxhDKEciGgNeR7+ xmlRzUOrDC/m2/1eSaR7vBmWr/RLDIgpTca9JGLk/6hDdQ4eiX+HG26dh3KlgdQ7Guu0 YEJ8Ht2gDxtPpqq1IN6GiUJZrUvM7IglPa0FsnaM3wZOyGZOOzyjBTYhf4F4WM28dqax +g+5natMg7mVDhASbJpl3Jvq5wArg7axR6yw1OeXaWwI/IrZlJCgB+rna3JdesOyJ0UC 8AsgC+AN3Tb+58Iw/lLXZ/4Q/A/YszCTinzmEEWuY1g8qpm9Iy3WbNhUc95HZiVuSrbU j/dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091409; x=1706696209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aG1VmNa9qyKWKkyTkfP1qaYwJsyZK0k+Eh9BTsafnvQ=; b=SinOml0dtSKFTZDZUxtwZHf+Mb0IdfVGt0Sfi+vgSmCxT3rt4YLgwzisNnqkL25V8u p61k5sMeNzfrDlnW5MdhXY/qGn/32BFYtUiUhDqU1zoDo6t+vVKEEyz7xuBEC1hYHZrg MncgfFQIS9HNcfGZM+l/IAGtU4ndReDxxNHk8b7mENVCd5SWtjSfCZhpsglYpzlqsYYE tEXqxF5EWRZiwgxGdPisKHbYQz0HBOrkmuy2Pzv9nTpqDDyuiHalRD4Csab9eCz7JreH dDLiSo8qlATZLMglhmWs7asevSlGJBoESlKcI3Yhyk/ZnW1mYhugdDcLSFTC1fJ3vI7y RnVA== X-Gm-Message-State: AOJu0YwLpHDjUT5h86FK6g8bEGyCCWSrPoYqB4CkP8chiw/+eIQGA1CT kWZgfg3zICYmNdDiX/5dbL2EgpNumdHrWyS38JrCuoiliy+nLoIVsbJpSYl079Y= X-Received: by 2002:a17:907:c201:b0:a31:3d5a:1337 with SMTP id ti1-20020a170907c20100b00a313d5a1337mr120904ejc.45.1706091408933; Wed, 24 Jan 2024 02:16:48 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id i2-20020a170906090200b00a2a04c9226asm15225890ejd.194.2024.01.24.02.16.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:16:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/9] accel/tcg: Rename tcg_ss[] -> tcg_specific_ss[] in meson Date: Wed, 24 Jan 2024 11:16:31 +0100 Message-ID: <20240124101639.30056-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org tcg_ss[] source set contains target-specific units. Rename it as 'tcg_specific_ss[]' for clarity. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 46f7d53eeb..aef80de967 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,8 +1,8 @@ -tcg_ss = ss.source_set() common_ss.add(when: 'CONFIG_TCG', if_true: files( 'cpu-exec-common.c', )) -tcg_ss.add(files( +tcg_specific_ss = ss.source_set() +tcg_specific_ss.add(files( 'tcg-all.c', 'cpu-exec.c', 'tb-maint.c', @@ -11,12 +11,12 @@ tcg_ss.add(files( 'translate-all.c', 'translator.c', )) -tcg_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) -tcg_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c')) +tcg_specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) +tcg_specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c')) if get_option('plugins') - tcg_ss.add(files('plugin-gen.c')) + tcg_specific_ss.add(files('plugin-gen.c')) endif -specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) +specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss) specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( 'cputlb.c', From patchwork Wed Jan 24 10:16:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765630 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036331wrx; Wed, 24 Jan 2024 02:18:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYusW1sG8n0s/tf2RuJjUTr5H3ImQDKhBxEVQg4ALFpQOAcgT7yNnpMuFDhZIxAlCc3yJs X-Received: by 2002:a05:6102:447:b0:46a:f1b1:772c with SMTP id e7-20020a056102044700b0046af1b1772cmr2181600vsq.51.1706091482397; Wed, 24 Jan 2024 02:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091482; cv=none; d=google.com; s=arc-20160816; b=cFFFXW1zCbGUg4eS2s5RjBO9E51vMIKaLVdXWCKTqHNpx6Lpl4vBhHG0iS5AG7d3fj 4WdE07bPh83RJHvh5QjG+p+PHebw/AK4xzMASmJ9UIlMxxq1V8Xo29f4C4PAhNsan18e TO3Q8JdkF8eTVTNciHYntRZJv8q46LSPfmpg1jARU6tHuaKxhyLGU0M6JKHMBiXTvrqF fjnovpIcEOtqpts/EcbYFpHZIWTjTOmmheExe6zxqzs3kl+5zkFSMODVtTJoMrfiaAAe J3SKc3M554+tPlEtEWKkN/N1VUBP6p15oEXrpFKsRA0bn/O55lIKupwsc2EjDcI9Rnq0 Bdvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FBMlS39CW/Iv4VBfcOh+Zv0cB8PVhw/t20rhumALwGU=; fh=NbVuPqdWflDAvPSkTKr6NNYNDd7OZZnC8VcS2hE3bCE=; b=grMiRsKAIhRa0hEMG99n3RRcRDV289TYlnRqW8HeFM+KROmG/IioeJOPUHE4Xddfa+ mLQmlQ1T9J+v8p6U4FfrjlaP1nVk6GfLjsTzcckJs0rlO+DQjIZBSKllG59AuuOG63Vj 8HHtPHz9pH6Fl9MTIS0qxIXI+riPdIHUGaGQgJ8bI76tTYviXiPeWlyeLWs0A1IiGSUa QaWA/LRPjhVA0cvSBYrMZEtUEvOHico/92SAY/2IeA+aHC4ekSvJaeEYORQmsYRchEdC 9wvufGpp5ntaXnjAkoyazYb9TEcnMQOMYSugm4z0eaNThxG72Sb25STk7zqQIMy63M5d x84Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kkdr2i3B; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t3-20020a0cde03000000b00684b831fb9csi10097228qvk.170.2024.01.24.02.18.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kkdr2i3B; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaJZ-0003EP-75; Wed, 24 Jan 2024 05:17:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJW-0003ED-VY for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:16:59 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJV-0003oZ-DC for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:16:58 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2cf2a381b86so2734441fa.0 for ; Wed, 24 Jan 2024 02:16:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091415; x=1706696215; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FBMlS39CW/Iv4VBfcOh+Zv0cB8PVhw/t20rhumALwGU=; b=Kkdr2i3BB1dXg81R+RWi9qDJn3QQEEOuI7C4nuEx2ab9BEdZkuncnRWCnxZNw8YAkB G5oIjVSS3hrjIVSBAquYqq+H4DoCQzTkByzWBIvOsB2ggBjxpK4sioJzxfMdxrvBGibd yE49qpZB39HYrGXQ12bu3gGfN+89LdxV4BQq9gK1sWpRFkjBUqp/UvJLYZ+L3DtWbg9g R2AkkD2ruvaIBzf7e0vouGV8t18Tno3+EkmIRAaDGBccusojcRb04b8eVSSap4dWPY1O b4aNDMKMKyKSaabx88powozt844fgfzbN97Fz04gnw94srmdl/3S/NL1nwmUKWEdhx5H ateQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091415; x=1706696215; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FBMlS39CW/Iv4VBfcOh+Zv0cB8PVhw/t20rhumALwGU=; b=ORIIHZVpyokCZ5MhPf+rDjABkoldUMve766OX1bh3nPuDiZbGvSWEGs5JTQF+3SotK 61pVRpP+S+ldlGjfgZ4YTtQt/Ew/UfHPDoSQTIc+jdeybPNeKU4075LZArbVSWyx15RC yuEikW/XHIs0MRGWRUxBuD0wCT2KO3Ps178hArNjK7JvpNFJaQEn3Whll0u3NbOwAiOs i/nAPTUm3OXP97mxkOVXIshTP3U+UEOKnLCUBj/QNSAZ19J1x0NoE/5JSR3z2AdIFXNx Yg+SIJRcJBmgrVIHbwb+tEgdghV35w5L5kIog8PjyO+K27GbZF85uPdjJtDFroCTCkwu KoiA== X-Gm-Message-State: AOJu0Ywcm8PR3Hl/X5LWfCnbcxJTZWHztCtppc6ZzHcwfk51CsSMVYBd K4ZU9RIiIFL+pidhGHfl6Ds/YtL4XjB0AWMAR51L/UZ54koZ5w3r3G61QSv1eHA= X-Received: by 2002:a2e:be84:0:b0:2cc:c7ef:924d with SMTP id a4-20020a2ebe84000000b002ccc7ef924dmr971451ljr.29.1706091415358; Wed, 24 Jan 2024 02:16:55 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id cn7-20020a0564020ca700b0055c349e04f8sm3444326edb.36.2024.01.24.02.16.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:16:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/9] accel/tcg: Rename tcg_cpus_destroy() -> tcg_cpu_destroy() Date: Wed, 24 Jan 2024 11:16:32 +0100 Message-ID: <20240124101639.30056-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org tcg_cpus_destroy() operates on a single vCPU, rename it as 'tcg_cpu_destroy'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/tcg-accel-ops.h | 2 +- accel/tcg/tcg-accel-ops-mttcg.c | 2 +- accel/tcg/tcg-accel-ops-rr.c | 2 +- accel/tcg/tcg-accel-ops.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/tcg-accel-ops.h index f9bc6330e2..17c7ed00eb 100644 --- a/accel/tcg/tcg-accel-ops.h +++ b/accel/tcg/tcg-accel-ops.h @@ -14,7 +14,7 @@ #include "sysemu/cpus.h" -void tcg_cpus_destroy(CPUState *cpu); +void tcg_cpu_destroy(CPUState *cpu); int tcg_cpus_exec(CPUState *cpu); void tcg_handle_interrupt(CPUState *cpu, int mask); void tcg_cpu_init_cflags(CPUState *cpu, bool parallel); diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttcg.c index af7307013a..bcba314a65 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -118,7 +118,7 @@ static void *mttcg_cpu_thread_fn(void *arg) qemu_wait_io_event(cpu); } while (!cpu->unplug || cpu_can_run(cpu)); - tcg_cpus_destroy(cpu); + tcg_cpu_destroy(cpu); bql_unlock(); rcu_remove_force_rcu_notifier(&force_rcu.notifier); rcu_unregister_thread(); diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 3208035d85..0617f66b5b 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -131,7 +131,7 @@ static void rr_deal_with_unplugged_cpus(void) CPU_FOREACH(cpu) { if (cpu->unplug && !cpu_can_run(cpu)) { - tcg_cpus_destroy(cpu); + tcg_cpu_destroy(cpu); break; } } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 813065c0ec..9b84b84218 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -63,7 +63,7 @@ void tcg_cpu_init_cflags(CPUState *cpu, bool parallel) cpu->tcg_cflags |= cflags; } -void tcg_cpus_destroy(CPUState *cpu) +void tcg_cpu_destroy(CPUState *cpu) { cpu_thread_signal_destroyed(cpu); } From patchwork Wed Jan 24 10:16:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765626 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036321wrx; Wed, 24 Jan 2024 02:18:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSupLOSNttM7f+bIyhyOLBOV+8hRpYY51UvyZ8cXDAKoZOq5GwFPDj49JFQFQzRb94RnRr X-Received: by 2002:a05:6902:e12:b0:dbc:d9b2:2b21 with SMTP id df18-20020a0569020e1200b00dbcd9b22b21mr359779ybb.46.1706091482093; Wed, 24 Jan 2024 02:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091482; cv=none; d=google.com; s=arc-20160816; b=zO2/Xwza6/+C/vNaULmrN2iVgCsCkjluuy5AJWXu7ZWPM5GyUxYkXGTijB7+NlGgYY pEaGNCqlxsr7cC8CQa6j+U+AJQXQzpcItmtBJcgBfcAY93DJaUVnYJ5keWgfGedmx1/a 7YUBweDnIYm/EkMiIjKFEWeVkpr8BMiv55c6ih3BWh6WKOwFFMOYygbrelJsYOPw+3L6 ea8OD7zmchg3TSqXnIzSR0AEoC4O9qFcBwbRkej4klz4i+WCRvN8t+hfKnwS1PpPgpQW R/9PYaObdqe4/oABFbJ7c7d5KC4uWeEVmyyE9++ALuYNK/DEDbx5H5/cWzoTCY20+v6b 6DAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QCaFP/JCcM9wNK6S/97qMJvFLtrlt8qlwc6m36BcsKg=; fh=NbVuPqdWflDAvPSkTKr6NNYNDd7OZZnC8VcS2hE3bCE=; b=oMPWssV5gTet+kQmAOtq4NhnoHSx8cgV+H2uevkG9V5oSehCm6ae7HdKfzmLYPclaR TjhDb3nMX9OGWViRdVrxMyir5XWOtcNhwl4/wJZmKqcT5Nqs4lUteyZ5T62YFF1RB4/v 2SNXcOodnkKlX369nlEeVCQ7Hl8PJPFKPuAY2IV0uhkmjFDamipKKx03kAR3FsSelt7S sG9YCvZ6h1Dnf23kCqM3YVB+ZFB/abUQ0fHZMBCC5RsDQB+h8fY3oA/BUOf0nYBOz79M laCbauwWpTD4caWqa5zRPZODumqo7Awpp/LSW/SblvLA1DMqMmyZU/BPgLmbiuZY4uqh UQsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z75ITGLP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h20-20020a0cab14000000b00681903304d1si9885826qvb.185.2024.01.24.02.18.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z75ITGLP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaJg-0003Fs-2e; Wed, 24 Jan 2024 05:17:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJc-0003FQ-VU for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:04 -0500 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJb-0003oy-BR for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:04 -0500 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2cf161b5eadso17107841fa.2 for ; Wed, 24 Jan 2024 02:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091421; x=1706696221; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QCaFP/JCcM9wNK6S/97qMJvFLtrlt8qlwc6m36BcsKg=; b=z75ITGLPdKccL7TMKDO/oMH/IW9BWXWuV5maFFOIMUyrrWmcQiQ57AZL2Mm833VMob NlNS9QNFuJJhOU240IsHqSwTJ/IIcSEeQNVbkS67TwrDC2ZIvrwzpYeu3nt1EQCU4E7K /tXexVPmj1Ix0fONkbOyZcabDW/juXDBPmILKWhhXrjV0R3uC6sRlrYcZziG4Dzt3a7K 4isKeyYmbwDQX2OKB5CvkR7qTKXEYqj6VCmA/NEnMI50LmKEsjkjCsWLdeEWScbv6zBG tZXUVned0OHaDpRAS9/0uZoV3C/W259tYE2tthjIbvyV56W+B8PDNwTjJmEwxXImv9UW /Lrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091421; x=1706696221; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QCaFP/JCcM9wNK6S/97qMJvFLtrlt8qlwc6m36BcsKg=; b=Kp+nTJFVHdUio2/WGOvpHJjH3SndRQBONmpP5LchaVxIcOA3NFTVJW3W1Pvv/MqE4a lxMX7966nW7bg/DkB/vcHqQkPAZCtIFfBHvkGXJEdjZpL4QZowpI7WXhW+YYMqlepgwb +v9xV/1uvlBJ4OavmbnD5lJuD0FgbQO+qPD7ttTY3CRoM3kW67ZxT3CvADsbbHln2KF1 GUzc8yc14AvR3SMFvhFLeUgY1oQzfdkXsRwHeWfhTurtn+ZM98PvEbvEFrsxxCOOLbSf 2EIdyYRYMJD+Xfo6Noz4ZJfGT0XJsWS/LxMSZppdEW7ksuHo6zLvI7At3fBJeo8/2L+s qqPA== X-Gm-Message-State: AOJu0YzoXgrnZMEiHIY506jmIuKqvUHojCwIAMohsBGst/m0tsnK84bh ElihM+yp5t2SYK9RONhxH0en0Ett/V7TcVtjjG60nLUIkvrDIUyOnWFWHeHAzzQQNrexM8pzQBD j X-Received: by 2002:a2e:beaa:0:b0:2cd:9f51:ac23 with SMTP id a42-20020a2ebeaa000000b002cd9f51ac23mr804483ljr.4.1706091421496; Wed, 24 Jan 2024 02:17:01 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id h27-20020a056402095b00b0055c643f4f8asm2410643edz.32.2024.01.24.02.17.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/9] accel/tcg: Rename tcg_cpus_exec() -> tcg_cpu_exec() Date: Wed, 24 Jan 2024 11:16:33 +0100 Message-ID: <20240124101639.30056-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=philmd@linaro.org; helo=mail-lj1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org tcg_cpus_exec() operates on a single vCPU, rename it as 'tcg_cpu_exec'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/tcg-accel-ops.h | 2 +- accel/tcg/tcg-accel-ops-mttcg.c | 2 +- accel/tcg/tcg-accel-ops-rr.c | 2 +- accel/tcg/tcg-accel-ops.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/tcg-accel-ops.h index 17c7ed00eb..44c4079972 100644 --- a/accel/tcg/tcg-accel-ops.h +++ b/accel/tcg/tcg-accel-ops.h @@ -15,7 +15,7 @@ #include "sysemu/cpus.h" void tcg_cpu_destroy(CPUState *cpu); -int tcg_cpus_exec(CPUState *cpu); +int tcg_cpu_exec(CPUState *cpu); void tcg_handle_interrupt(CPUState *cpu, int mask); void tcg_cpu_init_cflags(CPUState *cpu, bool parallel); diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttcg.c index bcba314a65..c552b45b8e 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -92,7 +92,7 @@ static void *mttcg_cpu_thread_fn(void *arg) if (cpu_can_run(cpu)) { int r; bql_unlock(); - r = tcg_cpus_exec(cpu); + r = tcg_cpu_exec(cpu); bql_lock(); switch (r) { case EXCP_DEBUG: diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 0617f66b5b..894e73e52c 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -258,7 +258,7 @@ static void *rr_cpu_thread_fn(void *arg) if (icount_enabled()) { icount_prepare_for_run(cpu, cpu_budget); } - r = tcg_cpus_exec(cpu); + r = tcg_cpu_exec(cpu); if (icount_enabled()) { icount_process_data(cpu); } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 9b84b84218..9c957f421c 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -68,7 +68,7 @@ void tcg_cpu_destroy(CPUState *cpu) cpu_thread_signal_destroyed(cpu); } -int tcg_cpus_exec(CPUState *cpu) +int tcg_cpu_exec(CPUState *cpu) { int ret; assert(tcg_enabled()); From patchwork Wed Jan 24 10:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765629 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036327wrx; Wed, 24 Jan 2024 02:18:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFflIDYPR50NRMssxP2aXfMwfpMiXMi4QmJyvHbEijnhuDzhBeEeiTFItVNUqEU5O54y/Z7 X-Received: by 2002:a05:6214:21a2:b0:685:c584:6e8b with SMTP id t2-20020a05621421a200b00685c5846e8bmr2622577qvc.0.1706091482349; Wed, 24 Jan 2024 02:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091482; cv=none; d=google.com; s=arc-20160816; b=Ep1rbQHZA92ekilH/Hvo6Y+MtfOLzkGmO05xxHjb4pq8dmcgxMX06BCknHIGAeEmQB V0yisJ8963zDBh0IKjWHcynxFHxaxO5wZsYPPDToaIQS46g7xuvEkRg9xR8oP++NcEyM 3UtGNOswGW00TBfs67HROXwZWickj58QVBxmlpGRIlI+VaC+VWXG2eeLqVFX8mlE9bDI 7fpPDQq+Ef1ypd10k2sBRm53PbzyjLIDK8XXb9FVe9PsBmW/Rl8zyddLyGBnqdc/qK48 t7GIvQjpwBlbXGd1L4TNPZiDWwIl26TmdJDK8Xv4atR3t5spN6xRYsu+OWGvynZgbqNX L44Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sHl/AtYG7is0KFUXE16Nv2to1GnXQQp2fEWClGXzUg0=; fh=NbVuPqdWflDAvPSkTKr6NNYNDd7OZZnC8VcS2hE3bCE=; b=YOlu+WGdzLLMnUhC0Unk6YjnWG6ailmx5IyrDsRbttfQxhGBBLz4vzgjFJ7dp6m7K/ OWMa4CqcS423i6Ha+1X+jlLEoJJ2m2dPbT5pYs2NE33WwE+OwVk9UA6OCR3zI18hjNt8 DC7wZRhymwuXtx+Sm9wXHuJHEfFx01uzTwsGl6QVLH2c82sxoaCEuyqBLysy7D7/WfRG c/PtBnJVZmHtYGfLgM1Qxde2pR4BHxRJbRTUCcYgzLb67GlN8THVQtw4MZZMfwHO4MkP +WHhY/zNTV+Tbn3ZN9T50IM/2Xi/RVGfCdSnZ0MkV30CiWrUqPPtJZ+S14uDD9SBOydp TcPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kd937uMx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n2-20020a0c9d42000000b0067f6107bfb2si4308119qvf.403.2024.01.24.02.18.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kd937uMx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaK8-0003OO-6z; Wed, 24 Jan 2024 05:17:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJk-0003GJ-Ik for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:14 -0500 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJh-0003pa-2F for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:12 -0500 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50f1c524010so5839871e87.3 for ; Wed, 24 Jan 2024 02:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091427; x=1706696227; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sHl/AtYG7is0KFUXE16Nv2to1GnXQQp2fEWClGXzUg0=; b=kd937uMxTjOVfqtJKOjiL5NmagA0shvH8906ZoZfdzRuuICqvKtlV94VIY0XXr5n+p YNyLCcjvsaoWkCALdjPrA/UxxAd6HILa5NLPeRlPLcuL3R+ZlITCx6OTPBgBtGXQ4/h6 MrbbK2X3iEyUHJA/ytOfp84EdZiZEVF5m1CSfdXQYPM9H3jB7lGNX/Gkkb0ZlN7dShQh kqRuyRhTGHBe/De5U57FXgubCSJtIuOeUdsAikjCcKslp9oE9T5n6MkMp9Of3jvI/NYp hbTfZVOO8JWd5ePEioH1tP1tD5ywq4Q0bEdRb8fUDFmxjE05yehK/9ggPx1adFLvWysR sqjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091427; x=1706696227; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sHl/AtYG7is0KFUXE16Nv2to1GnXQQp2fEWClGXzUg0=; b=kVgaWEKw4vZVSnI+YiBhjohO0gH8YDtO7ynXS5b77GgrWchUb79cnU5NIGrmPJqLIF D2HSTdTDlq5Pc3r5N3aBpS4ju2hpQk55F4Dz4uwSTMx9ip1tkXRKYdx0z5dR+pVrxfgf 8xpTol2i53El3IldOMDdRqdrLwkq+09qZEw02bnDrQsX127KIrQoMwFIaO9xzmRpoADX qpsAfsHkwDcnHVM1c4UpDh5gmUPa1A3cP3zF8I4YxcTBKTQAS+aSbg+PoP3RnpQFaaLy PSW04MlBAr9X8YSmAyu4/B01C1ZZlYeFnvIkYHogrsYMy1azdPfERuty3yoRqrIHGj8B uYQg== X-Gm-Message-State: AOJu0Yzz8GjFmNyqR1cYM/JVG0pKbukIgzFbY8cog1kPRXwE8nStLasl 71imj5q187nlD6fdZt36Z2mS1VOcwhLJ8fCxxwtqkHD2GxMnWq8K4sH9ZiKL6V8= X-Received: by 2002:ac2:5d2e:0:b0:50f:1c9a:13f4 with SMTP id i14-20020ac25d2e000000b0050f1c9a13f4mr1566570lfb.52.1706091427590; Wed, 24 Jan 2024 02:17:07 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id g17-20020a170906c19100b00a2b1a20e662sm15185422ejz.34.2024.01.24.02.17.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/9] accel/tcg: Un-inline icount_exit_request() for clarity Date: Wed, 24 Jan 2024 11:16:34 +0100 Message-ID: <20240124101639.30056-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert packed logic to dumb icount_exit_request() helper. No functional change intended. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/cpu-exec.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 6b3f66930e..d61b285d5e 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -791,6 +791,17 @@ static inline bool need_replay_interrupt(int interrupt_request) } #endif /* !CONFIG_USER_ONLY */ +static inline bool icount_exit_request(CPUState *cpu) +{ + if (!icount_enabled()) { + return false; + } + if (cpu->cflags_next_tb != -1 && !(cpu->cflags_next_tb & CF_USE_ICOUNT)) { + return false; + } + return cpu->neg.icount_decr.u16.low + cpu->icount_extra == 0; +} + static inline bool cpu_handle_interrupt(CPUState *cpu, TranslationBlock **last_tb) { @@ -896,10 +907,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, } /* Finally, check if we need to exit to the main loop. */ - if (unlikely(qatomic_read(&cpu->exit_request)) - || (icount_enabled() - && (cpu->cflags_next_tb == -1 || cpu->cflags_next_tb & CF_USE_ICOUNT) - && cpu->neg.icount_decr.u16.low + cpu->icount_extra == 0)) { + if (unlikely(qatomic_read(&cpu->exit_request)) || icount_exit_request(cpu)) { qatomic_set(&cpu->exit_request, 0); if (cpu->exception_index == -1) { cpu->exception_index = EXCP_INTERRUPT; From patchwork Wed Jan 24 10:16:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765631 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036330wrx; Wed, 24 Jan 2024 02:18:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZbtyIoKQhhXTy6yuwzu2Ess+Vx9fBA32v+YnQrGfXBM2L2brSLxBxqXB/sBozX4BT+yTJ X-Received: by 2002:a05:6214:ac2:b0:686:9f2e:71de with SMTP id g2-20020a0562140ac200b006869f2e71demr2887780qvi.77.1706091482415; Wed, 24 Jan 2024 02:18:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091482; cv=none; d=google.com; s=arc-20160816; b=u9r3CJpNKd2JNrqh3CQocd0l2S3hLAHMzPu/Lx8jfhOT0OMuY/ibwMxOOqDBZLDwIw u58iCA7LJxtQidI5u4NVBWeVWnNPk3LUig3SXz64iVFl45zg4urVign5PdJDjdx3+cFq Zv31ZYDObgjarPRtEC4AJEkfD3E+8efGYKeTWCz6JlEukxnqKNl017W4MFRwuFbjdCZD FWTgFPFeS6g+wxdlV93XqS9Y+8IKV7/4FzbLzRbdogfKFgKrSv8k6+hGMg/M/ASND+QJ nrRVH0sOC8cy40j1gXGYDFLWnh75Q3/5YZk+1wCE4DlMhqxR7GCz5as5ku6yny0+yDPQ /MLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kCdApdVb2tqf6HzKRfmudkQU18WR02XSp7D7zgQR15M=; fh=NbVuPqdWflDAvPSkTKr6NNYNDd7OZZnC8VcS2hE3bCE=; b=umppl3gVz/21ZOauzVbEjSt0DeMNloMlGtd8R9EPieXvYMbGfbqSU9HQWEs+Cjz1c4 0zvM4BexyTMwQ8RJ4Zl5gOJJ13gogA7WMwUafxBWSk9+4zotMe4k8ux3Bbp/4R2QKHXT eIrMZCpbdJ4UgXW4kv4TeVZiT5IjXyZhFVUisU0i0Rs0hailyEfPRqhvuT7c2q2f4ExE 6Uo4y2MwrIaCumNgCdPtqV1U5WfS6ypdJS2nIGVDGB7eT/ulFRqXQzJUkDBGA02IXBtg D0zWzWj/VZijfa5UikeOtzWVUDqjqtWVlASwTcdX2pGBN59BP4A2seSgzXxlSPNqE2k+ Dfug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kr5swZd+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r10-20020a0ce28a000000b00683c7a006bcsi9760599qvl.376.2024.01.24.02.18.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kr5swZd+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKE-0003jB-O3; Wed, 24 Jan 2024 05:17:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJq-0003Mq-HN for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:20 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJo-0003q3-5Y for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:18 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a293f2280c7so549244766b.1 for ; Wed, 24 Jan 2024 02:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091434; x=1706696234; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kCdApdVb2tqf6HzKRfmudkQU18WR02XSp7D7zgQR15M=; b=kr5swZd+2nM1QAnTrCMMOZ5KARfyobJ4HPJY86G0Bq94ies0QJLgO76Jg8dSEwpMKv TENaYADgGJc1GYDnhTKGowl2T5kjATMMmOVxo/prSpTQJrnHG+L0W6wXxMeauOdS6weC FbvyeD+09sY9SghpqGQ9F+uMMyP1XqJ8eGMAlGcd7U6cONePOYpnecJqAKeaC/H/LuV+ NOC77FA6jl9Glcfo0pM6n+iRUtIQb1Lm4ZjlOod6GusRAQJ5sygksWl67w/Y60cOvnCt 8ntMbBP+09oMX3d/GXAACSkcrBzMi/hxRhKh+7ygkUuppq+gxUJUQkANTuAMOvjMJJnk 3jmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091434; x=1706696234; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kCdApdVb2tqf6HzKRfmudkQU18WR02XSp7D7zgQR15M=; b=Gk2HuTa+JYJ4v5KadNmG/3WMAsAY/pUnkaKch4FsCDfWXhX2xP8PhdRHMShvLcv8ev pz7BbLyxaphqx3HCsgMryvJQrdu8G5whfiJxXo6lz+swr4C3FaLbVCdhMQ3olNYO7FmP 4Bks6Dt4qKAqBOI/fAveurrJNWUMpMtAKhnKW/dEdDSVVZJKL99zUT5ooGTmK8IvsQeD 6DYs70eCsWmmlnISQDD/gmW8kFOxDTJLdOroBoh53Po82knkyAkcv7IeWDtUie0XIwzB Vqc/5DlxzP0/Ebio5iUjaBMDEjysn+wO8w7tTSApuPdVY6piD+0Lx1YIrvkl0tk8hKPK Uv2Q== X-Gm-Message-State: AOJu0YwNYQ1iiCp1oLrsybRDa7bW5iLfivtIqSwCF7g6A2eijlCvydcs wGgaJHOFs5uCBjWhMG/4yiLakr4O30kJpd/p4tD+mCRWJQSfu9Iral12HZ8i90Y= X-Received: by 2002:a17:907:8b87:b0:a31:1092:69b2 with SMTP id tb7-20020a1709078b8700b00a31109269b2mr339392ejc.77.1706091433618; Wed, 24 Jan 2024 02:17:13 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id w17-20020a17090652d100b00a28116285e0sm10969588ejn.165.2024.01.24.02.17.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/9] accel/tcg: Hoist CPUClass arg to functions with external linkage Date: Wed, 24 Jan 2024 11:16:35 +0100 Message-ID: <20240124101639.30056-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Hoist the CPUClass argument from most of these internal helpers: - check_for_breakpoints_slow - check_for_breakpoints() - cpu_tb_exec() - cpu_exec_enter() - cpu_exec_exit() - cpu_handle_halt() - cpu_handle_debug_exception() - cpu_handle_exception() - need_replay_interrupt() - cpu_handle_interrupt() - cpu_loop_exec_tb() - cpu_exec_loop() - cpu_exec_setjmp() to the following ones with external linkage: - lookup_tb_ptr() - cpu_exec_step_atomic() - cpu_exec() Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson --- accel/tcg/cpu-exec.c | 82 ++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index d61b285d5e..b10472cbc7 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -324,8 +324,8 @@ static void log_cpu_exec(vaddr pc, CPUState *cpu, } } -static bool check_for_breakpoints_slow(CPUState *cpu, vaddr pc, - uint32_t *cflags) +static bool check_for_breakpoints_slow(CPUClass *cc, CPUState *cpu, + vaddr pc, uint32_t *cflags) { CPUBreakpoint *bp; bool match_page = false; @@ -357,7 +357,6 @@ static bool check_for_breakpoints_slow(CPUState *cpu, vaddr pc, #ifdef CONFIG_USER_ONLY g_assert_not_reached(); #else - CPUClass *cc = CPU_GET_CLASS(cpu); assert(cc->tcg_ops->debug_check_breakpoint); match_bp = cc->tcg_ops->debug_check_breakpoint(cpu); #endif @@ -390,11 +389,11 @@ static bool check_for_breakpoints_slow(CPUState *cpu, vaddr pc, return false; } -static inline bool check_for_breakpoints(CPUState *cpu, vaddr pc, - uint32_t *cflags) +static inline bool check_for_breakpoints(CPUClass *cc, CPUState *cpu, + vaddr pc, uint32_t *cflags) { return unlikely(!QTAILQ_EMPTY(&cpu->breakpoints)) && - check_for_breakpoints_slow(cpu, pc, cflags); + check_for_breakpoints_slow(cc, cpu, pc, cflags); } /** @@ -408,6 +407,7 @@ static inline bool check_for_breakpoints(CPUState *cpu, vaddr pc, const void *HELPER(lookup_tb_ptr)(CPUArchState *env) { CPUState *cpu = env_cpu(env); + CPUClass *cc = CPU_GET_CLASS(cpu); TranslationBlock *tb; vaddr pc; uint64_t cs_base; @@ -416,7 +416,7 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); cflags = curr_cflags(cpu); - if (check_for_breakpoints(cpu, pc, &cflags)) { + if (check_for_breakpoints(cc, cpu, pc, &cflags)) { cpu_loop_exit(cpu); } @@ -443,7 +443,7 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) * affect the impact of CFI in environment with high security requirements */ static inline TranslationBlock * QEMU_DISABLE_CFI -cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) +cpu_tb_exec(CPUClass *cc, CPUState *cpu, TranslationBlock *itb, int *tb_exit) { CPUArchState *env = cpu_env(cpu); uintptr_t ret; @@ -476,8 +476,6 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) * counter hit zero); we must restore the guest PC to the address * of the start of the TB. */ - CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->tcg_ops->synchronize_from_tb) { cc->tcg_ops->synchronize_from_tb(cpu, last_tb); } else { @@ -509,19 +507,15 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) } -static void cpu_exec_enter(CPUState *cpu) +static void cpu_exec_enter(CPUClass *cc, CPUState *cpu) { - CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->tcg_ops->cpu_exec_enter) { cc->tcg_ops->cpu_exec_enter(cpu); } } -static void cpu_exec_exit(CPUState *cpu) +static void cpu_exec_exit(CPUClass *cc, CPUState *cpu) { - CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->tcg_ops->cpu_exec_exit) { cc->tcg_ops->cpu_exec_exit(cpu); } @@ -566,6 +560,7 @@ static void cpu_exec_longjmp_cleanup(CPUState *cpu) void cpu_exec_step_atomic(CPUState *cpu) { + CPUClass *cc = CPU_GET_CLASS(cpu); CPUArchState *env = cpu_env(cpu); TranslationBlock *tb; vaddr pc; @@ -600,11 +595,11 @@ void cpu_exec_step_atomic(CPUState *cpu) mmap_unlock(); } - cpu_exec_enter(cpu); + cpu_exec_enter(cc, cpu); /* execute the generated code */ trace_exec_tb(tb, pc); - cpu_tb_exec(cpu, tb, &tb_exit); - cpu_exec_exit(cpu); + cpu_tb_exec(cc, cpu, tb, &tb_exit); + cpu_exec_exit(cc, cpu); } else { cpu_exec_longjmp_cleanup(cpu); } @@ -673,7 +668,7 @@ static inline void tb_add_jump(TranslationBlock *tb, int n, return; } -static inline bool cpu_handle_halt(CPUState *cpu) +static inline bool cpu_handle_halt(CPUClass *cc, CPUState *cpu) { #ifndef CONFIG_USER_ONLY if (cpu->halted) { @@ -697,9 +692,8 @@ static inline bool cpu_handle_halt(CPUState *cpu) return false; } -static inline void cpu_handle_debug_exception(CPUState *cpu) +static inline void cpu_handle_debug_exception(CPUClass *cc, CPUState *cpu) { - CPUClass *cc = CPU_GET_CLASS(cpu); CPUWatchpoint *wp; if (!cpu->watchpoint_hit) { @@ -713,7 +707,7 @@ static inline void cpu_handle_debug_exception(CPUState *cpu) } } -static inline bool cpu_handle_exception(CPUState *cpu, int *ret) +static inline bool cpu_handle_exception(CPUClass *cc, CPUState *cpu, int *ret) { if (cpu->exception_index < 0) { #ifndef CONFIG_USER_ONLY @@ -730,7 +724,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) /* exit request from the cpu execution loop */ *ret = cpu->exception_index; if (*ret == EXCP_DEBUG) { - cpu_handle_debug_exception(cpu); + cpu_handle_debug_exception(cc, cpu); } cpu->exception_index = -1; return true; @@ -740,7 +734,6 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) which will be handled outside the cpu execution loop */ #if defined(TARGET_I386) - CPUClass *cc = CPU_GET_CLASS(cpu); cc->tcg_ops->fake_user_interrupt(cpu); #endif /* TARGET_I386 */ *ret = cpu->exception_index; @@ -748,7 +741,6 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) return true; #else if (replay_exception()) { - CPUClass *cc = CPU_GET_CLASS(cpu); bql_lock(); cc->tcg_ops->do_interrupt(cpu); bql_unlock(); @@ -761,7 +753,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) * next instruction. */ *ret = EXCP_DEBUG; - cpu_handle_debug_exception(cpu); + cpu_handle_debug_exception(cc, cpu); return true; } } else if (!replay_has_interrupt()) { @@ -781,7 +773,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) * "real" interrupt event later. It does not need to be recorded for * replay purposes. */ -static inline bool need_replay_interrupt(int interrupt_request) +static inline bool need_replay_interrupt(CPUClass *cc, int interrupt_request) { #if defined(TARGET_I386) return !(interrupt_request & CPU_INTERRUPT_POLL); @@ -802,7 +794,7 @@ static inline bool icount_exit_request(CPUState *cpu) return cpu->neg.icount_decr.u16.low + cpu->icount_extra == 0; } -static inline bool cpu_handle_interrupt(CPUState *cpu, +static inline bool cpu_handle_interrupt(CPUClass *cc, CPUState *cpu, TranslationBlock **last_tb) { /* @@ -870,11 +862,9 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, True when it is, and we should restart on a new TB, and via longjmp via cpu_loop_exit. */ else { - CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->tcg_ops->cpu_exec_interrupt && cc->tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { - if (need_replay_interrupt(interrupt_request)) { + if (need_replay_interrupt(cc, interrupt_request)) { replay_interrupt(); } /* @@ -918,14 +908,15 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, return false; } -static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, +static inline void cpu_loop_exec_tb(CPUClass *cc, CPUState *cpu, + TranslationBlock *tb, vaddr pc, TranslationBlock **last_tb, int *tb_exit) { int32_t insns_left; trace_exec_tb(tb, pc); - tb = cpu_tb_exec(cpu, tb, tb_exit); + tb = cpu_tb_exec(cc, cpu, tb, tb_exit); if (*tb_exit != TB_EXIT_REQUESTED) { *last_tb = tb; return; @@ -970,16 +961,16 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, /* main execution loop */ static int __attribute__((noinline)) -cpu_exec_loop(CPUState *cpu, SyncClocks *sc) +cpu_exec_loop(CPUClass *cc, CPUState *cpu, SyncClocks *sc) { int ret; /* if an exception is pending, we execute it here */ - while (!cpu_handle_exception(cpu, &ret)) { + while (!cpu_handle_exception(cc, cpu, &ret)) { TranslationBlock *last_tb = NULL; int tb_exit = 0; - while (!cpu_handle_interrupt(cpu, &last_tb)) { + while (!cpu_handle_interrupt(cc, cpu, &last_tb)) { TranslationBlock *tb; vaddr pc; uint64_t cs_base; @@ -1001,7 +992,7 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc) cpu->cflags_next_tb = -1; } - if (check_for_breakpoints(cpu, pc, &cflags)) { + if (check_for_breakpoints(cc, cpu, pc, &cflags)) { break; } @@ -1046,7 +1037,7 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc) tb_add_jump(last_tb, tb_exit, tb); } - cpu_loop_exec_tb(cpu, tb, pc, &last_tb, &tb_exit); + cpu_loop_exec_tb(cc, cpu, tb, pc, &last_tb, &tb_exit); /* Try to align the host and virtual clocks if the guest is in advance */ @@ -1056,30 +1047,31 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc) return ret; } -static int cpu_exec_setjmp(CPUState *cpu, SyncClocks *sc) +static int cpu_exec_setjmp(CPUClass *cc, CPUState *cpu, SyncClocks *sc) { /* Prepare setjmp context for exception handling. */ if (unlikely(sigsetjmp(cpu->jmp_env, 0) != 0)) { cpu_exec_longjmp_cleanup(cpu); } - return cpu_exec_loop(cpu, sc); + return cpu_exec_loop(cc, cpu, sc); } int cpu_exec(CPUState *cpu) { int ret; SyncClocks sc = { 0 }; + CPUClass *cc = CPU_GET_CLASS(cpu); /* replay_interrupt may need current_cpu */ current_cpu = cpu; - if (cpu_handle_halt(cpu)) { + if (cpu_handle_halt(cc, cpu)) { return EXCP_HALTED; } WITH_RCU_READ_LOCK_GUARD() { - cpu_exec_enter(cpu); + cpu_exec_enter(cc, cpu); /* * Calculate difference between guest clock and host clock. @@ -1089,9 +1081,9 @@ int cpu_exec(CPUState *cpu) */ init_delay_params(&sc, cpu); - ret = cpu_exec_setjmp(cpu, &sc); + ret = cpu_exec_setjmp(cc, cpu, &sc); - cpu_exec_exit(cpu); + cpu_exec_exit(cc, cpu); }; return ret; From patchwork Wed Jan 24 10:16:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765634 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036500wrx; Wed, 24 Jan 2024 02:18:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2eXyIfHCcedp2EYjAVGjsGlY/lu4iscpTcfyzDMHkOIV3jyJcVyodB6TpHkfw3M866G17 X-Received: by 2002:a05:622a:5c8:b0:42a:14e9:7fe9 with SMTP id d8-20020a05622a05c800b0042a14e97fe9mr2495642qtb.136.1706091514038; Wed, 24 Jan 2024 02:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091514; cv=none; d=google.com; s=arc-20160816; b=TPzrSk0yRtGAYcR3fJLhZ8f9uXg9whXnm0/yYx0uaeISUfbowtDKKhUkvavTjmLu6l CbJD858mZLfHPBqDQ7IBe4kId2JwwY8kJV2ULWejU1PUFW0juXKpHzjZ+DQLu3IPM66s 57mW8V7hLE9KwQ214FNg7I648WYTpMgEb2MCjkcNHvBAJnSCaOcyBRy45q7LNRi8LgZk DXkLNXTRAxhZywqa6rIEYTvhww404foHNYmy9YETkqxTaa2G8jPJXApkRayDgYeXe0UE pp6umRFm3h5N4UnQ9rjKmy0MBA6rG/JinhYM49VvjTjiIft84bIX3WkXU0iQVs8ovbsN k82g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TSQhp0P/DRalBnOPDt7LO9q/NJaOxDtFUMlWyOyZnN8=; fh=NbVuPqdWflDAvPSkTKr6NNYNDd7OZZnC8VcS2hE3bCE=; b=lJlhYIaz9lSZnvu+1+gu3POMgY6B1OdATAvSyR84QIr20P1GOpIXnUCMp8jPIzSwSV 8op1S0gSA3bhTcFiGKbN7F5xEbSQYDg2epoaHvc/rYpWNOhnVbwDSbFyjDkx30It1hVV KU8iMw1uIS5Fpr5hzm+okBldFiTmyjwZpba2YxE7fA7LIhrLK3bdcA7DlC5lWlthkGJC A4OaXXXsnKELkYWVadGgmpJn+31Zn5vRLsoe3BpaReN234RnhGzXe7ZuxefNamYBbVH7 yuIzXh4L1zqxyeenjTr+xnBDYZ19W7jr0CTbXRVvapZ2K4LBql9TIUPsY1fj3rZi5aDU /HSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l1L1keZp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o8-20020a05622a138800b0042a5058669bsi3182486qtk.11.2024.01.24.02.18.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l1L1keZp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKG-0003t8-3r; Wed, 24 Jan 2024 05:17:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJv-0003NS-3C for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:25 -0500 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJt-0003qQ-8j for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:22 -0500 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5100b424f8fso1401957e87.0 for ; Wed, 24 Jan 2024 02:17:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091439; x=1706696239; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TSQhp0P/DRalBnOPDt7LO9q/NJaOxDtFUMlWyOyZnN8=; b=l1L1keZpSxgaSwqjNK8uAs3+/ZEr7MkclSMw1/S/byFZkYEKrKu/TLZD4zM0nhpjAv Fi2eSEoM+1+g11TMyzOmDzNt25ZJpwlF1/ZcpMN/r/+ankap4ed6ik0d7TjTzdvLQdr4 NDzFquoLZemjwRjdI+8QuP9xVGo47ZMYBjC1EBjxrKbFpm7+9mPE1SXZCMx3jsgfw5u1 oX+ITyz7f3bC6YhE+NacK29ZSzODXSKhoVN6bidlbHlmn8nTyKJiY+dG2r1QqAAiLU4r wNhbfUuyRMrrGZNq2QaqJlq7+qdYsnaG6eFSvGMJ12e0KUkRql+Olx1LJxkkO/Mj3lAt Blew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091439; x=1706696239; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TSQhp0P/DRalBnOPDt7LO9q/NJaOxDtFUMlWyOyZnN8=; b=PZG0ti4auOF5wDLUYlaOY18LYN+w9qiKLjc3AUXzjrH0qp+v96XB6XIKO0haKfBj64 VLZ5D6za8KTe3WUT9WD78du9iHxNbdGDT7qUIkhtzhmquZviVQcrdCP4BsSSJLY/MwDK 1itxVpq5xk+tUvY6Age8Ra2SCmwhx8+pvDfC/LLHKvqcLa/PzmeO6FzfUrJheQ9kQFdY yvxe93fs7mo4it2z4W6w9qeg/Y9WvUk8Pn/loPnnWyMX2s9bltoiFPw4X2Mggl8QUzD2 xS+4l+XcwKoPrqUy4D6v2Lb7HrK9JfmEoZJke0ZpqPIywe3N6DlKrXVrWZEyiwHS6zya oDMA== X-Gm-Message-State: AOJu0Yy35S+sKw7xqvOd/6xToUH+0SfD1xxInYpIEtRi3z2+kXswuOV2 zjVBApkQstguVi2ySPeDJ1RsFJl98dNJOozK9lJB+ECmy5XmLG/kHr6mXty8EaA= X-Received: by 2002:a05:6512:4018:b0:50f:da9:16b2 with SMTP id br24-20020a056512401800b0050f0da916b2mr3904262lfb.74.1706091439730; Wed, 24 Jan 2024 02:17:19 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id i13-20020a05640200cd00b00559c71e70e3sm9558946edu.79.2024.01.24.02.17.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 6/9] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler Date: Wed, 24 Jan 2024 11:16:36 +0100 Message-ID: <20240124101639.30056-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In order to make accel/tcg/ target agnostic, introduce the need_replay_interrupt() handler. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Reviewed-by: Pavel Dovgalyuk --- include/hw/core/tcg-cpu-ops.h | 5 +++++ accel/tcg/cpu-exec.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 479713a36e..2fae3ac70f 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -170,6 +170,11 @@ struct TCGCPUOps { */ bool (*io_recompile_replay_branch)(CPUState *cpu, const TranslationBlock *tb); + /** + * @need_replay_interrupt: Return %true if @interrupt_request + * needs to be recorded for replay purposes. + */ + bool (*need_replay_interrupt)(int interrupt_request); #endif /* !CONFIG_USER_ONLY */ #endif /* NEED_CPU_H */ diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index b10472cbc7..4ab7d6c896 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -778,7 +778,10 @@ static inline bool need_replay_interrupt(CPUClass *cc, int interrupt_request) #if defined(TARGET_I386) return !(interrupt_request & CPU_INTERRUPT_POLL); #else - return true; + if (!cc->tcg_ops->need_replay_interrupt) { + return true; + } + return cc->tcg_ops->need_replay_interrupt(interrupt_request); #endif } #endif /* !CONFIG_USER_ONLY */ From patchwork Wed Jan 24 10:16:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765635 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036536wrx; Wed, 24 Jan 2024 02:18:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPS4NqTcJs/q7vadL1XQ+EllRI2b84LfoB8dBz8A3aTFYFm55jFSg4tnrsooqNB4hKNdQD X-Received: by 2002:a05:6808:2e91:b0:3bd:4b70:d73 with SMTP id gt17-20020a0568082e9100b003bd4b700d73mr1713477oib.65.1706091520378; Wed, 24 Jan 2024 02:18:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091520; cv=none; d=google.com; s=arc-20160816; b=sLTDrlrQFdqEzSHJb0yz/AKPKF0Wvo9JQ4Y439DurFF8zoMx4DTPjiR4626S6utQVi xWKC4G3Ze5JVcp1WlMHG6ngl4XdgXQHpqimH3F3fqWOGRRvfiMgJPlpeul7HLExZpyGq UdOo9OGL0OZwjc0c/3dcAiOxmzKjf8p9rB3iRz7GIuCVO3TzUJZf/EMMKI8XdRkvveFH 0xnRLsZ68gN44t2zgxU4g+DiqkTAabgRizI4VtMdgp7HhjODdoxY9yVt+QL1mxvf8Msh NTvTlPZs6uPWSpaWdE3eBsUQXZsRzH1r6oUrLzyfTjjcUKlh37ETcafW+kSKHx5mztNZ J14Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; fh=yZPlqbZbDw4iG+IYYt39v7EQyQGjesk+yOnAkxYYWcQ=; b=LLU5qaUSnp1rp8eZX7VMvb2Tk9/pgnigWdhULdvw1GFREkN6P+yinIzy3FNRCeKXor kby6cAHLkzK2XDyMCWf8SM14DZMg26YwtBDtlnhoegd/Hy8hGDTRpfJvyCaoVnntXgB9 LZQmBYVpG29W0nnYg2UR9oynoH/rHNYX3N17/fXFCm7/swjzmTVPyCW/JWVnesmWmCs5 rZISV0253/gHfn7SN/yxPim6G9j5attphjQwJQLqqEusnNf6BfbC6TGhFS3BkdWruuY4 XXwDpqNKLseTY2dsvxb/ZmEDl1tNAnFIVcFUz/8kFf/TLvOdJ8KPL2hUlrhiKGMS6rIb XUFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vF5HjYUh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l7-20020ae9f007000000b0078389ccf071si9514911qkg.77.2024.01.24.02.18.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:40 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vF5HjYUh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKG-0003tu-7w; Wed, 24 Jan 2024 05:17:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaK2-0003SI-Mq for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:36 -0500 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaK0-0003qp-FA for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:30 -0500 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-50eac018059so7354495e87.0 for ; Wed, 24 Jan 2024 02:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091446; x=1706696246; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; b=vF5HjYUhFRqo+nUDh6iMa6JuEAek56ZT22nnNj2rBAFQ1+t1IGfEPKhlASRNo7H6rM AZ5vT1QGztdH0bRjZE1sTMvW78ilTMW4EIiSUVGv9uwC7GKUuBkesWzubUVhUepLEDqG wEr8L5WHSDEMK0asNrTy2DVr7vrbsezzGOY+OXVA5zAORDMkxLMxDd6fZF8Voxq038Q3 YxLXEoaRR6TZ71GJxHl3SZjILYb4iJM548F8GA6kTllkCP+LvDINghkf5fsDTyEiqdM+ 0ocAvyq3ahnBF3DqLEGV69kzb7gVVSvVlCKgVNQaMePBlMY6M5lK/TXfxLTYvu9BQQY7 768w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091446; x=1706696246; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; b=Nxlz4NIMA9jTsVsim1bysPvi6btjRNpS4IECCp+DRbfL+XnbDj2QsG+1b2hf6pVI/q x38Ptb15dVX6MmhHD6zgN+tovWYWdHd65DhmSPjn8ZwVrBf7sjY29PDw1uCkDrDHh75z XUGZHzt92GooIoVN/5hcfLBHBXgxJbhV4Pd0QXlzESzZe/cwE0+RqOcsOML4Xnax4gLH DbO+osYeTwbHSQTMdg6VLQBvb4iaP0VzEZvkMhcCtbgxnv/O0rRDzka62FM5xwNl78eW /kySI6XulJBiwyN0QSzQNbM7v46Jlbvw0EgJOGul/7HzSSs7mRIQCwzLpfLitH0GY+Bf mffQ== X-Gm-Message-State: AOJu0YyeNw4XW8Bnyfac9903EYynqNEZgY4vOQPRUSHlIUmiMjUiFaLH t4I7S8mc/VZ0VJwt42BpJ191rhTKGqwofM+rLjPt9y25MuICvdyg5BDTj0haozc= X-Received: by 2002:ac2:5b5e:0:b0:510:ab6:e418 with SMTP id i30-20020ac25b5e000000b005100ab6e418mr1156806lfp.33.1706091445750; Wed, 24 Jan 2024 02:17:25 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id t19-20020a1709067c1300b00a2cab4514a2sm14281787ejo.133.2024.01.24.02.17.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost Subject: [PATCH 7/9] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/ Date: Wed, 24 Jan 2024 11:16:37 +0100 Message-ID: <20240124101639.30056-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move this x86-specific code out of the generic accel/tcg/. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson Reviewed-by: Pavel Dovgalyuk --- target/i386/tcg/helper-tcg.h | 1 + accel/tcg/cpu-exec.c | 9 --------- target/i386/tcg/sysemu/seg_helper.c | 10 ++++++++++ target/i386/tcg/tcg-cpu.c | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index ce34b737bb..253b1f561e 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_SPACE_BITS); */ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY +bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 4ab7d6c896..5a978a9e72 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -768,21 +768,12 @@ static inline bool cpu_handle_exception(CPUClass *cc, CPUState *cpu, int *ret) } #ifndef CONFIG_USER_ONLY -/* - * CPU_INTERRUPT_POLL is a virtual event which gets converted into a - * "real" interrupt event later. It does not need to be recorded for - * replay purposes. - */ static inline bool need_replay_interrupt(CPUClass *cc, int interrupt_request) { -#if defined(TARGET_I386) - return !(interrupt_request & CPU_INTERRUPT_POLL); -#else if (!cc->tcg_ops->need_replay_interrupt) { return true; } return cc->tcg_ops->need_replay_interrupt(interrupt_request); -#endif } #endif /* !CONFIG_USER_ONLY */ diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/seg_helper.c index 1cb5a0db45..e6f42282bb 100644 --- a/target/i386/tcg/sysemu/seg_helper.c +++ b/target/i386/tcg/sysemu/seg_helper.c @@ -127,6 +127,16 @@ void x86_cpu_do_interrupt(CPUState *cs) } } +bool x86_need_replay_interrupt(int interrupt_request) +{ + /* + * CPU_INTERRUPT_POLL is a virtual event which gets converted into a + * "real" interrupt event later. It does not need to be recorded for + * replay purposes. + */ + return !(interrupt_request & CPU_INTERRUPT_POLL); +} + bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { X86CPU *cpu = X86_CPU(cs); diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index e1405b7be9..255d56d4c3 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -123,6 +123,7 @@ static const struct TCGCPUOps x86_tcg_ops = { .do_unaligned_access = x86_cpu_do_unaligned_access, .debug_excp_handler = breakpoint_handler, .debug_check_breakpoint = x86_debug_check_breakpoint, + .need_replay_interrupt = x86_need_replay_interrupt, #endif /* !CONFIG_USER_ONLY */ }; From patchwork Wed Jan 24 10:16:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765632 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036388wrx; Wed, 24 Jan 2024 02:18:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZpi0CaGK4UyKiff87w6sGuyu+lJRygUDBcX4jRaT0FZ4fg+vBwloxuXeCAfZHPoXoAFv8 X-Received: by 2002:a05:620a:8203:b0:783:89fe:509a with SMTP id ow3-20020a05620a820300b0078389fe509amr8097672qkn.152.1706091493835; Wed, 24 Jan 2024 02:18:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091493; cv=none; d=google.com; s=arc-20160816; b=qw7tCkD8YJsfz9MBWw8nuqT4P6oOjw/87f8UcY+bWb84Idfh2sxt77btwhZXZL0xtz 4SMJF+FkedXC+Mbn9ZnydQDWVt1RNgM3WILNwKKrePAXXuMRF/xzp+0ferKWki7Zburi E5bQ0W8d8hxexo3DYe0MrwJDonMu3KMM6gPbeO0l5E94tUIkRm/oyuTQgTviYsZxbrXn dM9e9duDFRgIY/c3OOEhwldKb1KSt/kEir++r9myyU1GM4FY9pmCNQeV624mF7yKmaqE FLpDzdtYNSeU2UtQJ/sm+il3Jw1Hl50ALJ/IPUN+ZhI9oKPPhERCVPnorZpogruS3gyw c3xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X94AmIL+mNsGxo00rh8nsvmtFlP/7iCFJPTsu1PEIEI=; fh=NbVuPqdWflDAvPSkTKr6NNYNDd7OZZnC8VcS2hE3bCE=; b=WBMynqjdaldouf2EGVdHsfmFjChShrcoEOgQ3MHSdDIrGtXEX7GZluhYZeGJvufEE8 /v9g7Rc5PD8um73JLGnyjbXK/7bbtvfBmng3VI/SkaxK3JdjBN8eYTxpsF55tlkIWEPG OmeawABQ9NzZr1iFJLE1IUuPjjgXCe6BDVlnozTW0gNoWEYN0qKMy8+eIdSWrfh0ASd3 blvpG8PpjSjqRb0rV/mSFj/njzKn7BwfKsAd21ZLvXuoqAuPXyvFVNT+9M0RuB6nE/Yg Do5MNkfegC+1lHwAEDYKFwW0aEHypyhuKejb21259tIX+4Qxl+DE5zDk+B08ElBhDade XL9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OZpQtAtA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v15-20020a05620a090f00b007833cf6a76asi9720659qkv.170.2024.01.24.02.18.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:13 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OZpQtAtA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKH-00041Z-A5; Wed, 24 Jan 2024 05:17:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaK7-0003cC-TO for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:38 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaK6-0003rF-7U for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:35 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-559f92bf7b6so9562604a12.0 for ; Wed, 24 Jan 2024 02:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091451; x=1706696251; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X94AmIL+mNsGxo00rh8nsvmtFlP/7iCFJPTsu1PEIEI=; b=OZpQtAtAucMqQuCNBUkJge29NiCtNb3k7ii9ODvmv72snZiuYg4U1UDBSBF3Cac7jQ YjAGLYeeD0O8LK87QayTdTVpJNT21ekY7aU2XiDsbh1TQlrfVExGRLPebJp8NsbDHv2n fz6L6fqC0JqzzTrUoN8Z0k20jQCoekU7SKLetnHtUKj1kyyV679WnQA0Y3gt+WowqO0O uIZmjCLxzVG9SfJkWKdThYNU+HrdxH99L+kaHT5qOLBe+c12iRBeWugG15Jx404oqZVL CSCqZD0ZQhqOVfu9erKwqoXHBHwOCdhnrOjgosfW8mhuCd3Fr+atlrjql0Fpe/u5aWMV nYGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091451; x=1706696251; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X94AmIL+mNsGxo00rh8nsvmtFlP/7iCFJPTsu1PEIEI=; b=wgYkKYjqfj1AoJS4NFCGBOF3rL2kUXEPiLf9Ik57VBKDgVAvuVI1LgapI1Xr5ti5xu fzmGQkYgrdWif+HGecYbX2Fob2tvczwNeRnCzAcEK90aG4GCLqMiKC3DLkTcZOH7AvI+ /MqghashjR3YHPTFaPaZw48VU0t7btxswPy33rR+Xtv/6c+RwvXoh+Nk4HbDPUlKLtik 0YdPYJwl7cyUKTFo2zQkh0qCQzD9glYFP/vkR1dhBG9XGVWcLSzFTjkSzV9TIw/j6Dhg 6uG/yKwnNeVkbBtjyD8QbEI8r5QOfGJvQHgyZQ38UvZ9rOkR4N/d8X5nN1Jy7xILdT0m Uo3w== X-Gm-Message-State: AOJu0YxJzeQ4hq336w8da7kBwBUlW5udy97F02zOxNZxiZcKF/KyFOQm gvsxyQErpRNrzWAclUeCNcpWu+nhpTCeBgc+l5M43eYa2g2xelWi7E8u9sec6KU= X-Received: by 2002:aa7:d3c8:0:b0:55c:8d17:1bea with SMTP id o8-20020aa7d3c8000000b0055c8d171beamr1038023edr.17.1706091451682; Wed, 24 Jan 2024 02:17:31 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id e9-20020a056402104900b0055c15c5919csm4080051edu.86.2024.01.24.02.17.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 8/9] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler Date: Wed, 24 Jan 2024 11:16:38 +0100 Message-ID: <20240124101639.30056-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In order to make accel/tcg/ target agnostic, introduce the cpu_exec_halt() handler. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 2 ++ accel/tcg/cpu-exec.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 2fae3ac70f..3307338c80 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -114,6 +114,8 @@ struct TCGCPUOps { void (*record_sigbus)(CPUState *cpu, vaddr addr, MMUAccessType access_type, uintptr_t ra); #else + /** @cpu_exec_halt: Callback for handling halt in cpu_exec */ + void (*cpu_exec_halt)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); /** diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5a978a9e72..390a9644da 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -681,6 +681,9 @@ static inline bool cpu_handle_halt(CPUClass *cc, CPUState *cpu) bql_unlock(); } #endif /* TARGET_I386 */ + if (cc->tcg_ops->cpu_exec_halt) { + cc->tcg_ops->cpu_exec_halt(cpu); + } if (!cpu_has_work(cpu)) { return true; } From patchwork Wed Jan 24 10:16:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 765633 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp2036421wrx; Wed, 24 Jan 2024 02:18:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlpnuHjKhAScHdRY6W0GQ7ECagT592mMhacNGbz8dJgyTC0pH5ELFUu96tzQd90D6SBM/W X-Received: by 2002:a05:6214:c8b:b0:686:1e2:747e with SMTP id r11-20020a0562140c8b00b0068601e2747emr2454474qvr.71.1706091501527; Wed, 24 Jan 2024 02:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706091501; cv=none; d=google.com; s=arc-20160816; b=BG6g1RPJ98Nyc3HSXIUBNjt6gBS1EDBvUjNPuJBaySd9dSQF0frubAkxthuAZ+K2TR 6pemgXo4vDVVFf3+D81+OmDrurGZfAgMdWYqyyVjlMGqpk4hhMqeofZN0TiTuJnsPFF0 XMMnFgc4DZNrkfwxrqFILsO92FRkvf3kfe4jjaa6E5Lm9+sIft18wPaqIWqzGuNXeIA3 o0lGZCotOcdaDAZ4JcIpI8yWczJA11AOPS0EkQq3XcoX3miOYrAEaHjTQ0qBoe9d7K8u 243hS7MukZpeXEOmhSvROaxa4sJ7DwX70PHV209PTIsHlKuwpdpKmfrB3VPcOsiNa2IY HH1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gpEb2PEYPX2zoYAlv9rul3UN8M152eCIu+XSN9MDjH0=; fh=yZPlqbZbDw4iG+IYYt39v7EQyQGjesk+yOnAkxYYWcQ=; b=GED3lqL/pDyzuR4v36gXLzejXb3Z1p/t8iQeAwlt5rbLhoz/rf/0aEwTM/CWY2K+Do 1FV0hrRvZ4rnI9vtkq0r3i1FLrDR+UnuJjjohcYvwumOSklK59RMVdAkWR6gvyKy2dtm AY9J522CxMQ3z6ejwQ6m8gSEfn2n6BXDd0jcjdNzXKIoHe87av5Pb/uIr/2wQm3R0Msj 7AoPK9BJLbVXLakjzbTlgdyJO4TwHCz+YcanFlmtZCCz9R3eF8yT9Aeu0uXDI5mZIHb5 Rk9tqmJC3iYPbHMx3zQxr3MjSZIBxefiKwlQXIL6TUPZVnq+/ZF2Os7hBAz2Z1hrOF94 d9Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2fAohS+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y2-20020a0ce042000000b00683a29421ddsi9737439qvk.458.2024.01.24.02.18.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2024 02:18:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2fAohS+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKI-0004Cw-7S; Wed, 24 Jan 2024 05:17:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaKD-0003hF-3T for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:41 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaKB-0003t0-DX for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:40 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a30b3a9e9c6so209303566b.2 for ; Wed, 24 Jan 2024 02:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091458; x=1706696258; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gpEb2PEYPX2zoYAlv9rul3UN8M152eCIu+XSN9MDjH0=; b=O2fAohS+Poviqif5YxxMHRgGtHn0QJ8/pStftmB1hYL/k8NoETwOMrKYCN+kpgNACQ 6jxyU+tSqtmphUGc4H5GPB+TSXri8rbsJEhg+/R7y6HgKCns9Ygn/jYelcD8Tf+zR3QH T1M2O10H/zZWMbuYtJH5bL/KpRJKo87umqaf59fKtTSLIyOb/gB5HyhkEXGnF7KwHdMa a5dprPWuPgJhHhU6qD9cfhPLx7Vfv73Mud6QolgeA1Zypo30l0WGKKUGYW2xpaI3G2xJ 4+AzqystCX7wW6xlvAXfLnnMoIuWf0a14QD2nXHF8+QbRYZRSAu8sygFFt7IPLj2YXiP E2DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091458; x=1706696258; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gpEb2PEYPX2zoYAlv9rul3UN8M152eCIu+XSN9MDjH0=; b=wbUma8ZPw5pOYWqRaoSVmX512CMTQEv7T7XslM1CrgJ/NbY5DsKH834wwwj7jJLgvk 6IEFPXei5fLn6jp33YnvkFA3dk7PjlhYe0mUkGYpsB5uuuTzUMFsykfNj1uHuABK3XQa QwmV+FrTa2k8JUUJZJF2OxOkj2ydAvhcwoLd6PRZUSJesYeV5lAGObxfcO2CbBuV29yD soi9GVjKdddQ0t5nweSlCMistWwl+QX3OGzOIkcJxrZK9JfmAo8SlByjqAeZfCgIfsI/ Py1wDq+E7EwR0PNcXAHcftM4jiTZeEvlZqNYV4aX7MvzWy8RRulXfoB6ep52wJKrjJy9 gSDg== X-Gm-Message-State: AOJu0YxqVlBOufCepcfo0xBuROHViHpy7p9TZ/9LtO1exFyhG7xQdFg4 JK3eRURi4cZ1Hnmcdx0rRk5++bJ1HuQdiQXIHCKMm7QwdnOPDuj7zzXiiuuPipo= X-Received: by 2002:a17:906:c50:b0:a30:8497:4db2 with SMTP id t16-20020a1709060c5000b00a3084974db2mr325628ejf.201.1706091457794; Wed, 24 Jan 2024 02:17:37 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id tj4-20020a170907c24400b00a311082cd00sm599770ejc.37.2024.01.24.02.17.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost Subject: [PATCH 9/9] target/i386: Extract x86_cpu_exec_halt() from accel/tcg/ Date: Wed, 24 Jan 2024 11:16:39 +0100 Message-ID: <20240124101639.30056-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move this x86-specific code out of the generic accel/tcg/. Reported-by: Anton Johansson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 + accel/tcg/cpu-exec.c | 12 ------------ target/i386/tcg/sysemu/seg_helper.c | 13 +++++++++++++ target/i386/tcg/tcg-cpu.c | 1 + 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 253b1f561e..effc2c1c98 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_SPACE_BITS); */ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY +void x86_cpu_exec_halt(CPUState *cpu); bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 390a9644da..7662f4973d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -30,9 +30,6 @@ #include "qemu/rcu.h" #include "exec/log.h" #include "qemu/main-loop.h" -#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY) -#include "hw/i386/apic.h" -#endif #include "sysemu/cpus.h" #include "exec/cpu-all.h" #include "sysemu/cpu-timers.h" @@ -672,15 +669,6 @@ static inline bool cpu_handle_halt(CPUClass *cc, CPUState *cpu) { #ifndef CONFIG_USER_ONLY if (cpu->halted) { -#if defined(TARGET_I386) - if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { - X86CPU *x86_cpu = X86_CPU(cpu); - bql_lock(); - apic_poll_irq(x86_cpu->apic_state); - cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); - bql_unlock(); - } -#endif /* TARGET_I386 */ if (cc->tcg_ops->cpu_exec_halt) { cc->tcg_ops->cpu_exec_halt(cpu); } diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/seg_helper.c index e6f42282bb..2db8083748 100644 --- a/target/i386/tcg/sysemu/seg_helper.c +++ b/target/i386/tcg/sysemu/seg_helper.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" +#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" #include "exec/cpu_ldst.h" @@ -127,6 +128,18 @@ void x86_cpu_do_interrupt(CPUState *cs) } } +void x86_cpu_exec_halt(CPUState *cpu) +{ + if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { + X86CPU *x86_cpu = X86_CPU(cpu); + + bql_lock(); + apic_poll_irq(x86_cpu->apic_state); + cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); + bql_unlock(); + } +} + bool x86_need_replay_interrupt(int interrupt_request) { /* diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 255d56d4c3..3028b57c97 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -119,6 +119,7 @@ static const struct TCGCPUOps x86_tcg_ops = { #else .tlb_fill = x86_cpu_tlb_fill, .do_interrupt = x86_cpu_do_interrupt, + .cpu_exec_halt = x86_cpu_exec_halt, .cpu_exec_interrupt = x86_cpu_exec_interrupt, .do_unaligned_access = x86_cpu_do_unaligned_access, .debug_excp_handler = breakpoint_handler,