From patchwork Fri Feb 5 22:56:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376985 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2573476ejt; Fri, 5 Feb 2021 15:00:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzV9w7Rdx8WVcfxDyuyhXQJ5kR2241ZtDkWzMC2ijmgAJZKP7ExfWpcm8wLvB93hGrauTR5 X-Received: by 2002:a25:6cc6:: with SMTP id h189mr9762811ybc.434.1612566034684; Fri, 05 Feb 2021 15:00:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566034; cv=none; d=google.com; s=arc-20160816; b=dqLZgQZ8eWaX7eK0gVaMGWY1wwCwV0TguSjvNpxn11YinOLcUIIZoNWQQ/a1H8xBHC F4LH0KMd5Juw23eeUxfvrOJaMUxWOnB5gTgPqUii0CS0yCakOfMwUoN7UhdYMGg2yCyK Dd1zwRWVkA56O52ozjxLMxz+41h/mkRLDOe210MNu6G387psR0f5UGyjSb6OzQiJYtZw /gChayCQF2kysHoCR28E2AGd6/imFGjvMIo/uU9cdJ+whwZIm3mdUsU5vxM9r1cZSBIs 1tjD1gYvX7dWVyqDeRm2WJirOTvOwGPj3zdpDPdxs6pKcHRNyncnkF723k8y8Ynb4kH6 ck+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=5/ZgyQAuQvE4YcOG34t++03WUxcDnhNMW/sElkvFii8=; b=IzwkS+KJUNfz4/0X284fjRxF6V9zH989+TCSnm5mGL0vZKL08Do4yjL4nmeE5OssIe S5I9H7ToCiCGFCQtY2TB3Tr2BTQ8ahAPDQCnwNBikE2lL37JR70AiwWeiD33eVf0E4hu LJ4SYGOT5G5dWRmg0+Pn3m9gT5yj/veiRSffq3tfT3i/QGOl5VoRWxn1aPks60MuwqiJ etKYZiVNrONPi4il/bpsWlrpSWT/4q/fKBFA4CHGhVDiar9gSl5oa0ddnVGybgEbHGIK 3eNXOqOA0buUKOpkN2DX76Qab1UF4/3s0IZCujGCOYSd9QQKp7DSQdZFkyZKw8sMzyCs 17wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Sm2DRgca; 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=fail (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 j2si8853129ybb.357.2021.02.05.15.00.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:00: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=fail header.i=@linaro.org header.s=google header.b=Sm2DRgca; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A5a-0006oG-1T for patch@linaro.org; Fri, 05 Feb 2021 18:00:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A28-0001CS-Bp for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:00 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:34043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A26-00039E-QJ for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:00 -0500 Received: by mail-pg1-x532.google.com with SMTP id o7so5596249pgl.1 for ; Fri, 05 Feb 2021 14:56:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5/ZgyQAuQvE4YcOG34t++03WUxcDnhNMW/sElkvFii8=; b=Sm2DRgcaealHOz6DVWja2oTH7ZYjsKCP9FKO/tiksAfYErg9t6Mp43YGDVYEEi5lYE spmLKi8Y6MOxzKH57JRnw2EeEt7czJGgb0705w+HGLadSUhJo654pSU5M4n3Hc2CEVyW gq9T6YtQ3lEps9GtREfxNIsP3BVhBeMLpP1LIUO3OjFpOlU1tS3lib19ZAFjwLDKwasv bYeQqG3yDfDrZjvoLmQltPN+1IMuRBVamT7Fht2g5xaUIZpkies8PmXfFWl/B54yZaBG J7v94qywKLlaBDcIoiaiq7WRZ4We/nlkC8Mmp0L46xLnnjhNoKGOOZwh47zU6xX0mcEd iRnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5/ZgyQAuQvE4YcOG34t++03WUxcDnhNMW/sElkvFii8=; b=P/fl7LiDLSqxDm2qHmE6Yyj4lG53oK+Wxw4r1ciAf3vGTnIRPScu9AB4y01HiXRteI g++ZvoPAutYRxJgpVPOeGIaV2A4Bf9wP+ucNa7oj74e3RODWW42gUSipNlypSbNHmZBV IQrqNHOHMLvC/3BH0GsS7/KCvWkjM0qVULWRuO9VyxpK6neV5NGRITx6YI1UgefqyAn+ GS84Z5C3a5ssQffneM38gAKL68rxefIiwmDgVkjKrQmrPNxrtoEfYpPgXRCVgkUJbuB3 Px8eh6MX4F37FlNEpEzMzjerLOnddjbV3IpUY0gjSQhXdzpWB/MlMOfNVGvIKGQGauTM YHJA== X-Gm-Message-State: AOAM530rvz0OqXz+YZmxqTVUl9M73hnzzZyCjMlK51ldYSJfu3IIhPQP 7tpKYTzPOaDmtM1JI21DjBQRWoGJEtR+5Juf X-Received: by 2002:a63:2306:: with SMTP id j6mr6591705pgj.187.1612565816421; Fri, 05 Feb 2021 14:56:56 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:56:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 01/46] tcg/s390: Fix compare instruction from extended-immediate facility Date: Fri, 5 Feb 2021 12:56:05 -1000 Message-Id: <20210205225650.1330794-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Richard W . M . Jones" , Miroslav Rezanina Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The code is currently comparing c2 to the type promotion of uint32_t and int32_t. That is, the conversion rules are as: (common_type) c2 == (common_type) (uint32_t) (is_unsigned ? (uint32_t)c2 : (uint32_t)(int32_t)c2) In the signed case we lose the desired sign extensions because of the argument promotion rules of the ternary operator. Solve the problem by doing the round-trip parsing through the intermediate type and back to the desired common type (all at one expression). Fixes: a534bb15f30 ("tcg/s390: Use constant pool for cmpi") Tested-by: Richard W.M. Jones Reviewed-by: David Hildenbrand Reported-by: Miroslav Rezanina Reported-by: Richard W.M. Jones Suggested-by: David Hildenbrand Suggested-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210204182902.1742826-1-f4bug@amsat.org> Signed-off-by: Richard Henderson --- tcg/s390/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/s390/tcg-target.c.inc b/tcg/s390/tcg-target.c.inc index b67470137c..695d7ee652 100644 --- a/tcg/s390/tcg-target.c.inc +++ b/tcg/s390/tcg-target.c.inc @@ -1067,7 +1067,7 @@ static int tgen_cmp(TCGContext *s, TCGType type, TCGCond c, TCGReg r1, op = (is_unsigned ? RIL_CLFI : RIL_CFI); tcg_out_insn_RIL(s, op, r1, c2); goto exit; - } else if (c2 == (is_unsigned ? (uint32_t)c2 : (int32_t)c2)) { + } else if (c2 == (is_unsigned ? (TCGArg)(uint32_t)c2 : (TCGArg)(int32_t)c2)) { op = (is_unsigned ? RIL_CLGFI : RIL_CGFI); tcg_out_insn_RIL(s, op, r1, c2); goto exit; From patchwork Fri Feb 5 22:56:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376983 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2572765ejt; Fri, 5 Feb 2021 14:59:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwASaqgx9Ao1z8p1P2XMz2DZHNhCoTLP7yR2/R2oONDUKrCQsY7yfhXJ2KmH7XP4U0vTkxZ X-Received: by 2002:a25:d209:: with SMTP id j9mr5217863ybg.175.1612565966428; Fri, 05 Feb 2021 14:59:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612565966; cv=none; d=google.com; s=arc-20160816; b=t/iq8roeMABuBne7GP4WjgQsoaitlyDoDccpFiNpO+9DANfaCwd0kQ8B0ArLHGkofz h6gZ6lzWNXlYBCcEoVfYEACRWWvtiXoHSV6Ap1SQMgwww31F7Ms86m4dffns61AEayRN Uw4aWrGpRBuR49EwtG34b6hNqbR0bDXsESOdS63/KJsonranX/TCIwqBiCn6vEoZ6oBB hgf/fRH4pVBNmmjWEiJ1K6ZEVrNE0jTkafwJ+G22I6xBrHtMlSpJTkwjVF5rqN+7MN/j cSJ+65QQAlps8WU9r/tf1G6HNDFH+imaRnSYgGH/X8O6hMmEZ51TQEzCdtk6CMlvj86L HCaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=SCva1h2dUQRt32RzqDb0V6uTgNEuULtJ+A8f47HZjL4=; b=0Zt2jShrCIaSpkvX5cw4ZR6A9X5Hnq0rJjzkD2tONRmsR2yPpepRD8Mpg8q2cwnTf2 YSCn2nOfLyEb20wFaq2xooxqEVqn4zliKIJuRPPswM9hOPpsPv++nNqAZSUQgZ/111PD 0v7nARhCPiik4Q/ZfbEvEdrKVxDQ4Q8k+gtv5LV+CAy3/qPIu9cU+18aVuXsHjXVmSqi LqDJ+XFE+dauj057GqNCj+ynV6akE9EPMFVG5QwAGqNunHCnJOBNEaGSQQFywWQz/gBE s84v9nGVGSGS060YReBMqoGiRMH88jX8qlGDeULTN4rs/H7MQpiN8kUWHa5BPOrL+Fu7 Gb8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=htVF+Elu; 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 x123si9945383ybe.87.2021.02.05.14.59.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 14:59:26 -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=htVF+Elu; 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]:47568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A4T-0004o7-Rz for patch@linaro.org; Fri, 05 Feb 2021 17:59:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A29-0001E4-1O for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:01 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:46296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A27-00039f-HK for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:00 -0500 Received: by mail-pg1-x52d.google.com with SMTP id r38so5545180pgk.13 for ; Fri, 05 Feb 2021 14:56:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SCva1h2dUQRt32RzqDb0V6uTgNEuULtJ+A8f47HZjL4=; b=htVF+EluHKDgvxHML7/wiWXYAPWb+lePSiMT/4EL3lMCaRy1SsEEiOBJKWfrivGYKj sKVDkeePBM69ZLEeKL7xn5xDHZoAhQPnSjj4np1LzrPmzRu2nYiqPQK5t3rVVzGHSl4J BUnJEoGPXUq3bj45YB6zsLZgdy69dDKwn+SFDzGBQJDe7qRuKKK1OhdBjE6C6G5uW5kQ zVzW8KmV+keN8DG1eoi5E3Os3iQhb2lr53jwK2VM04P1qAg8SK+WRfGhMRNJ8sU6btyb hrGAaSQjzTrNvK6OVRrf2MSDd7W1eVsb/8VQzuLLc7Kmr1vkuB5qYJTNoPGrtdyq6pW7 Ki/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SCva1h2dUQRt32RzqDb0V6uTgNEuULtJ+A8f47HZjL4=; b=NVecQ2HBYi41JKpKGjor6RprhCl2sUd8aDJVBbG2HsuhPN5nNYhqCeFo7xXDTaOnnG 9GD57gkobon0chf3uOfH0cuKnMHrElDYfcUuqMmfq+O8LSWElSoDGYRDQz+KeE4RmORY MAuNdHqQFCk9+wg8sJXOl+jk29x22AkK0+ntZR3ATDDfptUGqiBISB/ikWwPDtkEk7Wm +oY+mCbuQlPnVhYG7Y/wjRR7QS1cQrw69unmAfFNh03jPTZxZkj0ZbqNRwEikpq3vAbH 72YyBUBoHiZd+l+5NbGs2812nRfc5j8nN9Q982BT9hDeVzSZ7ri+pe/cifk5FF1Sa/Uo UMew== X-Gm-Message-State: AOAM532ZmLeZFk9ZjjtFEH+tDE6karJF0nzD7whcs4Y0Y47cRanlWYbX oYpYlq3AuhpZm/naKm1Slg8QKkYlLbb4eRrj X-Received: by 2002:a65:5903:: with SMTP id f3mr6810295pgu.28.1612565818122; Fri, 05 Feb 2021 14:56:58 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:56:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 02/46] exec/cpu-defs: Remove TCG backends dependency Date: Fri, 5 Feb 2021 12:56:06 -1000 Message-Id: <20210205225650.1330794-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé "exec/cpu-defs.h" contains generic CPU definitions for the TCG frontends (mostly related to TLB). TCG backends definitions aren't relevant here. See tcg/README description: 4) Backend tcg-target.h contains the target specific definitions. tcg-target.c.inc contains the target specific code; it is #included by tcg/tcg.c, rather than being a standalone C file. So far only "tcg/tcg.h" requires these headers. Remove the "target-tcg.h" header dependency on TCG frontends, so we don't have to rebuild all frontends when hacking a single backend. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210204191423.1754158-1-f4bug@amsat.org> Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h | 3 --- 1 file changed, 3 deletions(-) -- 2.25.1 diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index d1f5e3fc3d..ba3cd32a1e 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -25,9 +25,6 @@ #include "qemu/host-utils.h" #include "qemu/thread.h" -#ifdef CONFIG_TCG -#include "tcg-target.h" -#endif #ifndef CONFIG_USER_ONLY #include "exec/hwaddr.h" #endif From patchwork Fri Feb 5 22:56:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376987 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2575100ejt; Fri, 5 Feb 2021 15:02:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbqeykKwelQdwlo6BUn8HhJa2oTZ22plO1jESwxpUep6LQONGF1mHk9nQ17/+Lv3LSaG20 X-Received: by 2002:a25:7785:: with SMTP id s127mr9145697ybc.170.1612566150421; Fri, 05 Feb 2021 15:02:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566150; cv=none; d=google.com; s=arc-20160816; b=KScZI0zgI5bc3zJ3Ka+fa0gOROgs9koLD4ypUOY/kN18Drrfs/VxwD0Iogl5SAI3SN f1B67CcCmyPMvujWfKwl1LZJqHXNRGxRUf5m2c/pjDXcvC3AFpBEeKrTD4OHCYnApcVv +LM6ze4ihQCL9eqlaCjpCQ1CLNaGs3WrP7ZniOth3YILO86Tq2deQZXcFQZ8oJJXVrq4 Qhw9HmPxMKb5xIQPDA0hSgBUuvgCNKWOl+ucVIv2Wapj7DEpu35/iKtzQ4RLKf/v4GUs Z7TWsN47eD5SlImWi8TnbLACo5B8G9sCiFe2ZLv5jU+efvFe0jlkzEFLzvAGg3bz7iLg 2+OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=rQnZeltFcMCYQ9xe609eFENXoL/masnHJpQsAf4wZNg=; b=ValqI16p9KO6LoGDs4xsg8ESJxn1mish6LfKlFpwd0CdNvcULmlrYIFYl+3IOqtREw KFMXmyxJrKPU/0mkwevTh/VcxEIo7PEX3mrSZ3biSOoKwv6fPh75E2S0INqpZRFcTWzd vt59NHRv8/BMywcqkwwSAGD8HemLTHegEmMWtvWLAj5Ayexwalvg5G5sjivBRTCLS4J4 yA0pZWL0vZvkbrz9YXU8cx+HYRlESJLOeuuhkh13gYPt3UnwAlDNclJsDfuSyB3osxWW /zGqyLpWTiOl8c/LpJw5FSRdfuwFMmOnLBZ0GhZPEGTcj4gm2TqVGeIAiKoU0s6no7vJ TQUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GHNqfpXS; 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 c184si9903741yba.487.2021.02.05.15.02.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:02:30 -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=GHNqfpXS; 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]:56080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A7R-0008MV-SO for patch@linaro.org; Fri, 05 Feb 2021 18:02:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2A-0001Hn-Ma for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:02 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:55621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A29-0003B0-2y for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:02 -0500 Received: by mail-pj1-x1032.google.com with SMTP id s24so4425143pjp.5 for ; Fri, 05 Feb 2021 14:57:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rQnZeltFcMCYQ9xe609eFENXoL/masnHJpQsAf4wZNg=; b=GHNqfpXSHIROClfIVl+N/5pYROaVcWeR8tjhC2QVA9ges6CHZjlY9wQprFjkoB7Z4m xpzxJfe3/ATqE6gIQzt4bNMEfC+jUqdkdUHXUmzKK2Zp5dU5DaDCbwsjmIkrSQeuoBhO TJyg0Ut1LyjVqMfQoSkq3ZumfLzjpLSX92yI0NhUTI73V2LZAk7Qxj+FuErMYtzuwg7L JAexHw8Y2VzlZJ1UtFiFhxTwcfiv83Le+5yVk5sK/1xzIQEB+mCQqWyYL/fvzXLIr9cM pUPvktZx5wehsXRLRLsNS8hB69zIWarlCdIK+nrgLFQXNghhMUNysz1MQyCRlYO0c3bO CxMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rQnZeltFcMCYQ9xe609eFENXoL/masnHJpQsAf4wZNg=; b=Mj5cw3aN4a2TYqIpJhtCb0frYR9C2tyVsR8eey4wE8XPOkKM+MlnMjk0UwugSJHubu eoh47FjtGFI7/YY8iogtf6Nt0wN0lemhZPk4Ud1SvYrI3tN1okRUbGrlyRdOfK2dnjFw oQtYpRxE0znZ0EIFbJ7iYNDc6e2qTGdOD39vIrITS1atma1N1AY/X21TTr2oJjYceH3A p0aE4rdfawb8qlsmaxVjq8GjPvGnB49BH/BwukKlRrR+K4mr/a26vP8BW/0nmYanPU8V Ssv86QpR46jOywYUiQ2yovUZI4StaBGmi+QIXNBZtJaZ3xD7ejYPHa+qFbwAuRIDLqb9 3EcQ== X-Gm-Message-State: AOAM533dbOql+Y02OzOnsNSutecRZHZs2frhweftHeV1HI9N+QZjLhcR O9716/PHd5J2RhZc9e0kiPn+namPwxqZo6dd X-Received: by 2002:a17:90a:7608:: with SMTP id s8mr6275860pjk.105.1612565819751; Fri, 05 Feb 2021 14:56:59 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:56:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/46] tcg/aarch64: Do not convert TCGArg to temps that are not temps Date: Fri, 5 Feb 2021 12:56:07 -1000 Message-Id: <20210205225650.1330794-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Fixes INDEX_op_rotli_vec for aarch64 host, where the 3rd argument is an integer, not a temporary, which now tickles an assert added in e89b28a6350. Previously, the value computed into v2 would be garbage for rotli_vec, but as the value was unused it caused no harm. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 3c1ee39fd4..1376cdc404 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -2488,7 +2488,7 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, v0 = temp_tcgv_vec(arg_temp(a0)); v1 = temp_tcgv_vec(arg_temp(va_arg(va, TCGArg))); a2 = va_arg(va, TCGArg); - v2 = temp_tcgv_vec(arg_temp(a2)); + va_end(va); switch (opc) { case INDEX_op_rotli_vec: @@ -2502,6 +2502,7 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, case INDEX_op_shrv_vec: case INDEX_op_sarv_vec: /* Right shifts are negative left shifts for AArch64. */ + v2 = temp_tcgv_vec(arg_temp(a2)); t1 = tcg_temp_new_vec(type); tcg_gen_neg_vec(vece, t1, v2); opc = (opc == INDEX_op_shrv_vec @@ -2512,6 +2513,7 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, break; case INDEX_op_rotlv_vec: + v2 = temp_tcgv_vec(arg_temp(a2)); t1 = tcg_temp_new_vec(type); c1 = tcg_constant_vec(type, vece, 8 << vece); tcg_gen_sub_vec(vece, t1, v2, c1); @@ -2525,6 +2527,7 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, break; case INDEX_op_rotrv_vec: + v2 = temp_tcgv_vec(arg_temp(a2)); t1 = tcg_temp_new_vec(type); t2 = tcg_temp_new_vec(type); c1 = tcg_constant_vec(type, vece, 8 << vece); @@ -2543,8 +2546,6 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, default: g_assert_not_reached(); } - - va_end(va); } static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) From patchwork Fri Feb 5 22:56:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376986 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2575060ejt; Fri, 5 Feb 2021 15:02:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOe9Crm5qiMDB69orO8HiADgVHJe1Ye6rSRqicDT9SqoO5aVw8fP9Npnk/xYsGxF2mnFLB X-Received: by 2002:a25:a541:: with SMTP id h59mr9806111ybi.203.1612566147497; Fri, 05 Feb 2021 15:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566147; cv=none; d=google.com; s=arc-20160816; b=g0ImLVAcBa92Enu9tPfeOAUolVajxp+a3akevYfNNHltCtze/0+troyCs7w7CUeP2r TFr1vKi6Ayxb1fKrzUyFXkgVKADjZH5ddoabKZhevQFJ81zluhNM45ww3pgVzpuZMJty +SZlvjdsrRT2iNYnM50+roU0alqxp/Umb1+nhM/hTWwLpL3kTsArMITs1zSg1rzI12kB h41lJ2QJPA0nZdOyC+15FYQg/8YeMGcWZt51JH/a2ld7kNa1N7L3NiNlTs/1rSJ8prSW WtbN+sk4BaTEWLD1vr0WVbadAKd6l5rcKVHYWkdNQZz8aEOmKWUQ1+j0OkwE6T9kbuma yrNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=C3tpiU3zelsjFSQQuB1ZzEawshUyJREYmvhF2hEYIiM=; b=JCca9H4yRy8CKi0iBltxd8Lm0xW2vIyKn3Lhx9V3rX83Vsd+ED75jDRArddQD2giOw JA1phL/o2vt6eUMVNDSeTgq3R+Ky23/cx09u0gXU2Z6fT7ufMxJXq0nYxSbqL7QlydPd 6AXc7PLO4e78vc/STbmqzcq+fQ7G44/Y5IZLZAqJZkaSRBgO7xROPHYMzL/uuD/ZEI4F Dw8wzbIWE/exEcdBcXB9VY0jAJZWtoiYP9qf4WFGHHuhy6Cl90vmNZDAwC8IjhNDMAYY tht+ygMGv2cUU/JUUaPTiG+gvPujh5HcREBm7WYkhoIn1n2nAtmrHe9udwN23/5eiXPb hJdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QUAPEzlk; 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=fail (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 x4si10389692ybt.319.2021.02.05.15.02.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:02:27 -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=fail header.i=@linaro.org header.s=google header.b=QUAPEzlk; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A7O-0008He-UJ for patch@linaro.org; Fri, 05 Feb 2021 18:02:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2C-0001N2-Kv for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:04 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:42603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2B-0003BL-52 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:04 -0500 Received: by mail-pg1-x536.google.com with SMTP id g15so5561106pgu.9 for ; Fri, 05 Feb 2021 14:57:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C3tpiU3zelsjFSQQuB1ZzEawshUyJREYmvhF2hEYIiM=; b=QUAPEzlkG4XEJ7gMS87qaxkHynxo19jFCLuslZRJs4ZkqlNd8UkIyqKWpU3IA38tvA w3pJS5caJR1jYV/LUam/0nHmCzC5uAHIh0mxEh3YwdMmXSxLQ0e7N6BvvNNP8/2s/EeD +jPNfYfDn9DZznrUQBZ6LcudBt49tRqI7BZI7lIS01skmPqsqaZ8WNh/L4RWu8XQDGDX FVBndbGJOv0Bb60fCysHasNKwmu3DqNkK1W6VDiVPdBfF+HUdhJG/uxX+XQR4rHadDrP dQB7UiirpIrQSjiOklW8CGnOcXxH9yCXpm7Tfcxvvf6e7Hu96JlZHwDyBdwviP8UKvKB QQDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C3tpiU3zelsjFSQQuB1ZzEawshUyJREYmvhF2hEYIiM=; b=pgZChAsm//7kHmUs7dxYSwm2hCNpjSts35npekyor/oMjuPTvJLoKzPUdrNLf3SEn8 ze+HANxNKie4GF0xVXnjKPik2Npx9rgPrm+gFl+eXe7a+ySL/wQ/Pn+PRAwIcivr7McY AvZE/zwCFmyUcN9yn57+Cz+4N9CKMNm3S0ytvu3ZdOGuhOkInPN3/BoEdi3VU5URJ2s8 jLSZdr/e2vfsWXleZv742jiQzZ/8WVNnyDptmDuxs6Af9EAY/6p1IYQivZZIsWgXU6a9 CILz9VByOAXs2oyCzaoBhSZD04LgO2WdXp4kCjZTfYjdYtRwGeBA+rTShXxexAC1Aoku ZMqg== X-Gm-Message-State: AOAM530/zjmMggbp76GopwC+DE/3d4mNXzPijg2Hi4CmMpaO7Xf1ykJK E5X0A+JQAqbAIQWx1xlufptMem89Q2OsPIQY X-Received: by 2002:a65:6119:: with SMTP id z25mr6366426pgu.17.1612565821947; Fri, 05 Feb 2021 14:57:01 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 04/46] configure: Fix --enable-tcg-interpreter Date: Fri, 5 Feb 2021 12:56:08 -1000 Message-Id: <20210205225650.1330794-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The configure option was backward, and we failed to pass the value on to meson. Fixes: 23a77b2d18b ("build-system: clean up TCG/TCI configury") Tested-by: Stefan Weil Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- configure | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/configure b/configure index e85d6baf8f..a34f91171d 100755 --- a/configure +++ b/configure @@ -1110,9 +1110,9 @@ for opt do ;; --enable-whpx) whpx="enabled" ;; - --disable-tcg-interpreter) tcg_interpreter="true" + --disable-tcg-interpreter) tcg_interpreter="false" ;; - --enable-tcg-interpreter) tcg_interpreter="false" + --enable-tcg-interpreter) tcg_interpreter="true" ;; --disable-cap-ng) cap_ng="disabled" ;; @@ -6417,6 +6417,7 @@ NINJA=$ninja $meson setup \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi \ $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \ + -Dtcg_interpreter=$tcg_interpreter \ $cross_arg \ "$PWD" "$source_path" From patchwork Fri Feb 5 22:56:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376997 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2576661ejt; Fri, 5 Feb 2021 15:04:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyty6w+vwjKkMeWq1xqbS2nS9FTfnzAu1Abr2Px0cf1VdSSiAC3sAz2a/4SG+h+gOxBUBe2 X-Received: by 2002:a25:3056:: with SMTP id w83mr9086419ybw.504.1612566279125; Fri, 05 Feb 2021 15:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566279; cv=none; d=google.com; s=arc-20160816; b=ZZ+2EEgdgmv2n92WDKAh0CU21lIpNjl+jCM4Qtk0x3BqlvKCsq+tuwd3twd+Locgxj UWOGaq/fFeXldRpbRCOyhgEpwXLvLjE7THzbpG4KWk29U89sKilnQ4QfyOJf3Eh5YMt/ DT79nzeUICkJE8/wi/tBpaesYzTwLbT203bAQGMakeIF7GvxPbdanpYlKx5tBDksNlx2 WxQ+7MVLTakjRwdUUQA56dLM69KLTAecXeoXw85Tohs5oMleHSU0A4AcuE/Wstj9MrWg RVsJNvZSiGmN5PZlgndjcP3LBbabvv95EGwvX7bixUgzBQccivEzl0GaYy7MDUvkLfZP /mSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=GERD/esKSxShFOguv3KoJ5qwPYQvSGdHFbj2dQY7+2M=; b=TF560bVh3Rp1atG94Ep7+t9qFMuEbUE2ZxNqD+heWOrevD0WIbIX8KD4OnAbyAmMz2 R9vPhw/tR+CVQrKB6/rqHs3hpzz8QWfqGMndfXzUyC8EODJwA9MfifrEvhmwIksv8WmC U2dIGeX//4Z0PU24y5SQHlL8knUknxI8A/GSTnRfPAra0GZV744nbyk9YAHPOMpqBAQC An9PPjGfz5Ke7nuGrkr4O1q0wglQrfe5u3LtXPoMqLJBuy9SPn9nc38LNIHlM8l3BNe3 JUohWs49/D+HuzaB7DV+75xN4kW1MmBWfTzriOJNsUdTA1LSK2EZJIzrd5oIAUbGMGgG C6BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o0lNxANi; 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 v6si9401065ybs.431.2021.02.05.15.04.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:04:39 -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=o0lNxANi; 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]:36182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A9W-0003Jv-GE for patch@linaro.org; Fri, 05 Feb 2021 18:04:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2E-0001Sw-PW for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:06 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:46930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2D-0003D4-1l for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:06 -0500 Received: by mail-pl1-x636.google.com with SMTP id u11so4289774plg.13 for ; Fri, 05 Feb 2021 14:57:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GERD/esKSxShFOguv3KoJ5qwPYQvSGdHFbj2dQY7+2M=; b=o0lNxANib8fu5MqZ0FUHOgr5gkOwK8PgPdachVt11ZErBZ5rYLKp7SEEfR4VN6kqw6 SFIe5rA4n2DY6He+7uBmdHGKH0y0lwI3xcOCMsMf8vmDyl/hNWM57i7DUvxdzYLMnOSj A84PJzmzWfNsYf7E5Hc2ibe6edvTn+E0oB5MOlUc/o4u8UAr/D+V8L+RbCFBRiLqyxxs RQjxspaARavgBABsJS0tYNhal91t7uErOrh+gMh8zwVPjEc08leEPIxPbZXQPvE8hXxi j2cgcbsl6J3uPtSPUCUbiUt9pdNjvCpw8UlW+pyufuj3H4BWb2fiFvyuD4VMAGMlV75+ 9gRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GERD/esKSxShFOguv3KoJ5qwPYQvSGdHFbj2dQY7+2M=; b=PbiQyhxL2HeaMJgVCdufAqe3gR20K8m97uW3YJxws447H9vm9X2JBfb7YAzxq5Uf47 kD6cNOvRw5VPyPpKIM3fjVNMBwvWT6Tn7xoZSCnRyecaWxfg9Rd6Gf2r33AzZdwdMlQh dk9NqHtgC/jZlY5IaZJQKynZq4ljFbOUtOcoSpsp1A4KiGeXydTqixwWgppsqO6OrcC4 f7BabFCzcn1MB8hmWMqi3YfqYVeIinvfdOSGnxDJDMH2bgW6aXGrb7c+tNSJqGzANL6d zRjl0NABchi6wlPdX3/3X+npDLf/FTvi149AqDEfGIFq4FkLF5j1PRuQ3Qy6xJfVcL4J yg2A== X-Gm-Message-State: AOAM530+ap6No+GnkQfr1Yt463J/DGQhAXq2rrcs4TXCiYjrcXWYfE6w /17Y78G/E2FCsZvrrkUHlmTfBqFJmkHBbxMV X-Received: by 2002:a17:90a:f416:: with SMTP id ch22mr6233955pjb.61.1612565823735; Fri, 05 Feb 2021 14:57:03 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 05/46] tcg/tci: Make tci_tb_ptr thread-local Date: Fri, 5 Feb 2021 12:56:09 -1000 Message-Id: <20210205225650.1330794-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Each thread must have its own pc, even under TCI. Remove the GETPC ifdef, because GETPC is always available for helpers, and thus is always required. Move the assignment under INDEX_op_call, because the value is only visible when we make a call to a helper function. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-Id: <20210204014509.882821-6-richard.henderson@linaro.org> --- include/exec/exec-all.h | 2 +- tcg/tcg-common.c | 4 ---- tcg/tci.c | 7 +++---- 3 files changed, 4 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 125000bcf7..f933c74c44 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -544,7 +544,7 @@ void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr); /* GETPC is the true target of the return instruction that we'll execute. */ #if defined(CONFIG_TCG_INTERPRETER) -extern uintptr_t tci_tb_ptr; +extern __thread uintptr_t tci_tb_ptr; # define GETPC() tci_tb_ptr #else # define GETPC() \ diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c index 7e1992e79e..aa0c4f60c9 100644 --- a/tcg/tcg-common.c +++ b/tcg/tcg-common.c @@ -25,10 +25,6 @@ #include "qemu/osdep.h" #include "tcg/tcg.h" -#if defined(CONFIG_TCG_INTERPRETER) -uintptr_t tci_tb_ptr; -#endif - TCGOpDef tcg_op_defs[] = { #define DEF(s, oargs, iargs, cargs, flags) \ { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags }, diff --git a/tcg/tci.c b/tcg/tci.c index 3fc82d3c79..b3f9531a73 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -57,6 +57,8 @@ typedef uint64_t (*helper_function)(tcg_target_ulong, tcg_target_ulong, tcg_target_ulong, tcg_target_ulong); #endif +__thread uintptr_t tci_tb_ptr; + static tcg_target_ulong tci_read_reg(const tcg_target_ulong *regs, TCGReg index) { tci_assert(index < TCG_TARGET_NB_REGS); @@ -526,16 +528,13 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif TCGMemOpIdx oi; -#if defined(GETPC) - tci_tb_ptr = (uintptr_t)tb_ptr; -#endif - /* Skip opcode and size entry. */ tb_ptr += 2; switch (opc) { case INDEX_op_call: t0 = tci_read_ri(regs, &tb_ptr); + tci_tb_ptr = (uintptr_t)tb_ptr; #if TCG_TARGET_REG_BITS == 32 tmp64 = ((helper_function)t0)(tci_read_reg(regs, TCG_REG_R0), tci_read_reg(regs, TCG_REG_R1), From patchwork Fri Feb 5 22:56:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376992 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2576138ejt; Fri, 5 Feb 2021 15:03:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNkswHqP//BXWNunaZKONLAtiTsEcPB+Mac2gqZFdFLKwfewsYGRZ3R3AKCPvRkJN2qGkW X-Received: by 2002:a25:84cb:: with SMTP id x11mr10210938ybm.63.1612566231986; Fri, 05 Feb 2021 15:03:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566231; cv=none; d=google.com; s=arc-20160816; b=t/YJ6nwdYYW/hMQiSbQpj9W793lV1XzLIPnyy0Gd77Mdmp2cPiO8Lf9dcJ9N61yJs2 Hu2YkBZfh/zlJu2rPvk5Lkb70+FhNOOfAtDTEQC0TWQqy8L26UtxcfID+ZlwyjT1m8t6 2bTY2McoJ4cY1N0a2mP8PeTYqK8YV1WHwkq/dzSdMPLOTndZGutUC1hDLm9/D2MWKUDB JKMbFmds2Ry54FCgxhVzHG6qFFPzH5LNPy4P2I9kRYqnB7Tqz48z1Mp8CgLm2uvABQ4v 2XPVXNRlN7IZwPTLqBGU4jej9jE2Lyl+Mp0KBdaMOQYzmXJ64ocPpvMMzbcGPGVqiUSH 9Ydw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=onZUWhtxKDVzYiKYm4mcVALF5M4RSZvicSg1zN9qm0A=; b=DK8YoQlWFSYpXc2QZZdh67ojKXQtq+Pdve3ZhZfjZUd7v010cul7IXo8R9Q0ep2izf ZdVZtfxOdf5XnSCyWQGJTNGv3AXmKxmInth0gkzlnlQW53B4eaDCOgTtK/59aepJOjr5 0yBOuAL9l7xnDsFpzky4kKFgitY7QPrP1DJZGdsK/mf0Ean/ukMyPGNkPMMUbo6Q8M3N /96OP/UR4hiTSfcWAenCCyPMOFVCaGdgub3dbxDrPZiSxfy4kgi5YAvsIpUuXT9iyNZ3 u9gkYH1Z9XuR5CTd7kYaNA6orGS/A1wm1FI4zEpQzjG+jIDQye/fQPXCjsVtZUox6tUV fmcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rRqbavEk; 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=fail (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 u17si10198456ybc.124.2021.02.05.15.03.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:03:51 -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=fail header.i=@linaro.org header.s=google header.b=rRqbavEk; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:32956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A8l-000218-Dk for patch@linaro.org; Fri, 05 Feb 2021 18:03:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2I-0001cE-3F for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:10 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:34492) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2F-0003Ej-4E for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:09 -0500 Received: by mail-pj1-x102d.google.com with SMTP id my11so7280894pjb.1 for ; Fri, 05 Feb 2021 14:57:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=onZUWhtxKDVzYiKYm4mcVALF5M4RSZvicSg1zN9qm0A=; b=rRqbavEkSdzF62xluHGJYEZ8pXsYRCMlTwKs9yY+BHwOk2yO84rwfevjS2i3Ail8jd UVmZyLjTGda4OmribsxTmBA2DfyoxIeZMugSpFmFxMYspT2FNTCa1xDVgWfn4aRFAXzb HvNtsA5WLiS19Eu8p4f4i12UIDnld/lGgfprxHoVsOHA5FvKGcUasK63YzOS+LSSU/vn eIbgzdGZ3SQnwDJMGfw874qRi/U6qURtR4TZD/23dDW5hpptJU7UodKgQQ93GVDm0AfK WNjgFOjbeKN9opLrYi+tHUshwJn36fsvI2Kfl+/wo1p/eRgOikbke5anQpKYB3VmwpRL jFAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=onZUWhtxKDVzYiKYm4mcVALF5M4RSZvicSg1zN9qm0A=; b=hHsdb2kl8sgQyfTfWkU8l3FndUW64xy59x7gnfqwNLu2TIRYLikeKgSX3jS3bPOcGA JRVy2efSVonv742Z4pM5Gnx9BNDn03MrwrMIwLPFMMBXd0gAb2t1oYI5uHPSUvDyt6aa L56XD2Gkhlr6G866AnW/rSi3atRp9/vgvQoW1x1PQYtzriPAk1UqgRet3WA9PNA5+5yZ m0gtNVX9MHXTeDOYtk9wEkFaCMhoQ8Nplk6OYJUrBtDjg56J38jQyvvdPAuHMF970JH6 KyMBijANTQkVMzj20K/jX9nWeWTxcWl5ogvlvJLS/9QoR/HHUHz8uEIaOCgrla7Yzcgk ai4w== X-Gm-Message-State: AOAM530uC/2mIPhvp3Np1PrkxULmPrumq4etqw7GZDj/3UDlCwSargVO HkRre4M5yz87MdMymUZJlV9GrZE2iqMkREaq X-Received: by 2002:a17:90a:d09:: with SMTP id t9mr6523369pja.139.1612565825805; Fri, 05 Feb 2021 14:57:05 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/46] tcg/tci: Implement INDEX_op_ld16s_i32 Date: Fri, 5 Feb 2021 12:56:10 -1000 Message-Id: <20210205225650.1330794-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Stefan Weil Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Stefan Weil That TCG opcode is used by debian-buster (arm64) running ffmpeg: qemu-aarch64 /usr/bin/ffmpeg -i theora.mkv theora.webm Tested-by: Alex Bennée Reviewed-by: Alex Bennée Reported-by: Alex Bennée Signed-off-by: Stefan Weil Message-Id: <20210128024814.2056958-1-sw@weilnetz.de> Signed-off-by: Richard Henderson --- tcg/tci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index b3f9531a73..2ba97da189 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -615,7 +615,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, TODO(); break; case INDEX_op_ld16s_i32: - TODO(); + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_s32(&tb_ptr); + tci_write_reg(regs, t0, *(int16_t *)(t1 + t2)); break; case INDEX_op_ld_i32: t0 = *tb_ptr++; From patchwork Fri Feb 5 22:56:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376984 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2573151ejt; Fri, 5 Feb 2021 15:00:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRbahalSgSSoAi2Jso3SV0kyAX0EkQGATk/Lnxw5aTM9i3XJqbZvmUsCH6eQyOTspbZMow X-Received: by 2002:a25:8e02:: with SMTP id p2mr9758283ybl.416.1612566012093; Fri, 05 Feb 2021 15:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566012; cv=none; d=google.com; s=arc-20160816; b=aQNmX/1DreTfRGpoW0emrIRz5wqJIkJI/RdMMDch1y40Xi1ft8RsFTc/DxCsJJPbZ5 QNzcWhmM7frgqzBcZO6c0CwREsevRByd3gdnV5X9zUzFnm1rYFiFyJDjtqZjLFI2D9rw VfrAnw7w3NYKygHWl3BLIHxv8kr8KD3lP0yshxgL8q58H8//x2ancGjfBxd4ZBNTRlaP Gufm/Ob8h7B5b/h5FOc7bwZI7XUimFJmYEsIBRAOy7Y9rv9bhY9vlw5MrMhXbyPfOeY8 Fjw4gZLnSVOnomSBue4Gn/Ijaw4W1a6Ju64TYt3ozXYP2jIZwwJyxoJcgg1sZScbXvX1 zwbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=tnzvFG8Gmy7YN7i7Jw+CtzTgCAPtOrT7NLuSzhM8paA=; b=q2wAPvshB7fnTT/Rc09mEvFistJli69RuqaruLpkzimQWK2qiCK2rjHMJP+/ssk5Zp dkG6LZ6w3dc5iTa0JUzLw+kY4j88hUnLKRZ1respj+XYIhSLoHWLMKduSztAHkWhkPjn 6bhbcBr7WSI6Ct0gUPBgSmv0Nu2UUlT+2jqPhfsxIUYrfBOZlW979jwnoVwBFssGQ7W1 5IpK+nK5KLBPyOTJvh9EqzRve4c8um6/NkJf87tcre9HwS2T6N0TUfctDq44K4a0jEhx rWziJ8T+9P8+K5Cg8K9Dz+tWorcR7+BlveVH1RNPfcEMIGu/nel92iHpTeQuhD0lck5b 8CFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZK9eVMs1; 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=fail (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 g23si8566427ybe.439.2021.02.05.15.00.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:00:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZK9eVMs1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A5D-0005zn-F8 for patch@linaro.org; Fri, 05 Feb 2021 18:00:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2I-0001ep-OI for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:10 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:45832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2H-0003F0-6d for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:10 -0500 Received: by mail-pg1-x52c.google.com with SMTP id o21so4167693pgn.12 for ; Fri, 05 Feb 2021 14:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tnzvFG8Gmy7YN7i7Jw+CtzTgCAPtOrT7NLuSzhM8paA=; b=ZK9eVMs1HmuWwrPAfwI6mXAx6Gi8fKddXmphBsVExjY2X+WMFtjUJ2dyo44ziyebHz 80onARvTPmYVG2uF+PU1kgrVfKKtjzVHxF8UaRiz5F6Ef1B0L4iO+NZOV3DyI05H/lwS QCTU4XYPY9AgIh/aC4nw8J7yaxy6niq+tIxOWUa6YmGiNITVD8z4lXzgT0HvzZhWbwcP ifUKDj+A+T/BCvjjNrLzp49f95dOC0M8+zpankGQvpFORQLRj2BVDZaBmcqZS5ynb/DZ KYyt/tFFpkNCor71ZyTrxaLngJQsLUMS3s6UhndW7a/V2FlK2BIWY9eKVdPlXN9ol0bm ogfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tnzvFG8Gmy7YN7i7Jw+CtzTgCAPtOrT7NLuSzhM8paA=; b=jpivEFwx7p2BtqAlZ5aLGFi8yjqaEZ/n+q4G8cL1NWWnBQWrY7P0fDsRgjuBHTGMDC FuMq8lIW+MFfOob9W+8II/IZvJAa0zhnDpfAJAaMGNCsrzD85NZSQkvxhs3CgPy0VFHp sk0Ph+46vTHUWZLP1hNWBRBIMg6X8BJsKGWPem/o8lSUSw+UkYjpz242GdpJmZWRUtPb spR/TLLuSavnJ6zMvTQJvAHZlyJOR7oyylqdjIojw0pJ8vpbw0xIi5VP2jBsHf/4qw/H gvzHZg2TQO/JsiG5iim3YhuN8ECBFAon9pY1H0bd6W5TOemBLsWcPt20mgwfCHEbNraR 3wDg== X-Gm-Message-State: AOAM5333hVDFv1mE4wUWYbZHTWCdTpowd+RLkkfOdk92jEYsdi1BV8UQ N1gIYA0rC91QCXdhKUN3NhwVEuYRhH2GMLEv X-Received: by 2002:a62:444:0:b029:1bc:ebb6:71f8 with SMTP id 65-20020a6204440000b02901bcebb671f8mr6318620pfe.75.1612565828000; Fri, 05 Feb 2021 14:57:08 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/46] tcg/tci: Implement INDEX_op_ld8s_i64 Date: Fri, 5 Feb 2021 12:56:11 -1000 Message-Id: <20210205225650.1330794-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Stefan Weil Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Stefan Weil That TCG opcode is used by debian-buster (arm64) running ffmpeg: qemu-aarch64 /usr/bin/ffmpeg -i theora.mkv theora.webm Tested-by: Alex Bennée Reviewed-by: Alex Bennée Reported-by: Alex Bennée Signed-off-by: Stefan Weil Message-Id: <20210128020425.2055454-1-sw@weilnetz.de> Signed-off-by: Richard Henderson --- tcg/tci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 2ba97da189..c3a8511dfe 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -883,7 +883,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg8(regs, t0, *(uint8_t *)(t1 + t2)); break; case INDEX_op_ld8s_i64: - TODO(); + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_s32(&tb_ptr); + tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); break; case INDEX_op_ld16u_i64: t0 = *tb_ptr++; From patchwork Fri Feb 5 22:56:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376989 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2575683ejt; Fri, 5 Feb 2021 15:03:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwccfG0MGM8LPBGXriufJRuEVW/rdJTEWNEKvCzO8FfED3YEQnMDqttEOPRP2m0nrjxr5AH X-Received: by 2002:a25:55c5:: with SMTP id j188mr9006118ybb.455.1612566191420; Fri, 05 Feb 2021 15:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566191; cv=none; d=google.com; s=arc-20160816; b=Fv3mS5+0RdMGi2LqqMEqPOwlJb/4Mm9QynBSi4gn6iceRSJl4xGa8bRQbLCjBJ8AyT 2/LzJ+nTIHtU0GicfIzO8IGMF1zNHyCFtnbop3fy4DyDEQPOCKRWwueATVQX2zsN1BtY mk/r6IUPjD/raZ020EVWYPBxNOPPPwtUVsTad0wA7niaRwMdbmi2yVF0qZtcXgfFie9w l/wjuwYrPisK3oeEJHcugCYPU/PQh/xwatA7A9JH4bzVdh3vF94F8GFpi8xABIc/1+xv /impkkSP+sYgvwTJnqq16CILP5kKNct9/1E7lEvRjo60xxIIORxo5hitCCR4bX+V4RJE Ymiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Tquh43lruzGWRcmOiBMYX1Wiqh+FHEpp7zn+YOCAYms=; b=bxLP0yX1QF3lPSBNHQNr8mL2P6Y5lycjogdKCcHDjuBe5D/9SJ9TsJJtXB1/2WwuFy PCffus0fSt5Eo2PB0DP1udB0REgy4TvORzsRkUHxk462k+zN7EmkFN20vnSydxINwuN0 0H1qWVFuC5lyhJglALCKhkIEk0m8CXwlRZ0biY1CXBsazb15CsjGFTcuQFR7YnebCfiy 4rjp/FKpF2o/4nEsg/TRY+SiRJ/HqXIgsVZsdAplm+xCnHboBI5y2I9lPFjnGycZgip4 nwoY3ziOg1htezWxY9Ii3UIuFTIlsBzss2o74ZsuhVtaIwI/vuHdnDXX8oNeL+aMrbVi ugWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GsECdYiY; 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 d184si9746683ybh.185.2021.02.05.15.03.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:03:11 -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=GsECdYiY; 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]:59144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A86-0001B9-Pf for patch@linaro.org; Fri, 05 Feb 2021 18:03:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2K-0001iY-8I for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:12 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:39178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2I-0003GG-RK for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:12 -0500 Received: by mail-pf1-x42b.google.com with SMTP id x23so3795812pfn.6 for ; Fri, 05 Feb 2021 14:57:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tquh43lruzGWRcmOiBMYX1Wiqh+FHEpp7zn+YOCAYms=; b=GsECdYiYnf3/hnoqh4DaqMeFNXAtKiuM8/yypajc2URy6/NRTAT5tAaoA2FCvBYe9w Zvh3Mfvn/DPOBts/6OBNFS4T9gEiouKoLp8YRjMBFDW+kX30FjihuuFUlYvocF+cZlit +g9C16d5c0lGom2CQiF9swpzLlFe9rW0lUnHA0QP31nI+9nHTo4LcehUI3Gl6Q284eav Kpmz5YLRaPkq31LCcXTJOpj73x58HAbUZz0upVDbuqBYen/q47gjBYyJoHoMUPBuBfeb QRU4xETeWq0OCQkEVFbdS7LI3VTRYLFsHovJfSJzvxq3AEV53gI4koyENmI1mqRZZ8F7 IvJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tquh43lruzGWRcmOiBMYX1Wiqh+FHEpp7zn+YOCAYms=; b=lu9KrFd/UY2e5J7EbJyE0nY1gDdcJqPI8NEUbkvlWbGL3BRLfGwwTfu+Y/nRaQwRsF AlZ5jlZcCShXGtfPHAdOgPuhJc0O891wlqyT/nXELsqYf/H7fhHLZA+bIioPd/huW7Cy 0ond9tOepm32AG7CfR65H6km7kCaXPD/+u9MTTIO8WypKdyWpUAQUs3vgwMi7HqLPkHo PCpWc/ZgKPvBqQj+msh9TRkbLVDq4XelAGhE2Lg7tyWaEhHCr747CwlCS83zmfN0nPdb xjzTK4N0xx0XnmmLnTgNcLhjPvGviIeBQEV4KaH3YV1KE3lg7XBsLUl2LaPJZ8Ww5NDo tyQw== X-Gm-Message-State: AOAM5323gkZqJyOwjFNlBUVr/GrcHMlDPY6cJpV0N952hodRGrkYw0qB Qgks0FdI+vJWduw8BUKrQCavGfqr7bcL6ug+ X-Received: by 2002:a62:ea14:0:b029:1bf:f580:3375 with SMTP id t20-20020a62ea140000b02901bff5803375mr6748933pfh.53.1612565829641; Fri, 05 Feb 2021 14:57:09 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 08/46] tcg/tci: Inline tci_write_reg32s into the only caller Date: Fri, 5 Feb 2021 12:56:12 -1000 Message-Id: <20210205225650.1330794-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index c3a8511dfe..e8023b5384 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -117,14 +117,6 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -#if TCG_TARGET_REG_BITS == 64 -static void -tci_write_reg32s(tcg_target_ulong *regs, TCGReg index, int32_t value) -{ - tci_write_reg(regs, index, value); -} -#endif - static void tci_write_reg8(tcg_target_ulong *regs, TCGReg index, uint8_t value) { tci_write_reg(regs, index, value); @@ -907,7 +899,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg32s(regs, t0, *(int32_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(int32_t *)(t1 + t2)); break; case INDEX_op_ld_i64: t0 = *tb_ptr++; From patchwork Fri Feb 5 22:56:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377001 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2578441ejt; Fri, 5 Feb 2021 15:07:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJze9vypkNaxczst2zxa9Y0d5pkakZrozTFaUCPrOBVSJLbSZfFLoXHZLmusSSVmHHxBoqd3 X-Received: by 2002:a25:a088:: with SMTP id y8mr9853048ybh.512.1612566437320; Fri, 05 Feb 2021 15:07:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566437; cv=none; d=google.com; s=arc-20160816; b=d5pJbGyT8c17KIBx/FnPRG9IG167zdri68j7XJL+kqkLGtv3jCbOBBFwA89uBTwvS3 D3Ny8RlCKPVjcOs23HqUkW6rZwDztaAkJtqw+wl5ESoPXmK8USgeacubAbRe0Q19rf8f hXCR8T5skuO+dV6osEbN036ngviSB7pyeE/z3vwW5IIchYPKxA5I7gponbWKaNmUafrz 1Hqo7hlzpDJpamQB5y/JbWSyDGpLw/7UVx9fqSf5+GiMqLeWGMavCCCkTQ5hDZKHYCRh LoeKNnl5cJdQx4kMhvR7TVjarFnZPt7M3b9RMylB4CrRLSujbU1VC1BvmBpo6Q3Iet9u 8gfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Md45LaRHqD6ZCRI/YVUcF8sf7nVG5D4Ru9kLS7nSJTY=; b=BRsOAjZDP8n3xAVwKFYL15gIChvtSfKzLRb5U6mFaTzmWqq7dShfw5j5dsJgnvabdI ptyI/sMPiT2fjsbHdDU7cLS3mCsW1fnYONwj15dseqCukA+pXMtlPUqjjlBaIQT1VlOF XpjgPY1PSfNblav5NaWVkmZBXbLSrwtrSGGIOvs03LXG8E4gHt6gPooa4XVI6d1GeJko l3WlEdn7BkwaudXsFxZKU6sU7X+qOT72IsKo4qIcMQhX0GnY23havwNxyVReQazE97Ul G/iq+7Lqnxr6Y+Z+sYnNYsjDRL+1RFGU13UsTRWiVR8q0bgbOM73J350hIre22rXxymc xEeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j0zAkgiJ; 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 c67si11442436yba.427.2021.02.05.15.07.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:07:17 -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=j0zAkgiJ; 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]:44662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AC4-0006se-Pn for patch@linaro.org; Fri, 05 Feb 2021 18:07:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2M-0001o2-56 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:14 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:45624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2K-0003HW-K2 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:13 -0500 Received: by mail-pf1-x432.google.com with SMTP id j12so5282379pfj.12 for ; Fri, 05 Feb 2021 14:57:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Md45LaRHqD6ZCRI/YVUcF8sf7nVG5D4Ru9kLS7nSJTY=; b=j0zAkgiJqpGgZajxpqlw7xdsRquSXFHkmM5kDRwyEqzNp3HpSXGHOnazqsm6aARaAG yVDr30vD1YjM0JKNyuXjeWaAY6dE1eyXtazjUAAXi5i+ZqX6PHX2hXc+HtH0zRjRbJd6 H+IEMEZjaO/eHdqt/W4D2U7zwHfUpfW6jDnAtRWeOWP+ZVfEuPp6YXbRjJi26ozs6WKi udvIKvNtFyVKuzirGhcstQejFPlMSNWiKNfMfbPoaHOQXC4L7z2q5aSDUEiNDH0Denwd Nh/cpJFykLwDVojqsO3G7ybtQR17Cm+/JQjAbEHbNzP0v1xSp+bzPv7Kiot7a/BwgDZh 2Acg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Md45LaRHqD6ZCRI/YVUcF8sf7nVG5D4Ru9kLS7nSJTY=; b=Eu8wY+9SN2IJK68lpHgmONGC2b5FJOu1VF910USrnkxhBxJGMHGYGZ9Ytkt2y+7LRD lnlXlNJqUF0JiTPrX2Iq+CoI3ZE9pds++26555SMoq6tRK5p7rFlZPstPrPDvSLILO2n jOfwtcYYgNzWRfJIdIyHlhgoUvrLjkKVAJKMrGGzJ7ABzJi4aJejcnt4O++yaPmkGrQG Y8XYb/EC/1v9AvjFwlmkuEPhClrup0jMblGJrYpg+cKQnrOCmPSNLt/U9TNli+AfdlrC E67EAey55ejxE+wS6amAWRDgbu/o3gZw67wbe9cSTWcz27n0sPmIXnhlw6ZrKfA4S0QE ngTQ== X-Gm-Message-State: AOAM5305Jfe9VrTyJLDfD98W7QwJ9n37brbwBtWc1mOWx0In2YCOAdEH iMn47z+/H6Bc5GP4jRE2iRB015CapvAEAyV7 X-Received: by 2002:a63:3008:: with SMTP id w8mr6391426pgw.207.1612565831377; Fri, 05 Feb 2021 14:57:11 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 09/46] tcg/tci: Inline tci_write_reg8 into its callers Date: Fri, 5 Feb 2021 12:56:13 -1000 Message-Id: <20210205225650.1330794-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index e8023b5384..740244cc54 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -117,11 +117,6 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -static void tci_write_reg8(tcg_target_ulong *regs, TCGReg index, uint8_t value) -{ - tci_write_reg(regs, index, value); -} - #if TCG_TARGET_REG_BITS == 64 static void tci_write_reg16(tcg_target_ulong *regs, TCGReg index, uint16_t value) @@ -598,7 +593,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg8(regs, t0, *(uint8_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); break; case INDEX_op_ld8s_i32: TODO(); @@ -872,7 +867,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg8(regs, t0, *(uint8_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); break; case INDEX_op_ld8s_i64: t0 = *tb_ptr++; From patchwork Fri Feb 5 22:56:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377000 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2577704ejt; Fri, 5 Feb 2021 15:06:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxePZs6CaWIRpL7ICPViZLg2OrYW7R78PqD5FHT17VVZXf9WgTfgmYAF2j9FfhvhewyzS0/ X-Received: by 2002:a25:3055:: with SMTP id w82mr9750966ybw.142.1612566366746; Fri, 05 Feb 2021 15:06:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566366; cv=none; d=google.com; s=arc-20160816; b=BvmsIswyaVyTzTTcuuW8tKN6cqJ8+hCMJw8HRzTbHVS6FkT/VbrHtaUWd0YhDOiRAx JhFuX6GFus4QGwuMGdUudbMpzllvHc/GLT5Rc+2VfGNpElCVVRQo5HvK9tzcCsG8KtyM MrJV6mKWJCjLpEoDcIQl/YtAukH1z/hc96WXhMoKOg6a/huWqtLGSKNeJpjZmbuFjUsV F8d535CZ6lUnlPBoyy1fkyQVa64FKyYkF48Sf7Z8D0UWN2ST3zPBOpJDj0OEUEZBOh0u qwNA9x0c2VriUxCFgP7fIbPRE8gp9oiM+3R9PshMVPz95+JF6nNyNN+hh2SDi/4mTzIt 0bnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=nVyouWDBw9IpYjnxIdxk6Lk2rEB7Cry5s6L8ndOAdHg=; b=ulxSWAeHMKbSfIuS+Q919mwJjKyi/NnErkSgYItfK9yp3yPulys2cnHdS0LXlSoPkE J8aiHfjMW90LoEwl0I1yZLZrqAXE6ISkQC5wgPym9KC4Ne3IvS0L9onIMMtDxIM0kTLD W7m+hQSCJQHfxbW/TDGXgO4rwftZ0Egl2rM1bbkB1us7UMBexwhCFpV6AFvteKdHBbvG qgnX6oeRJw1arAXWoYrhFxMb9QL413Evq8B8DiDIdBV1iYTka+z/XzW01mOlDwYDMwS1 CV4Nay1qjGnzhdeuZTbuHI6zcwxcPqx9qxWokWPuV1RMCV1OFdOGapdJZpfrl0CgKeOm 1sGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NkO1pt+1; 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 e68si10419801ybc.272.2021.02.05.15.06.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:06:06 -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=NkO1pt+1; 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]:41360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AAw-0005Rr-4F for patch@linaro.org; Fri, 05 Feb 2021 18:06:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2N-0001sM-O6 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:15 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:43353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2M-0003IK-6l for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:15 -0500 Received: by mail-pf1-x42e.google.com with SMTP id q131so5280528pfq.10 for ; Fri, 05 Feb 2021 14:57:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nVyouWDBw9IpYjnxIdxk6Lk2rEB7Cry5s6L8ndOAdHg=; b=NkO1pt+1MRTqezkwqO97XXuqn444D0PMd05thLoRCojglKtPEZ6h3/rdr6vsHXPFBD ot8v7HnuGp0NHECUAEPlXDM4Pu862x6QDR4tv0S1nbz+0zQEsgl5ZJYL2y9FW/xU3DRi MqCBDbBjKnrUTyNpN4gTc2GL3aoVxDVe9sOqCgAushdkKXTpOQmiUlf7jQ/WI/taZmch HUD1viexHDGQaziuA0oTYUpYMZyqMtiyYm9U64531/sKK7Vb9xJW1ZLFBzJMs65uU3JJ VId5Lon3TPyN2j0sZ9uXuMTVfTFrJkUkl96y4p87+ek4zrghxejLnOEb9OEG8+t5HFpv bWSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nVyouWDBw9IpYjnxIdxk6Lk2rEB7Cry5s6L8ndOAdHg=; b=Ir6fntJoeRc/47eUAr8OkhOEBBEZVdu9a4Ibn+NWnShEDTH8u8aIHpDHGUImsrzGp8 zSPq9BIcdpTEOI8q2jw3gNGhbT6CfaV/q2n48rZJ909WPXT2MRoR2hnpD/uL9Bo06hti 5I63J/vyauiaknPpnkQmwPVekIZHhIZXlC6hElfR9+UU8qia2MPfGtuInT1Mh+E6CEoC Kg01uZGDUtFS6muMZQIYe/2KvNyh7BptdXfZjFCwHWZhhw7lrvSkeoIoKpRASFYzqdIZ YwugdWQBawbi0hxc5P9Nx0Ps/lJqIzQpeugY3oUPsc91AHKaLa669IjXG3wZpieIN8Ks tlYQ== X-Gm-Message-State: AOAM5307ENB2oc6VCCxffGGA+08yC664JnjXn5F5i1m6d4I8lm+198eB FKRBES+x2UJNoebVQVvzqvMw0A0HaPZFAYjX X-Received: by 2002:a63:f95b:: with SMTP id q27mr6622450pgk.82.1612565832983; Fri, 05 Feb 2021 14:57:12 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/46] tcg/tci: Inline tci_write_reg16 into the only caller Date: Fri, 5 Feb 2021 12:56:14 -1000 Message-Id: <20210205225650.1330794-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 740244cc54..005d2946c4 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -117,14 +117,6 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -#if TCG_TARGET_REG_BITS == 64 -static void -tci_write_reg16(tcg_target_ulong *regs, TCGReg index, uint16_t value) -{ - tci_write_reg(regs, index, value); -} -#endif - static void tci_write_reg32(tcg_target_ulong *regs, TCGReg index, uint32_t value) { @@ -879,7 +871,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg16(regs, t0, *(uint16_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); break; case INDEX_op_ld16s_i64: TODO(); From patchwork Fri Feb 5 22:56:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376999 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2577180ejt; Fri, 5 Feb 2021 15:05:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyq1+Bh4hcsgyepk39SjAKBI8Q7LnDSUpqjFR9o3yMk2O3Hlk80CMGT1O4q/X1hwcjSy5Qk X-Received: by 2002:a25:1e42:: with SMTP id e63mr9666614ybe.270.1612566323246; Fri, 05 Feb 2021 15:05:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566323; cv=none; d=google.com; s=arc-20160816; b=U9ZyIzsANNxemNZ1SoQenemWuXpf2wZOcXG4T9+EK3xwZpDQuRcWw4y6g7+8IqYwKt PnVNtPssYfyGZ+MGThT7Q9bAZCFKjhNmVt8C/Xabs4hBVBxJf98yCIfJ17X0GjCoBSLL LfcZFVdH5QhlquXRmxpdVM7/8cqveLqDnU6pF7nvqQgn/YG62EzAX/GDV0A0QoO1R/Xy +GeKU9nbRF4IJ9yYluoE4dwUYOYBUdTWT8lRO/BkjSJ4dvQvB/Uo7K1R+I/xonEK+Hmw 0OJpggZtQe0A02Cb4u1lnQisYu0RPHkqJKAuI/sk0YjPdJ2hWaMsc/+qMshygh6o3EMv ZDLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=WvF+amzq1Ily9oj+9g5vZaVj1S2ujChoxYC/fno/cGA=; b=ygA7PXWay/q1Qt5gku/I9UFWTJ/xknwj3YzxbPQcGK6z7TaUBN6mnfTQLw80lPxDRF T4JEcQFxf/taw7t2p3A02aJXJovD3Z1dWBg9JF1cqy/AzZipmNOs0eyP0yEEiH8VWb+n ElT1gqwIcuqZsjcTDg/LzQ/8vh4B7zhLvvQyECO6NCPNzufQjnH3p8d712GMNSHMhL/m JxbxhmcoNH93pptTNCcbWNv5Uc/Q6VkJjL2/kVQ/eihOaIe0qMYN1rKNcxcparwR2rqa IgFZLyCKOVR29FT7Zsvb5ZwbBU7KMwuwIpCcLWO3/hLfoKOVQ5BMhvUyote1BFM6u2hN pOZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n1eWRDCs; 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 g13si12775786ybj.0.2021.02.05.15.05.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:05:23 -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=n1eWRDCs; 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]:39842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AAE-0004mO-BS for patch@linaro.org; Fri, 05 Feb 2021 18:05:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2Q-0001zD-AD for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:18 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:42601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2O-0003Jr-7s for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:18 -0500 Received: by mail-pg1-x533.google.com with SMTP id g15so5561415pgu.9 for ; Fri, 05 Feb 2021 14:57:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WvF+amzq1Ily9oj+9g5vZaVj1S2ujChoxYC/fno/cGA=; b=n1eWRDCsCyoTEgMWxZpdZiwX2nlFEzYa7kXZAtBJVa8wdKMq4njpnMrw+AFz0VpLNP zWf808MFAHAAHguWQG66zDH1cTNf4wdljlAzA1bk80GDp2J3azJqnfEsOvqGWf/lI8RQ mRgpUK38JpNIBZMY0gFxG/8dwX5EWHkd86mEwRBQlKh6tKO71aBrynVFTVQQiPBiwjfA wa9268yaCXYdqLbpKIEQzibAGFgYqshA+aET/yVdNKTzLnEH7zVpol6heQGUiMptWGma WgsfoXoNUYnu3dZNFLq1/g3SP4s5oO8py0ylnTX/rjFW7TSvnH2X+vpskm3LYTFf3g2R 4IBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WvF+amzq1Ily9oj+9g5vZaVj1S2ujChoxYC/fno/cGA=; b=HXwk0MnJLDamsfSYzHcnzZroUbaWjVKBA6YpkXZPzxOp4mZPenzUdq+tPY7dlTU4Il KLFYviSr8Od0aCuI0uivPGxsvWhYoYkqu+LjUDnjun4vr4Et7tzBGUHJYEliuoiA3qUF 0450gks6pqqVxJvEQm0Rq359Chy99hKxT1w+N69dbSTUi/68AU5SGzGcq+PRTxBcBJ+e cQbxi70Dugh2bP90Mt6ywf71RgsXRkw6Rw/WCE5jnj5XpR8jwiTDQW7p3nkmqNU35cFK WxGEobkhwYc3h76T0luj86zoMvfg6MBvB8ajlJqdaLwedWzDCa1K5pWZzGMp5SFu/G1g XziA== X-Gm-Message-State: AOAM532l58LMK4a1HpQuU9bZ21CuHQ1AMP94gUDPDSaclLmHfAeLrIDf tVgxUx4iq1P/Cd125tWMBkZlwxVsMqPesMyl X-Received: by 2002:a63:ac19:: with SMTP id v25mr6493624pge.258.1612565834979; Fri, 05 Feb 2021 14:57:14 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 11/46] tcg/tci: Inline tci_write_reg32 into all callers Date: Fri, 5 Feb 2021 12:56:15 -1000 Message-Id: <20210205225650.1330794-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" For a 64-bit TCI, the upper bits of a 32-bit operation are undefined (much like a native ppc64 32-bit operation). It simplifies everything if we don't force-extend the result. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 66 +++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 36 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 005d2946c4..39ad00663f 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -117,12 +117,6 @@ tci_write_reg(tcg_target_ulong *regs, TCGReg index, tcg_target_ulong value) regs[index] = value; } -static void -tci_write_reg32(tcg_target_ulong *regs, TCGReg index, uint32_t value) -{ - tci_write_reg(regs, index, value); -} - #if TCG_TARGET_REG_BITS == 32 static void tci_write_reg64(tcg_target_ulong *regs, uint32_t high_index, uint32_t low_index, uint64_t value) @@ -549,7 +543,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t1 = tci_read_r32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); condition = *tb_ptr++; - tci_write_reg32(regs, t0, tci_compare32(t1, t2, condition)); + tci_write_reg(regs, t0, tci_compare32(t1, t2, condition)); break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_setcond2_i32: @@ -557,7 +551,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp64 = tci_read_r64(regs, &tb_ptr); v64 = tci_read_ri64(regs, &tb_ptr); condition = *tb_ptr++; - tci_write_reg32(regs, t0, tci_compare64(tmp64, v64, condition)); + tci_write_reg(regs, t0, tci_compare64(tmp64, v64, condition)); break; #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: @@ -571,12 +565,12 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_mov_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; case INDEX_op_tci_movi_i32: t0 = *tb_ptr++; t1 = tci_read_i32(&tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; /* Load/store operations (32 bit). */ @@ -603,7 +597,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg32(regs, t0, *(uint32_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); break; case INDEX_op_st8_i32: t0 = tci_read_r8(regs, &tb_ptr); @@ -631,44 +625,44 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 + t2); + tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 - t2); + tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 * t2); + tci_write_reg(regs, t0, t1 * t2); break; #if TCG_TARGET_HAS_div_i32 case INDEX_op_div_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, (int32_t)t1 / (int32_t)t2); + tci_write_reg(regs, t0, (int32_t)t1 / (int32_t)t2); break; case INDEX_op_divu_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 / t2); + tci_write_reg(regs, t0, t1 / t2); break; case INDEX_op_rem_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, (int32_t)t1 % (int32_t)t2); + tci_write_reg(regs, t0, (int32_t)t1 % (int32_t)t2); break; case INDEX_op_remu_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 % t2); + tci_write_reg(regs, t0, t1 % t2); break; #elif TCG_TARGET_HAS_div2_i32 case INDEX_op_div2_i32: @@ -680,19 +674,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 & t2); + tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 | t2); + tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 ^ t2); + tci_write_reg(regs, t0, t1 ^ t2); break; /* Shift/rotate operations (32 bit). */ @@ -701,32 +695,32 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 << (t2 & 31)); + tci_write_reg(regs, t0, t1 << (t2 & 31)); break; case INDEX_op_shr_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1 >> (t2 & 31)); + tci_write_reg(regs, t0, t1 >> (t2 & 31)); break; case INDEX_op_sar_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, ((int32_t)t1 >> (t2 & 31))); + tci_write_reg(regs, t0, ((int32_t)t1 >> (t2 & 31))); break; #if TCG_TARGET_HAS_rot_i32 case INDEX_op_rotl_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, rol32(t1, t2 & 31)); + tci_write_reg(regs, t0, rol32(t1, t2 & 31)); break; case INDEX_op_rotr_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); t2 = tci_read_ri32(regs, &tb_ptr); - tci_write_reg32(regs, t0, ror32(t1, t2 & 31)); + tci_write_reg(regs, t0, ror32(t1, t2 & 31)); break; #endif #if TCG_TARGET_HAS_deposit_i32 @@ -737,7 +731,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp16 = *tb_ptr++; tmp8 = *tb_ptr++; tmp32 = (((1 << tmp8) - 1) << tmp16); - tci_write_reg32(regs, t0, (t1 & ~tmp32) | ((t2 << tmp16) & tmp32)); + tci_write_reg(regs, t0, (t1 & ~tmp32) | ((t2 << tmp16) & tmp32)); break; #endif case INDEX_op_brcond_i32: @@ -789,56 +783,56 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_ext8s_i32: t0 = *tb_ptr++; t1 = tci_read_r8s(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext16s_i32 case INDEX_op_ext16s_i32: t0 = *tb_ptr++; t1 = tci_read_r16s(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext8u_i32 case INDEX_op_ext8u_i32: t0 = *tb_ptr++; t1 = tci_read_r8(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext16u_i32 case INDEX_op_ext16u_i32: t0 = *tb_ptr++; t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg32(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_bswap16_i32 case INDEX_op_bswap16_i32: t0 = *tb_ptr++; t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg32(regs, t0, bswap16(t1)); + tci_write_reg(regs, t0, bswap16(t1)); break; #endif #if TCG_TARGET_HAS_bswap32_i32 case INDEX_op_bswap32_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg32(regs, t0, bswap32(t1)); + tci_write_reg(regs, t0, bswap32(t1)); break; #endif #if TCG_TARGET_HAS_not_i32 case INDEX_op_not_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg32(regs, t0, ~t1); + tci_write_reg(regs, t0, ~t1); break; #endif #if TCG_TARGET_HAS_neg_i32 case INDEX_op_neg_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg32(regs, t0, -t1); + tci_write_reg(regs, t0, -t1); break; #endif #if TCG_TARGET_REG_BITS == 64 @@ -880,7 +874,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg32(regs, t0, *(uint32_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); break; case INDEX_op_ld32s_i64: t0 = *tb_ptr++; From patchwork Fri Feb 5 22:56:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377003 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2579148ejt; Fri, 5 Feb 2021 15:08:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJycB8w4JAJanI8aQLsWXmJEljXrm4cgKnMv/JOkrg4IrsNyh0p8cDMtqVqPIimubhIyYSoS X-Received: by 2002:a25:7c43:: with SMTP id x64mr9980883ybc.267.1612566503683; Fri, 05 Feb 2021 15:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566503; cv=none; d=google.com; s=arc-20160816; b=iylD8zNZ3/oKN8LTdLxc4TYtwQPzq201SUZNyXcx52pYWzv+zu2GkvKfqqEr1Og2tH tO7NybSzp4gXw4XvSBCfO1BPTZSBjSezCtsXVCzNT/yWUygfRtaYUR32uq2H6oxhWYQL s2JbW2PNtfivVMBZ4pDDTRiNUm0BDhJLbw13bp0PiiVtJn3DcqzwKL54lJq8ZWkA7nH0 mxGwn2mjJrX/rjmSJeTLfgH9SpI06tyzbL4gy+RSZw75w0xw1k/wnuzfjb85ELEFZ/d0 ewzwcDrGpgPHGq8o0fO+y1DAiltYafsMh6uAPTo7wmsF9YYbohauwJfRbMd3+ecj1aq9 8kFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=3gzoTh/DnzHssC7cCFW1QEczWz5vWhlHn8h/Weu1Sj0=; b=UMappsEyNOy42wQ4sF5WLlsPz+46Dk7GieElvtycyOJQnexCrI72w01M/4/TmiMFOo Xpi5OHQ7rzovicLE2uF51/+lVejD9O6pFswmmuvAnPTuAAL2F8BvEHV83BQxT2UcVhrb UHZLX0mlIOOI5VCFnuz7uohbMgGx9PzLnCkKLQxNQG9CqXhsgFRvzKRQRBexir6Fylwq xZuQC1QKgZq39KymCQTopXq4OFnPbtJYmUPkH2HwaaRSBn2iAwwZgyJ9zJz3OO3B18GC ro1mCAf8Q9gwXyg3F+Vebx45m6pmRiaflORUzMZQgiww+f+jzk8hlYb78sjK+xTqUMTv plcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BIYAbNO9; 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 f195si9009908yba.130.2021.02.05.15.08.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:08:23 -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=BIYAbNO9; 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]:48530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AD9-0008W8-0B for patch@linaro.org; Fri, 05 Feb 2021 18:08:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2S-00023s-3H for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:20 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:35873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2P-0003Jz-TJ for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:19 -0500 Received: by mail-pf1-x431.google.com with SMTP id 18so3156577pfz.3 for ; Fri, 05 Feb 2021 14:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3gzoTh/DnzHssC7cCFW1QEczWz5vWhlHn8h/Weu1Sj0=; b=BIYAbNO98EmJmFzSTcx0Xg1uTHRkieCeU7/tu307qjpGqWUA5EJxNXuiWk4y3yR5hM 6inBeVS/8QA2a4dlP/Jyc+6sgd6Ky8FDvbnfBRvyW/1RXG5dY/0RGH2xBhbPLjwoGVGM zOFuzQRiqS00iAa/1f11bHihNl6pxHstf1pzeAuXs9592mT0LNPoChSQtHtwzC1UsTRH f0zGz6rCXdbK1s9da9LBgu+orZr5DXaxhChYWncIRQVDgM+7LaBVCOZ9KW0PPIPQhT7m 8gD/UW1hmpS81Is1T4Xi3yrLL7BSNVoYDcXRjC7tvcAYr0kkF4I8UnODcSiY43PZJMAv 5VbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3gzoTh/DnzHssC7cCFW1QEczWz5vWhlHn8h/Weu1Sj0=; b=KrsT0eHxKIM4uqbaIDdusYLzrBDT5oM0Xvjk4PKW3Na2MyZ++NA6C99iSpe8NhDzyx +VtfymWw3p21FOtN6TvStt0vaC9Z1sgY7yHsXnndXw+kQrloxf8zCun48q+iNMb1ZBje W7wz+xySaZ4HNOJer7gKOY+G+fqdDiEZr9xHGvlefzYR+i6jaMCt5BsSHdtqdkS6Woh8 WWEvw/YHP3rUR8+iyTEV2nNtQz42s2RpcK/PWNSfAwmXEP6n3qcuhD8SO0q3FySrcYIW SoA3qw7QdFBkDQTNaE1KfJzguyHwjT1cERgmIy/2jWNjBvDLCUiY0/KMaHf7ELnWxPXu AC3g== X-Gm-Message-State: AOAM531sRnEkBVeEY4+5UKV3FibTmm8uLz/u0l++JimYrV2d9Tap2FbG c5evxNAczltAVweHw388Nc+X1wMvcakSPY/X X-Received: by 2002:aa7:8b51:0:b029:1ae:687f:d39b with SMTP id i17-20020aa78b510000b02901ae687fd39bmr6910751pfd.50.1612565836560; Fri, 05 Feb 2021 14:57:16 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 12/46] tcg/tci: Inline tci_write_reg64 into 64-bit callers Date: Fri, 5 Feb 2021 12:56:16 -1000 Message-Id: <20210205225650.1330794-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Note that we had two functions of the same name: a 32-bit version which took two register numbers and a 64-bit version which was a no-op wrapper for tcg_write_reg. After this, we are left with only the 32-bit version. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 60 +++++++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 33 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 39ad00663f..0f56702b93 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -124,12 +124,6 @@ static void tci_write_reg64(tcg_target_ulong *regs, uint32_t high_index, tci_write_reg(regs, low_index, value); tci_write_reg(regs, high_index, value >> 32); } -#elif TCG_TARGET_REG_BITS == 64 -static void -tci_write_reg64(tcg_target_ulong *regs, TCGReg index, uint64_t value) -{ - tci_write_reg(regs, index, value); -} #endif #if TCG_TARGET_REG_BITS == 32 @@ -559,7 +553,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t1 = tci_read_r64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); condition = *tb_ptr++; - tci_write_reg64(regs, t0, tci_compare64(t1, t2, condition)); + tci_write_reg(regs, t0, tci_compare64(t1, t2, condition)); break; #endif case INDEX_op_mov_i32: @@ -839,12 +833,12 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_mov_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; case INDEX_op_tci_movi_i64: t0 = *tb_ptr++; t1 = tci_read_i64(&tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; /* Load/store operations (64 bit). */ @@ -886,7 +880,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_write_reg64(regs, t0, *(uint64_t *)(t1 + t2)); + tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; case INDEX_op_st8_i64: t0 = tci_read_r8(regs, &tb_ptr); @@ -920,19 +914,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 + t2); + tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 - t2); + tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 * t2); + tci_write_reg(regs, t0, t1 * t2); break; #if TCG_TARGET_HAS_div_i64 case INDEX_op_div_i64: @@ -951,19 +945,19 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 & t2); + tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 | t2); + tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 ^ t2); + tci_write_reg(regs, t0, t1 ^ t2); break; /* Shift/rotate operations (64 bit). */ @@ -972,32 +966,32 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 << (t2 & 63)); + tci_write_reg(regs, t0, t1 << (t2 & 63)); break; case INDEX_op_shr_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1 >> (t2 & 63)); + tci_write_reg(regs, t0, t1 >> (t2 & 63)); break; case INDEX_op_sar_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, ((int64_t)t1 >> (t2 & 63))); + tci_write_reg(regs, t0, ((int64_t)t1 >> (t2 & 63))); break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, rol64(t1, t2 & 63)); + tci_write_reg(regs, t0, rol64(t1, t2 & 63)); break; case INDEX_op_rotr_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); t2 = tci_read_ri64(regs, &tb_ptr); - tci_write_reg64(regs, t0, ror64(t1, t2 & 63)); + tci_write_reg(regs, t0, ror64(t1, t2 & 63)); break; #endif #if TCG_TARGET_HAS_deposit_i64 @@ -1008,7 +1002,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp16 = *tb_ptr++; tmp8 = *tb_ptr++; tmp64 = (((1ULL << tmp8) - 1) << tmp16); - tci_write_reg64(regs, t0, (t1 & ~tmp64) | ((t2 << tmp16) & tmp64)); + tci_write_reg(regs, t0, (t1 & ~tmp64) | ((t2 << tmp16) & tmp64)); break; #endif case INDEX_op_brcond_i64: @@ -1026,28 +1020,28 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_ext8u_i64: t0 = *tb_ptr++; t1 = tci_read_r8(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext8s_i64 case INDEX_op_ext8s_i64: t0 = *tb_ptr++; t1 = tci_read_r8s(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext16s_i64 case INDEX_op_ext16s_i64: t0 = *tb_ptr++; t1 = tci_read_r16s(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext16u_i64 case INDEX_op_ext16u_i64: t0 = *tb_ptr++; t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #endif #if TCG_TARGET_HAS_ext32s_i64 @@ -1056,7 +1050,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_ext_i32_i64: t0 = *tb_ptr++; t1 = tci_read_r32s(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #if TCG_TARGET_HAS_ext32u_i64 case INDEX_op_ext32u_i64: @@ -1064,41 +1058,41 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_extu_i32_i64: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg64(regs, t0, t1); + tci_write_reg(regs, t0, t1); break; #if TCG_TARGET_HAS_bswap16_i64 case INDEX_op_bswap16_i64: t0 = *tb_ptr++; t1 = tci_read_r16(regs, &tb_ptr); - tci_write_reg64(regs, t0, bswap16(t1)); + tci_write_reg(regs, t0, bswap16(t1)); break; #endif #if TCG_TARGET_HAS_bswap32_i64 case INDEX_op_bswap32_i64: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - tci_write_reg64(regs, t0, bswap32(t1)); + tci_write_reg(regs, t0, bswap32(t1)); break; #endif #if TCG_TARGET_HAS_bswap64_i64 case INDEX_op_bswap64_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t0, bswap64(t1)); + tci_write_reg(regs, t0, bswap64(t1)); break; #endif #if TCG_TARGET_HAS_not_i64 case INDEX_op_not_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t0, ~t1); + tci_write_reg(regs, t0, ~t1); break; #endif #if TCG_TARGET_HAS_neg_i64 case INDEX_op_neg_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - tci_write_reg64(regs, t0, -t1); + tci_write_reg(regs, t0, -t1); break; #endif #endif /* TCG_TARGET_REG_BITS == 64 */ From patchwork Fri Feb 5 22:56:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377005 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2579534ejt; Fri, 5 Feb 2021 15:08:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaS2fHj6NEVOH/3VZNrpmufhHXijG68Lg5EOkGNYbcr4rmn3skMnOsg/g6MMw0ezr3pG7n X-Received: by 2002:a25:41cb:: with SMTP id o194mr8938788yba.167.1612566538248; Fri, 05 Feb 2021 15:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566538; cv=none; d=google.com; s=arc-20160816; b=jBYS7zbvU8PHvbFXCChTPjTy78WnqTp+ZQazCHP603SKjQYDGB0E50ijIQsSEtZG/z 5ZX1b5sloMs4zad0EQcj394C8GBetIyFMVdtMptUqzs8cVloEK9yedsIe4hhuflJW21w PfpRAwVUkjk86uul5o2RWLNqYgMhg8AAzbEqkJkWsnDIUobQe8FgACbYPqA/Zu3pUb2a +f+fJ+Xo9r0XNhD6q+n7GOHO7F0aKCjEjcy8GnJsPVuhOX+SD6ooHqzhcrDR6YOo+mmm /NtKZubxWhHOutNDprI82YONzByQrIgocNJa1Ol3CIhCb4basT+owZpi6XsJGfa2esYG 46Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=G2sd+rMiFVhWCMHNvyHgxhZmWKXrzCkUbxixI9tGVCY=; b=hE+HDnEG9XTy7Ej138ViKHjYNk/VMC9iHPkf6XeIkSFlJjQA1v0qHeGW4n5uMJ/hiS iFTP5NxpB0coPf+bRCDDSJcyCckmC4i6vy0/jYPylbsrdIXn9mPP1fCVOdXvMjGGrDDC MRl5IqFzSNrLJyrgeEv0opkxIa8w5xJYMpLCVqCbCt3laXkIAiaG3QDt7qXlXwXv/H9p 1vmHL+pB+3zwH28CuElOUVKKPwtpxBmUsg870hfiV7/ceAZWXRoDRWEIbakLd+hN3Pqc OgG0SNXqUVnRTHMuqRro9peQ/vMpoxXsDwa7rcnRmD+zoEH3N2ew4IWramfmoH2bKQWc ogYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dmjhXO+P; 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 n5si10532471ybo.226.2021.02.05.15.08.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:08:58 -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=dmjhXO+P; 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]:49078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ADh-0000J2-M1 for patch@linaro.org; Fri, 05 Feb 2021 18:08:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2T-00026N-8I for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:21 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:37867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2R-0003Li-Nl for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:21 -0500 Received: by mail-pg1-x52a.google.com with SMTP id z21so5584816pgj.4 for ; Fri, 05 Feb 2021 14:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G2sd+rMiFVhWCMHNvyHgxhZmWKXrzCkUbxixI9tGVCY=; b=dmjhXO+PEPjleCmwixqeNYYmo16Ktxg8qXT3ryFx38P/z2NLdygFLG3i2vW4ZEjccq xiKTGZvceEqzx1b0CyHeH+k1rr4RIEosnr0OxeCBsQugkvWpq80Sofrc7IECKVOHG+Tq 4Fh9weIUT7qeXCplHGeDBKXrZy2s+cPNU9WfcdJKp41tngvxDOntGasqxE4aIycnS/Y8 fPzYlhsP4O3bccrmuL7HOi5Pj99QZgW1gA8dPkD9aDW+soezrWW4eLC6tbLtg3KNjry7 +PUlBpc4/FmJD/cpp6V0PWmqREO28KzKD+UhyaL/kpCp5OS3661vMrQuc9VuCXs91Wu9 S01Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G2sd+rMiFVhWCMHNvyHgxhZmWKXrzCkUbxixI9tGVCY=; b=XM19McAmmr3y3HkkiRzG4s8Vq25g9ipwuMtIZg24LdRFCtY/dCLimAtiKf44tFLiCA e+PcaTBnyhuWexujcK7Oi0CZSaJSWOa5anL1ur2us9SZ+8jwmI7I77swDUnayl8T36Br miSfaaqmm3ih5JLTc69tpnWfyD+ECtFVjU8MKUGAQNKW7uUVthpVzbykQFVn23yR/4cU eRDfbS6wdbrfRVvO+p3ASSfPKiQc9LRc2hdYJ2tEQnH74yXNBK12//gQ4A7Evu648PXi tyomVN7x9UQ5q6PBxh+xRx+b3cm3TlL4V06y08YBz+ZFoFYu3kYhGUglH8T5TSXPt1Xo 3QqQ== X-Gm-Message-State: AOAM532rn8aIiGplhcMqS1gj9bliFqZNf+x7bRqEzsURsEz2V0ivyR5I z9TJX3fyZU1IRtJb++juMDZFHYt1Jtj2gACG X-Received: by 2002:a62:190d:0:b029:1bd:e11c:4eff with SMTP id 13-20020a62190d0000b02901bde11c4effmr6608317pfz.22.1612565838346; Fri, 05 Feb 2021 14:57:18 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 13/46] tcg/tci: Merge INDEX_op_ld8u_{i32,i64} Date: Fri, 5 Feb 2021 12:56:17 -1000 Message-Id: <20210205225650.1330794-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 0f56702b93..7e108bcbb3 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -455,6 +455,18 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition) # define qemu_st_beq(X) stq_be_p(g2h(taddr), X) #endif +#if TCG_TARGET_REG_BITS == 64 +# define CASE_32_64(x) \ + case glue(glue(INDEX_op_, x), _i64): \ + case glue(glue(INDEX_op_, x), _i32): +# define CASE_64(x) \ + case glue(glue(INDEX_op_, x), _i64): +#else +# define CASE_32_64(x) \ + case glue(glue(INDEX_op_, x), _i32): +# define CASE_64(x) +#endif + /* Interpret pseudo code in tb. */ /* * Disable CFI checks. @@ -569,7 +581,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (32 bit). */ - case INDEX_op_ld8u_i32: + CASE_32_64(ld8u) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -843,12 +855,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld8u_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); - break; case INDEX_op_ld8s_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Fri Feb 5 22:56:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376988 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2575444ejt; Fri, 5 Feb 2021 15:02:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOoSXyM+ZKl/UpJiHJkctLtD7A+R5G2Af9tPuEHqk3Icfd0aEJPZxKlgRJrfMo0qb1JiLV X-Received: by 2002:a25:5583:: with SMTP id j125mr8739350ybb.307.1612566174696; Fri, 05 Feb 2021 15:02:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566174; cv=none; d=google.com; s=arc-20160816; b=GDuunCwcpsun1nUpbA1UpaRT0n1MXVkx9U0LXts7SzTPEcLOU4nU9uYfH4tyCRp2H1 VORhPl2ifuiBYgQvUio+G7Tq2pwLQcaLL/Qdeg5TqQZvgnjjGQXt4ksc1rtFFTk2Ouzq NiBuyfONJ4ETInj/wzkEJursyBbOglX1paYpvc/PISeTmThnFkVyuCA1QAuZazJQXHgt vWKpJLoeuRztuo3BCGl867xCMV9MdPXuXSmzT6eB4QTf9MchTWm+Ur/DHUgv0CDiM3nK QRAdAasg5b1sPDFs3nQ4GFH57Limc2rkixqRusTaDvkzpv7bHbSS32Zx9I5j/T6IiN7a kWHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=ivQ6CdRm/OXUCJL48bE6dU1klkzWgC1aTXX7CV1kiyA=; b=ozk7Pa5qLTZgdJctd+qEqPrPU3/SCkI0M9lIJ97iTIxPEj8bPnc8Qhlu35d3ajReQs 08zE1rguqDpQWzUl+p60KKm1lG3JQBefSgghDi5S8HuvK/g8RwH3qH1+5yQLCNVXZxBx UKYDcUTLbohkw4RWvNOlZANyK/tuqHsUxF0RO6mQdE8Cjz//9+PR+4TW/MESHIO8B5ze yCBeWB06XU8XakS/ICi6isiwoN+WWFfbzMyXDN+MCVFDQzHBvRRdRhydfyGgvglzxynx g0YpLHBLZbY3F12ML+3j58Oxd8LNupb72TtSFflyrfieoXG5G3EG5vMZZLbXZh9paxLz BHOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h78bA6SX; 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 t1si9485966ybo.308.2021.02.05.15.02.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:02:54 -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=h78bA6SX; 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]:56626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A7q-00008F-1I for patch@linaro.org; Fri, 05 Feb 2021 18:02:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2V-0002Bb-VA for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:23 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:40544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2U-0003ME-6s for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:23 -0500 Received: by mail-pg1-x530.google.com with SMTP id b21so5565786pgk.7 for ; Fri, 05 Feb 2021 14:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ivQ6CdRm/OXUCJL48bE6dU1klkzWgC1aTXX7CV1kiyA=; b=h78bA6SXlYmOsELiPucHg3RTgg0+WrgcB5+6LnNc9vqEyTibCJAEy+IQmcuPvHChHN UQnjoCAvpTopaGiU7b324qrLHHGin9Ki/gHZWQca1vUyztrmlhKYCUX9LKoAvMt2Z4mI cdVKQ8R6dGxUuzkv2/4L55rsjaWjsWk3ozPUZnHNvPpONO1BjqVi2ka71Vb/k6sZtMm+ ihpu4r2c4N+wmOvhQjQ7ZvFvNIB58yQY2i6rmWxXl/IY6dYcpixFsFwhipl2JA6N2Bp7 co3t6dSJ4OEVHE6nfNvY+ZlZC2NE11EOkCNzLLZtwA/aCeQqFdb4FLmNJWs5sWFR6rbh kx9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ivQ6CdRm/OXUCJL48bE6dU1klkzWgC1aTXX7CV1kiyA=; b=GzugvEiKeBIZ+WGCJsoVh3vdOODjnMRAXEqnlsef+U6SJZLeTKMEdhwTzsfXB4coYs jBkTrTXvJaxWmTXIf2pHhcpMw0kpPD4DcGyFS9CgTRdkh20kuhkurbTZIAyONO8abtAW twvLs0Bj0eNCJgDlwLocppeDUmSc0BsAJKZ7x0Y/RC1oGoJm42HxU3WRWdjF/ZLzAH+E Lpf1TPh2hw+xZd3vlj+f0kWSD48TcUuapHfBsm57f7Nz5/v+WXoTsO4DquCxguzl7YWR mhNt3YAKRnt3/ijEOQ0sSC81NPPmoF/LBdhUZ15iK66LhvueOmKEB0NHR9qsaJSXYwYu 4xxQ== X-Gm-Message-State: AOAM53239iaB3TWDfe467TK6R5t1FvZCQmQsMmJHvCYFS+Js+XY9QNAH ODrQtkDWQmtckePpYWe1hCn5XQzCWKUJxCLk X-Received: by 2002:a63:150b:: with SMTP id v11mr6840229pgl.183.1612565840003; Fri, 05 Feb 2021 14:57:20 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 14/46] tcg/tci: Merge INDEX_op_ld8s_{i32,i64} Date: Fri, 5 Feb 2021 12:56:18 -1000 Message-Id: <20210205225650.1330794-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Eliminating a TODO for ld8s_i32. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 7e108bcbb3..c31be1a1f4 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -587,8 +587,11 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint8_t *)(t1 + t2)); break; - case INDEX_op_ld8s_i32: - TODO(); + CASE_32_64(ld8s) + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_s32(&tb_ptr); + tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); break; case INDEX_op_ld16u_i32: TODO(); @@ -855,12 +858,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld8s_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); - break; case INDEX_op_ld16u_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Fri Feb 5 22:56:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377004 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2579527ejt; Fri, 5 Feb 2021 15:08:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyX958Gqmqhm2XlRUckI5ihHyZBHTsW0xol3WOEf3dwfzJ7CxQkSWzUosNGPO+d03bH4JmS X-Received: by 2002:a25:ad93:: with SMTP id z19mr9572470ybi.133.1612566537457; Fri, 05 Feb 2021 15:08:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566537; cv=none; d=google.com; s=arc-20160816; b=ci4yU7EwKmlukRjCL7B7tOHu6z8gcvsL6VQfz6XaclK55BjgnXXqwqwtAvvM34Tz33 18cHMtbu/g17376XXiRlzbD6e9mVAz1hFS/9/n96jIPdVhqfzqalGzVotnjZO1cUH+W1 g1o+2AdnHuL4YRPbghPiMceh0gqqUA2I05Um11Pk+F+hG399KBRFBhyo6cFjR+EgkFuU zkH3ugfFoSFLydjTSk6C2kEwkKy9Vo+G/sSEA6LCvZrF60BNYCiWLRfURIn4tBh8dnr5 Pm0oRvbDOcfQkIl392ELuXurh1hfcPXneVcs94evqFBPJl0eBk5HIUqWWuB1QFqbdWpL ldpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=SP+dSNoCSW/u6ABPE/2oquCEK8adb2mItiXQWA/oP48=; b=APpCGD87yQxHmkKSo2WrRvpRcxnA8jNbIs67WQwe7JpBadEaWXnBHXhmuOlgJTpt43 2lfRjyzwrY2wAcnyuBQBR3IL0mczO0jLgn2l25PVFdabaPZ/csS6BtkxQAyZ8K7eq7Fy LeI53ixnpZIzv+0CsDASQjQF35mAYo03hY5JKipGdIlx6dzR6PGqaLw1lKcY4BdUMU24 pg7OD7ftT6t0KkN4LftEK5LkkMJzLT70hP9vfpsyoguBzIP+9kYszUxJ9nUIJ+Hd0IHX xROw8Qj0NyHuHmCGk+KQPXkBpJCvOElzv71LBDKGiJI0+8g5gmfTjSU/eT9YMJ31TuHq PfDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=asEdl3Ea; 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 h11si3052727ybk.396.2021.02.05.15.08.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:08:57 -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=asEdl3Ea; 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]:49864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ADg-0000gP-RW for patch@linaro.org; Fri, 05 Feb 2021 18:08:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2W-0002Br-PU for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:24 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:37870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2U-0003Nm-W1 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:24 -0500 Received: by mail-pg1-x52d.google.com with SMTP id z21so5584906pgj.4 for ; Fri, 05 Feb 2021 14:57:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SP+dSNoCSW/u6ABPE/2oquCEK8adb2mItiXQWA/oP48=; b=asEdl3Ea8gFvH/teEUjR4VD4Txq4ZC87JJWCFbyvhMXq/zcf+iCU0YuJxfiBjrX1Pk LlMrqeNTmz56+AfIS3ML6vedCaYTczsw3YIcMPI/RXrAcQ6ULItpS8Da47gm+f1zRz+a aJJE5lrFKCWZekhaxl13SV9rxruz1LlCO6iBetLqyopyrX24H2sEiiSjTDFqbC9BIoi4 Zhe+0tpUUSwjeoGzTgWKIvth0V12avKIdZuGTwtkVYsOE68FN2COBOHEpuSzSqDYNseZ bmVBqXB60Gqz/ryJptnqSAQhDlI7npd7g9ochbJX4JSZDvYoeGG9v+MQay0GNbRxVCh1 tjrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SP+dSNoCSW/u6ABPE/2oquCEK8adb2mItiXQWA/oP48=; b=Q7gtzN5eb0EweSnv9udylHwEOWg2hdzgOzx6NRNx2vSX+IqTg8kxNtRsadISWjyhdP 9YC3b3p6vbEp91P9kq+amHkXkpydy/lkWwUIYIPHSNiiUQMTTvkgULPQbSadWfCb6t0i 4dH7nzgx7cpo/ehCdcLGfTsPlfbfWEXrJ11NGrYWUtAv7MtOGsl493jFWsVJ/hpLGrQ3 vck91LJi6C5tFDhefF+I5MhhMZdtoHVAfzf704htp9nx7m+bG3RZ6nihPSOTlDSa4zeP WTtoG344rIqOkxKJeWBZ4o9G/0k6yxlawNW7bmU0VYTYOrYHwTXOXJr0Ph783ud9Iwua zu9g== X-Gm-Message-State: AOAM532YqCF8PkrObFwUB7L+/BgCguQRp2qonBD7jYAcZp7w2Jtg64dx uB6bqGBLd9NH4FQjhRkP2ywAAeEjzEpTXcL2 X-Received: by 2002:a63:e50:: with SMTP id 16mr6436423pgo.74.1612565841847; Fri, 05 Feb 2021 14:57:21 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 15/46] tcg/tci: Merge INDEX_op_ld16u_{i32,i64} Date: Fri, 5 Feb 2021 12:56:19 -1000 Message-Id: <20210205225650.1330794-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Eliminating a TODO for ld16u_i32. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index c31be1a1f4..b64d611ec9 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -593,8 +593,11 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(int8_t *)(t1 + t2)); break; - case INDEX_op_ld16u_i32: - TODO(); + CASE_32_64(ld16u) + t0 = *tb_ptr++; + t1 = tci_read_r(regs, &tb_ptr); + t2 = tci_read_s32(&tb_ptr); + tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); break; case INDEX_op_ld16s_i32: t0 = *tb_ptr++; @@ -858,12 +861,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld16u_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); - break; case INDEX_op_ld16s_i64: TODO(); break; From patchwork Fri Feb 5 22:56:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377010 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2581105ejt; Fri, 5 Feb 2021 15:11:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWUBhWhF6blOB9xfdbrndiwUIUBFaFeB6BTWIl8dPz+2ZhgGU/xhGRTWLRK21IjVOz5pOx X-Received: by 2002:a25:89:: with SMTP id 131mr10011967yba.328.1612566694420; Fri, 05 Feb 2021 15:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566694; cv=none; d=google.com; s=arc-20160816; b=BHGaLrpbdzZMV2T2PHycrZYZyQ0T1ZVYm20M1KGhxreMgB93eoSvoMRzytw493IvQV WAG+YwD2S1v9QhbNdrnFhoGD0U99RwPjfDTE3jG15nVfKjabZXoF1/mcQdE7/9sXMbmG RukYt4oFElyXrE6vQbU++wlsZyf/5nowaWgiS77QrSuXbAWuGL3X0V9pumPHqkA0LzK4 SpfYHzWRqozdpOU0TfXVh6NV1IcotGf9UYuaHNAjovCxzy0cRUfM7UYtxqM5+/9TiW0o VAZbpFFnLGyYsBduSUADdhw4Q2JtSAeRWqm2qxsSCaxdlUyAOTcg35kjJv3zXomPakJi 86vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=ILdwR5pcSGw7723xZ1U2bA9/JhsnvGlthCTDNdPrhhQ=; b=VmcUQ/fQC6SKWIlA52bi6qqFqBbKwY0hD/YSjYuP6FYp9dHzCTwNNCnNYfIr9q3GU4 43SXR6bx9byqLPeNaf7s3QOzzv+K8pb44WV9M7oJFUZbJb/lqhzA+GhhgMu7+UfopwPG XVF0Rl9qTtDpJO8Lgl8wsGUnEo13b2xfJP+Mm21JS3rBDdw35/pk6AbSfz40e7zEXRCq 6qUlBX6DQ4h27W7J9rlS4Sh0C34FxcXr5khxrmS7IooigSaffpu3PXyVi9TMpUT5YmEz GW3D/1fGqksBgU/vPAq3b7sgRZEmWL9I/47AFI24NV3cw7QCE7YdIrThUo93tR1cwXkj Ycsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZWGQKYb6; 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 x4si10408585ybt.319.2021.02.05.15.11.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:11: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=ZWGQKYb6; 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]:57348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AGD-00042D-OF for patch@linaro.org; Fri, 05 Feb 2021 18:11:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2Y-0002FG-CX for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:26 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:46297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2W-0003O1-Ra for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:26 -0500 Received: by mail-pg1-x52c.google.com with SMTP id r38so5545771pgk.13 for ; Fri, 05 Feb 2021 14:57:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ILdwR5pcSGw7723xZ1U2bA9/JhsnvGlthCTDNdPrhhQ=; b=ZWGQKYb6ajAYjfu9TGU7TQ1HwLDIEjAUCHDpqk4+cCNPli//UTLsfrpNADI/7W86vY al4nQyFI1QHZR6ECP3pjEjdsv05CJuFil8/XmobPDB7Ejsq9LeNZPhMpURPjkf0Kotm9 7mN4JhrpR9tFPCv1eA/iyV1mgpxj8xhecWFCZr3e+Uw6hyLqgmNiEOi2V7AwfLOwcs73 HbBTRB9nZVxxRW+ZMYUlWa6mUyCNZmaYU3SfPoBKuDyk4u51FqoL1el3k2Vw2DengGCg m83Y4s556zF7eCoYTBG3KR17tp4Bu3bfJ5QCSUd2fqycA1iUdJvQwETPYdchNH5f+0IC nENA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ILdwR5pcSGw7723xZ1U2bA9/JhsnvGlthCTDNdPrhhQ=; b=NJB7GHKWSQc58mx8OPrKs/v7M7vmo+PKmiLzGVLC9Ggjr4kWbApL6AfxCTtGI35Qfs 4D8ymld8yBUkOxxU2f5DhQgNo4DIohmXdru08LLw2KFPwsx0bKWZLFe8OIZoOvnfjbMm kjDXnN0jKspbZLb+YLPNNMKMZSkRzGNMEQn/dmseOTZtA2qCCq5Og/wMLHQJDJfwyM8L i9c9fzrI6SRoAUU7FOozibAra1Y4+PAiHUYYhJtkqEXvjrJhFFOrVcNiUG0/tR+N+wVt wBi2Aw6RL4PfZW0gFzHyZDIKnGEhQ2gMD26g+FEerR9IuZGHOn5chTjfaktQT7gH0aCk 9G+Q== X-Gm-Message-State: AOAM532sJhBzW2dcy5CFaTJFuqCYyHqxFgHaEGVJVIo+DGmeOrEDZVQ3 F80c+KahWyleziH2fGdjW+noPkjn33fzrm6X X-Received: by 2002:a65:68ce:: with SMTP id k14mr6572066pgt.401.1612565843769; Fri, 05 Feb 2021 14:57:23 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 16/46] tcg/tci: Merge INDEX_op_ld16s_{i32,i64} Date: Fri, 5 Feb 2021 12:56:20 -1000 Message-Id: <20210205225650.1330794-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Eliminating a TODO for ld16s_i64. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index b64d611ec9..259a8538bf 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -599,7 +599,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint16_t *)(t1 + t2)); break; - case INDEX_op_ld16s_i32: + CASE_32_64(ld16s) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -861,9 +861,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld16s_i64: - TODO(); - break; case INDEX_op_ld32u_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Fri Feb 5 22:56:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376998 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2576862ejt; Fri, 5 Feb 2021 15:04:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwshsARyyT22HDY+wvPwb4AlXUyte7/Lh0cVy2ZXdkuPYSPjNBl/FSyw0rJ20K2b1oTuSj9 X-Received: by 2002:a25:2483:: with SMTP id k125mr9106420ybk.108.1612566298578; Fri, 05 Feb 2021 15:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566298; cv=none; d=google.com; s=arc-20160816; b=RYXTzNn0Xn4NYhCcPB1fayyX8IvYeOISQTOXKkYQC+ZhdQebPClZ5sw+ugFmYRk3v5 bfmjy/ZAbGkqYfPQkrGjjWn2arL1JJG1A1S9+sZiTd5dI/kecQzOKD/+3y0rilHkk5OX Vzs5CZW6rvWScWzy7hPilrGtWudE/afACqfW3Kcor8GoLI5nefx6fj3AvSvmyGD98bGO YgPdqwG+VXgbTcK7Uby0wg7qCi/QLIuUPR5jtQePnSzpY/CSXZrVvYF5/B3tBcBUp19n 6LBQSYYH/9E39TwQbV1kNPEm1hHMJXwEU491hFQ9WrndJByYOsuZOu8dRnKMOrRrgoNk CUiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=iY5vh2fyihhpXHBTL1OAa7t0Sts/YD95jy25p+z4l7A=; b=Wwn26wVAEdtjrZ1ly31qJnk+5yfY93A2U6GeHBr15eKLqdI+ZiaqtHvNeHJlvWylsq Nr3rTgDMsuAPTS5k33wvtZ5Q44WTazIbf6RHPC4XtUfoFntNzUCHJgVafTW5K6VcO4sx R4N2sLd5jeOD+5x+hBLpI410zTjcELgOAVRkLXMkpUTymlh5pfh36j5xsYx7qPuZuZ1G nUsptFurMbsl0l5YKni+1dSd+Sm5e1eOo/SqJXfkIFxlwwsAWwvwJyXPKWODc/ZQIl/L JD4Gei3yPJgTfUxB9ShUUwwFHSQ+ilmhc+srXB4T/bAKkSMS4wTCdgnM43a0bO3ai4Hl Wu/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MLgFxdFQ; 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 r10si10189908ybk.154.2021.02.05.15.04.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:04:58 -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=MLgFxdFQ; 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]:37046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8A9p-0003ei-UK for patch@linaro.org; Fri, 05 Feb 2021 18:04:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2b-0002I8-E7 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:31 -0500 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:44981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2Y-0003P4-OV for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:29 -0500 Received: by mail-pg1-x531.google.com with SMTP id s23so5553520pgh.11 for ; Fri, 05 Feb 2021 14:57:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iY5vh2fyihhpXHBTL1OAa7t0Sts/YD95jy25p+z4l7A=; b=MLgFxdFQERIgujC/yWcnhkJ+u2dWRKGdx/xVVv/vTgyCCoeTcZGl41q9XuEPUCJlGS qNCOgPuOPfPhZ6X5+PQqGTiM3crq8rr9EXvNOpjuf9shLmNRjOVFLOFNx3QX31MRVd5y TurypG/CLsE2Jzm4QsMMiIIBmB8wD2kWqrcSJU4yiouYC+RgAAfmTQU6Kxo0iduJvjWA ShqJuai4h+ooIO4kmLSbck7vwk+OhydB8euSVtTctT0zctgXD6gd/FPGjTaahrWgvDDu mzh/jwVNrp2MsHt/whEYdvsbX/SaMMIMe0qrAQhTWiNe571tTbRiiBtJ1PfK2d4+gGRI 8myw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iY5vh2fyihhpXHBTL1OAa7t0Sts/YD95jy25p+z4l7A=; b=bzIjamCn8Fm1fF29eHkNtIZP/d7tbFiXMw2b6SKF5eoweFksPvyriChzK6eGmK3/UY Dl17q9RmTAObQDRR/XE/vUkaD4NlQ8F1XAKgayTFauSd3WBZ7LGqFQAHj0PZY2SgsYAC Uv73YQRpKmjlhP8QiivnTrND2+z/gM9o3HXxtnnEg15wv87WmLSYVn0X5VLhajw81rWy NraF/ZvmHrPlyQs/qDqBmBnqkWHNAfa71tCN0TCz2AGfx1tYjUAp1qgWL4TclGan/xdn ++yw+gArxyvGHgIjDN44+m1cKQ4sjQ77YkyZ49a/3ps49PIFZrZmx2u7jEfy+VH0kwrq uVPA== X-Gm-Message-State: AOAM531Ws6iGfG1XGdu/gkER7HKl54XFssJ+YL8VRYHoefchJeXpUuGc lJD+/XCXT3R6rF9+DdwVtyiwGJ0+3xRkq3Ds X-Received: by 2002:a63:2306:: with SMTP id j6mr6593343pgj.187.1612565845525; Fri, 05 Feb 2021 14:57:25 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 17/46] tcg/tci: Merge INDEX_op_{ld_i32,ld32u_i64} Date: Fri, 5 Feb 2021 12:56:21 -1000 Message-Id: <20210205225650.1330794-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 259a8538bf..55863f76a7 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -606,6 +606,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg(regs, t0, *(int16_t *)(t1 + t2)); break; case INDEX_op_ld_i32: + CASE_64(ld32u) t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -861,12 +862,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, /* Load/store operations (64 bit). */ - case INDEX_op_ld32u_i64: - t0 = *tb_ptr++; - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); - break; case INDEX_op_ld32s_i64: t0 = *tb_ptr++; t1 = tci_read_r(regs, &tb_ptr); From patchwork Fri Feb 5 22:56:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377002 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2578727ejt; Fri, 5 Feb 2021 15:07:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwB31Wa84OR6LmqGzo+xUD6oz2D0pOsVbXcFYCDk3jAmxRtXv4gWB+qFGFRt5p9Um8MiYYq X-Received: by 2002:a25:56c5:: with SMTP id k188mr9637572ybb.476.1612566462345; Fri, 05 Feb 2021 15:07:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566462; cv=none; d=google.com; s=arc-20160816; b=aJqL3GJiycVF9Xf2/J5y2gojRf6+8O8BobcjqAizKXD0fCTSijdXvyaI8jarVn5qYY 739VIYxYm6m8xtIlqfCC0YH6HhGB6fjMJXU7tHZv/FEAsNFAkyD68m2uOMh1uFF5H3n3 g1WDhIsq9ds/j6NeXrIaxUamx/5TUXudKAlq5jCLMHJRNzFnrAU1Y4+3ZRVTt72gI6Lj UrMd9xvw20mG/I+Pv/+34X+omfTkwCjlUmL59KDYvWeMQEqUwAvcK0RnZLRHe7vDgQHh WIyQ68SdgOxu6xqx15Xw05odqs+a1oDRWH1HvBccI5Kq2IEAxpJCaq5QQYmK+7p3lIYp aq1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=06+ir6ny4Ln0oN97wv1SB2Wg0mLnpqdVB1qEhcqxE0Q=; b=s92juYEGDWZkcFxFeNETt+CSA+nqE5D5lRqmCKZqgzYI0+axNRt0MAYfAVgXs8Rsgi 6WHGwpl9KDcRny2Q6AhrTz/bRQJoECEo0fz729UCui0cJJdjaj4/7sNevq0lHBJSOqdk zKRX7vLBHAg3haI+gTHzDuoAYigejhaSahxRdQ3kSrUG8ifFcBA+1xAC2VINtb47PWXK GLxnskc3EQCAAd+PaphkQrSF+6AhnTx1qfVH8P2nQdlI3a36yiM00bJahqygEcMVQ9/P X1IWPT4/FvqCMHnlNiq6XTtIQhq5tUkyCifoceU+Qs+K5/a+Pd8lqbQiaqOvVgam9zJK uhlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DSgz8liF; 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 w3si9378862ybo.470.2021.02.05.15.07.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:07:42 -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=DSgz8liF; 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]:45554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ACT-0007FA-Lc for patch@linaro.org; Fri, 05 Feb 2021 18:07:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2f-0002Ka-O4 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:34 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:35195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2b-0003Ps-68 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:32 -0500 Received: by mail-pj1-x102c.google.com with SMTP id e9so4656554pjj.0 for ; Fri, 05 Feb 2021 14:57:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=06+ir6ny4Ln0oN97wv1SB2Wg0mLnpqdVB1qEhcqxE0Q=; b=DSgz8liFJVhbDG23AdG0cQdmFwQZCm35hRnO40Lv0SBw/H1pLXCqji2WfOqISV7rfV rdGsXgrHU7GCqDttodhn/4INZxDiL7XvYIT/APKfyevDkzxHMy7O1PCjHUEqhWA36EAl 2c6ECsS7eXnJm8EcZfI/PxrSC1bX6v22KQyRTdm2W9SI1tQ+VIkJ1nqSV1UhsHptE4oJ b+mnBOC8aGELmRXoSfZU0nup0gGuP88XTGzTE1ci+Cn2+sVlnZp54aRKJa/loxpkCury EXQloGhcv8/N5PN/87ZR5S08h8h1g2kGD+d9upvg1lmJ6yHuTeC+LihBW3RcwguI3GvZ PRRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=06+ir6ny4Ln0oN97wv1SB2Wg0mLnpqdVB1qEhcqxE0Q=; b=YHGmvajdwyiPzrWWKvOFXyu4BrJYQwcDG1iqI9BD5svtuwjNSw9FEeTkG3GtBiTYEW cwFZNcEYyVOWnmISORphLmnPTXR12RTpC5WMD067GsKaFE6E2RD/JwJZUp98DOAvF0Lc DG9Kz8NmdYoRTZrfpXmLuT6REoRO8UiFpINEUN5lTc6chl7JJuqmEYiVbCluVeLndxin pLNR/Q3hSejMeE5h28NcCor5srVgVKFPW008clJJQyUcR4hF2R92vOkWu21sADwVCvee wT5it0uBtqhCzRdbWDm0PggbF4iL5pEcSkM2VeZUu16OFDpqD1Y5csgOza6rDdc1VSZn 9dHA== X-Gm-Message-State: AOAM532cLroTzE1D0OMbSvZwBh1oMD/H9qZADzqWMuUi2c7kOO90mQEH OwnNxU7HHzzwqSTmUFbrfz6zaspKPa7nRIfX X-Received: by 2002:a17:90a:ab07:: with SMTP id m7mr6092852pjq.74.1612565847161; Fri, 05 Feb 2021 14:57:27 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 18/46] tcg/tci: Merge INDEX_op_st8_{i32,i64} Date: Fri, 5 Feb 2021 12:56:22 -1000 Message-Id: <20210205225650.1330794-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 55863f76a7..6819c97792 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -612,7 +612,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint32_t *)(t1 + t2)); break; - case INDEX_op_st8_i32: + CASE_32_64(st8) t0 = tci_read_r8(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -874,12 +874,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; - case INDEX_op_st8_i64: - t0 = tci_read_r8(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint8_t *)(t1 + t2) = t0; - break; case INDEX_op_st16_i64: t0 = tci_read_r16(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); From patchwork Fri Feb 5 22:56:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377014 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2584825ejt; Fri, 5 Feb 2021 15:17:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZyqwizRe8KECYvgVHMafqFl0rN/anLqO0uNToHYZjhf70hc7lx/LkA8hdvwWms4kJ0qxD X-Received: by 2002:a25:d982:: with SMTP id q124mr10075726ybg.160.1612567048075; Fri, 05 Feb 2021 15:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567048; cv=none; d=google.com; s=arc-20160816; b=QKRv9pN7cq18wG8vQhXQeQIxXhl+XswxRN5+OrpWcnYD98Gr8vEFcTF+XjOryclCX9 3GJvYs2f3VXKG8tQhmnwtiC9sLs6w7mviQl2p/FsnoV8GSHFPCtHZZelYcJzbAwt2UOj wS7az3CMbi9NAlzmoq1aMeVgru0XffGe2YcLFG4zs99LN6fFTuflnW01JSa/bpvbz8Td 6nnD5XnFwqlosPGp+Iw/6GrBr94WlBNPEvcoN/kj5l/EBter2u37rTNmb0ESDAWgMiUn w+rtAccGGGqncsPZ47foP1KhGWOy/4pt64f3kM3n+l4ElGp45cAR9blBd84koQqHb+3G unPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=acbBM9pC8e1A/bvx5nB4UsPCm3LAoSp/wHIVXG+hEzA=; b=ajpniERxuprUfwYhW2TrxS2eVRdEZ8KKolH+3SbZuqTld6KNz+nAnO/+Y73xOyef/N u8uifR1fgw+/ymj32ObY71MwPqDOfKgRnb1WDXxx5GJ5CVJxfKTgfDcZ0nLdcq5vAvqK GD4hpwhq7ITaSixxHoYhe7rB2hVhWwio3PvQ7m+oqT4eRibV5Ljk/cHiHe0yuRkE5cyg lPSelPTcGw+6Hh8yyL5MzRj18ZtzGnvErzXnPyGJB3FQ++pSWLRyGRFtlPQ+Thu3hJ0M qcisnV7m0RaNqkO7UxsEtE37YGKTsQYLkiUkKP3RI36bgvy5EvZKr60XaUbvWcHaOi0D 9dZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ho2RXL3w; 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 m139si10109117ybm.411.2021.02.05.15.17.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:17:28 -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=Ho2RXL3w; 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]:45460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ALt-0002vp-Ma for patch@linaro.org; Fri, 05 Feb 2021 18:17:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2j-0002MZ-1e for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:38 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:37869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2c-0003QJ-8s for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:36 -0500 Received: by mail-pg1-x52b.google.com with SMTP id z21so5585086pgj.4 for ; Fri, 05 Feb 2021 14:57:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=acbBM9pC8e1A/bvx5nB4UsPCm3LAoSp/wHIVXG+hEzA=; b=Ho2RXL3wttU4qf3EWy18fqovU+Z2TFG4Kj9IH9nc4ze0uA7inzIiig2wrC6cNN+2Eg OkFBDtdrOWX8wkXqlrnlpgQhe743pVaf3E8+YKSdYE0w22/mWVechQls8d+TsaUgrFB/ kJq32+DzXCzMaBeqig83wATIyNOUl/c38ESm2T84iWuQMoZdh3FaQyo6nDl9hmoigKTF 1xf4oajjtko2yTcKFkabYvWQ0vu9HOhKgkJsanNFovHls7ipfkd4w+q6uW2il5x81wKj 899sy7vlD6DvmjJRI4s/XmD8Dqg3z2nTtkH2FKcDEymAOFKzFKoNuO/UOOZCnKz6h8Y4 W/Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=acbBM9pC8e1A/bvx5nB4UsPCm3LAoSp/wHIVXG+hEzA=; b=UjuIjkKenOwV2MLq0qd351qMtIfpvrF6wSemOqz5N86mVx1SV7mpmt94iLWXgr3r1y tA80rGbVNbhz2DOIAUzVtDrED5NfLmgr1bmV0OVyOW3I+E2c/R9natwc6KPLXjm4NKPH L3acxaucdEcxwJBRvdXC1AzYUywKQhY7Q7QYturX5jje2uyesM0hMeE9x0cWvup4KEJM zK/WFf8izh5v9P9wyvtCOmZawwSmC96ZGhq7sKm0/O4P19kdTW7IaJhbZi5cDPeE0ZYK 97sTjinJSkRSYAH9Ctu7m8CBxOJSlzOx5xbv+TJ/YjyTruDW7OFcsjxxbLiPUy2yntcb OOMw== X-Gm-Message-State: AOAM531LGDL4YoqP2L1GMxqwbQUZLsIZ65F8kke3+cDdAIqpq+kYz2ww ZY+tqWEAPkMp+HW6Qb5CLW0+PhlOl+BD930n X-Received: by 2002:aa7:8bce:0:b029:1b8:f395:87a with SMTP id s14-20020aa78bce0000b02901b8f395087amr6498574pfd.36.1612565848984; Fri, 05 Feb 2021 14:57:28 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 19/46] tcg/tci: Merge INDEX_op_st16_{i32,i64} Date: Fri, 5 Feb 2021 12:56:23 -1000 Message-Id: <20210205225650.1330794-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 6819c97792..fe935e71a3 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -618,7 +618,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); *(uint8_t *)(t1 + t2) = t0; break; - case INDEX_op_st16_i32: + CASE_32_64(st16) t0 = tci_read_r16(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -874,12 +874,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; - case INDEX_op_st16_i64: - t0 = tci_read_r16(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint16_t *)(t1 + t2) = t0; - break; case INDEX_op_st32_i64: t0 = tci_read_r32(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); From patchwork Fri Feb 5 22:56:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377008 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2580358ejt; Fri, 5 Feb 2021 15:10:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQMxbS8qjMXpGasD1vaWENyXW19/A4G5aKMVuIUrT8O2gjZMg25G3nms9Ca2/vqReekHz6 X-Received: by 2002:a25:bbc2:: with SMTP id c2mr772577ybk.311.1612566614310; Fri, 05 Feb 2021 15:10:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566614; cv=none; d=google.com; s=arc-20160816; b=I55ZEl2DMZWmRbTJ8Bc2U3UGb6I1ZfFn/G2G/MSXbfYI6xbpzsqMmxQtJm/LTfDxTX DD1z9ogONAB4rqn1FwXQpymnoyaKuhuXxw+04oCEWRFTSZFkKRcF1Vr2suVz3oa4i8De 2I8Cuwl0mS7zifN7xPybhEVXP3s8WACvK26QZzd2/7JpVXU0mLs2KQFF06o+TF8dtYI8 JuW93tkDY7RuGUDQxsjfc6g+ZImMy/ttDBOSGc88/DdLvA8KhP/njkFRpcJ5ZJBAqQTK tEdkyxxu6nM3jDxfo37JOApzn8zfyUpL5rKP9173RbHcCAG3uEyZC8UOo7rsu5zTaJwW 5pyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=aEJQJ28aTfFYwWXCrc4/tQ7PstJpDur23rDVFAChQBo=; b=AKNNFSBtJIkHySVD+YiB0kYyHsWZEcK1yePW9K5PAcvTD1egRLRN7Bkji51DLp3W9A MtfB/KpkNWXa8nk6Eez5oCHzDfd4YiHgEnTZOZBejzFpCaZ601tYlIInWEw0Eauqh5/r bFQYi+drMUaHnQLwU5ah590fRvGwzUSS+RFAf478ttMl7fNYPRFikHpSlhzQY37xkyJ1 f0KsUizh8tLCT0GYui0doHC3ggNxg7lCFuNcoxLyzcew9U+6Ih44IGVtiRI9ZDDL1V+g grjUUeqt+Tc9w2qnldZLX884ZuOT5QDIQuIs1pLVnFepj7ndY9kASi0gkEOzxxDY8RKr yXng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zn0OFHWT; 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 u1si11217203ybk.9.2021.02.05.15.10.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:10:14 -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=Zn0OFHWT; 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]:55752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AEv-0003DU-MO for patch@linaro.org; Fri, 05 Feb 2021 18:10:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2h-0002LH-0z for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:35 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:34489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2e-0003RB-Ss for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:34 -0500 Received: by mail-pj1-x1029.google.com with SMTP id my11so7281253pjb.1 for ; Fri, 05 Feb 2021 14:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aEJQJ28aTfFYwWXCrc4/tQ7PstJpDur23rDVFAChQBo=; b=Zn0OFHWTwm6UmyypmZeMhXaR8R9ieQl1XZftMoNmHvzfElRZw0Gc4gYGMCdYEri1ld JikJbW5r7KqYHzFMyDLCE+3QUfjlNiFAXEaLnZ1zpubIV16c0KyOrcvoD70mbtj3qBX1 0X0IGQ9x2Uq3TMJ3gEEU2x9rppvJC8SMSVVIZvAG7Gte4QMvbZAvhDAKF2aBZ0gbqr8P DxYt3fjvYxhEs0nffLAoKJROfEQxXZBP4k1NTE4kpipo2CFuZ/yO+t6wsOAOSALie5Cr IcaXN6TuWgMfJdicMAKK6oznytRPYHcWGZPEeSowDvcP+2G8o/uaz5f/+L2xg4xxHYwm 8prA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aEJQJ28aTfFYwWXCrc4/tQ7PstJpDur23rDVFAChQBo=; b=BHQJaNHuogP1X7i0jH45jghYkL3QmWHx3nplvellQk1G+PVnv3ZPsoCmTd0XkH66Ri yLPelgFIT+qRcdJ7C6fUeZ9gq5K3XbxIzgNkQLoYF3XoyDVXTv3WqVn8/MohLeGyFy2N ZWaRDxesI795OgpvVLjPZgV6neMz0CBTINhtWN+7MOEPnDXXvedjgCpnxD+iAjtIs+r7 DziXRCUgyr+kHscRVG0bE8H0eshGtV+jUtianhyWvdwo9lhpSVPBOLF3s8IWEon4NhQR jM3oPtd1RdiziS4rIL5gqWaL8mHPxnuGwnHIxJDpcEAEOmW39eLYDzUakTdH3Xvl2pTC +zZg== X-Gm-Message-State: AOAM532B1X7KAKCKpaLGA993DYe6M2cuJOY/rEaU9wY9dePXKEcseNgS cVM/tFzJlEj/BR6p6OOrgUxZ+c+4KRTYxUE0 X-Received: by 2002:a17:90b:3907:: with SMTP id ob7mr6236230pjb.18.1612565851094; Fri, 05 Feb 2021 14:57:31 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 20/46] tcg/tci: Move stack bounds check to compile-time Date: Fri, 5 Feb 2021 12:56:24 -1000 Message-Id: <20210205225650.1330794-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The existing check was incomplete: (1) Only applied to two of the 7 stores, and not to the loads at all. (2) Only checked the upper, but not the lower bound of the stack. Doing this at compile time means that we don't need to do it at runtime as well. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 2 -- tcg/tci/tcg-target.c.inc | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index fe935e71a3..ee2cd7dfa2 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -628,7 +628,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = tci_read_r32(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_assert(t1 != sp_value || (int32_t)t2 < 0); *(uint32_t *)(t1 + t2) = t0; break; @@ -884,7 +883,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t0 = tci_read_r64(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); - tci_assert(t1 != sp_value || (int32_t)t2 < 0); *(uint64_t *)(t1 + t2) = t0; break; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index f0f6b13112..82efb9af60 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -375,10 +375,20 @@ static void tci_out_label(TCGContext *s, TCGLabel *label) } } +static void stack_bounds_check(TCGReg base, target_long offset) +{ + if (base == TCG_REG_CALL_STACK) { + tcg_debug_assert(offset < 0); + tcg_debug_assert(offset >= -(CPU_TEMP_BUF_NLONGS * sizeof(long))); + } +} + static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1, intptr_t arg2) { uint8_t *old_code_ptr = s->code_ptr; + + stack_bounds_check(arg1, arg2); if (type == TCG_TYPE_I32) { tcg_out_op_t(s, INDEX_op_ld_i32); tcg_out_r(s, ret); @@ -514,6 +524,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_st16_i64: case INDEX_op_st32_i64: case INDEX_op_st_i64: + stack_bounds_check(args[1], args[2]); tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_debug_assert(args[2] == (int32_t)args[2]); @@ -716,6 +727,8 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, intptr_t arg2) { uint8_t *old_code_ptr = s->code_ptr; + + stack_bounds_check(arg1, arg2); if (type == TCG_TYPE_I32) { tcg_out_op_t(s, INDEX_op_st_i32); tcg_out_r(s, arg); From patchwork Fri Feb 5 22:56:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377007 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2580227ejt; Fri, 5 Feb 2021 15:10:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0yHhv4Sbw7njzGc8xhpEljXBKTp160jncDfOCBvfD9ANLp0+BxKKr9DillePzkMphYv7t X-Received: by 2002:a25:3d81:: with SMTP id k123mr8891166yba.430.1612566605020; Fri, 05 Feb 2021 15:10:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566605; cv=none; d=google.com; s=arc-20160816; b=V9IuOHZAhbm6Em4eC09JgXpL9pJ6OOPmZoCFwdxX/uXZTnw3beZh3PdluiTNIV7ERf ks4MIgrSmCzm0GhcGHSUCNKewL/d1ayu9JiqWiY8vSrRKKZD7+A5zxO3Ysi+qgxFkgQu Vu9ZyqRj8OC9a6+pUn1Pvrl9Gl445JuxL/K26HRc8Bv5gE8AXGNXB2f75tXiu7lSE8E9 F4rOj4cHFGplo6aVh0Lsmp4IFnBeMhD/X7LqmGhwYYUP577fY8Ve9nz7ayM6lvXDzEcI 8BJCpgK56Ne0p4dMIYA3wmKxah/OluSQO2Xy2C86odfdmkqBc0k6TltnuynV+zfv7tRr URxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=pMV4BySeK8KuIUlVV1lxW3l1A4MrToushLk684ASlQM=; b=tN5q0FHiG2W4pyZPtOUZ64hgImFqTQ3EU2sSL8krJpPCcEiUNwelUmB1NLLiA1R/vO 3YL4SvC9857ZHtTW6stnGqAdWklGWSfhXAls/UJusyEID/wq6sSXwtf4M30I1IrBvhPF CaDwhEO/UA9s3Xb7Z9R65xfdZrsg6T8JzLTs4cA4CiNT5aTMuQLvyry9ephnzAMfvsat WrsSKsE0IEupPJpPPDE8YJLBCaNEAT2ZgRn/+bYBoARnoEe6ilrK5RWVvhrXQ5BFi/5K N8eilupXr985T9N6ao7OVa54YPPDsVVKLC0PCC3vjF0J4hWjKt2TOuNGUOW+QTO8CpMT YDXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NG7/wbWo"; 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 j16si10235957ybp.412.2021.02.05.15.10.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:10:05 -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="NG7/wbWo"; 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]:53992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AEl-0002RL-QU for patch@linaro.org; Fri, 05 Feb 2021 18:10:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2j-0002Mj-1r for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:38 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:36587) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2g-0003RG-0b for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:36 -0500 Received: by mail-pj1-x102a.google.com with SMTP id gx20so4656185pjb.1 for ; Fri, 05 Feb 2021 14:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pMV4BySeK8KuIUlVV1lxW3l1A4MrToushLk684ASlQM=; b=NG7/wbWo3MmxonFxm5mCWykFM4bZtgaQjybyFuC+q/dRifINx1BoKTBn/9ivLLcxKu wpD2S2OxOwFpzIGB8nBegB/ApDgfo5BKwwFiuSUge/HJorkcdDxlkb3Z4poIIpk2LMpz eLGHyOb7pbJiDhCzCy43TicGFTIYLv8AtaD92m456ClVFLs4EHth+3Z2JIwBeHxNshUh +RO97q4as6/s6rHpb/vRTnFjrHcJ2/Nq4HR2uxgx7B93f9D+yOujs2TeqayMmpgNQWkQ BSlxPcLMGRBjiG8ae8bm3XblZx8U/dVI+yAYYc0g688ASsVwQL5yPuxEvgy/7nN/G3FQ ewTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pMV4BySeK8KuIUlVV1lxW3l1A4MrToushLk684ASlQM=; b=fY6zQWMHZLsf8sZzXAx6/lB5n1XjI3sgA7yzFgj1Y8rkhWlvDNOKLmXx8wFnzPkq3Y 6UF6ByS8svOayovQO+uCB6xzmf9tfUV0Je8LYFZZv8gxMyx2tzFszWqU1l/Of8ZlQmhP +h/vW5WDGlGx7YadJM69+HOuDTCSwAXOftWuZVtePnZ5zt5FSA5r4LKa+yjAotuL6PEw mdfM+NjPHjWShWQKiimf8sT7bd5U2IjB0Dq3/TSLyd+tcY7GQ4w8eAHmUQOW1RiKV0FQ Da2r4/ACA0ND+iLl8abGyuRD36NBRfvvsP04+eZoe+wpNAbhiLVblOsePWw2KMCQO1xP 8CZg== X-Gm-Message-State: AOAM533fIt9hVJnG2FN2DvgT55/Bpr2LLzyeSNnoY7dgN+ehJM9qC2dh xkaUK9Mfz0pzFV+wzIljlbmdWQYcX/NdVjj5 X-Received: by 2002:a17:90a:6985:: with SMTP id s5mr2678030pjj.121.1612565852784; Fri, 05 Feb 2021 14:57:32 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 21/46] tcg/tci: Merge INDEX_op_{st_i32,st32_i64} Date: Fri, 5 Feb 2021 12:56:25 -1000 Message-Id: <20210205225650.1330794-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index ee2cd7dfa2..eb70672efb 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -625,6 +625,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, *(uint16_t *)(t1 + t2) = t0; break; case INDEX_op_st_i32: + CASE_64(st32) t0 = tci_read_r32(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); t2 = tci_read_s32(&tb_ptr); @@ -873,12 +874,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_s32(&tb_ptr); tci_write_reg(regs, t0, *(uint64_t *)(t1 + t2)); break; - case INDEX_op_st32_i64: - t0 = tci_read_r32(regs, &tb_ptr); - t1 = tci_read_r(regs, &tb_ptr); - t2 = tci_read_s32(&tb_ptr); - *(uint32_t *)(t1 + t2) = t0; - break; case INDEX_op_st_i64: t0 = tci_read_r64(regs, &tb_ptr); t1 = tci_read_r(regs, &tb_ptr); From patchwork Fri Feb 5 22:56:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377013 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2583922ejt; Fri, 5 Feb 2021 15:16:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLdg/VL2x1TiYlDh6u2Skwm0SH1h7vccPSzcTAEOFEVToigy+r12oluiYqj4TfeuGdMRek X-Received: by 2002:a25:6d8a:: with SMTP id i132mr9828462ybc.337.1612566962311; Fri, 05 Feb 2021 15:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566962; cv=none; d=google.com; s=arc-20160816; b=XcjKiwRiksA6do5ADd7+IckPWRIHmJLtzfHzJplBvP2puwGjUVNLZQdoWziE5Tju0S OlSmWY0GsxgFfjc4UPZgjZsHw3yoktrx7hvzVgCarZYFtBc6QjH6syP2sEnCAaBM4y9o +3fSvwbv5Z7f+8iC2adyjnGaBA8+5mh2Hw4y0nOw7yQaA3JFrwsHl8p2wM4BRfegRNgx 853kJn8+ItBjy/t+J9bJWpzCOM87t90m3znCyHCFkcMURo7N8SBZYrFSPsd5VhsywN7Z 71+f1uzVV1mp1D61yEexPd7cumfvEXBbfIVfgbHO+4pFJO9EKkHMSCEfs0YJ/RYCkDir x9iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=PJmFss8croBP2fe7sUR8rqNmFHSeMIecdaY2so4F4z0=; b=fpBqJhx64OiJZm9YHnmWnlp38adOXv2Im7XdqR5sUIzfu3VcRVvIIdOmu84RKgMcKK fKg1olBgyKsq/np1lo2V/KlERQI2we5rMm40o5H0hsHz8yWkTeQiUayYsMFvOPZe/zTn EyvO3kS7fSbCqbQbMxxUayP7iqDiMIUZSujLxyleoeH5/6hU56y8N3WYhCr3fO9Unnwm 60/ncmcESb5cwK5n10VJp94gdGuJfGnuqAXvbwO+VpXo547vnh9LWeWE4JPy3Tw6BXxq dAfG7iKROmoB3XMc4Y7IJ2c7G6UumuwUXHTCNOPn9szuWnY2wSpd5xfgEZ3u0LtIWZNO Zigg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eRluxCym; 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 x18si9690672ybj.403.2021.02.05.15.16.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:16: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=eRluxCym; 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]:41802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AKX-0001Ea-5y for patch@linaro.org; Fri, 05 Feb 2021 18:16:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2k-0002Mw-Ua for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:40 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:46783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2i-0003Si-M7 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:38 -0500 Received: by mail-pf1-x42d.google.com with SMTP id f63so5279713pfa.13 for ; Fri, 05 Feb 2021 14:57:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PJmFss8croBP2fe7sUR8rqNmFHSeMIecdaY2so4F4z0=; b=eRluxCym/LTibO4o6UQwsQrv+gNWVamQ0oAUBHzghfMBvAkPllOdG+41lNNDc/Heby vs/Pbz56SliKQG0LSKZRRaNxSkplTf4LlxNKlI3M2wSNo70cRL3thfTsMuBYNJJ3n4G+ wlCtQCetIBPoA1NR7VIn65svK+gqoAl50alnema9MbLQSqleZWk1FygrDEWXgAK3Jvhh Lt6RzZhlYmII8gkUpRNpmeytvT3AJ5zJHF0JhKC3nNXUAnabKLkffNIUtfDEu1zmHUie g7Rt5+i4rLwM+2ltJKY1e1Sk+P/osUDnugelro4Uoqe+gekD551DUqUHEXQa1Jo9WLJX A5qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PJmFss8croBP2fe7sUR8rqNmFHSeMIecdaY2so4F4z0=; b=eDSsOombzdf0Yk6q34qzi7IMof9aHRHe9pcTd5JSoTvID8NJTj29qdx9kc2h0HB5CY BccRGYdSdI+8r2j+2Ms2sN3rsRvy3Z5QJaY5WgltvzSk76kR2567HzPx4RzwrHvRX6OD qTM2j7Lj9V6OZCon/6BhJQHNgAvIMa7iK704xPDbRbrGJI+hGJ8ZyDChxbbl+eMWkYc+ j/4Tv4nGNyXDROH76vyS3VN4nF0es2PnKM7TwCParFau82arSyAEjUk1qu5Y5KSfOvoO Ncgs6Vif2GJ1oD8vPaSA/kpoDITaAWL03iycXd9WHzM1Dv7rMVc2E6ak7VrNTmZVJeTz Trkw== X-Gm-Message-State: AOAM531cfEj1TsXmWm84ZTDVrE/VqX/92wtpmwKcQpXwCAOUyrWT+n6k ko8/S6XLzYMsqs6ZBFwExA/iBdsBg3ESalkQ X-Received: by 2002:aa7:9596:0:b029:1be:28cc:cfe8 with SMTP id z22-20020aa795960000b02901be28cccfe8mr6460463pfj.49.1612565854476; Fri, 05 Feb 2021 14:57:34 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 22/46] tcg/tci: Use g_assert_not_reached Date: Fri, 5 Feb 2021 12:56:26 -1000 Message-Id: <20210205225650.1330794-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Stefan Weil Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Three TODO instances are never happen cases. Other uses of tcg_abort are also indicating unreachable cases. Tested-by: Alex Bennée Reviewed-by: Stefan Weil Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index eb70672efb..36d594672f 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -362,7 +362,7 @@ static bool tci_compare32(uint32_t u0, uint32_t u1, TCGCond condition) result = (u0 > u1); break; default: - TODO(); + g_assert_not_reached(); } return result; } @@ -404,7 +404,7 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition) result = (u0 > u1); break; default: - TODO(); + g_assert_not_reached(); } return result; } @@ -1114,7 +1114,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp32 = qemu_ld_beul; break; default: - tcg_abort(); + g_assert_not_reached(); } tci_write_reg(regs, t0, tmp32); break; @@ -1163,7 +1163,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tmp64 = qemu_ld_beq; break; default: - tcg_abort(); + g_assert_not_reached(); } tci_write_reg(regs, t0, tmp64); if (TCG_TARGET_REG_BITS == 32) { @@ -1191,7 +1191,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, qemu_st_bel(t0); break; default: - tcg_abort(); + g_assert_not_reached(); } break; case INDEX_op_qemu_st_i64: @@ -1221,7 +1221,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, qemu_st_beq(tmp64); break; default: - tcg_abort(); + g_assert_not_reached(); } break; case INDEX_op_mb: @@ -1229,8 +1229,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, smp_mb(); break; default: - TODO(); - break; + g_assert_not_reached(); } tci_assert(tb_ptr == old_code_ptr + op_size); } From patchwork Fri Feb 5 22:56:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377006 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2579690ejt; Fri, 5 Feb 2021 15:09:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJw81xMec4sxere3hVBaVWA2dN74thuVyVgLpTLqPa7moET9cbGrdesHferk1H8PELNFupm0 X-Received: by 2002:a25:d844:: with SMTP id p65mr8969326ybg.27.1612566551544; Fri, 05 Feb 2021 15:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566551; cv=none; d=google.com; s=arc-20160816; b=NGdVNnm/sfSEBqzJbgYBL99MTxL3tQ+CsSvbu6pEd3Jp+LzAewZP7Q2V/Jp6zqylkS PmQt49gCX8d+GreQKYEBgT4u2BFDpn5eSbKklZFYmH/3SPfxdLFh8TvOropFrxChCJhV d3LDhQfFkO6DF5GLmLZ7W5/fL42yX1dM2TsslXop+KBbkjHzKqv9kO0sG1FDr1APID9B JPiP0spznaOij3mYORLpajJT3MMZX5D8yjUNsqwTm9v5TUPhZhEdRCZdC9BwkMKbGRq8 ns6TkDAHP57ChqEUmV7nCRlJvS4llG8XCknJUHbD1KOx6GS0o2q+aUXUa9LY00FCzro4 +ZnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=rzqE8qXvCMMaAx4wVWdxYTRZ0dwbqGtPGHyjXMn8W48=; b=xsfJWGD5m+sj5gxFbppG/xA+HHKDfGzPSJtKgqEwUUAH0HeiuQxnwyrKRploP3Qig5 n2u2coZLBg0D4JYx+actekYEgVjpQbxVRZNujOgaVxswEVW7SpetriKLjJXV5+lJvBqv q4Cwjpwy+OzohhDtxPhQe0jaPMBORo9WzTDvFH2SZKWDsebk5qePp8B34s900tW9aSR1 C6I1fNpu3cKBJ9/d45fMZhhXo7LH52OQDoYSh0rdDEjnF8yju84edzv+BlVF6H7jFQlj +RGdJqMGfTU/FZkomGlTja8B3lkT42R2k2h6E91Z5JpblChnKNOTvVjWbVZC8voWIByR d+Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DEYMcJMJ; 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 d1si9725963ybj.201.2021.02.05.15.09.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:09:11 -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=DEYMcJMJ; 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]:50356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ADu-0000uf-V7 for patch@linaro.org; Fri, 05 Feb 2021 18:09:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2q-0002NP-40 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:45 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:35063) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2j-0003Ss-Jf for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:40 -0500 Received: by mail-pf1-x42a.google.com with SMTP id w14so5311555pfi.2 for ; Fri, 05 Feb 2021 14:57:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rzqE8qXvCMMaAx4wVWdxYTRZ0dwbqGtPGHyjXMn8W48=; b=DEYMcJMJod0XWqkOZWL0nQ7S2E8INfJOFRnzIogdWrnd/LZSBwJTyTelqNPgujlq4/ /684yoOCDbqDC/xUmn+J47VuRbfa7q0NITfesCY4auBj/LvVCGAdMMD/uiGITxyhGquH Gy4HX9t4V/zIOlmR44dIwcqwHSzNrI9N2g+8T01IlTzgAJ2V69dz4YyWnTSdZWqIbb6F 7OL571c7C9FNehgkpFy2WwIP0oiSzi7Yrdk8c7LZ3hvriBr6bHKWX7PTkBMHjtmfNLFc Dfgdi7yyl5velkph1em15EboEeratZisGy6oZ5Hl5EYF2xcklkG3p1tr+VFHLgUUE76B oDZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rzqE8qXvCMMaAx4wVWdxYTRZ0dwbqGtPGHyjXMn8W48=; b=Hqk66NtQErdSMplxAEM5tUtPxCqziBhFM1ziPDnNgk37nbh+cY6zTHzZElFO4B+ed8 H2zJw2PELa6i1RCeehJ35LXDfaxoggCbNCmcl51Lu+yZ0tn8+VTwOTvXK5ritO91VFIA PpOhg61XxeN2s3LE/j14Pwn/wBS3xYtQb3Hw3AL/gRW11+ijZUZd8k3btwYL+DSXEXtz TczWLDRVTr3lyeIgXW9goo4XGSHy3V1yH1gO3Dl77b3r1HmT4kkUxMLOF+8DbN36kvg2 H+p+lIxQrLBlhgxB5n/BBM1rWyU6xmwvuFa0EV6JQTXWKSQYMvE0qzuio9tFGowHIVa9 ANbw== X-Gm-Message-State: AOAM532zP8aECAXOJB3bp8oqPaEA/fJ/5OniKLEpeCZ0jYF4bCDzNBy9 rcSUh+Zn7WmW4A2qg/kwyMdjorTzaFDWGGyz X-Received: by 2002:a63:606:: with SMTP id 6mr4461841pgg.331.1612565856361; Fri, 05 Feb 2021 14:57:36 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 23/46] tcg/tci: Remove dead code for TCG_TARGET_HAS_div2_* Date: Fri, 5 Feb 2021 12:56:27 -1000 Message-Id: <20210205225650.1330794-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We do not simultaneously support div and div2 -- it's one or the other. TCI is already using div, so remove div2. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 12 ------------ tcg/tci/tcg-target.c.inc | 8 -------- 2 files changed, 20 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 36d594672f..25329345cf 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -652,7 +652,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_ri32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; -#if TCG_TARGET_HAS_div_i32 case INDEX_op_div_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); @@ -677,12 +676,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_ri32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 % t2); break; -#elif TCG_TARGET_HAS_div2_i32 - case INDEX_op_div2_i32: - case INDEX_op_divu2_i32: - TODO(); - break; -#endif case INDEX_op_and_i32: t0 = *tb_ptr++; t1 = tci_read_ri32(regs, &tb_ptr); @@ -908,11 +901,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_remu_i64: TODO(); break; -#elif TCG_TARGET_HAS_div2_i64 - case INDEX_op_div2_i64: - case INDEX_op_divu2_i64: - TODO(); - break; #endif case INDEX_op_and_i64: t0 = *tb_ptr++; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 82efb9af60..6dc5bac2f3 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -596,10 +596,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ TODO(); break; - case INDEX_op_div2_i64: /* Optional (TCG_TARGET_HAS_div2_i64). */ - case INDEX_op_divu2_i64: /* Optional (TCG_TARGET_HAS_div2_i64). */ - TODO(); - break; case INDEX_op_brcond_i64: tcg_out_r(s, args[0]); tcg_out_ri64(s, const_args[1], args[1]); @@ -639,10 +635,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_ri32(s, const_args[1], args[1]); tcg_out_ri32(s, const_args[2], args[2]); break; - case INDEX_op_div2_i32: /* Optional (TCG_TARGET_HAS_div2_i32). */ - case INDEX_op_divu2_i32: /* Optional (TCG_TARGET_HAS_div2_i32). */ - TODO(); - break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: case INDEX_op_sub2_i32: From patchwork Fri Feb 5 22:56:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377024 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2587898ejt; Fri, 5 Feb 2021 15:23:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkBXVg7VSNNOC+7FRXIr9tebTlOgltDwCLTk5s+4u9icOg4HdA5iBk7LRDWvtCI5AVf3X8 X-Received: by 2002:a25:a267:: with SMTP id b94mr9836673ybi.277.1612567387740; Fri, 05 Feb 2021 15:23:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567387; cv=none; d=google.com; s=arc-20160816; b=lrKxX41EZtBtEMZBsYtGJ2s9pO0hGgosaVe0/ySUSFPOqB+Qyq14l5wvj6CXtYZXUd dOycjuCSdZA2YY7yVnaaJ5AhWS1EiFWCOhwZb6Tqq7YdcgGllgyFWJzSY72UdvitSTEr xqKokUKasZ7pge28eC0Z0tM+iIXM+J+dbE+K8Kjh9ipcAOmrnwcwAG9r6jVXf6ioZyoU cu0xjCmQz/k97XVj7qprY19B6+wE3zJUDLQawWuPdUSA/p/eKPCZvCODPCfwjIG8E/BI BBxAzaTFABnYePOmM+YMKnYqAO8kfJiWlFEZKGj+rMTtl3w1xEtP+1WwJK0JL94sC5ED lV/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=nPG7Xcmlwk2vyC0De6Qy+WTUFdq1vGPN65ZNzO4h0N8=; b=xz2LQRM33FAo2MInlQJYn6eMdfP+THvNB1Br5y3ooK+mp9U1T8f27bSA2gysOfPtcU MzkRGSNkMZHEz9rOtJeZbt+o8ItCfPRcVdrZv4tMx3Cirx4XuLmQUeVr2ocWcpH4VLHG D1oeNdshvEYSMNj7fUXk+9U6I/EI+Ajvo1HQQdP4BD2YNjeEX1v0CNH2jvgEfsB7bzXF c70YA4/5/2yH4ebUayikcrxzgeqC3xFjqOB0QUJWdYWhbXXTLYI6oNiVQZJRQgf/CkAX AYi8PN+KGbBtKgXlSO8oYBf2q8Gg33+raO8E6qy+NS76oe2T9/4b/nGM3e8hXFpMt9Y9 PeAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EsitVyKX; 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 y9si10806540ybn.264.2021.02.05.15.23.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:23:07 -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=EsitVyKX; 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]:36286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ARP-0002gN-3O for patch@linaro.org; Fri, 05 Feb 2021 18:23:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A36-0002WC-CR for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:00 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:45832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2m-0003Tj-Ov for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:57 -0500 Received: by mail-pg1-x52a.google.com with SMTP id o21so4168351pgn.12 for ; Fri, 05 Feb 2021 14:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nPG7Xcmlwk2vyC0De6Qy+WTUFdq1vGPN65ZNzO4h0N8=; b=EsitVyKX3VGFveBg5/yDPX41MvH3ZaYKnmTZuSqDyHDb7cYREGMybY0cIsX9zwnU10 aMGskTnad8JqBLciHj4u/HvuttQhaHrl/vEuKHU3DODDEqxrlWvMrpBtHXvuFldfd3ox 77xLiqaZtWpuDs0p6fA7+3MirmdPCqrRH6sXui4JVo3vEpn2PQpWrHvr1BP7dxU4FQ4m mlu+96u6fZWwZIGPF843pM06BaD2H8CfwTxzlt/cOxhpcIWVYwfq87AMz1UUmxo+ddM0 ooGxieZkthkOp4lOxifOAErZ1GvEk13QRk35u3f30hKGQa4aOrlrmnahPaeJW8TM06tk 86pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nPG7Xcmlwk2vyC0De6Qy+WTUFdq1vGPN65ZNzO4h0N8=; b=I3n71WO+OxJsHzAWCasY3gh7rKHbcFzhroZpdSNh/MZvaypnPPgnvEHSMlUMPF7gB3 JDGLd78zGs0xq2dkEHI38u0Ei1ZBMBDJRZYt5JTDDiKQhBsS3cu6o1n1XfdhNHlpVGIO 2UCUCVC92VrTxvpZllCfk6WlEK64rvleCAs8iACy2JGvP/ETXTzCWyGCtRvmzjT4HTyy A+cFQNLNf4S+emuU53lnaU+ptokFGBCoSfZXO6UJcIU1aD+81EiQ5Wh+RohSDgH9zocF 1URQY7+en9kTSZPxBTkvD3HC7ewz47K8exdeyZC/J0F9q3exNlXmAcmkNH/39F+pPhso EP2g== X-Gm-Message-State: AOAM5302mgmETETx3/XTt4kW+w8ViRCcfbWKEoDsuisNt6YKtfpXv3r/ 5M1qWb+RiB6gZHDojGbWdtptDS0Lr8KqXR8v X-Received: by 2002:a63:3747:: with SMTP id g7mr6327466pgn.376.1612565858610; Fri, 05 Feb 2021 14:57:38 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 24/46] tcg/tci: Implement 64-bit division Date: Fri, 5 Feb 2021 12:56:28 -1000 Message-Id: <20210205225650.1330794-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Trivially implemented like other arithmetic. Tested via check-tcg and the ppc64 target. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 4 ++-- tcg/tci.c | 28 ++++++++++++++++++++++------ tcg/tci/tcg-target.c.inc | 10 ++++------ 3 files changed, 28 insertions(+), 14 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index bb784e018e..7fc349a3de 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -100,8 +100,8 @@ #define TCG_TARGET_HAS_extract_i64 0 #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_div_i64 0 -#define TCG_TARGET_HAS_rem_i64 0 +#define TCG_TARGET_HAS_div_i64 1 +#define TCG_TARGET_HAS_rem_i64 1 #define TCG_TARGET_HAS_ext8s_i64 1 #define TCG_TARGET_HAS_ext16s_i64 1 #define TCG_TARGET_HAS_ext32s_i64 1 diff --git a/tcg/tci.c b/tcg/tci.c index 25329345cf..5c84a1c979 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -894,14 +894,30 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, t2 = tci_read_ri64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; -#if TCG_TARGET_HAS_div_i64 case INDEX_op_div_i64: - case INDEX_op_divu_i64: - case INDEX_op_rem_i64: - case INDEX_op_remu_i64: - TODO(); + t0 = *tb_ptr++; + t1 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_ri64(regs, &tb_ptr); + tci_write_reg(regs, t0, (int64_t)t1 / (int64_t)t2); + break; + case INDEX_op_divu_i64: + t0 = *tb_ptr++; + t1 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_ri64(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint64_t)t1 / (uint64_t)t2); + break; + case INDEX_op_rem_i64: + t0 = *tb_ptr++; + t1 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_ri64(regs, &tb_ptr); + tci_write_reg(regs, t0, (int64_t)t1 % (int64_t)t2); + break; + case INDEX_op_remu_i64: + t0 = *tb_ptr++; + t1 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_ri64(regs, &tb_ptr); + tci_write_reg(regs, t0, (uint64_t)t1 % (uint64_t)t2); break; -#endif case INDEX_op_and_i64: t0 = *tb_ptr++; t1 = tci_read_ri64(regs, &tb_ptr); diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 6dc5bac2f3..3327ce3072 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -577,6 +577,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_sar_i64: case INDEX_op_rotl_i64: /* Optional (TCG_TARGET_HAS_rot_i64). */ case INDEX_op_rotr_i64: /* Optional (TCG_TARGET_HAS_rot_i64). */ + case INDEX_op_div_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ + case INDEX_op_divu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ + case INDEX_op_rem_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ + case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ tcg_out_r(s, args[0]); tcg_out_ri64(s, const_args[1], args[1]); tcg_out_ri64(s, const_args[2], args[2]); @@ -590,12 +594,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_debug_assert(args[4] <= UINT8_MAX); tcg_out8(s, args[4]); break; - case INDEX_op_div_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_divu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_rem_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ - TODO(); - break; case INDEX_op_brcond_i64: tcg_out_r(s, args[0]); tcg_out_ri64(s, const_args[1], args[1]); From patchwork Fri Feb 5 22:56:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377016 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2585665ejt; Fri, 5 Feb 2021 15:18:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJo82Yc9FHrs6NgbTnSQ+pV9Brz+cA4klydsNMApNLeOGcqHjPDO7oizyqHSViKkg3Mt8o X-Received: by 2002:a25:83cc:: with SMTP id v12mr9487139ybm.293.1612567139375; Fri, 05 Feb 2021 15:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567139; cv=none; d=google.com; s=arc-20160816; b=C6qFWQms0fQZb6jugYRcg/HsbwZ2GX4rllhFz4YnZvWlNRRM7T+PRsMCkoxImr2ohE SX1v5RAqnYqrjl2Trgr6OiKm6r5rmiKw/jq61WtGH4G0qgZbR3XkuQX9qGs8aeaRUrL/ IyxYYcwDdmKc5yO2CScQh3y7O2USpDv9xAg8W3dsp/cXd16hRTiWL1Kmw/1jnllU/M42 ApoUOOfDuCLWClFE60+mJvuqMfpBfbdiK+QprnRhY20p22eLCwX/BzZAn9YJryMEm93W 39MObPLn21YOeVOTGJk9gVyjtqAECLmSXB5cXuDp8CT1UlfKyeLGQKqNuI10jkN4qZl9 RJCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=5oMkWTFAvkbENXCd9UcZlqUmvtysI4E37yjhcZ4CH7A=; b=HSOvmLsBb67vOHY5ZRTfkf1wy84xmEl6LZBh/479QHwi8y0zZ+9yaXutTI5vTESiQZ kFXJt3zIX/o4CrET31b9VxNxb/NDc9teTZauwceQTBoukPMI2CTbYo+eXhVpqpCAytNX kvwRJ9211+ZygS6jZtb+LAqnEsfI6aocbvzPYAIbGm6jO7FiTtsBcIOTY8z2Qa+l44k/ mz0u0UOiFKRebqq/h5kQALi8YH39DdNJacdfUUF9iS7R+J3RKMmzeNZ5kXuXx+HNrqBZ 8155mnkWq9ePvGk8TTvbQwhqoJQk6LAwRLiD8sQt44ne4RqdmK30qntj8sobFMXzKk6j JzAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DBFczdXt; 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 n9si12777910ybn.170.2021.02.05.15.18.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:18:59 -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=DBFczdXt; 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]:50022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ANO-0004tA-QZ for patch@linaro.org; Fri, 05 Feb 2021 18:18:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A37-0002Wr-Cc for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:01 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:52657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2n-0003Tn-H1 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:00 -0500 Received: by mail-pj1-x102c.google.com with SMTP id q72so4431397pjq.2 for ; Fri, 05 Feb 2021 14:57:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5oMkWTFAvkbENXCd9UcZlqUmvtysI4E37yjhcZ4CH7A=; b=DBFczdXtmyPuofXW1veFtbo/xYHksbLPShpUNFnNaOnYPuEVj3xo6wmmtBWZUN9BJN tD2naYHElT0U8cEBvNvnNRY6tHJmU7czWGzg61t3T64iOaIfTzx8TqH6AqfaTasqVIqy IWo4gaN0gApV4aZfsYk+uvj59sLotFGdLOdbYswgkNTjhrJUBnaJse9FKtjvbbjfXyMc jQSP9yJw7kyBXSUerzF/M6CyWm+59qff6ShFzdgQYqfns5EYS13W4sNmQp6v1XZukvhq 1/YHb/pTTmc9r7gkKVM/T+FNA5RnAsbHTsnda3U1gSIC2IMLHXShVy8rKjJ7QAEQG0sR CxYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5oMkWTFAvkbENXCd9UcZlqUmvtysI4E37yjhcZ4CH7A=; b=HVAf7srQAMD8d581mfa0PVXUX8deT5yVwTL/IvUse7xdOgAzapYa1Io9VuwkJYTHqM T9zxuKcI+vAcHQfp1tSGWMxh4faTVDGxgCDOYmUajT3wFnFtPFQ29/975UjGrfGY+WfP ru/eSQMeNHr3kxK7WLmqhgm/T9rcJvT2s8tel/1rGqu16MuBZ2/XG5/xXpZ9h8MPO3vQ BMXUp/K0dGQOV1zugUJ/6HFkOumOjzlWjVQScNqrRY1wU00kA6Nrd65VuPwhgHTp/uMg U6rztrXUEG1K1PNiVV8LJUGgcOKf254T6x+8674vB8GZ/4B8oCwar7vvA/mLG+xiMKPY 0lwg== X-Gm-Message-State: AOAM533kZRgs/xgoWNUpnz1+PQoGVLxo47h+zT6AkczsWytzGIFF2u9p qwfEJHeLFygrtiUCerVkL35ZVhtUqVLAglMt X-Received: by 2002:a17:90a:53:: with SMTP id 19mr6057736pjb.29.1612565860181; Fri, 05 Feb 2021 14:57:40 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 25/46] tcg/tci: Remove TODO as unused Date: Fri, 5 Feb 2021 12:56:29 -1000 Message-Id: <20210205225650.1330794-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 8 -------- 1 file changed, 8 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 5c84a1c979..e0d815e4b2 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -33,14 +33,6 @@ #include "tcg/tcg-op.h" #include "qemu/compiler.h" -/* Marker for missing code. */ -#define TODO() \ - do { \ - fprintf(stderr, "TODO %s:%u: %s()\n", \ - __FILE__, __LINE__, __func__); \ - tcg_abort(); \ - } while (0) - #if MAX_OPC_PARAM_IARGS != 6 # error Fix needed, number of supported input arguments changed! #endif From patchwork Fri Feb 5 22:56:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377015 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2585236ejt; Fri, 5 Feb 2021 15:18:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEYxESIvRkK5YSx4fCrSbz1AxB6nKgLMgG/+mF2+TVLQ78XHiT/Er+dsX2s2DU0rCJWRj3 X-Received: by 2002:a25:c683:: with SMTP id k125mr10654690ybf.32.1612567088737; Fri, 05 Feb 2021 15:18:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567088; cv=none; d=google.com; s=arc-20160816; b=EcTE/EeurqacmXoSjV1L154iHXA0Gv+Arlj7083dMQieTLQIsCmrCn5bP/e+kHF2vb 2z0t0LHtwYv4jLW9AtCv+XAh0NET64gEMObR/jFVdaFMbZyOJTpPY8RVqNRa632Dw3uK zRAxDhpsQ44DQM2htDfhdbwbEoQHh3mzS67vE3StvHsjkgIZbKO6lV/oGGtYGjD7EpRA FCkrM0BeJVfg0tEl3U3jNK5DXbugHib5MJ2DxZmqk2fPV9364l3Uf0jnI4DT8xOmMboe 7s5hYwAa/+ZFz70xADJustLwV/WDwvsfn31Z8vdlYyK/X57g91KEouzy01Uuthqc3zWn H4tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=qiThUlNgHGJ/mquJtz2e8kAX1s9Aecgyjtto5Sl+Qt8=; b=b/zQcB8ZcFzGPa53wxkufy9YooFNROHjuRAgYdtN42SPFpvJF0W1/n54PbCjAGLLU6 e4Pj4DBjdGpcNamf/MBFUb0j4vITFHS+/wBoahI5/8FsNmMBkdGqWQpq8mv27qiGumvc iS+D2E+W2rpByZFkQM2ess1kqM/xToRUmmYk0XrCrHz/+xAQxMjqCy01sPdg3ljwiWe3 LLGu07I+GmG/FUSascAN7AEWEeuVDdEXeEewTbZjs65CI1EDmv7vQCt4nI4l0A1OEdmX OHIVs5ORrDjL9MmdyO14dPf9o6a1Vs4hZCYr3ddNgpHBmeeYOxI577iFBefWg312cO/Q eOdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IG85gxo2; 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 l195si10234075ybf.109.2021.02.05.15.18.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:18:08 -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=IG85gxo2; 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]:47092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AMa-0003eq-3s for patch@linaro.org; Fri, 05 Feb 2021 18:18:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2w-0002TJ-H2 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:52 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:40838) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2r-0003V8-63 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:50 -0500 Received: by mail-pf1-x42b.google.com with SMTP id i63so5296914pfg.7 for ; Fri, 05 Feb 2021 14:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qiThUlNgHGJ/mquJtz2e8kAX1s9Aecgyjtto5Sl+Qt8=; b=IG85gxo2JKC6LcenbsCMp+MvmEbCPXpLX6sMLvIUa/0vfkA4ZLM5kBKogdtQWatiG5 bEj86w99JO7dRP+Sz0Ro1hbdYNFdK6IEwGHPBLIghneQmDjSYKHHqSeLa6d3Cx0aSGS3 3UnCH3wtRnyhaJ+lh1l798QYexLIqaIA/Zh9FOsnD4SJC1BA+54FpFgqcM//7b1EWwvi Ph6NGVdp1/4NFFm1ZtL42VBFWNENWRyrcQXyaLKQ9Xs3R1iHnNZzRcVhW77spMbEmZvc 9LUP4m4Z2PoDJIx44nT2DYcg2bLmkF2Tg/Bmnejcr7BLXB+HRyUy+pno+FJTZZ11+rj1 EXjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qiThUlNgHGJ/mquJtz2e8kAX1s9Aecgyjtto5Sl+Qt8=; b=nYKeQczCK/GlKtIEYs5IzwlvB19TxCC+cCfkPKTHQElrvTExRBNvX8lT2JRxrG277g gPO3BraZNcGblcv30TsVcSc05sTyk0rfkS062PqqvwCmqis0SI4H6dfJtbfbjbvZK2To yUbciOLj4ajy+vCflsNhI2wTZzVnHX9TG0ZuCMQq3QHcqnNftp8xLeXmWKqWF/kxpYHV eeraeJPvimlzQAiSSoqdxKyiTSWet9LJ6WS/CJlNmUAa8wdpVkxMD1xHUxDgdWieBNLy 6ZD89QaZvNZEPseceNh9WWIJmPUQvpv4Mh+mQKxLcMCGjHeU7tf29JvwPzt/cwQLhfRL RHDQ== X-Gm-Message-State: AOAM533sO/sNrHWue1u3ev167H6qJcpZur5h4HWhD4+AICmsH/Ln6tui shbxuDYloCJq54GYNHpIAzL54jvbgazygtIa X-Received: by 2002:a63:3008:: with SMTP id w8mr6392876pgw.207.1612565861934; Fri, 05 Feb 2021 14:57:41 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 26/46] tcg/tci: Restrict TCG_TARGET_NB_REGS to 16 Date: Fri, 5 Feb 2021 12:56:30 -1000 Message-Id: <20210205225650.1330794-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As noted in several comments, 8 regs is not enough for 32-bit to perform calls, as currently implemented. Shortly, we will rearrange the encoding which will make 32 regs impossible. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 32 +++++--------------------------- tcg/tci/tcg-target.c.inc | 26 -------------------------- 2 files changed, 5 insertions(+), 53 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 7fc349a3de..8f7ed676fc 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -133,11 +133,8 @@ #define TCG_TARGET_HAS_mulu2_i32 1 #endif /* TCG_TARGET_REG_BITS == 64 */ -/* Number of registers available. - For 32 bit hosts, we need more than 8 registers (call arguments). */ -/* #define TCG_TARGET_NB_REGS 8 */ +/* Number of registers available. */ #define TCG_TARGET_NB_REGS 16 -/* #define TCG_TARGET_NB_REGS 32 */ /* List of registers which are used by TCG. */ typedef enum { @@ -149,7 +146,6 @@ typedef enum { TCG_REG_R5, TCG_REG_R6, TCG_REG_R7, -#if TCG_TARGET_NB_REGS >= 16 TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, @@ -158,33 +154,15 @@ typedef enum { TCG_REG_R13, TCG_REG_R14, TCG_REG_R15, -#if TCG_TARGET_NB_REGS >= 32 - TCG_REG_R16, - TCG_REG_R17, - TCG_REG_R18, - TCG_REG_R19, - TCG_REG_R20, - TCG_REG_R21, - TCG_REG_R22, - TCG_REG_R23, - TCG_REG_R24, - TCG_REG_R25, - TCG_REG_R26, - TCG_REG_R27, - TCG_REG_R28, - TCG_REG_R29, - TCG_REG_R30, - TCG_REG_R31, -#endif -#endif + + TCG_AREG0 = TCG_REG_R14, + TCG_REG_CALL_STACK = TCG_REG_R15, + /* Special value UINT8_MAX is used by TCI to encode constant values. */ TCG_CONST = UINT8_MAX } TCGReg; -#define TCG_AREG0 (TCG_TARGET_NB_REGS - 2) - /* Used for function call generation. */ -#define TCG_REG_CALL_STACK (TCG_TARGET_NB_REGS - 1) #define TCG_TARGET_CALL_STACK_OFFSET 0 #define TCG_TARGET_STACK_ALIGN 16 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 3327ce3072..7e3bed811e 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -187,7 +187,6 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R5, TCG_REG_R6, TCG_REG_R7, -#if TCG_TARGET_NB_REGS >= 16 TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, @@ -196,7 +195,6 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R13, TCG_REG_R14, TCG_REG_R15, -#endif }; #if MAX_OPC_PARAM_IARGS != 6 @@ -216,15 +214,11 @@ static const int tcg_target_call_iarg_regs[] = { #if TCG_TARGET_REG_BITS == 32 /* 32 bit hosts need 2 * MAX_OPC_PARAM_IARGS registers. */ TCG_REG_R7, -#if TCG_TARGET_NB_REGS >= 16 TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, TCG_REG_R11, TCG_REG_R12, -#else -# error Too few input registers available -#endif #endif }; @@ -245,7 +239,6 @@ static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "r05", "r06", "r07", -#if TCG_TARGET_NB_REGS >= 16 "r08", "r09", "r10", @@ -254,25 +247,6 @@ static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { "r13", "r14", "r15", -#if TCG_TARGET_NB_REGS >= 32 - "r16", - "r17", - "r18", - "r19", - "r20", - "r21", - "r22", - "r23", - "r24", - "r25", - "r26", - "r27", - "r28", - "r29", - "r30", - "r31" -#endif -#endif }; #endif From patchwork Fri Feb 5 22:56:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377009 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2580735ejt; Fri, 5 Feb 2021 15:10:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyc009i0Js7IHZuUNp5tyCzjY87uwHRPN5B138sWqR5qvxhCZwH0rIPeBZhPyGOlT0x7/ef X-Received: by 2002:a25:6d8a:: with SMTP id i132mr9803905ybc.337.1612566658323; Fri, 05 Feb 2021 15:10:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566658; cv=none; d=google.com; s=arc-20160816; b=RWb4RcEXPWCcwdS36gCDHm63DFEXZXJw9FwmLeHY9SQExk1a625hGQK0uEKatJgydi 0Jr0mrxfu02rGEoCDTDi1HxQ46tW5SZI1I6Q7yTsMNiXqh3bsh3J20/nV4SblVgUz0hx nfR73YEzruw+Mftj9ZKmNTR+iGMkBlPnNRAv07pJH78dytNQyugPyE5kjyTpixvq/QEF nNRGyR75g5G1F1fPZcgoMG4qFmxU/AUs5Q4fI2DuDqY65S9vjdF8h6XTs4T4URgvJ589 DHogB+DfLXs/oUQz1CiTXn3zO13jUQwH/HyXw1daWPygei+WUQGDXTe3FzoBqLQeGcNp r5Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=HpWGR2pzYCq2nhr0I+4v9m7InqBQYpMtzCuE7YrrkGg=; b=PdBjsm6BGzoFl59OPrju2UUm7bb5I1MNTORBbQlzAsYaW9rLvZs2VcsRuUx+ChsyNY c+kRzvA77evBafncOOMVn9B43v3s9t4gSgQAdp83N2LmE8EyY72xMLbiGalvu3HdYIVT h2Hfw0Sb3nm0hbjUWvVemvLMOk8WkbkldH7ugwS5GRvKBjobm8D2gL4Nns8OCbWYMNDy WxFPVESl+pU8btr0emz09ugSSX/EAZKtiYjon67sm3UmKEti8WIK7zJTIL+JO6WtGeba FPHP+Kep/0ssJWK5oqc/88aJU5pDPU6iZ88q4ITJSOnsjSy2FRn3JOqYdrl1+bdI79Hm 1IpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NSZplcO+; 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 n190si12054006ybn.445.2021.02.05.15.10.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:10:58 -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=NSZplcO+; 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]:56284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AFd-0003UB-Gc for patch@linaro.org; Fri, 05 Feb 2021 18:10:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2y-0002TX-FR for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:54 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:51829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2r-0003VL-Db for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:52 -0500 Received: by mail-pj1-x102e.google.com with SMTP id fa16so3998452pjb.1 for ; Fri, 05 Feb 2021 14:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HpWGR2pzYCq2nhr0I+4v9m7InqBQYpMtzCuE7YrrkGg=; b=NSZplcO+8PJeXUTBol9psnMFi5eU5iK/eBhSnx/24VTIe8RVlRQcM9qUUZzUPVIJES bBwGwjwZxzcqI6h2eeh0NskIylD1ryqKjM16WoD6wtQNr337kuQt2JJzHSwVMga4RKW9 rahJBhuYspwT1Zb8ZysGJi2vH0Sz8COBaDG1rLJV08ELu2y5WhfDSE0B3h9alzfz/ZDr D6RM/coevpbwkaP054WXQCdtaxlsWvN7Qd8bnZ1glS4pXoz1rcmqjiyBnfvuTUdCpPv7 dMStcr/9OnDQmafy5QE7uK08RlW5kE0iCVHq+V6jIJepvM4/kKVCy4VRmh728dWvbWJM zO+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HpWGR2pzYCq2nhr0I+4v9m7InqBQYpMtzCuE7YrrkGg=; b=GT6otCo5ee9m/OOj94gZ9951kdNITuTqkXlXG8aZqaJO8I8lVYPbwX6H500WMCGXYL tPbPFVevs0JjdZ1Ju/iSG45ZKYja7+w0vEkvK9W+M9WTmMMa77XQsVfJkrnEZRit947e PhfvQJf0Ex7d/rA0OgpCCz1QnwFTt8xBienWbJ4R/Kf/dC8BIqHnjMpL2/FNhD/6k5q4 tUhvgD3t2AwFMLSRVP+YaQPuXMzYLJr/PerXTcdXvX0zFYWOKrUx9QakZHZwKM0+nSnX QmrpbNrvCrDElf1a3a/XIMkQD01KYQ3ECX9u3Y7DWeDoE8lFLSMrNuzxHNZi63p5T8ky S2FA== X-Gm-Message-State: AOAM530xDFBOPpy3BEQkcSy5dyVI+xtkNTUikko9pfPVOWdHwaKX+EtI t7RTwoUSC9camLpc5NqkECQVklnIsnqOLV6f X-Received: by 2002:a17:90a:46cb:: with SMTP id x11mr6251365pjg.124.1612565863753; Fri, 05 Feb 2021 14:57:43 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 27/46] tcg/tci: Fix TCG_REG_R4 misusage Date: Fri, 5 Feb 2021 12:56:31 -1000 Message-Id: <20210205225650.1330794-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This was removed from tcg_target_reg_alloc_order and tcg_target_call_iarg_regs on the assumption that it was the stack. This was incorrectly copied from i386. For tci, the stack is R15. By adding R4 back to tcg_target_call_iarg_regs, adjust the other entries so that 6 (or 12) entries are still present in the array, and adjust the numbers in the interpreter. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci.c | 8 ++++---- tcg/tci/tcg-target.c.inc | 7 +------ 2 files changed, 5 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index e0d815e4b2..935eb87330 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -511,14 +511,14 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_read_reg(regs, TCG_REG_R1), tci_read_reg(regs, TCG_REG_R2), tci_read_reg(regs, TCG_REG_R3), + tci_read_reg(regs, TCG_REG_R4), tci_read_reg(regs, TCG_REG_R5), tci_read_reg(regs, TCG_REG_R6), tci_read_reg(regs, TCG_REG_R7), tci_read_reg(regs, TCG_REG_R8), tci_read_reg(regs, TCG_REG_R9), tci_read_reg(regs, TCG_REG_R10), - tci_read_reg(regs, TCG_REG_R11), - tci_read_reg(regs, TCG_REG_R12)); + tci_read_reg(regs, TCG_REG_R11)); tci_write_reg(regs, TCG_REG_R0, tmp64); tci_write_reg(regs, TCG_REG_R1, tmp64 >> 32); #else @@ -526,8 +526,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_read_reg(regs, TCG_REG_R1), tci_read_reg(regs, TCG_REG_R2), tci_read_reg(regs, TCG_REG_R3), - tci_read_reg(regs, TCG_REG_R5), - tci_read_reg(regs, TCG_REG_R6)); + tci_read_reg(regs, TCG_REG_R4), + tci_read_reg(regs, TCG_REG_R5)); tci_write_reg(regs, TCG_REG_R0, tmp64); #endif break; diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 7e3bed811e..aba7f75ad1 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -181,9 +181,7 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R1, TCG_REG_R2, TCG_REG_R3, -#if 0 /* used for TCG_REG_CALL_STACK */ TCG_REG_R4, -#endif TCG_REG_R5, TCG_REG_R6, TCG_REG_R7, @@ -206,19 +204,16 @@ static const int tcg_target_call_iarg_regs[] = { TCG_REG_R1, TCG_REG_R2, TCG_REG_R3, -#if 0 /* used for TCG_REG_CALL_STACK */ TCG_REG_R4, -#endif TCG_REG_R5, - TCG_REG_R6, #if TCG_TARGET_REG_BITS == 32 /* 32 bit hosts need 2 * MAX_OPC_PARAM_IARGS registers. */ + TCG_REG_R6, TCG_REG_R7, TCG_REG_R8, TCG_REG_R9, TCG_REG_R10, TCG_REG_R11, - TCG_REG_R12, #endif }; From patchwork Fri Feb 5 22:56:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377011 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2581310ejt; Fri, 5 Feb 2021 15:11:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5tt+ZTlFPswZV63IuV6NMMV4oE0LgUngCW/6dplJxlb60AagSpMMBMD1e58t1ifGB3EN8 X-Received: by 2002:a05:6902:1025:: with SMTP id x5mr9631237ybt.96.1612566713596; Fri, 05 Feb 2021 15:11:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566713; cv=none; d=google.com; s=arc-20160816; b=fvu3rbeCpvjD9Y5EO8dCQRr1J3AE/iusvMDelHst9/z01vR8Ft5gc4cAwV+FXMKFJ9 IUxHbUZoOWKtdS+nCeH35HHyT3p4zHfAHw2zZUrPyhaVLH0oHaTHF9HPzrY9O3r0kiZ0 SKU+bNcofYkewIaDIBAy0P9j9P/tVQOvwAt3y5YGpTSajtCVWy0s6UxvspFQeIIcmBoj m6SQwapN4mo3PRMk9HNB4PeUPvzmkzDH9H/3Wu7Ch4cmj7XBxEunu/KJUI8ZtthUxU/2 QZXDoaRWhShTDmGPTnyqGHJzXGLn7mBqw/apsMUJWnPjeN5jzNh9BCPggyLVnEIaDMTu Ltfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=CxdHWOva1wcLZN7HdcW8RTKMbDCttoUzy92bx6xGNB4=; b=Iz967PkslEe6En8euHfPXJfjkotPl2cLdoZOnrkmgN0605qyBYUJ/ET4jQtPVugGdQ 5N1V1HoCfJ2hjSXXV4ZPMs4uhE6ItrCEm+g+ygSmHtpa4uX4oZIXPqtCLD/sFZThIKQ/ 5OIzHQ8F7bAZctHg8V5FfI9tO/dK0motHDaiCSVA0w6K0mem9HcmFrGBJr1Q33nz4sLS zJGVtXqayV/WSe6xfTcQcoLzo3Cxcaf4QfxqjvqHrWvmO/D7h1cSF+wcKF5IpQctbzNC nDCUpPVcIa+3jbRNUBHsc73TEjMAjc66pSz6p1HvLiYnY0pugVizTtjSW4IeQh2bygKu 8GpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FfobfwaJ; 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 g14si11645551ybf.464.2021.02.05.15.11.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:11:53 -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=FfobfwaJ; 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]:58816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AGW-0004fr-VJ for patch@linaro.org; Fri, 05 Feb 2021 18:11:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A2w-0002St-9f for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:50 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:39390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2t-0003W8-G5 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:50 -0500 Received: by mail-pg1-x532.google.com with SMTP id o63so5575619pgo.6 for ; Fri, 05 Feb 2021 14:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CxdHWOva1wcLZN7HdcW8RTKMbDCttoUzy92bx6xGNB4=; b=FfobfwaJBOAOrdR7Cbh6ObJwJawtemF1NLL+BCjFzqziTUhWPLZ6sQjv4MLmV11E8Y w/H2l+zHR1EBUiTP+htNFdaF50WqydNr9BgDVzqhJvtIZ9z4aIHaCnNWHzi0oOkhQgw6 ZtLHFx4DFitE0spJTHmF+SnTpPir8YQ7M8ClhEjE27GImSWONyq3MEEg2qWwtUmcxGTb C2VrTWvHYneIMNsvR2IiUElXxwfzapkKwwIB/bMkggw8LtVsiG2KVrZDKfL39tV480gC VojB8XwNxbmAS/QHfIHgrJjbgcgXuuJuWtrsQEX3YqGdIvRpBSOam+D44sQj4Mthuru/ HgNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CxdHWOva1wcLZN7HdcW8RTKMbDCttoUzy92bx6xGNB4=; b=fdI9EPofkQMhCediwa1eTrySyDRjqzyzgjCoAewhkeyB/KtPtjCJZyubV768f92IUM I9qjpdVRZf695ku3PqSf1aF/e4t2J46NC2bkPRrTAIHFB7SgB4AnjFI/F3PRY0oB+Qyv FxgTu3GE09aROpFLzS4Eu4WB0VLf1pQIz+T/hyYku8VSQW4Wy8f2MwJXXBcs4HD7leDG GdIpsrpouYDdKcFOCfBbh22Yc1K0Uggc4FOmOyD1kZOUNgtXhu2A+FB2ZeI9x1KI7EKN OM18nJBPbGaMWonVmRtYvjB7Yjolk+h4j07okcgmn3ImK4snEFTyu45Yz3xcKqvKQP6j eYCg== X-Gm-Message-State: AOAM533OtAXQmkGme9IxqMstTz67p5Vk7nE8191hGtK/Y+ag1lg8Qdou hhBKNTCGgn6kNkxzIJtim3Ry04iawQ5EoifW X-Received: by 2002:aa7:8d0d:0:b029:1d7:3c52:e1f6 with SMTP id j13-20020aa78d0d0000b02901d73c52e1f6mr5688185pfe.39.1612565865559; Fri, 05 Feb 2021 14:57:45 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 28/46] tcg/tci: Remove TCG_CONST Date: Fri, 5 Feb 2021 12:56:32 -1000 Message-Id: <20210205225650.1330794-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Restrict all operands to registers. All constants will be forced into registers by the middle-end. Removing the difference in how immediate integers were encoded will allow more code to be shared between 32-bit and 64-bit operations. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tci/tcg-target-con-set.h | 6 +- tcg/tci/tcg-target.h | 3 - tcg/tci.c | 189 +++++++++++++---------------------- tcg/tci/tcg-target.c.inc | 85 ++++------------ 4 files changed, 89 insertions(+), 194 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target-con-set.h b/tcg/tci/tcg-target-con-set.h index 38e82f7535..f51b7bcb13 100644 --- a/tcg/tci/tcg-target-con-set.h +++ b/tcg/tci/tcg-target-con-set.h @@ -10,16 +10,12 @@ * tcg-target-con-str.h; the constraint combination is inclusive or. */ C_O0_I2(r, r) -C_O0_I2(r, ri) C_O0_I3(r, r, r) -C_O0_I4(r, r, ri, ri) C_O0_I4(r, r, r, r) C_O1_I1(r, r) C_O1_I2(r, 0, r) -C_O1_I2(r, ri, ri) C_O1_I2(r, r, r) -C_O1_I2(r, r, ri) -C_O1_I4(r, r, r, ri, ri) +C_O1_I4(r, r, r, r, r) C_O2_I1(r, r, r) C_O2_I2(r, r, r, r) C_O2_I4(r, r, r, r, r, r) diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 8f7ed676fc..9c0021a26f 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -157,9 +157,6 @@ typedef enum { TCG_AREG0 = TCG_REG_R14, TCG_REG_CALL_STACK = TCG_REG_R15, - - /* Special value UINT8_MAX is used by TCI to encode constant values. */ - TCG_CONST = UINT8_MAX } TCGReg; /* Used for function call generation. */ diff --git a/tcg/tci.c b/tcg/tci.c index 935eb87330..fb3c97aaf1 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -255,61 +255,6 @@ tci_read_ulong(const tcg_target_ulong *regs, const uint8_t **tb_ptr) return taddr; } -/* Read indexed register or constant (native size) from bytecode. */ -static tcg_target_ulong -tci_read_ri(const tcg_target_ulong *regs, const uint8_t **tb_ptr) -{ - tcg_target_ulong value; - TCGReg r = **tb_ptr; - *tb_ptr += 1; - if (r == TCG_CONST) { - value = tci_read_i(tb_ptr); - } else { - value = tci_read_reg(regs, r); - } - return value; -} - -/* Read indexed register or constant (32 bit) from bytecode. */ -static uint32_t tci_read_ri32(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint32_t value; - TCGReg r = **tb_ptr; - *tb_ptr += 1; - if (r == TCG_CONST) { - value = tci_read_i32(tb_ptr); - } else { - value = tci_read_reg32(regs, r); - } - return value; -} - -#if TCG_TARGET_REG_BITS == 32 -/* Read two indexed registers or constants (2 * 32 bit) from bytecode. */ -static uint64_t tci_read_ri64(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint32_t low = tci_read_ri32(regs, tb_ptr); - return tci_uint64(tci_read_ri32(regs, tb_ptr), low); -} -#elif TCG_TARGET_REG_BITS == 64 -/* Read indexed register or constant (64 bit) from bytecode. */ -static uint64_t tci_read_ri64(const tcg_target_ulong *regs, - const uint8_t **tb_ptr) -{ - uint64_t value; - TCGReg r = **tb_ptr; - *tb_ptr += 1; - if (r == TCG_CONST) { - value = tci_read_i64(tb_ptr); - } else { - value = tci_read_reg64(regs, r); - } - return value; -} -#endif - static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) { tcg_target_ulong label = tci_read_i(tb_ptr); @@ -504,7 +449,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, switch (opc) { case INDEX_op_call: - t0 = tci_read_ri(regs, &tb_ptr); + t0 = tci_read_i(&tb_ptr); tci_tb_ptr = (uintptr_t)tb_ptr; #if TCG_TARGET_REG_BITS == 32 tmp64 = ((helper_function)t0)(tci_read_reg(regs, TCG_REG_R0), @@ -539,7 +484,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_setcond_i32: t0 = *tb_ptr++; t1 = tci_read_r32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare32(t1, t2, condition)); break; @@ -547,7 +492,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_setcond2_i32: t0 = *tb_ptr++; tmp64 = tci_read_r64(regs, &tb_ptr); - v64 = tci_read_ri64(regs, &tb_ptr); + v64 = tci_read_r64(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare64(tmp64, v64, condition)); break; @@ -555,7 +500,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_setcond_i64: t0 = *tb_ptr++; t1 = tci_read_r64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); condition = *tb_ptr++; tci_write_reg(regs, t0, tci_compare64(t1, t2, condition)); break; @@ -628,62 +573,62 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_add_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; case INDEX_op_div_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 / (int32_t)t2); break; case INDEX_op_divu_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 / t2); break; case INDEX_op_rem_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, (int32_t)t1 % (int32_t)t2); break; case INDEX_op_remu_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 % t2); break; case INDEX_op_and_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 ^ t2); break; @@ -691,33 +636,33 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_shl_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 << (t2 & 31)); break; case INDEX_op_shr_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, t1 >> (t2 & 31)); break; case INDEX_op_sar_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, ((int32_t)t1 >> (t2 & 31))); break; #if TCG_TARGET_HAS_rot_i32 case INDEX_op_rotl_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, rol32(t1, t2 & 31)); break; case INDEX_op_rotr_i32: t0 = *tb_ptr++; - t1 = tci_read_ri32(regs, &tb_ptr); - t2 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); + t2 = tci_read_r32(regs, &tb_ptr); tci_write_reg(regs, t0, ror32(t1, t2 & 31)); break; #endif @@ -734,7 +679,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif case INDEX_op_brcond_i32: t0 = tci_read_r32(regs, &tb_ptr); - t1 = tci_read_ri32(regs, &tb_ptr); + t1 = tci_read_r32(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare32(t0, t1, condition)) { @@ -760,7 +705,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; case INDEX_op_brcond2_i32: tmp64 = tci_read_r64(regs, &tb_ptr); - v64 = tci_read_ri64(regs, &tb_ptr); + v64 = tci_read_r64(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare64(tmp64, v64, condition)) { @@ -870,62 +815,62 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_add_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 + t2); break; case INDEX_op_sub_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 - t2); break; case INDEX_op_mul_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 * t2); break; case INDEX_op_div_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, (int64_t)t1 / (int64_t)t2); break; case INDEX_op_divu_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 / (uint64_t)t2); break; case INDEX_op_rem_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, (int64_t)t1 % (int64_t)t2); break; case INDEX_op_remu_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, (uint64_t)t1 % (uint64_t)t2); break; case INDEX_op_and_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 & t2); break; case INDEX_op_or_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 | t2); break; case INDEX_op_xor_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 ^ t2); break; @@ -933,33 +878,33 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, case INDEX_op_shl_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 << (t2 & 63)); break; case INDEX_op_shr_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, t1 >> (t2 & 63)); break; case INDEX_op_sar_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, ((int64_t)t1 >> (t2 & 63))); break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, rol64(t1, t2 & 63)); break; case INDEX_op_rotr_i64: t0 = *tb_ptr++; - t1 = tci_read_ri64(regs, &tb_ptr); - t2 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); + t2 = tci_read_r64(regs, &tb_ptr); tci_write_reg(regs, t0, ror64(t1, t2 & 63)); break; #endif @@ -976,7 +921,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif case INDEX_op_brcond_i64: t0 = tci_read_r64(regs, &tb_ptr); - t1 = tci_read_ri64(regs, &tb_ptr); + t1 = tci_read_r64(regs, &tb_ptr); condition = *tb_ptr++; label = tci_read_label(&tb_ptr); if (tci_compare64(t0, t1, condition)) { diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index aba7f75ad1..feac4659cc 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -92,8 +92,6 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_rem_i64: case INDEX_op_remu_i32: case INDEX_op_remu_i64: - return C_O1_I2(r, r, r); - case INDEX_op_add_i32: case INDEX_op_add_i64: case INDEX_op_sub_i32: @@ -126,8 +124,9 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_rotl_i64: case INDEX_op_rotr_i32: case INDEX_op_rotr_i64: - /* TODO: Does R, RI, RI result in faster code than R, R, RI? */ - return C_O1_I2(r, ri, ri); + case INDEX_op_setcond_i32: + case INDEX_op_setcond_i64: + return C_O1_I2(r, r, r); case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: @@ -135,11 +134,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_brcond_i32: case INDEX_op_brcond_i64: - return C_O0_I2(r, ri); - - case INDEX_op_setcond_i32: - case INDEX_op_setcond_i64: - return C_O1_I2(r, r, ri); + return C_O0_I2(r, r); #if TCG_TARGET_REG_BITS == 32 /* TODO: Support R, R, R, R, RI, RI? Will it be faster? */ @@ -147,11 +142,11 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_sub2_i32: return C_O2_I4(r, r, r, r, r, r); case INDEX_op_brcond2_i32: - return C_O0_I4(r, r, ri, ri); + return C_O0_I4(r, r, r, r); case INDEX_op_mulu2_i32: return C_O2_I2(r, r, r, r); case INDEX_op_setcond2_i32: - return C_O1_I4(r, r, r, ri, ri); + return C_O1_I4(r, r, r, r, r); #endif case INDEX_op_qemu_ld_i32: @@ -294,44 +289,6 @@ static void tcg_out_r(TCGContext *s, TCGArg t0) tcg_out8(s, t0); } -/* Write register or constant (native size). */ -static void tcg_out_ri(TCGContext *s, int const_arg, TCGArg arg) -{ - if (const_arg) { - tcg_debug_assert(const_arg == 1); - tcg_out8(s, TCG_CONST); - tcg_out_i(s, arg); - } else { - tcg_out_r(s, arg); - } -} - -/* Write register or constant (32 bit). */ -static void tcg_out_ri32(TCGContext *s, int const_arg, TCGArg arg) -{ - if (const_arg) { - tcg_debug_assert(const_arg == 1); - tcg_out8(s, TCG_CONST); - tcg_out32(s, arg); - } else { - tcg_out_r(s, arg); - } -} - -#if TCG_TARGET_REG_BITS == 64 -/* Write register or constant (64 bit). */ -static void tcg_out_ri64(TCGContext *s, int const_arg, TCGArg arg) -{ - if (const_arg) { - tcg_debug_assert(const_arg == 1); - tcg_out8(s, TCG_CONST); - tcg_out64(s, arg); - } else { - tcg_out_r(s, arg); - } -} -#endif - /* Write label. */ static void tci_out_label(TCGContext *s, TCGLabel *label) { @@ -419,7 +376,7 @@ static inline void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg) { uint8_t *old_code_ptr = s->code_ptr; tcg_out_op_t(s, INDEX_op_call); - tcg_out_ri(s, 1, (uintptr_t)arg); + tcg_out_i(s, (uintptr_t)arg); old_code_ptr[1] = s->code_ptr - old_code_ptr; } @@ -453,7 +410,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_setcond_i32: tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); - tcg_out_ri32(s, const_args[2], args[2]); + tcg_out_r(s, args[2]); tcg_out8(s, args[3]); /* condition */ break; #if TCG_TARGET_REG_BITS == 32 @@ -462,15 +419,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); tcg_out_r(s, args[2]); - tcg_out_ri32(s, const_args[3], args[3]); - tcg_out_ri32(s, const_args[4], args[4]); + tcg_out_r(s, args[3]); + tcg_out_r(s, args[4]); tcg_out8(s, args[5]); /* condition */ break; #elif TCG_TARGET_REG_BITS == 64 case INDEX_op_setcond_i64: tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); - tcg_out_ri64(s, const_args[2], args[2]); + tcg_out_r(s, args[2]); tcg_out8(s, args[3]); /* condition */ break; #endif @@ -516,8 +473,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_rotl_i32: /* Optional (TCG_TARGET_HAS_rot_i32). */ case INDEX_op_rotr_i32: /* Optional (TCG_TARGET_HAS_rot_i32). */ tcg_out_r(s, args[0]); - tcg_out_ri32(s, const_args[1], args[1]); - tcg_out_ri32(s, const_args[2], args[2]); + tcg_out_r(s, args[1]); + tcg_out_r(s, args[2]); break; case INDEX_op_deposit_i32: /* Optional (TCG_TARGET_HAS_deposit_i32). */ tcg_out_r(s, args[0]); @@ -551,8 +508,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_rem_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ case INDEX_op_remu_i64: /* Optional (TCG_TARGET_HAS_div_i64). */ tcg_out_r(s, args[0]); - tcg_out_ri64(s, const_args[1], args[1]); - tcg_out_ri64(s, const_args[2], args[2]); + tcg_out_r(s, args[1]); + tcg_out_r(s, args[2]); break; case INDEX_op_deposit_i64: /* Optional (TCG_TARGET_HAS_deposit_i64). */ tcg_out_r(s, args[0]); @@ -565,7 +522,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, break; case INDEX_op_brcond_i64: tcg_out_r(s, args[0]); - tcg_out_ri64(s, const_args[1], args[1]); + tcg_out_r(s, args[1]); tcg_out8(s, args[2]); /* condition */ tci_out_label(s, arg_label(args[3])); break; @@ -599,8 +556,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_rem_i32: /* Optional (TCG_TARGET_HAS_div_i32). */ case INDEX_op_remu_i32: /* Optional (TCG_TARGET_HAS_div_i32). */ tcg_out_r(s, args[0]); - tcg_out_ri32(s, const_args[1], args[1]); - tcg_out_ri32(s, const_args[2], args[2]); + tcg_out_r(s, args[1]); + tcg_out_r(s, args[2]); break; #if TCG_TARGET_REG_BITS == 32 case INDEX_op_add2_i32: @@ -615,8 +572,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_brcond2_i32: tcg_out_r(s, args[0]); tcg_out_r(s, args[1]); - tcg_out_ri32(s, const_args[2], args[2]); - tcg_out_ri32(s, const_args[3], args[3]); + tcg_out_r(s, args[2]); + tcg_out_r(s, args[3]); tcg_out8(s, args[4]); /* condition */ tci_out_label(s, arg_label(args[5])); break; @@ -629,7 +586,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, #endif case INDEX_op_brcond_i32: tcg_out_r(s, args[0]); - tcg_out_ri32(s, const_args[1], args[1]); + tcg_out_r(s, args[1]); tcg_out8(s, args[2]); /* condition */ tci_out_label(s, arg_label(args[3])); break; From patchwork Fri Feb 5 22:56:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377022 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2586624ejt; Fri, 5 Feb 2021 15:20:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/d/aZqQdArcYHaSCjr+XxlTUDWcuDVp8g6gKGjVyB4IpBJEATDtDn8Da49Nd1PF1x/XAG X-Received: by 2002:a25:a267:: with SMTP id b94mr9335018ybi.218.1612567248394; Fri, 05 Feb 2021 15:20:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567248; cv=none; d=google.com; s=arc-20160816; b=ofsO4mWN8+KQzH4ZJKwNNeFNsnjuGZ7EdpjBq9x7B6xLacH6tD9L5EJSw7TXzGlTy0 k4NEqLipejg7+GVk8U6OU1VKic2VQKF+tiiDYI6081Sk7NDQBuxzDt2FFh3S8N/XxBNd TlVzhZ3uh+lRrMdTZiDtdFN6zGJKllO5f0OR6SSG9Nw/MVs66vsst5vWZNpNYxIq/eVP daXw6Lj7vsrS/gUWs8C8d3GIZ/CNRoLEXAv47uD0/64ufDsoXZkb8KA/KpMs42cS8oC1 Q1mWUB4EdbWmoTjGO/WBiRrDnxX07Z/Ep5Qx0zoAGk/7T0/n1RbvRizbbQH/TTRpM6AJ J8Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=9MRMzfYMimoxQXaiFN+ZYnHqziLdwKpB4oqzqFQsvMI=; b=RGT4NeoAuxMdLfv/WGQIcxY2HskD8K2r9VNp9ZSvpa9dXEqeYio/HoRL6nalrO4cw9 mQTq7Dcpj6uNqQDgItZe/K8yJG49OxuomtG1MVpr4IobYLv4OBBEdN4kBNg0pxh08pLW QJgu+/trd7ci4inyctPtjyOtX25nfmDOj5ic+a67DEwZDGvJVJNgRsJYM7w8NvHukZwK kabkiPyquDg7/vrFNzZCOWz0k5IWJa+eU4tWZtcwURJBJioA/W0x492+deg6C4bcLujS 6NKxHh63noFnZjHhf+aDGkqqBjbb3JIfnuurN3+BwXyGKsCjpzIX8Yuhuf0yIyn1pPrk JabQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Avxl9z7h; 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=fail (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 i70si10415429yba.11.2021.02.05.15.20.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:20:48 -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=fail header.i=@linaro.org header.s=google header.b=Avxl9z7h; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AP9-0007gg-Ot for patch@linaro.org; Fri, 05 Feb 2021 18:20:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A31-0002Um-Qv for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:57 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:34925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2v-0003XP-G2 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:57:52 -0500 Received: by mail-pg1-x52c.google.com with SMTP id t25so5591593pga.2 for ; Fri, 05 Feb 2021 14:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9MRMzfYMimoxQXaiFN+ZYnHqziLdwKpB4oqzqFQsvMI=; b=Avxl9z7hq7gtuAy2tBEY4c0kKLw6HBwscI7WAu+/UZMLsN27J7KIEmivEi2jGfbjZH SpZsTGvW65tQJtSPheIh2DfQmAxfOYaXJoAOqLZez7WEmVKJFc9RhMTv/1n/xOs0CMZX UopTL3V3JKRbgKvODt9SYItRcztQiP5fKYbGCbUXSIa3sT0LbV232+3vtlrV63Hd2b2B fd4IjbWrCjwZzsn6UY2NZLoCxwzlK798EGrB/R20i4EOFK0P+mwZHJjiMrYgOpBm1+lB hF4dHtbaHbIRGEpU9/oMGvPWSksipbEO1DaUPNtyEsL80CTreC3TTg3N/mkjAhsXvQUt pCRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9MRMzfYMimoxQXaiFN+ZYnHqziLdwKpB4oqzqFQsvMI=; b=k/9LIlt4ik0ZXzYcz+HI+c6/VayA9Qc47DSHsSXeBWS4vHDoG/G5mqrqPBJ+WRkl1e 949IS8pr6TosIacm1Bmyl1gTW0xxC2zDtatIulcgZ6t3nDMIjrekQlALIYRyIb+++LuL ur3BXhmtw98AaaO+Wn6Xk/nblsEzaJLR5AXmhA7GysyjubIG5eHEYm5LqmviCSkyYVSO QtjUAlw0sIFBnp2jeLnv2VatYsZt4or9JW+oxwbCXbJAZIy5WJLyE3DZA569Gha6/rNk jcd6b1NX3sQTyb0hd38OXXkHZdk/9i/jUkquSx27KkORqRJvSGdT/lXaTEsLFJSjYG+d Dvjg== X-Gm-Message-State: AOAM5336/cj/vuG7lu4/d3jK+72hr65roipbJP9OjyE7suTmrrbkundS ZXCMw5ILSzIJqSFqJdU+whtnspBZddEclHkw X-Received: by 2002:a63:5014:: with SMTP id e20mr6540279pgb.152.1612565867501; Fri, 05 Feb 2021 14:57:47 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 29/46] cpu: Introduce TCGCpuOperations struct Date: Fri, 5 Feb 2021 12:56:33 -1000 Message-Id: <20210205225650.1330794-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost The TCG-specific CPU methods will be moved to a separate struct, to make it easier to move accel-specific code outside generic CPU code in the future. Start by moving tcg_initialize(). The new CPUClass.tcg_opts field may eventually become a pointer, but keep it an embedded struct for now, to make code conversion easier. Signed-off-by: Eduardo Habkost [claudio: move TCGCpuOperations inside include/hw/core/cpu.h] Reviewed-by: Alex Bennée Message-Id: <20210204163931.7358-2-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 16 +++++++++++++++- cpu.c | 6 +++++- target/alpha/cpu.c | 2 +- target/arm/cpu.c | 2 +- target/avr/cpu.c | 2 +- target/cris/cpu.c | 12 ++++++------ target/hppa/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- target/lm32/cpu.c | 2 +- target/m68k/cpu.c | 2 +- target/microblaze/cpu.c | 2 +- target/mips/cpu.c | 2 +- target/moxie/cpu.c | 2 +- target/nios2/cpu.c | 2 +- target/openrisc/cpu.c | 2 +- target/riscv/cpu.c | 2 +- target/rx/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/sh4/cpu.c | 2 +- target/sparc/cpu.c | 2 +- target/tilegx/cpu.c | 2 +- target/tricore/cpu.c | 2 +- target/unicore32/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- target/ppc/translate_init.c.inc | 2 +- 25 files changed, 48 insertions(+), 30 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 140fa32a5e..26b89fd7a4 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -76,6 +76,19 @@ typedef struct CPUWatchpoint CPUWatchpoint; struct TranslationBlock; +/** + * struct TcgCpuOperations: TCG operations specific to a CPU class + */ +typedef struct TcgCpuOperations { + /** + * @initialize: Initalize TCG state + * + * Called when the first CPU is realized. + */ + void (*initialize)(void); + +} TcgCpuOperations; + /** * CPUClass: * @class_by_name: Callback to map -cpu command line model name to an @@ -222,12 +235,13 @@ struct CPUClass { void (*disas_set_info)(CPUState *cpu, disassemble_info *info); vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len); - void (*tcg_initialize)(void); const char *deprecation_note; /* Keep non-pointer data at the end to minimize holes. */ int gdb_num_core_regs; bool gdb_stop_before_watchpoint; + + TcgCpuOperations tcg_ops; }; /* diff --git a/cpu.c b/cpu.c index 0b245cda2e..79a2bf12b3 100644 --- a/cpu.c +++ b/cpu.c @@ -159,14 +159,18 @@ void cpu_exec_initfn(CPUState *cpu) void cpu_exec_realizefn(CPUState *cpu, Error **errp) { CPUClass *cc = CPU_GET_CLASS(cpu); +#ifdef CONFIG_TCG static bool tcg_target_initialized; +#endif /* CONFIG_TCG */ cpu_list_add(cpu); +#ifdef CONFIG_TCG if (tcg_enabled() && !tcg_target_initialized) { tcg_target_initialized = true; - cc->tcg_initialize(); + cc->tcg_ops.initialize(); } +#endif /* CONFIG_TCG */ tlb_init(cpu); qemu_plugin_vcpu_init_hook(cpu); diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index b3fd6643e8..d66f0351a9 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -231,7 +231,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) dc->vmsd = &vmstate_alpha_cpu; #endif cc->disas_set_info = alpha_cpu_disas_set_info; - cc->tcg_initialize = alpha_translate_init; + cc->tcg_ops.initialize = alpha_translate_init; cc->gdb_num_core_regs = 67; } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 40142ac141..fa4d4ba4eb 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2276,7 +2276,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_stop_before_watchpoint = true; cc->disas_set_info = arm_disas_set_info; #ifdef CONFIG_TCG - cc->tcg_initialize = arm_translate_init; + cc->tcg_ops.initialize = arm_translate_init; cc->tlb_fill = arm_cpu_tlb_fill; cc->debug_excp_handler = arm_debug_excp_handler; cc->debug_check_watchpoint = arm_debug_check_watchpoint; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 6f3d5a9e4a..fb66695fbb 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -207,7 +207,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->tlb_fill = avr_cpu_tlb_fill; cc->vmsd = &vms_avr_cpu; cc->disas_set_info = avr_cpu_disas_set_info; - cc->tcg_initialize = avr_cpu_tcg_init; + cc->tcg_ops.initialize = avr_cpu_tcg_init; cc->synchronize_from_tb = avr_cpu_synchronize_from_tb; cc->gdb_read_register = avr_cpu_gdb_read_register; cc->gdb_write_register = avr_cpu_gdb_write_register; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index cff6b9eabf..4328f8e6c9 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -201,7 +201,7 @@ static void crisv8_cpu_class_init(ObjectClass *oc, void *data) ccc->vr = 8; cc->do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } static void crisv9_cpu_class_init(ObjectClass *oc, void *data) @@ -212,7 +212,7 @@ static void crisv9_cpu_class_init(ObjectClass *oc, void *data) ccc->vr = 9; cc->do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } static void crisv10_cpu_class_init(ObjectClass *oc, void *data) @@ -223,7 +223,7 @@ static void crisv10_cpu_class_init(ObjectClass *oc, void *data) ccc->vr = 10; cc->do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } static void crisv11_cpu_class_init(ObjectClass *oc, void *data) @@ -234,7 +234,7 @@ static void crisv11_cpu_class_init(ObjectClass *oc, void *data) ccc->vr = 11; cc->do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } static void crisv17_cpu_class_init(ObjectClass *oc, void *data) @@ -245,7 +245,7 @@ static void crisv17_cpu_class_init(ObjectClass *oc, void *data) ccc->vr = 17; cc->do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } static void crisv32_cpu_class_init(ObjectClass *oc, void *data) @@ -284,7 +284,7 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_stop_before_watchpoint = true; cc->disas_set_info = cris_disas_set_info; - cc->tcg_initialize = cris_initialize_tcg; + cc->tcg_ops.initialize = cris_initialize_tcg; } #define DEFINE_CRIS_CPU_TYPE(cpu_model, initfn) \ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index e28f047d10..80e3081631 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -154,7 +154,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) #endif cc->do_unaligned_access = hppa_cpu_do_unaligned_access; cc->disas_set_info = hppa_cpu_disas_set_info; - cc->tcg_initialize = hppa_translate_init; + cc->tcg_ops.initialize = hppa_translate_init; cc->gdb_num_core_regs = 128; } diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 4fa013720e..d90502a0cc 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -64,7 +64,7 @@ void tcg_cpu_common_class_init(CPUClass *cc) cc->synchronize_from_tb = x86_cpu_synchronize_from_tb; cc->cpu_exec_enter = x86_cpu_exec_enter; cc->cpu_exec_exit = x86_cpu_exec_exit; - cc->tcg_initialize = tcg_x86_init; + cc->tcg_ops.initialize = tcg_x86_init; cc->tlb_fill = x86_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->debug_excp_handler = breakpoint_handler; diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index c50ad5fa15..ef795b81a4 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -237,7 +237,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_stop_before_watchpoint = true; cc->debug_excp_handler = lm32_debug_excp_handler; cc->disas_set_info = lm32_cpu_disas_set_info; - cc->tcg_initialize = lm32_translate_init; + cc->tcg_ops.initialize = lm32_translate_init; } #define DEFINE_LM32_CPU_TYPE(cpu_model, initfn) \ diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index b811a0bdde..3604ece49b 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -478,7 +478,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) dc->vmsd = &vmstate_m68k_cpu; #endif cc->disas_set_info = m68k_cpu_disas_set_info; - cc->tcg_initialize = m68k_tcg_init; + cc->tcg_ops.initialize = m68k_tcg_init; cc->gdb_num_core_regs = 18; } diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index d5e8bfe11f..f2978ca726 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -382,7 +382,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_num_core_regs = 32 + 27; cc->disas_set_info = mb_disas_set_info; - cc->tcg_initialize = mb_tcg_init; + cc->tcg_ops.initialize = mb_tcg_init; } static const TypeInfo mb_cpu_type_info = { diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 4c4548233c..b96c3d5969 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -689,7 +689,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) #endif cc->disas_set_info = mips_cpu_disas_set_info; #ifdef CONFIG_TCG - cc->tcg_initialize = mips_tcg_init; + cc->tcg_ops.initialize = mips_tcg_init; cc->tlb_fill = mips_cpu_tlb_fill; #endif diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 6e0443ccb7..224cfc8361 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -116,7 +116,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data) cc->vmsd = &vmstate_moxie_cpu; #endif cc->disas_set_info = moxie_cpu_disas_set_info; - cc->tcg_initialize = moxie_translate_init; + cc->tcg_ops.initialize = moxie_translate_init; } static void moxielite_initfn(Object *obj) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 58688e1623..c28eb05ef0 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -234,7 +234,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_read_register = nios2_cpu_gdb_read_register; cc->gdb_write_register = nios2_cpu_gdb_write_register; cc->gdb_num_core_regs = 49; - cc->tcg_initialize = nios2_tcg_init; + cc->tcg_ops.initialize = nios2_tcg_init; } static const TypeInfo nios2_cpu_type_info = { diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index b0bdfbe4fe..a957f59e2e 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -198,7 +198,7 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) dc->vmsd = &vmstate_openrisc_cpu; #endif cc->gdb_num_core_regs = 32 + 3; - cc->tcg_initialize = openrisc_translate_init; + cc->tcg_ops.initialize = openrisc_translate_init; cc->disas_set_info = openrisc_disas_set_info; } diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 27788021eb..567f6790a9 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -618,7 +618,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->gdb_arch_name = riscv_gdb_arch_name; cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml; #ifdef CONFIG_TCG - cc->tcg_initialize = riscv_translate_init; + cc->tcg_ops.initialize = riscv_translate_init; cc->tlb_fill = riscv_cpu_tlb_fill; #endif device_class_set_props(dc, riscv_cpu_properties); diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 2bb14144a7..cdcab49c8a 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -195,7 +195,7 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) cc->gdb_write_register = rx_cpu_gdb_write_register; cc->get_phys_page_debug = rx_cpu_get_phys_page_debug; cc->disas_set_info = rx_cpu_disas_set_info; - cc->tcg_initialize = rx_translate_init; + cc->tcg_ops.initialize = rx_translate_init; cc->tlb_fill = rx_cpu_tlb_fill; cc->gdb_num_core_regs = 26; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 7da70afbf2..890781e74c 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -515,7 +515,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) #endif cc->disas_set_info = s390_cpu_disas_set_info; #ifdef CONFIG_TCG - cc->tcg_initialize = s390x_translate_init; + cc->tcg_ops.initialize = s390x_translate_init; cc->tlb_fill = s390_cpu_tlb_fill; #endif diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 1e0f05a15b..b86753cda5 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -232,7 +232,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) cc->get_phys_page_debug = superh_cpu_get_phys_page_debug; #endif cc->disas_set_info = superh_cpu_disas_set_info; - cc->tcg_initialize = sh4_translate_init; + cc->tcg_ops.initialize = sh4_translate_init; cc->gdb_num_core_regs = 59; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 6f14e370ed..3ab71e9d00 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -881,7 +881,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->vmsd = &vmstate_sparc_cpu; #endif cc->disas_set_info = cpu_sparc_disas_set_info; - cc->tcg_initialize = sparc_tcg_init; + cc->tcg_ops.initialize = sparc_tcg_init; #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) cc->gdb_num_core_regs = 86; diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index 1fee87c094..cd24d0eb9d 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@ -153,7 +153,7 @@ static void tilegx_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = tilegx_cpu_set_pc; cc->tlb_fill = tilegx_cpu_tlb_fill; cc->gdb_num_core_regs = 0; - cc->tcg_initialize = tilegx_tcg_init; + cc->tcg_ops.initialize = tilegx_tcg_init; } static const TypeInfo tilegx_cpu_type_info = { diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 4bff1d4718..bf135af40f 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -164,7 +164,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) cc->set_pc = tricore_cpu_set_pc; cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb; cc->get_phys_page_debug = tricore_cpu_get_phys_page_debug; - cc->tcg_initialize = tricore_tcg_init; + cc->tcg_ops.initialize = tricore_tcg_init; cc->tlb_fill = tricore_cpu_tlb_fill; } diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index b27fb9689f..226bf4226e 100644 --- a/target/unicore32/cpu.c +++ b/target/unicore32/cpu.c @@ -137,7 +137,7 @@ static void uc32_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = uc32_cpu_set_pc; cc->tlb_fill = uc32_cpu_tlb_fill; cc->get_phys_page_debug = uc32_cpu_get_phys_page_debug; - cc->tcg_initialize = uc32_translate_init; + cc->tcg_ops.initialize = uc32_translate_init; dc->vmsd = &vmstate_uc32_cpu; } diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 88a32268a1..5a6f5bf88b 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -209,7 +209,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) #endif cc->debug_excp_handler = xtensa_breakpoint_handler; cc->disas_set_info = xtensa_cpu_disas_set_info; - cc->tcg_initialize = xtensa_translate_init; + cc->tcg_ops.initialize = xtensa_translate_init; dc->vmsd = &vmstate_xtensa_cpu; } diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc index 3c05a17343..189f27cd1c 100644 --- a/target/ppc/translate_init.c.inc +++ b/target/ppc/translate_init.c.inc @@ -10878,7 +10878,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) cc->virtio_is_big_endian = ppc_cpu_is_big_endian; #endif #ifdef CONFIG_TCG - cc->tcg_initialize = ppc_translate_init; + cc->tcg_ops.initialize = ppc_translate_init; cc->tlb_fill = ppc_cpu_tlb_fill; #endif #ifndef CONFIG_USER_ONLY From patchwork Fri Feb 5 22:56:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377012 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2582662ejt; Fri, 5 Feb 2021 15:13:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKYb7MKZU6whaaWdZe+aL5VE4qrUWvDu3w93MjuINL1fIkCRe5EGdTmtD7njDuJYFV38qG X-Received: by 2002:a25:1182:: with SMTP id 124mr9005377ybr.154.1612566837161; Fri, 05 Feb 2021 15:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612566837; cv=none; d=google.com; s=arc-20160816; b=ElZdeWG6G5xyaxgveUj+hWBNaTvVcJZYIfb7nAry1pJ8ukLFcjdAKlQaKS6qVBCQLf PZu0dQW3J3sKISRQ5bbZor2Fqwc935H6W3ik88R6yf0qu2oq6S3kmAn0ee1LOQovzBbR KQhtRvJgAxxbSQMRvx2kqSkdfsGWIVbXjEO628URMIjSbTdqMnzBO05OrOIAMMhE5dGS 8b4tNwhyAH6BvDSe5LEzB+o8JDOsE6L1aYQ14/1eGb/EOfeO2zlcr9II+BavgNhkk6Kt FK3P/V/gRUejvJJoQda7IyxzfLP5cxGR3lhZlNlEn/SmYJfkGWJVGWZie5JK62j5mKAw IdxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=G4pfgRC/2OCn2LhfdCUNmf+gaeKXQD0DRrimp0qOuU4=; b=BpkfciOtt/2lkwIwS4WYcaocXc8r97D8DFjyTp8xmETEg6HKyWQ1vxnXUbdVcSHbl4 wCpGKkOuIENdDH+iZM/IMnELK2FHOfS66Hnd0oGxTAhYZukkb4FP1kfb2pLs0u61AArK /pISPPnDAOY/u5k7EJId+QJtjVv5dlhvByAVz+rFEO7R++5JW/h1hSFgxCTgmxklMssJ abmsikI0HIcqbb2aiRVHzTfwSu3xsrqxB6PFwILA36X5x1HHQfNmABwOOI8EkjWby2uY cfvclPWzfM5uB62g0CvDzsK02wattVYhe5TkdecAlGk4ZQgkfQfPK/5ehmnpfyomsdrV Y1SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RlsehIMi; 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=fail (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 g3si12006292ybk.78.2021.02.05.15.13.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:13:57 -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=fail header.i=@linaro.org header.s=google header.b=RlsehIMi; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AIW-0007Bk-I8 for patch@linaro.org; Fri, 05 Feb 2021 18:13:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A37-0002Wt-Dx for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:01 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:34048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A2x-0003YB-2z for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:00 -0500 Received: by mail-pg1-x534.google.com with SMTP id o7so5597433pgl.1 for ; Fri, 05 Feb 2021 14:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G4pfgRC/2OCn2LhfdCUNmf+gaeKXQD0DRrimp0qOuU4=; b=RlsehIMihC4mij/sg2ClFSH6VUUy0XrsX1W4hr7SJrFmRYsvFyOtN7y5UYplET/HsX m7AtZgbHTC9+FRhPFbWqqtPKXIsXrzlLPG6oZHCfCdKLHbVlnVb9iFnGkcF17Lx+e+Ga oHvNf0DT2+WtRXEPrKd+7YIQvy+heeCXuqLIjTbqfbJRiaSNmB1957DSgjiIgwQMMB68 HE9JfMbVL67PUORIaXP6xX6VzH3YuOVpbBIPYVMzrXeG8iezdYlNJkUbtVPaz49W9k0W PRTvtR2vdjUIlwfyqi9iFbGh6Y7gebEO35IQwlkO5EAypMn1P2ieQEMOHCUcMomwJYtb aGjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G4pfgRC/2OCn2LhfdCUNmf+gaeKXQD0DRrimp0qOuU4=; b=BwpQOrMhAhL6evWASTiqYuEJF9PJpT//7UN6YC/nvIDyu3/6wte+QbGkrCFVVGRopN 6G0JFquQMMxW3/xk12dTOjg5l0JOUlD4ZMQaq8K4Dbo5UC5xWsIspgfVNSDmUBbZO3j8 O2Dyw2VVDMYR2b7kAAYLXDjySOF1igsYNGs0wZH1OS3yvNn3r3wuZdFmG8Wp7/vIuI0j D02suDcVOMYELLNvuOiCfWXLKtBlEl+li1LU/iiAp7oJ2IkgqXKjcGLghbE7eSVVtYAx 3ew0dZ6fCU6xDskpEHMbnRS0U6lXnfhiictlVv00zBi7f61b/BiU8BRHs/Cly9rP4ebd aBLA== X-Gm-Message-State: AOAM530nywq5RpkYDeChnAQmT9b7JHaCrA8zxEUJh/Y59RruITfk8CoZ 8+K/Ha4tgawlcwjBbibFAk0TOpsveqW8xHFr X-Received: by 2002:a63:150b:: with SMTP id v11mr6841818pgl.183.1612565869740; Fri, 05 Feb 2021 14:57:49 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 30/46] target/riscv: remove CONFIG_TCG, as it is always TCG Date: Fri, 5 Feb 2021 12:56:34 -1000 Message-Id: <20210205225650.1330794-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , peter.maydell@linaro.org, Alistair Francis , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana for now only TCG is allowed as an accelerator for riscv, so remove the CONFIG_TCG use. Signed-off-by: Claudio Fontana Reviewed-by: Alistair Francis Reviewed-by: Alex Bennée Message-Id: <20210204163931.7358-3-cfontana@suse.de> Signed-off-by: Richard Henderson --- target/riscv/cpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.25.1 diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 567f6790a9..60d0b43153 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -617,10 +617,9 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) #endif cc->gdb_arch_name = riscv_gdb_arch_name; cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml; -#ifdef CONFIG_TCG cc->tcg_ops.initialize = riscv_translate_init; cc->tlb_fill = riscv_cpu_tlb_fill; -#endif + device_class_set_props(dc, riscv_cpu_properties); } From patchwork Fri Feb 5 22:56:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377020 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2586246ejt; Fri, 5 Feb 2021 15:20:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOCTEIfzsQVBTB2Ny136BH8RuMeO12h+7hb71gKPp3Ya8tNNXfJpTcIoHj74iAfdek6S6m X-Received: by 2002:a25:41cb:: with SMTP id o194mr8988816yba.167.1612567204529; Fri, 05 Feb 2021 15:20:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567204; cv=none; d=google.com; s=arc-20160816; b=m6666VUYjZeyCFKJZyYjyfieOyLWKpd/Su7WBv/usPsMwuzjkrPVLnR2Q36UEisNTp sd/rkSGYRiF8iZ24oibBBd6C7k3k4acNwzK05vC65ZO2EmIrFW9sEuHzcTIwDdyLZlen 6Wzm18nPh3m/JHBOVDqsgmeBPpHvw1a3YOpG3FgCAvBqteKkqZV/Yrz39lxkDXc4qgIC b3oDj+5WJZb0fWYoSGjAxjnWsYkzFXSGXWJtNaVBbfMIs+Jn6k6d1SZ3KHWq4jJ9Vu03 UxGsc70bzg8Q7w6ksajbJT+Z5tNmnWKCOiG5UzCkwMx+4C8KbDQ5FCc+zt0PBhBlFB5k SxoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=p24OmppzTkk6imjU3BHdTzuVQpvNCrU4ZaFU25HopQk=; b=W5d4ZLKyshYxmgf149hjh3qdNtintEgEvNrXATKJ/ZI+pzY5fP0YIi9NocUxYzA/gJ vclMNutWA93+j6kKaGerW4sbgskDDqIyLoVuTjVD0OlblzQ8dOSUTa0uVtKCEjiOoymm tr2w66axrqQo8haWYmQ51B+jLoS2YXAdMHLx5C2vR+utodqMl2oKAgadK1zYTtlswPFv O20yloHkljBszEBtnIFC+39MUkp7MyevUy2dg0QxSCrYHBaeJ+cZPxzYeHCLOCR8dFhB TFazLCEoEJ0EPyfSrrzpgVVZLkjtRqIs15IOWpGJSJECyW3yGsqohjenHLP2ZVmtv7jY jyhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xtg8lqfw; 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=fail (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 u1si11240073ybk.9.2021.02.05.15.20.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:20:04 -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=fail header.i=@linaro.org header.s=google header.b=xtg8lqfw; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AOR-00075w-SW for patch@linaro.org; Fri, 05 Feb 2021 18:20:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3B-0002cQ-Bk for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:05 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:55624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A30-0003ZH-BQ for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:04 -0500 Received: by mail-pj1-x1033.google.com with SMTP id s24so4425903pjp.5 for ; Fri, 05 Feb 2021 14:57:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p24OmppzTkk6imjU3BHdTzuVQpvNCrU4ZaFU25HopQk=; b=xtg8lqfw1Trhgjziu5+aQ/gdu/2tZ2IB7qmvfttRHxFJBP2YwzX9eUJxn1jO73vWkw osgufH4FrPT93jCtQr4VluOs6amKO2Wd4hiePKwS/mh2OVZkSkJJKV/+GEPrhdJZoa7L mkuEWN6efC7g/fHuF1C5163uxzEOKSSP78XycR4TNSYWXkdWQAous5q1Gtj+83V3sxOj gs6yZ+pODU472ovhzYmM3t9hgq9OQQReUmvNcaCatVe36WF2V1yHxlgI+F3NsB/IeE70 SueeimrFRafMyVjHO6HzEwHq7BQ8hgyS8RLyqJwz3M53u3K16+awiyMYb3oX63yZuS7P ieYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p24OmppzTkk6imjU3BHdTzuVQpvNCrU4ZaFU25HopQk=; b=WfsgKBdUG9XVyujGaB+XwLVwWxXk9GleCVCCoIOG3lUzRcesxrlRqPmZdZ74lwZeeg 4aPULYY70YORmC1mxXSkAf6QPwwAcB/gaV80PEJN0+6G6JxmwoYpjMQFJMSC7ORyzH0A IKgf/tL1uHAs/0F1rvL0NHhzRQ//w8igytfFEjWeTpiC25AkgtfYc+n1BKQi/Dryaqil cXDPCCZnLTH3+fsd8YgKfRsL50HTCmj7yCrRQooJ2AHrTpGU+RCucKcYOi5bpgc5U15F gTGPmkL8BoYyUdgW3g/4axVvblONEvGuvounYJggO/hoUBtvzzise7Peah8iVwq2mj8X DkqA== X-Gm-Message-State: AOAM533oN+I2JEz5pEee8LV+4K/ZKvYpjtNEcAG8Oixo6NpBeCUUBPeh Eq0tbnJEgVztHZE9NznbUbq7d6Pcv3RnxmEt X-Received: by 2002:a17:902:6808:b029:e2:b405:fc0d with SMTP id h8-20020a1709026808b02900e2b405fc0dmr4026457plk.10.1612565871471; Fri, 05 Feb 2021 14:57:51 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 31/46] accel/tcg: split TCG-only code from cpu_exec_realizefn Date: Fri, 5 Feb 2021 12:56:35 -1000 Message-Id: <20210205225650.1330794-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana move away TCG-only code, make it compile only on TCG. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson [claudio: moved the prototypes from hw/core/cpu.h to exec/cpu-all.h] Signed-off-by: Claudio Fontana Message-Id: <20210204163931.7358-4-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 11 +++++-- include/hw/core/cpu.h | 2 ++ accel/tcg/cpu-exec.c | 28 +++++++++++++++++ cpu.c | 70 ++++++++++++++++++++---------------------- hw/core/cpu.c | 6 +++- 5 files changed, 77 insertions(+), 40 deletions(-) -- 2.25.1 diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 4b5408c341..cfb1d79331 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -410,19 +410,26 @@ static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr) } #ifdef CONFIG_TCG +/* accel/tcg/cpu-exec.c */ void dump_drift_info(void); +/* accel/tcg/translate-all.c */ void dump_exec_info(void); void dump_opcount_info(void); #endif /* CONFIG_TCG */ #endif /* !CONFIG_USER_ONLY */ +#ifdef CONFIG_TCG +/* accel/tcg/cpu-exec.c */ +int cpu_exec(CPUState *cpu); +void tcg_exec_realizefn(CPUState *cpu, Error **errp); +void tcg_exec_unrealizefn(CPUState *cpu); +#endif /* CONFIG_TCG */ + /* Returns: 0 on success, -1 on error */ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, void *ptr, target_ulong len, bool is_write); -int cpu_exec(CPUState *cpu); - /** * cpu_set_cpustate_pointers(cpu) * @cpu: The cpu object diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 26b89fd7a4..d0b17dcc4c 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1126,6 +1126,8 @@ AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx); void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...) GCC_FMT_ATTR(2, 3); + +/* $(top_srcdir)/cpu.c */ void cpu_exec_initfn(CPUState *cpu); void cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 6d017e46dd..5628a156d1 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -828,6 +828,34 @@ int cpu_exec(CPUState *cpu) return ret; } +void tcg_exec_realizefn(CPUState *cpu, Error **errp) +{ + static bool tcg_target_initialized; + CPUClass *cc = CPU_GET_CLASS(cpu); + + if (!tcg_target_initialized) { + cc->tcg_ops.initialize(); + tcg_target_initialized = true; + } + tlb_init(cpu); + qemu_plugin_vcpu_init_hook(cpu); + +#ifndef CONFIG_USER_ONLY + tcg_iommu_init_notifier_list(cpu); +#endif /* !CONFIG_USER_ONLY */ +} + +/* undo the initializations in reverse order */ +void tcg_exec_unrealizefn(CPUState *cpu) +{ +#ifndef CONFIG_USER_ONLY + tcg_iommu_free_notifier_list(cpu); +#endif /* !CONFIG_USER_ONLY */ + + qemu_plugin_vcpu_exit_hook(cpu); + tlb_destroy(cpu); +} + #ifndef CONFIG_USER_ONLY void dump_drift_info(void) diff --git a/cpu.c b/cpu.c index 79a2bf12b3..bfbe5a66f9 100644 --- a/cpu.c +++ b/cpu.c @@ -124,12 +124,34 @@ const VMStateDescription vmstate_cpu_common = { }; #endif -void cpu_exec_unrealizefn(CPUState *cpu) +void cpu_exec_realizefn(CPUState *cpu, Error **errp) { CPUClass *cc = CPU_GET_CLASS(cpu); - tlb_destroy(cpu); - cpu_list_remove(cpu); + cpu_list_add(cpu); + +#ifdef CONFIG_TCG + /* NB: errp parameter is unused currently */ + if (tcg_enabled()) { + tcg_exec_realizefn(cpu, errp); + } +#endif /* CONFIG_TCG */ + +#ifdef CONFIG_USER_ONLY + assert(cc->vmsd == NULL); +#else + if (qdev_get_vmsd(DEVICE(cpu)) == NULL) { + vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu); + } + if (cc->vmsd != NULL) { + vmstate_register(NULL, cpu->cpu_index, cc->vmsd, cpu); + } +#endif /* CONFIG_USER_ONLY */ +} + +void cpu_exec_unrealizefn(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); #ifdef CONFIG_USER_ONLY assert(cc->vmsd == NULL); @@ -140,8 +162,15 @@ void cpu_exec_unrealizefn(CPUState *cpu) if (qdev_get_vmsd(DEVICE(cpu)) == NULL) { vmstate_unregister(NULL, &vmstate_cpu_common, cpu); } - tcg_iommu_free_notifier_list(cpu); #endif +#ifdef CONFIG_TCG + /* NB: errp parameter is unused currently */ + if (tcg_enabled()) { + tcg_exec_unrealizefn(cpu); + } +#endif /* CONFIG_TCG */ + + cpu_list_remove(cpu); } void cpu_exec_initfn(CPUState *cpu) @@ -156,39 +185,6 @@ void cpu_exec_initfn(CPUState *cpu) #endif } -void cpu_exec_realizefn(CPUState *cpu, Error **errp) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); -#ifdef CONFIG_TCG - static bool tcg_target_initialized; -#endif /* CONFIG_TCG */ - - cpu_list_add(cpu); - -#ifdef CONFIG_TCG - if (tcg_enabled() && !tcg_target_initialized) { - tcg_target_initialized = true; - cc->tcg_ops.initialize(); - } -#endif /* CONFIG_TCG */ - tlb_init(cpu); - - qemu_plugin_vcpu_init_hook(cpu); - -#ifdef CONFIG_USER_ONLY - assert(cc->vmsd == NULL); -#else /* !CONFIG_USER_ONLY */ - if (qdev_get_vmsd(DEVICE(cpu)) == NULL) { - vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu); - } - if (cc->vmsd != NULL) { - vmstate_register(NULL, cpu->cpu_index, cc->vmsd, cpu); - } - - tcg_iommu_init_notifier_list(cpu); -#endif -} - const char *parse_cpu_option(const char *cpu_option) { ObjectClass *oc; diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 7553411653..57542b6906 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -199,6 +199,10 @@ static bool cpu_common_virtio_is_big_endian(CPUState *cpu) return target_words_bigendian(); } +/* + * XXX the following #if is always true because this is a common_ss + * module, so target CONFIG_* is never defined. + */ #if !defined(CONFIG_USER_ONLY) GuestPanicInformation *cpu_get_crash_info(CPUState *cpu) { @@ -340,9 +344,9 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp) static void cpu_common_unrealizefn(DeviceState *dev) { CPUState *cpu = CPU(dev); + /* NOTE: latest generic point before the cpu is fully unrealized */ trace_fini_vcpu(cpu); - qemu_plugin_vcpu_exit_hook(cpu); cpu_exec_unrealizefn(cpu); } From patchwork Fri Feb 5 22:56:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377027 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2589501ejt; Fri, 5 Feb 2021 15:26:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtTrvCPaJPxKdziILIigXFHDfuwVyn4Mh3WklLXhKohndAEMuro0UqaqwwOtakjP6sRy+g X-Received: by 2002:a25:b3c2:: with SMTP id x2mr9500509ybf.304.1612567584226; Fri, 05 Feb 2021 15:26:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567584; cv=none; d=google.com; s=arc-20160816; b=S9/BFB6vddmKdw4QZWqY3FrAp1ncjEySC5QfvfMLRa9HTgH+rAEOw1tRKLfwwgaGli dkK6fXeo3v4ZrAk+lU/QJwE6XqDN3AxHtDgRvtuSuku0Jj3LzdskzGPldTVGrQAi+g9x 3djtTn380OrrfpxpHE37ZI5AqL+y9qu5ZNhkRTSH6oAA38vLkkFvm8MT1lJOvWha5SnX MG16nHJTZojA2Vvy7Y12gpO/IgRsnyZlywdXAdjyPDPdoaZxihgKA4ujFO0INJ8FalOK Cu72rJJ0Hl9VcZeWrc9mEfTBjfL9AWNHKdpGh1MB5/lTzIsZfpzz0heNUmiyh8IvT392 hy6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=ta7Xa7xkFMBbNPIy/284vzcbT6wt5OS9JI8O+IndJkY=; b=f48L4/RdOxWy/cG3bnbkXhMkzjhvtn1SxlvvC0GDl4DV/cfc7e7sHBTII4VJwrtpLA 8APBW381jD/GEaCRKcjTwaMJmfsBde6ULFAFrcBACEI2vJ488X3yW3z9Oqwh/lQZs5xj /tULzw+Do4RE5j1YuUsRZeJrPLuF7c0gh+lxVJQ7Omn1KvoNjBMxHRMdHt1HVtaCH0fb aXHq38YaTkJ28LvYGhbpVyRwuY807M2juiqTLpsOaIH82665kR3nSEGpNFzhbJ8RH4/L jzZm+jTyUORMeqpZkkeo6gMGpaVPybc356Kvun4KAoDZeHOiF4vKoN8kOPYVpGKBpNci Tqfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ywOC30BA; 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=fail (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 v7si10170657ybk.294.2021.02.05.15.26.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:26:24 -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=fail header.i=@linaro.org header.s=google header.b=ywOC30BA; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AUZ-00068f-Io for patch@linaro.org; Fri, 05 Feb 2021 18:26:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A39-0002ZC-KV for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:03 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:41555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A33-0003Zd-7d for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:03 -0500 Received: by mail-pl1-x632.google.com with SMTP id a16so4310622plh.8 for ; Fri, 05 Feb 2021 14:57:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ta7Xa7xkFMBbNPIy/284vzcbT6wt5OS9JI8O+IndJkY=; b=ywOC30BA8Y6mWuYiHXZlrCc4ohYsNSJBsN0Mj4sRHb/BP5kDbNnk6fBaABpx08bw90 dn3ah6zWUXT1ad4dVyYJu4DQbT6MV1dwyVkbDbfcgCN+Wm/WdZtBk5h6Lvf9mLdxZFaM vyK8rpV7HZLbprNtmNtYfBU9AxMcOnmjb0KIu19+NiuYlQ/2SlLcyO6nf/gM8iXvpmKB OBRUVh2U8KTvQunQ/dt6idRv3b/Pq2G2t8qQkS/S+a23lsVEOIKu5rAkNxo74V1S2Er4 7lZRlqk1xpvV6aOWMMaooNGclePwy77f3P5bSWf8hxIR3uuXTjRxbkas9STSjaNU/HDc /m4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ta7Xa7xkFMBbNPIy/284vzcbT6wt5OS9JI8O+IndJkY=; b=gr5ilHhZDmkvX4adInGSd5+pRiJwriK2CQf9uej1s9DxgBuxjRjCBoDF1Y7/YcMIs/ wJ9IjT/XNFusJ0rabhuEgbgmgbg+F1W9kmhC0CNCeaTaFNMGi6JGvC8XF41sQSpuWzPd S1OHyWzEIFfQzGXqiBx9iR5Wn8IDDtTxFVmkurLsHSVTiW2o1HwiPRHtVoSsAmXgoKFZ ElcA+vZzkPtACf3Sgj+hL0ElTM4LbI/X1gzP9LQXOmeAWEXki4BU6gSyhtVN+cLCIW1f C0ZFBYCC5rUrXy1UDOAvqO69kTz+IYsOc+UILKiCBIs/X0i2a64aFvwPUIQ5NWmuHJRk V44Q== X-Gm-Message-State: AOAM531cu9J90k6GrxvyUyXY7FoeMxYBfKlcRpVdcrY9e5F/h/WTNmie wKZw/6TGSblUivt9tmYlR9mp89X4K0UUHWvB X-Received: by 2002:a17:90a:9905:: with SMTP id b5mr5989914pjp.195.1612565873558; Fri, 05 Feb 2021 14:57:53 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 32/46] cpu: Move synchronize_from_tb() to tcg_ops Date: Fri, 5 Feb 2021 12:56:36 -1000 Message-Id: <20210205225650.1330794-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Eduardo Habkost , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost Signed-off-by: Eduardo Habkost [claudio: wrapped target code in CONFIG_TCG, reworded comments] Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Message-Id: <20210204163931.7358-5-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 22 +++++++++++++--------- accel/tcg/cpu-exec.c | 4 ++-- target/arm/cpu.c | 4 +++- target/avr/cpu.c | 2 +- target/hppa/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- target/microblaze/cpu.c | 2 +- target/mips/cpu.c | 4 +++- target/riscv/cpu.c | 2 +- target/rx/cpu.c | 2 +- target/sh4/cpu.c | 2 +- target/sparc/cpu.c | 2 +- target/tricore/cpu.c | 2 +- 13 files changed, 30 insertions(+), 22 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index d0b17dcc4c..8cf5585db7 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -86,6 +86,19 @@ typedef struct TcgCpuOperations { * Called when the first CPU is realized. */ void (*initialize)(void); + /** + * @synchronize_from_tb: Synchronize state from a TCG #TranslationBlock + * + * This is called when we abandon execution of a TB before starting it, + * and must set all parts of the CPU state which the previous TB in the + * chain may not have updated. + * By default, when this is NULL, a call is made to @set_pc(tb->pc). + * + * If more state needs to be restored, the target must implement a + * function to restore all the state, and register it here. + */ + void (*synchronize_from_tb)(CPUState *cpu, + const struct TranslationBlock *tb); } TcgCpuOperations; @@ -119,13 +132,6 @@ typedef struct TcgCpuOperations { * If the target behaviour here is anything other than "set * the PC register to the value passed in" then the target must * also implement the synchronize_from_tb hook. - * @synchronize_from_tb: Callback for synchronizing state from a TCG - * #TranslationBlock. This is called when we abandon execution - * of a TB before starting it, and must set all parts of the CPU - * state which the previous TB in the chain may not have updated. - * This always includes at least the program counter; some targets - * will need to do more. If this hook is not implemented then the - * default is to call @set_pc(tb->pc). * @tlb_fill: Callback for handling a softmmu tlb miss or user-only * address fault. For system mode, if the access is valid, call * tlb_set_page and return true; if the access is invalid, and @@ -202,8 +208,6 @@ struct CPUClass { void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list, Error **errp); void (*set_pc)(CPUState *cpu, vaddr value); - void (*synchronize_from_tb)(CPUState *cpu, - const struct TranslationBlock *tb); bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5628a156d1..12b6a91d62 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -213,8 +213,8 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) TARGET_FMT_lx "] %s\n", last_tb->tc.ptr, last_tb->pc, lookup_symbol(last_tb->pc)); - if (cc->synchronize_from_tb) { - cc->synchronize_from_tb(cpu, last_tb); + if (cc->tcg_ops.synchronize_from_tb) { + cc->tcg_ops.synchronize_from_tb(cpu, last_tb); } else { assert(cc->set_pc); cc->set_pc(cpu, last_tb->pc); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index fa4d4ba4eb..140cb33f07 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -54,6 +54,7 @@ static void arm_cpu_set_pc(CPUState *cs, vaddr value) } } +#ifdef CONFIG_TCG static void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { @@ -70,6 +71,7 @@ static void arm_cpu_synchronize_from_tb(CPUState *cs, env->regs[15] = tb->pc; } } +#endif /* CONFIG_TCG */ static bool arm_cpu_has_work(CPUState *cs) { @@ -2257,7 +2259,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->cpu_exec_interrupt = arm_cpu_exec_interrupt; cc->dump_state = arm_cpu_dump_state; cc->set_pc = arm_cpu_set_pc; - cc->synchronize_from_tb = arm_cpu_synchronize_from_tb; cc->gdb_read_register = arm_cpu_gdb_read_register; cc->gdb_write_register = arm_cpu_gdb_write_register; #ifndef CONFIG_USER_ONLY @@ -2277,6 +2278,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->disas_set_info = arm_disas_set_info; #ifdef CONFIG_TCG cc->tcg_ops.initialize = arm_translate_init; + cc->tcg_ops.synchronize_from_tb = arm_cpu_synchronize_from_tb; cc->tlb_fill = arm_cpu_tlb_fill; cc->debug_excp_handler = arm_debug_excp_handler; cc->debug_check_watchpoint = arm_debug_check_watchpoint; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index fb66695fbb..a82fa9d7a8 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -208,7 +208,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->vmsd = &vms_avr_cpu; cc->disas_set_info = avr_cpu_disas_set_info; cc->tcg_ops.initialize = avr_cpu_tcg_init; - cc->synchronize_from_tb = avr_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = avr_cpu_synchronize_from_tb; cc->gdb_read_register = avr_cpu_gdb_read_register; cc->gdb_write_register = avr_cpu_gdb_write_register; cc->gdb_num_core_regs = 35; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 80e3081631..94ea3014a3 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -144,7 +144,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) cc->cpu_exec_interrupt = hppa_cpu_exec_interrupt; cc->dump_state = hppa_cpu_dump_state; cc->set_pc = hppa_cpu_set_pc; - cc->synchronize_from_tb = hppa_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = hppa_cpu_synchronize_from_tb; cc->gdb_read_register = hppa_cpu_gdb_read_register; cc->gdb_write_register = hppa_cpu_gdb_write_register; cc->tlb_fill = hppa_cpu_tlb_fill; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index d90502a0cc..874286de28 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -61,7 +61,7 @@ void tcg_cpu_common_class_init(CPUClass *cc) { cc->do_interrupt = x86_cpu_do_interrupt; cc->cpu_exec_interrupt = x86_cpu_exec_interrupt; - cc->synchronize_from_tb = x86_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = x86_cpu_synchronize_from_tb; cc->cpu_exec_enter = x86_cpu_exec_enter; cc->cpu_exec_exit = x86_cpu_exec_exit; cc->tcg_ops.initialize = tcg_x86_init; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index f2978ca726..e40d1db88d 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -369,7 +369,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->cpu_exec_interrupt = mb_cpu_exec_interrupt; cc->dump_state = mb_cpu_dump_state; cc->set_pc = mb_cpu_set_pc; - cc->synchronize_from_tb = mb_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = mb_cpu_synchronize_from_tb; cc->gdb_read_register = mb_cpu_gdb_read_register; cc->gdb_write_register = mb_cpu_gdb_write_register; cc->tlb_fill = mb_cpu_tlb_fill; diff --git a/target/mips/cpu.c b/target/mips/cpu.c index b96c3d5969..350f1c66c7 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -257,6 +257,7 @@ static void mips_cpu_set_pc(CPUState *cs, vaddr value) } } +#ifdef CONFIG_TCG static void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { @@ -267,6 +268,7 @@ static void mips_cpu_synchronize_from_tb(CPUState *cs, env->hflags &= ~MIPS_HFLAG_BMASK; env->hflags |= tb->flags & MIPS_HFLAG_BMASK; } +#endif /* CONFIG_TCG */ static bool mips_cpu_has_work(CPUState *cs) { @@ -678,7 +680,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->cpu_exec_interrupt = mips_cpu_exec_interrupt; cc->dump_state = mips_cpu_dump_state; cc->set_pc = mips_cpu_set_pc; - cc->synchronize_from_tb = mips_cpu_synchronize_from_tb; cc->gdb_read_register = mips_cpu_gdb_read_register; cc->gdb_write_register = mips_cpu_gdb_write_register; #ifndef CONFIG_USER_ONLY @@ -690,6 +691,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->disas_set_info = mips_cpu_disas_set_info; #ifdef CONFIG_TCG cc->tcg_ops.initialize = mips_tcg_init; + cc->tcg_ops.synchronize_from_tb = mips_cpu_synchronize_from_tb; cc->tlb_fill = mips_cpu_tlb_fill; #endif diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 60d0b43153..1e9bd3c313 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -597,7 +597,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->cpu_exec_interrupt = riscv_cpu_exec_interrupt; cc->dump_state = riscv_cpu_dump_state; cc->set_pc = riscv_cpu_set_pc; - cc->synchronize_from_tb = riscv_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = riscv_cpu_synchronize_from_tb; cc->gdb_read_register = riscv_cpu_gdb_read_register; cc->gdb_write_register = riscv_cpu_gdb_write_register; cc->gdb_num_core_regs = 33; diff --git a/target/rx/cpu.c b/target/rx/cpu.c index cdcab49c8a..4e0de14eef 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -190,7 +190,7 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) cc->cpu_exec_interrupt = rx_cpu_exec_interrupt; cc->dump_state = rx_cpu_dump_state; cc->set_pc = rx_cpu_set_pc; - cc->synchronize_from_tb = rx_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = rx_cpu_synchronize_from_tb; cc->gdb_read_register = rx_cpu_gdb_read_register; cc->gdb_write_register = rx_cpu_gdb_write_register; cc->get_phys_page_debug = rx_cpu_get_phys_page_debug; diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index b86753cda5..130debe074 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -223,7 +223,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) cc->cpu_exec_interrupt = superh_cpu_exec_interrupt; cc->dump_state = superh_cpu_dump_state; cc->set_pc = superh_cpu_set_pc; - cc->synchronize_from_tb = superh_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = superh_cpu_synchronize_from_tb; cc->gdb_read_register = superh_cpu_gdb_read_register; cc->gdb_write_register = superh_cpu_gdb_write_register; cc->tlb_fill = superh_cpu_tlb_fill; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 3ab71e9d00..0ae38eb496 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -870,7 +870,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->memory_rw_debug = sparc_cpu_memory_rw_debug; #endif cc->set_pc = sparc_cpu_set_pc; - cc->synchronize_from_tb = sparc_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = sparc_cpu_synchronize_from_tb; cc->gdb_read_register = sparc_cpu_gdb_read_register; cc->gdb_write_register = sparc_cpu_gdb_write_register; cc->tlb_fill = sparc_cpu_tlb_fill; diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index bf135af40f..09cc6a0e62 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -162,7 +162,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) cc->dump_state = tricore_cpu_dump_state; cc->set_pc = tricore_cpu_set_pc; - cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb; + cc->tcg_ops.synchronize_from_tb = tricore_cpu_synchronize_from_tb; cc->get_phys_page_debug = tricore_cpu_get_phys_page_debug; cc->tcg_ops.initialize = tricore_tcg_init; cc->tlb_fill = tricore_cpu_tlb_fill; From patchwork Fri Feb 5 22:56:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377017 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2585859ejt; Fri, 5 Feb 2021 15:19:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJykzOxxjVsUz2Wpytc9oSAT78UcbzDCwTT2h8Ur+LP43/5HabMArEMFayuOLpYs1oORDs/4 X-Received: by 2002:a25:8245:: with SMTP id d5mr9846200ybn.182.1612567162102; Fri, 05 Feb 2021 15:19:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567162; cv=none; d=google.com; s=arc-20160816; b=puYZftPwYiS/2xtmCkM5YGsusAo1MoOYiw+qM2QvBsNXlORCgVqDxf3Gose8mNkmBf adFwKO+QGGM098QqbBc4TOwHToPfvoKSN2D1afhR6oBL9g1fAEwhe8Fbp9T2seUIp5YO sOo9GgrPQwFZ+srym0lZBKU9j/Lfpyb/Q1v8k6qwtrsvJ4PluC0yf9X6uKC2R2eLmJ9c cFpJxrZILqqwmu2uUeFZQ7XLFCuHWO32zl/9wRgkcbCOZlCBioJ+3hKzRYGneihKkVmZ wtB4Z1/a50yiQHRxlhXH6x72yqEj8bIc+D5wZ4Mq2Xz4GgdHqmSEVx7iOGABBLxzwqKS KzpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=xK5Dftj9uEZFD6bAh7tzhtmgVKApQzK0KsPnbDs5klE=; b=Z7p194/UNGvhLWPTV3mS9inXrnGnYgKwUpa0U2R9DlaY4bAevwvcx3YZJ6EMKq30S2 reJbHYzsjLu+QNfue6t/eBC2BDUPUEmsj+DDY3JZx6ohMOWvGN5cM5fo5yTrITTPhj6D Dil/txkpTX8iNql5p/kIoosxzxwjgf/a9pJHSfUd9QFeExPP14QxdAWoEYmYheC/JXEP lGE8nBMHB7z2je9SjwPN2AaLurGftPsQxKw4UATbzDQG+H8ADdI/r1lUeqesyMvu9tGe fhscSviqi5bwLs3LgP4FL3Vw4oCDoUTWgkxEFG6y9ti3ImzQoZGcschlWbnutghN64lt wM+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xKmOdqyV; 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=fail (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 e126si5870027yba.452.2021.02.05.15.19.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:19:22 -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=fail header.i=@linaro.org header.s=google header.b=xKmOdqyV; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ANl-00056P-DA for patch@linaro.org; Fri, 05 Feb 2021 18:19:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3B-0002ch-FE for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:05 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:43154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A34-0003ai-2Z for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:05 -0500 Received: by mail-pg1-x533.google.com with SMTP id n10so5559515pgl.10 for ; Fri, 05 Feb 2021 14:57:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xK5Dftj9uEZFD6bAh7tzhtmgVKApQzK0KsPnbDs5klE=; b=xKmOdqyVinxsjl3J4GKwhloxVrdIbems2Xs77z9Y6L26Q2tJWrb3DJqdWWMxkUg/5Y cF0qIRUz3QjttvVoWM9II+pn7f1wrIMzqTMRGa7m4rBVuVGHnryae/k4A7InPR3Ha1Fq oc3u+YUH4R/FkVfSd1KQJ0jlry97vnEbQeXGLvRGP4QQktsTADErko1noPFzAvTDFRtq 9oXHrkhV3kVdsdLPkgEQy2T/EOlM3iEdFOexvNlJAfHdw9VpQPOQGfF3phw+KHXPgM3q vNvxX+AK+fmLo9D/6E8a4jXxufcMjAqiJEqd7v6ejMqmieM1NAifv+wl5HY1NAozRdCP Q1Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xK5Dftj9uEZFD6bAh7tzhtmgVKApQzK0KsPnbDs5klE=; b=NKUyPduZ+tqNLhikM1ppUF3m9k5gYi3dhgXe/q9jBqL8rUsW+PuligCMHNYu3Ov1v2 Si/JjQi4cKRnDwB4eXL0uw1kAPMAnktRiaJYMo5JWFD9huBgeNBMvqY2nDuiZnUbROw7 q+yqrp6TY0Pt4yBfKHDrzSYO5SGSep08QbUZ/oNpUn56g5Cum6EBCKsczdhF+YzCZpYI yre1nLyb1nbnZi6/wtbkCVmUNSf3FCtfq+WLCkuhrW1ddndMt7QVxUEfd+IjY2Dc1hiQ q4HpQFfpgwBBlxrrcWRUH/H+fNh+CmYofZP6PJT8lSzz6RnKibqH4lJ7Y6QgpQPC+LhU EM/Q== X-Gm-Message-State: AOAM530y88Rwh5awQdQziMxJskox8ZNZZ3FHHdSeLwQZgXLEFOXwAQwY +Pjf2xTQ6N1ZMhjr3Twi1+73th11bn5JB0SS X-Received: by 2002:aa7:9e8c:0:b029:1cb:1c04:bdc6 with SMTP id p12-20020aa79e8c0000b02901cb1c04bdc6mr6519245pfq.54.1612565875660; Fri, 05 Feb 2021 14:57:55 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 33/46] cpu: Move cpu_exec_* to tcg_ops Date: Fri, 5 Feb 2021 12:56:37 -1000 Message-Id: <20210205225650.1330794-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost Signed-off-by: Eduardo Habkost [claudio: wrapped target code in CONFIG_TCG] Signed-off-by: Claudio Fontana Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20210204163931.7358-6-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 12 ++++++------ accel/tcg/cpu-exec.c | 12 ++++++------ target/alpha/cpu.c | 2 +- target/arm/cpu.c | 2 +- target/arm/cpu64.c | 5 ++++- target/arm/cpu_tcg.c | 7 ++++++- target/avr/cpu.c | 2 +- target/cris/cpu.c | 2 +- target/hppa/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 6 +++--- target/lm32/cpu.c | 2 +- target/m68k/cpu.c | 2 +- target/microblaze/cpu.c | 2 +- target/mips/cpu.c | 2 +- target/nios2/cpu.c | 2 +- target/openrisc/cpu.c | 2 +- target/riscv/cpu.c | 2 +- target/rx/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/sh4/cpu.c | 2 +- target/sparc/cpu.c | 2 +- target/tilegx/cpu.c | 2 +- target/unicore32/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- target/ppc/translate_init.c.inc | 16 ++++++++++------ 25 files changed, 54 insertions(+), 42 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 8cf5585db7..532984e016 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -99,6 +99,12 @@ typedef struct TcgCpuOperations { */ void (*synchronize_from_tb)(CPUState *cpu, const struct TranslationBlock *tb); + /** @cpu_exec_enter: Callback for cpu_exec preparation */ + void (*cpu_exec_enter)(CPUState *cpu); + /** @cpu_exec_exit: Callback for cpu_exec cleanup */ + void (*cpu_exec_exit)(CPUState *cpu); + /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */ + bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); } TcgCpuOperations; @@ -168,9 +174,6 @@ typedef struct TcgCpuOperations { * @gdb_get_dynamic_xml: Callback to return dynamically generated XML for the * gdb stub. Returns a pointer to the XML contents for the specified XML file * or NULL if the CPU doesn't have a dynamically generated content for it. - * @cpu_exec_enter: Callback for cpu_exec preparation. - * @cpu_exec_exit: Callback for cpu_exec cleanup. - * @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec. * @disas_set_info: Setup architecture specific components of disassembly info * @adjust_watchpoint_address: Perform a target-specific adjustment to an * address before attempting to match it against watchpoints. @@ -233,9 +236,6 @@ struct CPUClass { const char *gdb_core_xml_file; gchar * (*gdb_arch_name)(CPUState *cpu); const char * (*gdb_get_dynamic_xml)(CPUState *cpu, const char *xmlname); - void (*cpu_exec_enter)(CPUState *cpu); - void (*cpu_exec_exit)(CPUState *cpu); - bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); void (*disas_set_info)(CPUState *cpu, disassemble_info *info); vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 12b6a91d62..953f050698 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -262,8 +262,8 @@ static void cpu_exec_enter(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->cpu_exec_enter) { - cc->cpu_exec_enter(cpu); + if (cc->tcg_ops.cpu_exec_enter) { + cc->tcg_ops.cpu_exec_enter(cpu); } } @@ -271,8 +271,8 @@ static void cpu_exec_exit(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->cpu_exec_exit) { - cc->cpu_exec_exit(cpu); + if (cc->tcg_ops.cpu_exec_exit) { + cc->tcg_ops.cpu_exec_exit(cpu); } } @@ -655,8 +655,8 @@ 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 { - if (cc->cpu_exec_interrupt && - cc->cpu_exec_interrupt(cpu, interrupt_request)) { + if (cc->tcg_ops.cpu_exec_interrupt && + cc->tcg_ops.cpu_exec_interrupt(cpu, interrupt_request)) { if (need_replay_interrupt(interrupt_request)) { replay_interrupt(); } diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index d66f0351a9..d9ced1635a 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -218,7 +218,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = alpha_cpu_class_by_name; cc->has_work = alpha_cpu_has_work; cc->do_interrupt = alpha_cpu_do_interrupt; - cc->cpu_exec_interrupt = alpha_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = alpha_cpu_exec_interrupt; cc->dump_state = alpha_cpu_dump_state; cc->set_pc = alpha_cpu_set_pc; cc->gdb_read_register = alpha_cpu_gdb_read_register; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 140cb33f07..98a5a0c648 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2256,7 +2256,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = arm_cpu_class_by_name; cc->has_work = arm_cpu_has_work; - cc->cpu_exec_interrupt = arm_cpu_exec_interrupt; cc->dump_state = arm_cpu_dump_state; cc->set_pc = arm_cpu_set_pc; cc->gdb_read_register = arm_cpu_gdb_read_register; @@ -2278,6 +2277,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->disas_set_info = arm_disas_set_info; #ifdef CONFIG_TCG cc->tcg_ops.initialize = arm_translate_init; + cc->tcg_ops.cpu_exec_interrupt = arm_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = arm_cpu_synchronize_from_tb; cc->tlb_fill = arm_cpu_tlb_fill; cc->debug_excp_handler = arm_debug_excp_handler; diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 5e851028c5..a9a1cdb871 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -805,7 +805,10 @@ static void aarch64_cpu_class_init(ObjectClass *oc, void *data) { CPUClass *cc = CPU_CLASS(oc); - cc->cpu_exec_interrupt = arm_cpu_exec_interrupt; +#ifdef CONFIG_TCG + cc->tcg_ops.cpu_exec_interrupt = arm_cpu_exec_interrupt; +#endif /* CONFIG_TCG */ + cc->gdb_read_register = aarch64_cpu_gdb_read_register; cc->gdb_write_register = aarch64_cpu_gdb_write_register; cc->gdb_num_core_regs = 34; diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index 98544db2df..f2e565166e 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c @@ -15,6 +15,7 @@ /* CPU models. These are not needed for the AArch64 linux-user build. */ #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) +#ifdef CONFIG_TCG static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { CPUClass *cc = CPU_GET_CLASS(cs); @@ -38,6 +39,7 @@ static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) } return ret; } +#endif /* CONFIG_TCG */ static void arm926_initfn(Object *obj) { @@ -668,7 +670,10 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) cc->do_interrupt = arm_v7m_cpu_do_interrupt; #endif - cc->cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt; +#ifdef CONFIG_TCG + cc->tcg_ops.cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt; +#endif /* CONFIG_TCG */ + cc->gdb_core_xml_file = "arm-m-profile.xml"; } diff --git a/target/avr/cpu.c b/target/avr/cpu.c index a82fa9d7a8..499a98dcee 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -199,7 +199,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->has_work = avr_cpu_has_work; cc->do_interrupt = avr_cpu_do_interrupt; - cc->cpu_exec_interrupt = avr_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = avr_cpu_exec_interrupt; cc->dump_state = avr_cpu_dump_state; cc->set_pc = avr_cpu_set_pc; cc->memory_rw_debug = avr_cpu_memory_rw_debug; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 4328f8e6c9..7489fc20c8 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -269,7 +269,7 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = cris_cpu_class_by_name; cc->has_work = cris_cpu_has_work; cc->do_interrupt = cris_cpu_do_interrupt; - cc->cpu_exec_interrupt = cris_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = cris_cpu_exec_interrupt; cc->dump_state = cris_cpu_dump_state; cc->set_pc = cris_cpu_set_pc; cc->gdb_read_register = cris_cpu_gdb_read_register; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 94ea3014a3..34c598230e 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -141,7 +141,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = hppa_cpu_class_by_name; cc->has_work = hppa_cpu_has_work; cc->do_interrupt = hppa_cpu_do_interrupt; - cc->cpu_exec_interrupt = hppa_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = hppa_cpu_exec_interrupt; cc->dump_state = hppa_cpu_dump_state; cc->set_pc = hppa_cpu_set_pc; cc->tcg_ops.synchronize_from_tb = hppa_cpu_synchronize_from_tb; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 874286de28..b7c485aa76 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -60,10 +60,10 @@ static void x86_cpu_synchronize_from_tb(CPUState *cs, void tcg_cpu_common_class_init(CPUClass *cc) { cc->do_interrupt = x86_cpu_do_interrupt; - cc->cpu_exec_interrupt = x86_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = x86_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = x86_cpu_synchronize_from_tb; - cc->cpu_exec_enter = x86_cpu_exec_enter; - cc->cpu_exec_exit = x86_cpu_exec_exit; + cc->tcg_ops.cpu_exec_enter = x86_cpu_exec_enter; + cc->tcg_ops.cpu_exec_exit = x86_cpu_exec_exit; cc->tcg_ops.initialize = tcg_x86_init; cc->tlb_fill = x86_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index ef795b81a4..eea2d3e515 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -223,7 +223,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = lm32_cpu_class_by_name; cc->has_work = lm32_cpu_has_work; cc->do_interrupt = lm32_cpu_do_interrupt; - cc->cpu_exec_interrupt = lm32_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = lm32_cpu_exec_interrupt; cc->dump_state = lm32_cpu_dump_state; cc->set_pc = lm32_cpu_set_pc; cc->gdb_read_register = lm32_cpu_gdb_read_register; diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 3604ece49b..0d5f8e0dd8 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -466,7 +466,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = m68k_cpu_class_by_name; cc->has_work = m68k_cpu_has_work; cc->do_interrupt = m68k_cpu_do_interrupt; - cc->cpu_exec_interrupt = m68k_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = m68k_cpu_exec_interrupt; cc->dump_state = m68k_cpu_dump_state; cc->set_pc = m68k_cpu_set_pc; cc->gdb_read_register = m68k_cpu_gdb_read_register; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index e40d1db88d..35b4b2eb9d 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -366,7 +366,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->has_work = mb_cpu_has_work; cc->do_interrupt = mb_cpu_do_interrupt; cc->do_unaligned_access = mb_cpu_do_unaligned_access; - cc->cpu_exec_interrupt = mb_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = mb_cpu_exec_interrupt; cc->dump_state = mb_cpu_dump_state; cc->set_pc = mb_cpu_set_pc; cc->tcg_ops.synchronize_from_tb = mb_cpu_synchronize_from_tb; diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 350f1c66c7..929f98a57a 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -677,7 +677,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = mips_cpu_class_by_name; cc->has_work = mips_cpu_has_work; cc->do_interrupt = mips_cpu_do_interrupt; - cc->cpu_exec_interrupt = mips_cpu_exec_interrupt; cc->dump_state = mips_cpu_dump_state; cc->set_pc = mips_cpu_set_pc; cc->gdb_read_register = mips_cpu_gdb_read_register; @@ -691,6 +690,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->disas_set_info = mips_cpu_disas_set_info; #ifdef CONFIG_TCG cc->tcg_ops.initialize = mips_tcg_init; + cc->tcg_ops.cpu_exec_interrupt = mips_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = mips_cpu_synchronize_from_tb; cc->tlb_fill = mips_cpu_tlb_fill; #endif diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index c28eb05ef0..b0d51f77f5 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -222,7 +222,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = nios2_cpu_class_by_name; cc->has_work = nios2_cpu_has_work; cc->do_interrupt = nios2_cpu_do_interrupt; - cc->cpu_exec_interrupt = nios2_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = nios2_cpu_exec_interrupt; cc->dump_state = nios2_cpu_dump_state; cc->set_pc = nios2_cpu_set_pc; cc->disas_set_info = nios2_cpu_disas_set_info; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index a957f59e2e..48c416e138 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -187,7 +187,7 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = openrisc_cpu_class_by_name; cc->has_work = openrisc_cpu_has_work; cc->do_interrupt = openrisc_cpu_do_interrupt; - cc->cpu_exec_interrupt = openrisc_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = openrisc_cpu_exec_interrupt; cc->dump_state = openrisc_cpu_dump_state; cc->set_pc = openrisc_cpu_set_pc; cc->gdb_read_register = openrisc_cpu_gdb_read_register; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 1e9bd3c313..81ec7e6c99 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -594,7 +594,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = riscv_cpu_class_by_name; cc->has_work = riscv_cpu_has_work; cc->do_interrupt = riscv_cpu_do_interrupt; - cc->cpu_exec_interrupt = riscv_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = riscv_cpu_exec_interrupt; cc->dump_state = riscv_cpu_dump_state; cc->set_pc = riscv_cpu_set_pc; cc->tcg_ops.synchronize_from_tb = riscv_cpu_synchronize_from_tb; diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 4e0de14eef..9493e9031a 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -187,7 +187,7 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) cc->class_by_name = rx_cpu_class_by_name; cc->has_work = rx_cpu_has_work; cc->do_interrupt = rx_cpu_do_interrupt; - cc->cpu_exec_interrupt = rx_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = rx_cpu_exec_interrupt; cc->dump_state = rx_cpu_dump_state; cc->set_pc = rx_cpu_set_pc; cc->tcg_ops.synchronize_from_tb = rx_cpu_synchronize_from_tb; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 890781e74c..53c2f6f89e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -508,7 +508,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) cc->get_crash_info = s390_cpu_get_crash_info; cc->write_elf64_note = s390_cpu_write_elf64_note; #ifdef CONFIG_TCG - cc->cpu_exec_interrupt = s390_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = s390_cpu_exec_interrupt; cc->debug_excp_handler = s390x_cpu_debug_excp_handler; cc->do_unaligned_access = s390x_cpu_do_unaligned_access; #endif diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 130debe074..b2d4e3648c 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -220,7 +220,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = superh_cpu_class_by_name; cc->has_work = superh_cpu_has_work; cc->do_interrupt = superh_cpu_do_interrupt; - cc->cpu_exec_interrupt = superh_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = superh_cpu_exec_interrupt; cc->dump_state = superh_cpu_dump_state; cc->set_pc = superh_cpu_set_pc; cc->tcg_ops.synchronize_from_tb = superh_cpu_synchronize_from_tb; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 0ae38eb496..139939494e 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -864,7 +864,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->parse_features = sparc_cpu_parse_features; cc->has_work = sparc_cpu_has_work; cc->do_interrupt = sparc_cpu_do_interrupt; - cc->cpu_exec_interrupt = sparc_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = sparc_cpu_exec_interrupt; cc->dump_state = sparc_cpu_dump_state; #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) cc->memory_rw_debug = sparc_cpu_memory_rw_debug; diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index cd24d0eb9d..4c6176d26e 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@ -148,7 +148,7 @@ static void tilegx_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = tilegx_cpu_class_by_name; cc->has_work = tilegx_cpu_has_work; cc->do_interrupt = tilegx_cpu_do_interrupt; - cc->cpu_exec_interrupt = tilegx_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = tilegx_cpu_exec_interrupt; cc->dump_state = tilegx_cpu_dump_state; cc->set_pc = tilegx_cpu_set_pc; cc->tlb_fill = tilegx_cpu_tlb_fill; diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index 226bf4226e..84c3419989 100644 --- a/target/unicore32/cpu.c +++ b/target/unicore32/cpu.c @@ -132,7 +132,7 @@ static void uc32_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = uc32_cpu_class_by_name; cc->has_work = uc32_cpu_has_work; cc->do_interrupt = uc32_cpu_do_interrupt; - cc->cpu_exec_interrupt = uc32_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = uc32_cpu_exec_interrupt; cc->dump_state = uc32_cpu_dump_state; cc->set_pc = uc32_cpu_set_pc; cc->tlb_fill = uc32_cpu_tlb_fill; diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 5a6f5bf88b..42a5e4ebe8 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -195,7 +195,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = xtensa_cpu_class_by_name; cc->has_work = xtensa_cpu_has_work; cc->do_interrupt = xtensa_cpu_do_interrupt; - cc->cpu_exec_interrupt = xtensa_cpu_exec_interrupt; + cc->tcg_ops.cpu_exec_interrupt = xtensa_cpu_exec_interrupt; cc->dump_state = xtensa_cpu_dump_state; cc->set_pc = xtensa_cpu_set_pc; cc->gdb_read_register = xtensa_cpu_gdb_read_register; diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc index 189f27cd1c..2b0343686f 100644 --- a/target/ppc/translate_init.c.inc +++ b/target/ppc/translate_init.c.inc @@ -10700,6 +10700,7 @@ static void ppc_cpu_reset(DeviceState *dev) } #ifndef CONFIG_USER_ONLY + static bool ppc_cpu_is_big_endian(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -10710,6 +10711,7 @@ static bool ppc_cpu_is_big_endian(CPUState *cs) return !msr_le; } +#ifdef CONFIG_TCG static void ppc_cpu_exec_enter(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -10731,7 +10733,9 @@ static void ppc_cpu_exec_exit(CPUState *cs) vhc->cpu_exec_exit(cpu->vhyp, cpu); } } -#endif +#endif /* CONFIG_TCG */ + +#endif /* !CONFIG_USER_ONLY */ static void ppc_cpu_instance_init(Object *obj) { @@ -10842,7 +10846,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = ppc_cpu_class_by_name; cc->has_work = ppc_cpu_has_work; cc->do_interrupt = ppc_cpu_do_interrupt; - cc->cpu_exec_interrupt = ppc_cpu_exec_interrupt; cc->dump_state = ppc_cpu_dump_state; cc->dump_statistics = ppc_cpu_dump_statistics; cc->set_pc = ppc_cpu_set_pc; @@ -10879,12 +10882,13 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #endif #ifdef CONFIG_TCG cc->tcg_ops.initialize = ppc_translate_init; + cc->tcg_ops.cpu_exec_interrupt = ppc_cpu_exec_interrupt; cc->tlb_fill = ppc_cpu_tlb_fill; -#endif #ifndef CONFIG_USER_ONLY - cc->cpu_exec_enter = ppc_cpu_exec_enter; - cc->cpu_exec_exit = ppc_cpu_exec_exit; -#endif + cc->tcg_ops.cpu_exec_enter = ppc_cpu_exec_enter; + cc->tcg_ops.cpu_exec_exit = ppc_cpu_exec_exit; +#endif /* !CONFIG_USER_ONLY */ +#endif /* CONFIG_TCG */ cc->disas_set_info = ppc_disas_set_info; From patchwork Fri Feb 5 22:56:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377023 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2587211ejt; Fri, 5 Feb 2021 15:21:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkC5s3i4L3304nw+5BLpou3MkJ5VDTglMjyCU2OdcJMo5GVLgwpjYocJqxH4LvDzRt5QOx X-Received: by 2002:a25:4981:: with SMTP id w123mr9588543yba.123.1612567307050; Fri, 05 Feb 2021 15:21:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567307; cv=none; d=google.com; s=arc-20160816; b=SpoJsQyLTEryCQyDDlSLRMFRygSh/dgFktRGqbWaOvtvv0gWm5HIVphHy7CX/GaVSq yy0sx07A4mUXfhIx2mRl/E4XY17JamvMBGBbhNtMVvWhIb8aDZSOE5GjGAe2Ws8+GMor XPaxee++nSPJNtBhhLvsjdSHFGyRQqM085LAmXsqHxHCRdbNdoA6rNMypxmdsUCK9lg2 kqRvEYtHkgqAAEeDD+5YTQkmMlyVE6Yil5Aul4hoyf3UDiHcy0HhoUISxhcryONCTQjG jd+DkYaYpVVcxzLsYX13obhF1W9wqzo8izI+71c0yv5Pi/edYhV2Ahovo1L8Nfihp1fl bHcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=mHoREKAt2ZKKEs6Cgf9rK0MI3lrgHCoAPNRSfmq/i8Y=; b=KBo77km5NjpFN6AMWbx6UMeCVNhXvVd0xai12EzTfbb4VupJdZMclKYoTtgK5CKWL0 mwk4QwTeUWm+nCHe6IQ/kmEYG8YspwUyKwMelf5OKVBrt3vjRzDqBmrwvfOtjEoHk4cF XXZMtsz6a01o9IwLKp7u3bkwWSulFReiW42+JPPZwcD5SqyZ69386mGwMmgqf5qzaw+h Wec+eTt0gMflcQn58tFqq5q3S5AGGabJFlpClucX6aF4QQIEXSi8FLDl8orQtruvGvMC L3b+bXeEoTvCeQx25EbbE0c0JUVH3cHpIyeS3UWyQSxCEDVghX9tm11xUpejdteXQd1K T2tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Lpohr37U; 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=fail (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 l81si9363374ybl.280.2021.02.05.15.21.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:21:47 -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=fail header.i=@linaro.org header.s=google header.b=Lpohr37U; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AQ6-0000ES-CK for patch@linaro.org; Fri, 05 Feb 2021 18:21:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3D-0002fk-5G for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:07 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:44936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A36-0003b6-7Q for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:06 -0500 Received: by mail-pf1-x42d.google.com with SMTP id t29so5282994pfg.11 for ; Fri, 05 Feb 2021 14:57:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mHoREKAt2ZKKEs6Cgf9rK0MI3lrgHCoAPNRSfmq/i8Y=; b=Lpohr37UUD00cqSQWNR4oAY/WJjCCfw0ME/NV1nc74Jy6oEYbmcgfCkFZPCmjpKJmT IeiYJKpPhzN0HBK4U4Za7l2UVn/QfeCVmFzU972OVCld2GD/ofvpBF3kYSFcbdfmcV1n SxpQQgyNN8BrODnemPXJEKv5eLBxnmywcgnT7Umfhv+MI/KKzJ52aC6Mad5qNKgSU0do 6KvT2dZ/IK/voqtiMsZPZY70RE8Ws8HTCIyu2IjN/+zfr0epo1bALpIOFojKUfg+rEjk nNxbNRzvRuHGsFA1i+4tSVGHvXMQMbo+nwg3FSnSLHTxVa0jkXfaEmIJkI6VlFYtoik7 iFrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mHoREKAt2ZKKEs6Cgf9rK0MI3lrgHCoAPNRSfmq/i8Y=; b=dT32JrajO2qS6JcUYla7HYu5vrkUUnYUZNaXoku/+wDc4xBDb5g6jbHsG024MX6agc s5Zbi/VnjqMPrH/8D4Vb9OZJ0jdYpFgG+WfS9EQxEEnNkbIy/rFQoyx5xXqu/c+IF5nA gViJKmAiDpcPppcf4QgeskInUWrNiaCE82W/5VTj71Z2542e5DnNmKdxtNpe3QnXAOb5 EK3c4fOTuYZadDTuFkoLivu5rzLXA/maK/M/phzi+6fD/Wp0c24NHnzCHkH4KJJpJ/5G NKO1+YBKclmp0gza9M6qlxyzMb5sf/dBImQ5kelx9wf/hToekNLm2S++zH1hP8Qih+FM clZg== X-Gm-Message-State: AOAM5327BxbLTvhL7Lc4rAKkd9qAjVG0rkHdtveqbwaFf3Z3DLFY961l EXsS0cprSPblK17YnzgNoH/0WYaYDu3nTGcE X-Received: by 2002:a62:503:0:b029:1c0:aed7:c88 with SMTP id 3-20020a6205030000b02901c0aed70c88mr6597590pff.76.1612565878065; Fri, 05 Feb 2021 14:57:58 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 34/46] cpu: Move tlb_fill to tcg_ops Date: Fri, 5 Feb 2021 12:56:38 -1000 Message-Id: <20210205225650.1330794-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost [claudio: wrapped target code in CONFIG_TCG] Signed-off-by: Eduardo Habkost Signed-off-by: Claudio Fontana Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20210204163931.7358-7-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 21 ++++++++++++--------- accel/tcg/cputlb.c | 7 ++++--- accel/tcg/user-exec.c | 6 +++--- target/alpha/cpu.c | 2 +- target/arm/cpu.c | 2 +- target/avr/cpu.c | 2 +- target/cris/cpu.c | 2 +- target/hppa/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- target/lm32/cpu.c | 2 +- target/m68k/cpu.c | 2 +- target/microblaze/cpu.c | 2 +- target/mips/cpu.c | 2 +- target/moxie/cpu.c | 2 +- target/nios2/cpu.c | 2 +- target/openrisc/cpu.c | 2 +- target/riscv/cpu.c | 2 +- target/rx/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/sh4/cpu.c | 2 +- target/sparc/cpu.c | 2 +- target/tilegx/cpu.c | 2 +- target/tricore/cpu.c | 2 +- target/unicore32/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- target/ppc/translate_init.c.inc | 2 +- 26 files changed, 42 insertions(+), 38 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 532984e016..94236b68d7 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -105,6 +105,18 @@ typedef struct TcgCpuOperations { void (*cpu_exec_exit)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); + /** + * @tlb_fill: Handle a softmmu tlb miss or user-only address fault + * + * For system mode, if the access is valid, call tlb_set_page + * and return true; if the access is invalid, and probe is + * true, return false; otherwise raise an exception and do + * not return. For user-only mode, always raise an exception + * and do not return. + */ + bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, + MMUAccessType access_type, int mmu_idx, + bool probe, uintptr_t retaddr); } TcgCpuOperations; @@ -138,12 +150,6 @@ typedef struct TcgCpuOperations { * If the target behaviour here is anything other than "set * the PC register to the value passed in" then the target must * also implement the synchronize_from_tb hook. - * @tlb_fill: Callback for handling a softmmu tlb miss or user-only - * address fault. For system mode, if the access is valid, call - * tlb_set_page and return true; if the access is invalid, and - * probe is true, return false; otherwise raise an exception and - * do not return. For user-only mode, always raise an exception - * and do not return. * @get_phys_page_debug: Callback for obtaining a physical address. * @get_phys_page_attrs_debug: Callback for obtaining a physical address and the * associated memory transaction attributes to use for the access. @@ -211,9 +217,6 @@ struct CPUClass { void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list, Error **errp); void (*set_pc)(CPUState *cpu, vaddr value); - bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr); hwaddr (*get_phys_page_debug)(CPUState *cpu, vaddr addr); hwaddr (*get_phys_page_attrs_debug)(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 7a69726ba4..b7717803b8 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1305,7 +1305,8 @@ static void tlb_fill(CPUState *cpu, target_ulong addr, int size, * This is not a probe, so only valid return is success; failure * should result in exception + longjmp to the cpu loop. */ - ok = cc->tlb_fill(cpu, addr, size, access_type, mmu_idx, false, retaddr); + ok = cc->tcg_ops.tlb_fill(cpu, addr, size, + access_type, mmu_idx, false, retaddr); assert(ok); } @@ -1576,8 +1577,8 @@ static int probe_access_internal(CPUArchState *env, target_ulong addr, CPUState *cs = env_cpu(env); CPUClass *cc = CPU_GET_CLASS(cs); - if (!cc->tlb_fill(cs, addr, fault_size, access_type, - mmu_idx, nonfault, retaddr)) { + if (!cc->tcg_ops.tlb_fill(cs, addr, fault_size, access_type, + mmu_idx, nonfault, retaddr)) { /* Non-faulting page table read failed. */ *phost = NULL; return TLB_INVALID_MASK; diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 1215b55ca0..5509dd53e9 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -187,7 +187,7 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info, clear_helper_retaddr(); cc = CPU_GET_CLASS(cpu); - cc->tlb_fill(cpu, address, 0, access_type, MMU_USER_IDX, false, pc); + cc->tcg_ops.tlb_fill(cpu, address, 0, access_type, MMU_USER_IDX, false, pc); g_assert_not_reached(); } @@ -217,8 +217,8 @@ static int probe_access_internal(CPUArchState *env, target_ulong addr, } else { CPUState *cpu = env_cpu(env); CPUClass *cc = CPU_GET_CLASS(cpu); - cc->tlb_fill(cpu, addr, fault_size, access_type, - MMU_USER_IDX, false, ra); + cc->tcg_ops.tlb_fill(cpu, addr, fault_size, access_type, + MMU_USER_IDX, false, ra); g_assert_not_reached(); } } diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index d9ced1635a..9f36f824fd 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -223,7 +223,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = alpha_cpu_set_pc; cc->gdb_read_register = alpha_cpu_gdb_read_register; cc->gdb_write_register = alpha_cpu_gdb_write_register; - cc->tlb_fill = alpha_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = alpha_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->do_transaction_failed = alpha_cpu_do_transaction_failed; cc->do_unaligned_access = alpha_cpu_do_unaligned_access; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 98a5a0c648..27a16c1950 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2279,7 +2279,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.initialize = arm_translate_init; cc->tcg_ops.cpu_exec_interrupt = arm_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = arm_cpu_synchronize_from_tb; - cc->tlb_fill = arm_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = arm_cpu_tlb_fill; cc->debug_excp_handler = arm_debug_excp_handler; cc->debug_check_watchpoint = arm_debug_check_watchpoint; cc->do_unaligned_access = arm_cpu_do_unaligned_access; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 499a98dcee..d6e93049b4 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -204,7 +204,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = avr_cpu_set_pc; cc->memory_rw_debug = avr_cpu_memory_rw_debug; cc->get_phys_page_debug = avr_cpu_get_phys_page_debug; - cc->tlb_fill = avr_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = avr_cpu_tlb_fill; cc->vmsd = &vms_avr_cpu; cc->disas_set_info = avr_cpu_disas_set_info; cc->tcg_ops.initialize = avr_cpu_tcg_init; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 7489fc20c8..9222717f3e 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -274,7 +274,7 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = cris_cpu_set_pc; cc->gdb_read_register = cris_cpu_gdb_read_register; cc->gdb_write_register = cris_cpu_gdb_write_register; - cc->tlb_fill = cris_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = cris_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = cris_cpu_get_phys_page_debug; dc->vmsd = &vmstate_cris_cpu; diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 34c598230e..d5a25014e8 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -147,7 +147,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.synchronize_from_tb = hppa_cpu_synchronize_from_tb; cc->gdb_read_register = hppa_cpu_gdb_read_register; cc->gdb_write_register = hppa_cpu_gdb_write_register; - cc->tlb_fill = hppa_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = hppa_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = hppa_cpu_get_phys_page_debug; dc->vmsd = &vmstate_hppa_cpu; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index b7c485aa76..85b69224a9 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -65,7 +65,7 @@ void tcg_cpu_common_class_init(CPUClass *cc) cc->tcg_ops.cpu_exec_enter = x86_cpu_exec_enter; cc->tcg_ops.cpu_exec_exit = x86_cpu_exec_exit; cc->tcg_ops.initialize = tcg_x86_init; - cc->tlb_fill = x86_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = x86_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->debug_excp_handler = breakpoint_handler; #endif diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index eea2d3e515..76dc728858 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -228,7 +228,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = lm32_cpu_set_pc; cc->gdb_read_register = lm32_cpu_gdb_read_register; cc->gdb_write_register = lm32_cpu_gdb_write_register; - cc->tlb_fill = lm32_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = lm32_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = lm32_cpu_get_phys_page_debug; cc->vmsd = &vmstate_lm32_cpu; diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 0d5f8e0dd8..e38e4d5456 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -471,7 +471,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) cc->set_pc = m68k_cpu_set_pc; cc->gdb_read_register = m68k_cpu_gdb_read_register; cc->gdb_write_register = m68k_cpu_gdb_write_register; - cc->tlb_fill = m68k_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = m68k_cpu_tlb_fill; #if defined(CONFIG_SOFTMMU) cc->do_transaction_failed = m68k_cpu_transaction_failed; cc->get_phys_page_debug = m68k_cpu_get_phys_page_debug; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 35b4b2eb9d..3c09507069 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -372,7 +372,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.synchronize_from_tb = mb_cpu_synchronize_from_tb; cc->gdb_read_register = mb_cpu_gdb_read_register; cc->gdb_write_register = mb_cpu_gdb_write_register; - cc->tlb_fill = mb_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = mb_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->do_transaction_failed = mb_cpu_transaction_failed; cc->get_phys_page_attrs_debug = mb_cpu_get_phys_page_attrs_debug; diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 929f98a57a..63c0f3b94c 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -692,7 +692,7 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->tcg_ops.initialize = mips_tcg_init; cc->tcg_ops.cpu_exec_interrupt = mips_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = mips_cpu_synchronize_from_tb; - cc->tlb_fill = mips_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = mips_cpu_tlb_fill; #endif cc->gdb_num_core_regs = 73; diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 224cfc8361..1177d092c1 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -110,7 +110,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data) cc->do_interrupt = moxie_cpu_do_interrupt; cc->dump_state = moxie_cpu_dump_state; cc->set_pc = moxie_cpu_set_pc; - cc->tlb_fill = moxie_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = moxie_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = moxie_cpu_get_phys_page_debug; cc->vmsd = &vmstate_moxie_cpu; diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index b0d51f77f5..1384836de0 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -226,7 +226,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) cc->dump_state = nios2_cpu_dump_state; cc->set_pc = nios2_cpu_set_pc; cc->disas_set_info = nios2_cpu_disas_set_info; - cc->tlb_fill = nios2_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = nios2_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->do_unaligned_access = nios2_cpu_do_unaligned_access; cc->get_phys_page_debug = nios2_cpu_get_phys_page_debug; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 48c416e138..9857bfde23 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -192,7 +192,7 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = openrisc_cpu_set_pc; cc->gdb_read_register = openrisc_cpu_gdb_read_register; cc->gdb_write_register = openrisc_cpu_gdb_write_register; - cc->tlb_fill = openrisc_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = openrisc_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = openrisc_cpu_get_phys_page_debug; dc->vmsd = &vmstate_openrisc_cpu; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 81ec7e6c99..9d813924ef 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -618,7 +618,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->gdb_arch_name = riscv_gdb_arch_name; cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml; cc->tcg_ops.initialize = riscv_translate_init; - cc->tlb_fill = riscv_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = riscv_cpu_tlb_fill; device_class_set_props(dc, riscv_cpu_properties); } diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 9493e9031a..77609728b8 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -196,7 +196,7 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) cc->get_phys_page_debug = rx_cpu_get_phys_page_debug; cc->disas_set_info = rx_cpu_disas_set_info; cc->tcg_ops.initialize = rx_translate_init; - cc->tlb_fill = rx_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = rx_cpu_tlb_fill; cc->gdb_num_core_regs = 26; cc->gdb_core_xml_file = "rx-core.xml"; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 53c2f6f89e..ceee62ddca 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -516,7 +516,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) cc->disas_set_info = s390_cpu_disas_set_info; #ifdef CONFIG_TCG cc->tcg_ops.initialize = s390x_translate_init; - cc->tlb_fill = s390_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = s390_cpu_tlb_fill; #endif cc->gdb_num_core_regs = S390_NUM_CORE_REGS; diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index b2d4e3648c..1f6c687c3c 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -226,7 +226,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.synchronize_from_tb = superh_cpu_synchronize_from_tb; cc->gdb_read_register = superh_cpu_gdb_read_register; cc->gdb_write_register = superh_cpu_gdb_write_register; - cc->tlb_fill = superh_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = superh_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->do_unaligned_access = superh_cpu_do_unaligned_access; cc->get_phys_page_debug = superh_cpu_get_phys_page_debug; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 139939494e..19e90a414d 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -873,7 +873,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.synchronize_from_tb = sparc_cpu_synchronize_from_tb; cc->gdb_read_register = sparc_cpu_gdb_read_register; cc->gdb_write_register = sparc_cpu_gdb_write_register; - cc->tlb_fill = sparc_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = sparc_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->do_transaction_failed = sparc_cpu_do_transaction_failed; cc->do_unaligned_access = sparc_cpu_do_unaligned_access; diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index 4c6176d26e..75b3a4bae3 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@ -151,7 +151,7 @@ static void tilegx_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.cpu_exec_interrupt = tilegx_cpu_exec_interrupt; cc->dump_state = tilegx_cpu_dump_state; cc->set_pc = tilegx_cpu_set_pc; - cc->tlb_fill = tilegx_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = tilegx_cpu_tlb_fill; cc->gdb_num_core_regs = 0; cc->tcg_ops.initialize = tilegx_tcg_init; } diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 09cc6a0e62..9b21b640e2 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -165,7 +165,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) cc->tcg_ops.synchronize_from_tb = tricore_cpu_synchronize_from_tb; cc->get_phys_page_debug = tricore_cpu_get_phys_page_debug; cc->tcg_ops.initialize = tricore_tcg_init; - cc->tlb_fill = tricore_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = tricore_cpu_tlb_fill; } #define DEFINE_TRICORE_CPU_TYPE(cpu_model, initfn) \ diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index 84c3419989..a57d315d2f 100644 --- a/target/unicore32/cpu.c +++ b/target/unicore32/cpu.c @@ -135,7 +135,7 @@ static void uc32_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.cpu_exec_interrupt = uc32_cpu_exec_interrupt; cc->dump_state = uc32_cpu_dump_state; cc->set_pc = uc32_cpu_set_pc; - cc->tlb_fill = uc32_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = uc32_cpu_tlb_fill; cc->get_phys_page_debug = uc32_cpu_get_phys_page_debug; cc->tcg_ops.initialize = uc32_translate_init; dc->vmsd = &vmstate_uc32_cpu; diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 42a5e4ebe8..e764dbeb73 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -201,7 +201,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_read_register = xtensa_cpu_gdb_read_register; cc->gdb_write_register = xtensa_cpu_gdb_write_register; cc->gdb_stop_before_watchpoint = true; - cc->tlb_fill = xtensa_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = xtensa_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->do_unaligned_access = xtensa_cpu_do_unaligned_access; cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug; diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc index 2b0343686f..1e0fc5ac3d 100644 --- a/target/ppc/translate_init.c.inc +++ b/target/ppc/translate_init.c.inc @@ -10883,7 +10883,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #ifdef CONFIG_TCG cc->tcg_ops.initialize = ppc_translate_init; cc->tcg_ops.cpu_exec_interrupt = ppc_cpu_exec_interrupt; - cc->tlb_fill = ppc_cpu_tlb_fill; + cc->tcg_ops.tlb_fill = ppc_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->tcg_ops.cpu_exec_enter = ppc_cpu_exec_enter; cc->tcg_ops.cpu_exec_exit = ppc_cpu_exec_exit; From patchwork Fri Feb 5 22:56:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377029 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2590815ejt; Fri, 5 Feb 2021 15:29:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyo1dW7m3WNmOqQom6iMyUgu6PukVlx3jP+h0hS1JAuhdNHN0EObnAabs1J+rbz0n+qEvMH X-Received: by 2002:a25:3104:: with SMTP id x4mr10206817ybx.141.1612567741981; Fri, 05 Feb 2021 15:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567741; cv=none; d=google.com; s=arc-20160816; b=tTm2/AGazsm0bl7tlysepT60UrRQhGsMyn0SPKnLGzQJ7YWeXj+E8XDdYVLgZzyl0j duyaO3jNQc9omWbwfVe3DYCIzvs9Q1pE/ChSrLiwptc9aoJgnSaW4RGuYwU6EoMIXqyX xFlwc8qPVGPWjeQ15VbBKfkUad3Z5tYr0Fqhu10ujQebGqast8wj852hXB9PHWiwmBOq ZEf6q1YPzYgJDPnc5MbVcrRg8uKZquO13hk2sZ+u3WtF+k6RFqidJ78QsOFkHoKl5gaV KsXFWuycB+My8oIW7HOkVS08v9bZRc8mCKZzswMrMN5WMsZcNabc2H48So2lmU2c8KaH Enog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=wqRDnPxC3RxnOxn5WTlMaueEc2xxzwe38jPVUhiL4JU=; b=kMHCCxcjBtOXndp9XuIJGEHx5xr4l1aTfVA0gti/l3hm8hELiUSjDzhnGIV/ykltN9 sO3dcdo66ExFl9rMVOqGs9+/DmwBxzwxbEnXcwPzv8gHxVhr3kWb7cW5RMWyAnAAt5Ii HzM90i3q+uwNiPm4AREtoE7u9VSWesFWBZ3H2eVrkrB0wCzwZXIcjz79BsNBWT9l7ZE6 IAq9nIpsMWqV6gQbqve5I8jHA3HrqN09lffvAXOJQfvQdkaiBJSQSgtoY6Jr0RO+3Bmc fT1+9S3w3XiJIOzd2m6obha8S5oy7j/eHIzGnOXhBu2fjaeJX71DyAi6eGe67x9//aN7 WSiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hvDO1NxE; 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=fail (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 r3si10357635ybg.132.2021.02.05.15.29.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:29: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=fail header.i=@linaro.org header.s=google header.b=hvDO1NxE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AX7-0000bO-E0 for patch@linaro.org; Fri, 05 Feb 2021 18:29:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3E-0002hn-WB for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:10 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:45839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A39-0003bp-5W for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:07 -0500 Received: by mail-pg1-x530.google.com with SMTP id o21so4168839pgn.12 for ; Fri, 05 Feb 2021 14:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wqRDnPxC3RxnOxn5WTlMaueEc2xxzwe38jPVUhiL4JU=; b=hvDO1NxEbtnrvJz6f97C5g4S1XdJE7DjZOZ9eq6ed6W7SQiHxutwA5dyKbCncFKtjl rawgY+rDTmh3ke4CwCuzKn6hlRH/Xq+kQFyKlZlMcL5VRpc4AoLNBWCYcDxFlqdzcNK3 dhe1kwlpNg59s3XdhT8Nsifr0utH9ZYJGnoMzwrOVpWgBrVsDz5QiZEjAnluYQXpJLc6 JxrEAFUmMC7DPJ4nVCkZrdHRTSZvZEbjs3QeYXXOYqTAlU4RKBlwn1ypWfOt1ge1HGGW pIQPGNAO+lSJV4d4sAWj3HIAfRXIvcfyEf4x5v0uhgg4nIZTNcb/hcHjPHt2Rz9fQfpf w6gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wqRDnPxC3RxnOxn5WTlMaueEc2xxzwe38jPVUhiL4JU=; b=ZWz0zRxMhwQOdrmjkdKVogaxS2rQ04JziBm2T/3bGLF83FaYkDafNn/AkrD874Me1e BEUm8I2kxtSnP/CxaTJMh+pwHopaqM2oCOtfOLkwFgIY/K5vh7ZI+DvnjWJPdBoTKSK9 uaxW3qq+oCTSe44xTWaJPqRfFUm6MSVhjOEQSgfVBOw7GZYjElG+h+/BI0s8GtTH7l1z NZuSJACpgrgm9RnM4JEf7CnuyiRdX9CgQNv6t8HN6NmTxqa2m3e2D4xXUTHW2TmxSaik cJUdB1JFXpI20Y2yVkFmBL2YEtX3dANhiKspss5hwLQk+eS9TN8SKEsrGNbNYzI0+W4K AF8A== X-Gm-Message-State: AOAM532+ls4YIz+iGNd/GeqyQsEU7Yh2UmRZIqBwaRQiBgJeOJeYxA95 tNewCR/cOwPia/iYoaOFO368z2sQ2BqiRFfF X-Received: by 2002:aa7:864d:0:b029:1d5:ca12:f0e6 with SMTP id a13-20020aa7864d0000b02901d5ca12f0e6mr6503228pfo.58.1612565880160; Fri, 05 Feb 2021 14:58:00 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:57:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 35/46] cpu: Move debug_excp_handler to tcg_ops Date: Fri, 5 Feb 2021 12:56:39 -1000 Message-Id: <20210205225650.1330794-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Eduardo Habkost , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost Signed-off-by: Eduardo Habkost Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20210204163931.7358-8-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 4 ++-- accel/tcg/cpu-exec.c | 4 ++-- target/arm/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- target/lm32/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 94236b68d7..ff82eae939 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -117,6 +117,8 @@ typedef struct TcgCpuOperations { bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); + /** @debug_excp_handler: Callback for handling debug exceptions */ + void (*debug_excp_handler)(CPUState *cpu); } TcgCpuOperations; @@ -161,7 +163,6 @@ typedef struct TcgCpuOperations { * @gdb_write_register: Callback for letting GDB write a register. * @debug_check_watchpoint: Callback: return true if the architectural * watchpoint whose address has matched should really fire. - * @debug_excp_handler: Callback for handling debug exceptions. * @write_elf64_note: Callback for writing a CPU-specific ELF note to a * 64-bit VM coredump. * @write_elf32_qemunote: Callback for writing a CPU- and QEMU-specific ELF @@ -224,7 +225,6 @@ struct CPUClass { int (*gdb_read_register)(CPUState *cpu, GByteArray *buf, int reg); int (*gdb_write_register)(CPUState *cpu, uint8_t *buf, int reg); bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp); - void (*debug_excp_handler)(CPUState *cpu); int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu, int cpuid, void *opaque); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 953f050698..e7e54fd75d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -512,8 +512,8 @@ static inline void cpu_handle_debug_exception(CPUState *cpu) } } - if (cc->debug_excp_handler) { - cc->debug_excp_handler(cpu); + if (cc->tcg_ops.debug_excp_handler) { + cc->tcg_ops.debug_excp_handler(cpu); } } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 27a16c1950..66ac210b0c 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2280,7 +2280,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.cpu_exec_interrupt = arm_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = arm_cpu_synchronize_from_tb; cc->tcg_ops.tlb_fill = arm_cpu_tlb_fill; - cc->debug_excp_handler = arm_debug_excp_handler; + cc->tcg_ops.debug_excp_handler = arm_debug_excp_handler; cc->debug_check_watchpoint = arm_debug_check_watchpoint; cc->do_unaligned_access = arm_cpu_do_unaligned_access; #if !defined(CONFIG_USER_ONLY) diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 85b69224a9..6c1ebbdcc6 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -67,6 +67,6 @@ void tcg_cpu_common_class_init(CPUClass *cc) cc->tcg_ops.initialize = tcg_x86_init; cc->tcg_ops.tlb_fill = x86_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->debug_excp_handler = breakpoint_handler; + cc->tcg_ops.debug_excp_handler = breakpoint_handler; #endif } diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index 76dc728858..bbe1405e32 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -235,7 +235,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data) #endif cc->gdb_num_core_regs = 32 + 7; cc->gdb_stop_before_watchpoint = true; - cc->debug_excp_handler = lm32_debug_excp_handler; + cc->tcg_ops.debug_excp_handler = lm32_debug_excp_handler; cc->disas_set_info = lm32_cpu_disas_set_info; cc->tcg_ops.initialize = lm32_translate_init; } diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index ceee62ddca..8ade66178e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -509,7 +509,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) cc->write_elf64_note = s390_cpu_write_elf64_note; #ifdef CONFIG_TCG cc->tcg_ops.cpu_exec_interrupt = s390_cpu_exec_interrupt; - cc->debug_excp_handler = s390x_cpu_debug_excp_handler; + cc->tcg_ops.debug_excp_handler = s390x_cpu_debug_excp_handler; cc->do_unaligned_access = s390x_cpu_do_unaligned_access; #endif #endif diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index e764dbeb73..b6f13ceb32 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -207,7 +207,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug; cc->do_transaction_failed = xtensa_cpu_do_transaction_failed; #endif - cc->debug_excp_handler = xtensa_breakpoint_handler; + cc->tcg_ops.debug_excp_handler = xtensa_breakpoint_handler; cc->disas_set_info = xtensa_cpu_disas_set_info; cc->tcg_ops.initialize = xtensa_translate_init; dc->vmsd = &vmstate_xtensa_cpu; From patchwork Fri Feb 5 22:56:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377021 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2586615ejt; Fri, 5 Feb 2021 15:20:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxP/D8y2kJYlyptTpt8pD+VWGSNO5JH1ZNpRmuX2paJEu440mavfapVNCzMU4t/HBIcfHHB X-Received: by 2002:a25:d683:: with SMTP id n125mr10050332ybg.256.1612567247757; Fri, 05 Feb 2021 15:20:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567247; cv=none; d=google.com; s=arc-20160816; b=p1EzLf30hKpLMyhkXl27Hds2m6lnbgavR2dXMVzCICyNZ0rUgk1R9i9DzYY4pOciE4 kYl6nkhHlCWWeYYfdjtXEE3dLfpvyfMwrmzudz3vg2BUZd858JCTOiudQZ6XvzHbTv0n GJwBYGyLMNsBwDcZEX+leBMBabIGhJjYNzf/c8iuiEfxTL0zML6jXEh080IYbHyg0Q7B gBfoZU2iTmOhuakat9F+NyYVDQCRsZO/yFMYvysqbWVlv9w8RGqEYNzbq7G+il9EACIs 8G9C25sKV57OP8wknKXgEyuABq1oy26XQrpLjTXoWQBNoHczy0vwy1C7cf3jiPBwIq/J 0+OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=82rA4NMUeG8/5fEhbWdreaJ+KD3ZEBUxvQx5avkDYFY=; b=Cb3B6SI1+W6CPMFWua2Ffsyb2W4u5NGs+Zt2frN7vhRUwNCQyv5qy2+hKt43xldLc5 RftVLUe/q29rsee1mbrjpbB5fp0e5lzjqFE8w4w6/5AmxIUhanDoy/8jtxBAHIrZPisy eSfGeAfJZ7aLrzpfF+NWwQFvQounEPsWJM/FjJmG9ims0/iDtCGHRPoH1ZAs+5fl5QNM oLJnH67Zh6ihOIuspTfzDheLTJG8PRBMOcVKjnhQqAhIJnDLdC2nDE1rnhTplfYjqZPX 4zhyZpHSTuzxozLgjU2wXPb3MV2I2gTEGvERBl8K8syLcudeG/5FE7SV9n4mY8adWQVL qOcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dH8WQo0A; 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=fail (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 63si9729624ybh.449.2021.02.05.15.20.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:20:47 -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=fail header.i=@linaro.org header.s=google header.b=dH8WQo0A; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AP9-0007I5-4I for patch@linaro.org; Fri, 05 Feb 2021 18:20:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3G-0002iX-SX for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:10 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:34048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A39-0003ce-Mw for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:10 -0500 Received: by mail-pg1-x533.google.com with SMTP id o7so5597709pgl.1 for ; Fri, 05 Feb 2021 14:58:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=82rA4NMUeG8/5fEhbWdreaJ+KD3ZEBUxvQx5avkDYFY=; b=dH8WQo0AEMkHhpYfM75L0jN5sZXefiPMtCOKehdbFjxLsYTw0c1BaqSALoGvprb7QB HUJH7QWCkOOFkCVhyQE7y6dPuVbQyf7gJjWezjL/7gDF53/kYnAtOUINf7dnHp5niobr sx8SEd00msNEnExaofzOG1iiPcl/Qg6btaCHgiL39KMwGUr61NeBDkJlF+UABVaLOOjk xk71ShVbcmb1vTWjfpcL9/2Gcxcg2DgT+CmU6NaX/2LI2vVJ/tIFmjoMNv1Z4kHwFNPY UN/0mlyZdQXo28v2V68QoFi0Ui3HHNKRLpONUexLkpSRUyERUTX69pMyhzozV7DuuMOF JFVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=82rA4NMUeG8/5fEhbWdreaJ+KD3ZEBUxvQx5avkDYFY=; b=Is1QugGzk7BD6+xu8CYOCndfDyqNU/gO1wjUXUet+ow9JF6MTTv3N9ZQVbryYfXyHR 0gHuIh0bk96JEycANyqVWNpE/E6uu6tHGuQlmwB0KDjZ6Edhj7KvShhQWJVS2eAUeHBi Vj70OCpW5lGrmM+xDi3OqRmL4WkodycgWGx7o3lBV7E3D/iHAPFFYB3sDAXiTVchbB96 nP2rPrN82/X1l7VLK5uPfnGeqSIo6eLvFkty1qYJpwTyEW/rNdqL3GmQ3MrCtSVKgQ8n 8B7EhYJ6k4T2+6ycbKUkrflE/7hTUspZoFQ44U0h1SQGifJU5bc6NBpnyVD1Tt+9Rv8s VDEA== X-Gm-Message-State: AOAM531Bj6WK219OGKVF2UkDYSBPix7WVBrX+EQdskMhz3vHNnrlWwMO S0ZErd95o/2iFTgblSa6qVAM1kt3oQ59ChJW X-Received: by 2002:a63:4504:: with SMTP id s4mr6551341pga.284.1612565882132; Fri, 05 Feb 2021 14:58:02 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 36/46] target/arm: do not use cc->do_interrupt for KVM directly Date: Fri, 5 Feb 2021 12:56:40 -1000 Message-Id: <20210205225650.1330794-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana cc->do_interrupt is in theory a TCG callback used in accel/tcg only, to prepare the emulated architecture to take an interrupt as defined in the hardware specifications, but in reality the _do_interrupt style of functions in targets are also occasionally reused by KVM to prepare the architecture state in a similar way where userspace code has identified that it needs to deliver an exception to the guest. In the case of ARM, that includes: 1) the vcpu thread got a SIGBUS indicating a memory error, and we need to deliver a Synchronous External Abort to the guest to let it know about the error. 2) the kernel told us about a debug exception (breakpoint, watchpoint) but it is not for one of QEMU's own gdbstub breakpoints/watchpoints so it must be a breakpoint the guest itself has set up, therefore we need to deliver it to the guest. So in order to reuse code, the same arm_do_interrupt function is used. This is all fine, but we need to avoid calling it using the callback registered in CPUClass, since that one is now TCG-only. Fortunately this is easily solved by replacing calls to CPUClass::do_interrupt() with explicit calls to arm_do_interrupt(). Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Cc: Peter Maydell Message-Id: <20210204163931.7358-9-cfontana@suse.de> Signed-off-by: Richard Henderson --- target/arm/helper.c | 4 ++++ target/arm/kvm64.c | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index 47e266d7e6..1a64bd748c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9969,6 +9969,10 @@ static void handle_semihosting(CPUState *cs) * Do any appropriate logging, handle PSCI calls, and then hand off * to the AArch64-entry or AArch32-entry function depending on the * target exception level's register width. + * + * Note: this is used for both TCG (as the do_interrupt tcg op), + * and KVM to re-inject guest debug exceptions, and to + * inject a Synchronous-External-Abort. */ void arm_cpu_do_interrupt(CPUState *cs) { diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 3c37fc4fb6..dff85f6db9 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -946,7 +946,6 @@ static void kvm_inject_arm_sea(CPUState *c) { ARMCPU *cpu = ARM_CPU(c); CPUARMState *env = &cpu->env; - CPUClass *cc = CPU_GET_CLASS(c); uint32_t esr; bool same_el; @@ -962,7 +961,7 @@ static void kvm_inject_arm_sea(CPUState *c) env->exception.syndrome = esr; - cc->do_interrupt(c); + arm_cpu_do_interrupt(c); } #define AARCH64_CORE_REG(x) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \ @@ -1493,7 +1492,6 @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit) { int hsr_ec = syn_get_ec(debug_exit->hsr); ARMCPU *cpu = ARM_CPU(cs); - CPUClass *cc = CPU_GET_CLASS(cs); CPUARMState *env = &cpu->env; /* Ensure PC is synchronised */ @@ -1547,7 +1545,7 @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit) env->exception.vaddress = debug_exit->far; env->exception.target_el = 1; qemu_mutex_lock_iothread(); - cc->do_interrupt(cs); + arm_cpu_do_interrupt(cs); qemu_mutex_unlock_iothread(); return false; From patchwork Fri Feb 5 22:56:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377028 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2590553ejt; Fri, 5 Feb 2021 15:28:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVb9hd40iX2oaDB3Za7iViqKl4TxF7O77KWj+DIIsSth8liu4HFjVC/45DxmCcxygmQZav X-Received: by 2002:a25:a228:: with SMTP id b37mr9708436ybi.460.1612567707579; Fri, 05 Feb 2021 15:28:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567707; cv=none; d=google.com; s=arc-20160816; b=exYDkThDapeBWNPWs1LLA5B5566Yk93Pj0gbfn7NBKEk7FjvJ3i0w9VA9iBnLYRFZm AcKDVYYNVeI5iR/AdbQGfBdnF08yjcNiG4U7fm8NHigjLMM8p0TGoCQWfSgSeODNbqBE 7ucy+1fiVFewFliicoM44cAlS5vD4KTYqrf8ix2C16zmg7v+Wc1SO5FPnOfXzbnR6aP3 oiZXXtQIo113CJTxTDkHuDxm1t6QjprRH9ndC6LSZ29NHLhW0zNe3BIob2PvFa4eRLNk NPpbpnEM6/A+vv2J94DTZVyVj53vPDPXSe5l9vmK//fX/2uM8FCTckgr1ZHXHzqwX2r9 U0iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=/J9mJrdJwyDdM6ya72Do/M7+N2yTyUicIjTCtaubLCs=; b=ReoHd9YZbLefOFCs5Gq24wZ8aMNUPyGbOK2NKETSCJdTBlVU26sJybrJH+toFKDI9F 0owI9XHAalQeHzqBT4j7P8wa0jl9Jpviih+WhqYG2omz4u/eUYrjLOAA3T0FrMiiAEAU V3y5Kfl5AJbLIAyp4WPidXEumApmI9WGc5vYOb38RgWm63O7BU5/kw23KHRfwiRMcdd7 EBvmgeRi+50YH678Eh0DgRRyadmRVHsIst4nfRdDhi6RHCdeXHQAIYv5pKCeY/eCkopv s/PDQgymAFV9Py5g/S4AH8JM2YbQK2GOiwvqbo39texNY2JoARD9xOEbdtDmg9NQS93y pLPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Tj6GM3Kn; 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=fail (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 125si12306321ybh.279.2021.02.05.15.28.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:28:27 -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=fail header.i=@linaro.org header.s=google header.b=Tj6GM3Kn; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AWY-00085E-Up for patch@linaro.org; Fri, 05 Feb 2021 18:28:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3I-0002mr-FS for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:12 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:42600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3B-0003dU-JK for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:12 -0500 Received: by mail-pg1-x52e.google.com with SMTP id g15so5562455pgu.9 for ; Fri, 05 Feb 2021 14:58:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/J9mJrdJwyDdM6ya72Do/M7+N2yTyUicIjTCtaubLCs=; b=Tj6GM3KnayleoBJr+xn1WQd8pwSFkgIGFsPcAT6k+TK8lG1EePtIK/7FY7OgOgXvax SMutso8ttPorN0vzl9Xln5/Jbvmm4ePS1RYoEfL1zFasL58tnu5OW2/jqId2HJ344Swn y+DaEf4JfRTNqH9OGwHx2raJbYNxfSuW/EjUBOHZymgCe/1ak6LvBjlHhk+qJULT2kIT CIMSRg/fDSjrVeUn9ucJm7e1ZNe9Y/BKxlWhIuxDZ7Z4yd7CtGljAV5zXjCy73CXmrOz cK8SncZCByGH2wlQOkQ5TbJaF+wAfEqPEvTZzzNLZob85r4eeiRQDZy3j1MD+OT+SZZ7 7vGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/J9mJrdJwyDdM6ya72Do/M7+N2yTyUicIjTCtaubLCs=; b=DRtMCcru4l86zT30XuaKwM8xeJbn8v7fB0JXukDT43+Chsdz75TflVSThENhsRmAd9 xnAJjzuZ/o5n575c1G/OUyzGhJZIuOaM4MOPRzOUT4rumCvthrBb6fqLMH1vXM+FQMbJ e0MSrel92wKlf6F+xCas/8urgI7BIt93Zf9PKb6nJlo6wRfzWwDVF03qYZBoepB9OO7R P4TToj2fQ+jpkI5FdBf6TpekBMXyVWmSGS8C8OQ0G+RV+4efMVQrcmJttEnq4UhKZ+rs 0WVYcYKvygxyj5turv5qSnYy5CmVt3XJe02FAe91ZdXlRmtTEhOryKpqH6RzXykAJJJ0 vWhA== X-Gm-Message-State: AOAM531YeJSevZk3fCbDcf58hEa5Ag4hL/fPwpP8OijDNYRB0ce0rXCV INhRDc6zra2M3dhDUzfAk0otktcooMFlNVcO X-Received: by 2002:aa7:87d9:0:b029:1b7:1c6c:56e0 with SMTP id i25-20020aa787d90000b02901b71c6c56e0mr6355429pfo.25.1612565884045; Fri, 05 Feb 2021 14:58:04 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 37/46] cpu: move cc->do_interrupt to tcg_ops Date: Fri, 5 Feb 2021 12:56:41 -1000 Message-Id: <20210205225650.1330794-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20210204163931.7358-10-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 4 ++-- accel/tcg/cpu-exec.c | 4 ++-- target/alpha/cpu.c | 2 +- target/arm/cpu.c | 4 ++-- target/arm/cpu_tcg.c | 9 ++++----- target/avr/cpu.c | 2 +- target/avr/helper.c | 4 ++-- target/cris/cpu.c | 12 ++++++------ target/cris/helper.c | 4 ++-- target/hppa/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 2 +- target/lm32/cpu.c | 2 +- target/m68k/cpu.c | 2 +- target/microblaze/cpu.c | 2 +- target/mips/cpu.c | 4 ++-- target/moxie/cpu.c | 2 +- target/nios2/cpu.c | 2 +- target/openrisc/cpu.c | 2 +- target/riscv/cpu.c | 2 +- target/rx/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/sh4/cpu.c | 2 +- target/sparc/cpu.c | 2 +- target/tilegx/cpu.c | 2 +- target/unicore32/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- target/ppc/translate_init.c.inc | 2 +- 27 files changed, 41 insertions(+), 42 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index ff82eae939..60cf20bf05 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -105,6 +105,8 @@ typedef struct TcgCpuOperations { void (*cpu_exec_exit)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); + /** @do_interrupt: Callback for interrupt handling. */ + void (*do_interrupt)(CPUState *cpu); /** * @tlb_fill: Handle a softmmu tlb miss or user-only address fault * @@ -129,7 +131,6 @@ typedef struct TcgCpuOperations { * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. * @has_work: Callback for checking if there is work to do. - * @do_interrupt: Callback for interrupt handling. * @do_unaligned_access: Callback for unaligned access handling, if * the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory transactions @@ -199,7 +200,6 @@ struct CPUClass { int reset_dump_flags; bool (*has_work)(CPUState *cpu); - void (*do_interrupt)(CPUState *cpu); void (*do_unaligned_access)(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index e7e54fd75d..633ee3ef9e 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -547,7 +547,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) loop */ #if defined(TARGET_I386) CPUClass *cc = CPU_GET_CLASS(cpu); - cc->do_interrupt(cpu); + cc->tcg_ops.do_interrupt(cpu); #endif *ret = cpu->exception_index; cpu->exception_index = -1; @@ -556,7 +556,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) if (replay_exception()) { CPUClass *cc = CPU_GET_CLASS(cpu); qemu_mutex_lock_iothread(); - cc->do_interrupt(cpu); + cc->tcg_ops.do_interrupt(cpu); qemu_mutex_unlock_iothread(); cpu->exception_index = -1; diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 9f36f824fd..66f1166672 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -217,7 +217,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = alpha_cpu_class_by_name; cc->has_work = alpha_cpu_has_work; - cc->do_interrupt = alpha_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = alpha_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = alpha_cpu_exec_interrupt; cc->dump_state = alpha_cpu_dump_state; cc->set_pc = alpha_cpu_set_pc; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 66ac210b0c..dfb2398392 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -590,7 +590,7 @@ bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt_request) found: cs->exception_index = excp_idx; env->exception.target_el = target_el; - cc->do_interrupt(cs); + cc->tcg_ops.do_interrupt(cs); return true; } @@ -2261,7 +2261,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_read_register = arm_cpu_gdb_read_register; cc->gdb_write_register = arm_cpu_gdb_write_register; #ifndef CONFIG_USER_ONLY - cc->do_interrupt = arm_cpu_do_interrupt; cc->get_phys_page_attrs_debug = arm_cpu_get_phys_page_attrs_debug; cc->asidx_from_attrs = arm_asidx_from_attrs; cc->vmsd = &vmstate_arm_cpu; @@ -2286,6 +2285,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) #if !defined(CONFIG_USER_ONLY) cc->do_transaction_failed = arm_cpu_do_transaction_failed; cc->adjust_watchpoint_address = arm_adjust_watchpoint_address; + cc->tcg_ops.do_interrupt = arm_cpu_do_interrupt; #endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ #endif } diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index f2e565166e..d9c160f1ac 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c @@ -34,7 +34,7 @@ static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (interrupt_request & CPU_INTERRUPT_HARD && (armv7m_nvic_can_take_pending_exception(env->nvic))) { cs->exception_index = EXCP_IRQ; - cc->do_interrupt(cs); + cc->tcg_ops.do_interrupt(cs); ret = true; } return ret; @@ -666,12 +666,11 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) CPUClass *cc = CPU_CLASS(oc); acc->info = data; -#ifndef CONFIG_USER_ONLY - cc->do_interrupt = arm_v7m_cpu_do_interrupt; -#endif - #ifdef CONFIG_TCG cc->tcg_ops.cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt; +#ifndef CONFIG_USER_ONLY + cc->tcg_ops.do_interrupt = arm_v7m_cpu_do_interrupt; +#endif #endif /* CONFIG_TCG */ cc->gdb_core_xml_file = "arm-m-profile.xml"; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index d6e93049b4..476e645b37 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -198,7 +198,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = avr_cpu_class_by_name; cc->has_work = avr_cpu_has_work; - cc->do_interrupt = avr_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = avr_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = avr_cpu_exec_interrupt; cc->dump_state = avr_cpu_dump_state; cc->set_pc = avr_cpu_set_pc; diff --git a/target/avr/helper.c b/target/avr/helper.c index d96d14372b..69d3b6181f 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -34,7 +34,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (interrupt_request & CPU_INTERRUPT_RESET) { if (cpu_interrupts_enabled(env)) { cs->exception_index = EXCP_RESET; - cc->do_interrupt(cs); + cc->tcg_ops.do_interrupt(cs); cs->interrupt_request &= ~CPU_INTERRUPT_RESET; @@ -45,7 +45,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (cpu_interrupts_enabled(env) && env->intsrc != 0) { int index = ctz32(env->intsrc); cs->exception_index = EXCP_INT(index); - cc->do_interrupt(cs); + cc->tcg_ops.do_interrupt(cs); env->intsrc &= env->intsrc - 1; /* clear the interrupt */ cs->interrupt_request &= ~CPU_INTERRUPT_HARD; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index 9222717f3e..b65743e8ca 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -199,7 +199,7 @@ static void crisv8_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 8; - cc->do_interrupt = crisv10_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } @@ -210,7 +210,7 @@ static void crisv9_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 9; - cc->do_interrupt = crisv10_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } @@ -221,7 +221,7 @@ static void crisv10_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 10; - cc->do_interrupt = crisv10_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } @@ -232,7 +232,7 @@ static void crisv11_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 11; - cc->do_interrupt = crisv10_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } @@ -243,7 +243,7 @@ static void crisv17_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 17; - cc->do_interrupt = crisv10_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; } @@ -268,7 +268,7 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = cris_cpu_class_by_name; cc->has_work = cris_cpu_has_work; - cc->do_interrupt = cris_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = cris_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = cris_cpu_exec_interrupt; cc->dump_state = cris_cpu_dump_state; cc->set_pc = cris_cpu_set_pc; diff --git a/target/cris/helper.c b/target/cris/helper.c index ed45c3d9b7..1f4d6f7d45 100644 --- a/target/cris/helper.c +++ b/target/cris/helper.c @@ -299,7 +299,7 @@ bool cris_cpu_exec_interrupt(CPUState *cs, int interrupt_request) && (env->pregs[PR_CCS] & I_FLAG) && !env->locked_irq) { cs->exception_index = EXCP_IRQ; - cc->do_interrupt(cs); + cc->tcg_ops.do_interrupt(cs); ret = true; } if (interrupt_request & CPU_INTERRUPT_NMI) { @@ -311,7 +311,7 @@ bool cris_cpu_exec_interrupt(CPUState *cs, int interrupt_request) } if ((env->pregs[PR_CCS] & m_flag_archval)) { cs->exception_index = EXCP_NMI; - cc->do_interrupt(cs); + cc->tcg_ops.do_interrupt(cs); ret = true; } } diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index d5a25014e8..68233acf53 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -140,7 +140,7 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = hppa_cpu_class_by_name; cc->has_work = hppa_cpu_has_work; - cc->do_interrupt = hppa_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = hppa_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = hppa_cpu_exec_interrupt; cc->dump_state = hppa_cpu_dump_state; cc->set_pc = hppa_cpu_set_pc; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 6c1ebbdcc6..4a53cd89e2 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -59,7 +59,7 @@ static void x86_cpu_synchronize_from_tb(CPUState *cs, void tcg_cpu_common_class_init(CPUClass *cc) { - cc->do_interrupt = x86_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = x86_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = x86_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = x86_cpu_synchronize_from_tb; cc->tcg_ops.cpu_exec_enter = x86_cpu_exec_enter; diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index bbe1405e32..fb3761b749 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -222,7 +222,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = lm32_cpu_class_by_name; cc->has_work = lm32_cpu_has_work; - cc->do_interrupt = lm32_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = lm32_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = lm32_cpu_exec_interrupt; cc->dump_state = lm32_cpu_dump_state; cc->set_pc = lm32_cpu_set_pc; diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index e38e4d5456..69093a621f 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -465,7 +465,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = m68k_cpu_class_by_name; cc->has_work = m68k_cpu_has_work; - cc->do_interrupt = m68k_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = m68k_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = m68k_cpu_exec_interrupt; cc->dump_state = m68k_cpu_dump_state; cc->set_pc = m68k_cpu_set_pc; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 3c09507069..c93e44b8e5 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -364,7 +364,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = mb_cpu_class_by_name; cc->has_work = mb_cpu_has_work; - cc->do_interrupt = mb_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = mb_cpu_do_interrupt; cc->do_unaligned_access = mb_cpu_do_unaligned_access; cc->tcg_ops.cpu_exec_interrupt = mb_cpu_exec_interrupt; cc->dump_state = mb_cpu_dump_state; diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 63c0f3b94c..a88a138a8d 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -676,7 +676,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = mips_cpu_class_by_name; cc->has_work = mips_cpu_has_work; - cc->do_interrupt = mips_cpu_do_interrupt; cc->dump_state = mips_cpu_dump_state; cc->set_pc = mips_cpu_set_pc; cc->gdb_read_register = mips_cpu_gdb_read_register; @@ -690,10 +689,11 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->disas_set_info = mips_cpu_disas_set_info; #ifdef CONFIG_TCG cc->tcg_ops.initialize = mips_tcg_init; + cc->tcg_ops.do_interrupt = mips_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = mips_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = mips_cpu_synchronize_from_tb; cc->tcg_ops.tlb_fill = mips_cpu_tlb_fill; -#endif +#endif /* CONFIG_TCG */ cc->gdb_num_core_regs = 73; cc->gdb_stop_before_watchpoint = true; diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 1177d092c1..36bef4d357 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -107,7 +107,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = moxie_cpu_class_by_name; cc->has_work = moxie_cpu_has_work; - cc->do_interrupt = moxie_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = moxie_cpu_do_interrupt; cc->dump_state = moxie_cpu_dump_state; cc->set_pc = moxie_cpu_set_pc; cc->tcg_ops.tlb_fill = moxie_cpu_tlb_fill; diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 1384836de0..b5fe779ceb 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -221,7 +221,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = nios2_cpu_class_by_name; cc->has_work = nios2_cpu_has_work; - cc->do_interrupt = nios2_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = nios2_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = nios2_cpu_exec_interrupt; cc->dump_state = nios2_cpu_dump_state; cc->set_pc = nios2_cpu_set_pc; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 9857bfde23..1a31f7564f 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -186,7 +186,7 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = openrisc_cpu_class_by_name; cc->has_work = openrisc_cpu_has_work; - cc->do_interrupt = openrisc_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = openrisc_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = openrisc_cpu_exec_interrupt; cc->dump_state = openrisc_cpu_dump_state; cc->set_pc = openrisc_cpu_set_pc; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 9d813924ef..345b78fc3d 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -593,7 +593,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = riscv_cpu_class_by_name; cc->has_work = riscv_cpu_has_work; - cc->do_interrupt = riscv_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = riscv_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = riscv_cpu_exec_interrupt; cc->dump_state = riscv_cpu_dump_state; cc->set_pc = riscv_cpu_set_pc; diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 77609728b8..e79f009cbd 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -186,7 +186,7 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) cc->class_by_name = rx_cpu_class_by_name; cc->has_work = rx_cpu_has_work; - cc->do_interrupt = rx_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = rx_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = rx_cpu_exec_interrupt; cc->dump_state = rx_cpu_dump_state; cc->set_pc = rx_cpu_set_pc; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 8ade66178e..e6cf933594 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -496,7 +496,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = s390_cpu_class_by_name, cc->has_work = s390_cpu_has_work; #ifdef CONFIG_TCG - cc->do_interrupt = s390_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = s390_cpu_do_interrupt; #endif cc->dump_state = s390_cpu_dump_state; cc->set_pc = s390_cpu_set_pc; diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 1f6c687c3c..f69360fc16 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -219,7 +219,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = superh_cpu_class_by_name; cc->has_work = superh_cpu_has_work; - cc->do_interrupt = superh_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = superh_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = superh_cpu_exec_interrupt; cc->dump_state = superh_cpu_dump_state; cc->set_pc = superh_cpu_set_pc; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 19e90a414d..871b2a83c6 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -863,7 +863,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = sparc_cpu_class_by_name; cc->parse_features = sparc_cpu_parse_features; cc->has_work = sparc_cpu_has_work; - cc->do_interrupt = sparc_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = sparc_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = sparc_cpu_exec_interrupt; cc->dump_state = sparc_cpu_dump_state; #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index 75b3a4bae3..7d4ead4ef1 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@ -147,7 +147,7 @@ static void tilegx_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = tilegx_cpu_class_by_name; cc->has_work = tilegx_cpu_has_work; - cc->do_interrupt = tilegx_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = tilegx_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = tilegx_cpu_exec_interrupt; cc->dump_state = tilegx_cpu_dump_state; cc->set_pc = tilegx_cpu_set_pc; diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index a57d315d2f..e27ffc571a 100644 --- a/target/unicore32/cpu.c +++ b/target/unicore32/cpu.c @@ -131,7 +131,7 @@ static void uc32_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = uc32_cpu_class_by_name; cc->has_work = uc32_cpu_has_work; - cc->do_interrupt = uc32_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = uc32_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = uc32_cpu_exec_interrupt; cc->dump_state = uc32_cpu_dump_state; cc->set_pc = uc32_cpu_set_pc; diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index b6f13ceb32..3ff025f0fe 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -194,7 +194,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = xtensa_cpu_class_by_name; cc->has_work = xtensa_cpu_has_work; - cc->do_interrupt = xtensa_cpu_do_interrupt; + cc->tcg_ops.do_interrupt = xtensa_cpu_do_interrupt; cc->tcg_ops.cpu_exec_interrupt = xtensa_cpu_exec_interrupt; cc->dump_state = xtensa_cpu_dump_state; cc->set_pc = xtensa_cpu_set_pc; diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc index 1e0fc5ac3d..b16430a9d4 100644 --- a/target/ppc/translate_init.c.inc +++ b/target/ppc/translate_init.c.inc @@ -10845,7 +10845,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = ppc_cpu_class_by_name; cc->has_work = ppc_cpu_has_work; - cc->do_interrupt = ppc_cpu_do_interrupt; cc->dump_state = ppc_cpu_dump_state; cc->dump_statistics = ppc_cpu_dump_statistics; cc->set_pc = ppc_cpu_set_pc; @@ -10883,6 +10882,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #ifdef CONFIG_TCG cc->tcg_ops.initialize = ppc_translate_init; cc->tcg_ops.cpu_exec_interrupt = ppc_cpu_exec_interrupt; + cc->tcg_ops.do_interrupt = ppc_cpu_do_interrupt; cc->tcg_ops.tlb_fill = ppc_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->tcg_ops.cpu_exec_enter = ppc_cpu_exec_enter; From patchwork Fri Feb 5 22:56:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377018 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2585970ejt; Fri, 5 Feb 2021 15:19:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlcXnBjpdB1eM39fEwByela7zy9pNTqSMIXU2IPgxZjhPH71dalNDHOVL365Sohf/K6GKz X-Received: by 2002:a25:cc4c:: with SMTP id l73mr9989787ybf.395.1612567174540; Fri, 05 Feb 2021 15:19:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567174; cv=none; d=google.com; s=arc-20160816; b=TPunqqpVmZsXF0RifU3FxkXx6pE4r1etPSbIqaJ0qjCL3ChOj5CpfLnzZCdBsEC2sS sgOUlkXRdO7kmypFOPeAHcu8QAL7fYyeN1/Or56fuqUVwy2yHD31u8xs/R5otUSWHzxS qsFmREaYG7GNfNgLWrcWFs61dSDMz+tpi29NERkWSB9RVMsiy/rDe4ZOoCWAFMKnIBYV HUFtBg0JdGsQFt3vI/wpkZyz6UxBqWBZhH6fci3f8HfZvPsK7WBlcfKKT3qoMVsNRPI+ A8FlSEtxdufv1cHd3l+fTXHbPPNOfl9IDRoUN9oRS73jYnNZh8g9htXXDeKkJWpFshxt xStw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=rFjHhw95AixicSl/izmOOxjEy3QBcrFO1Yxm9VLmZkM=; b=wZqu94pbz56S9QMfryotwXRpyQzl7fBG29a+u7bF+h0FZ79QIbvC1OUSY9ymXJD1uL WvkKBySZwx6wPqeQVIJGw4hRGwn9fWWXkIV7sz2dYSqWhH7sxft1iOvIsl5BnCaxP+Ma on6SjpAdSHv08JtX6Al49K0LaY3DIMnibTVU7wcCWi3u+95r4FiIv5DwmGJvlaFaqJTi TsB2hBe5UzLFVzsU7iYvwkVijBFtF2tQwSbZ5bQMcrEJECVbMGOViRhjLXddplm03xfG ywPgffM4Zc9QCp22IKP5J1NKyUWq+7X+7XtZ4KURDx+53vHo+sgxow59uF2kJ5Ti4Z9n wLGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=olJJhU8r; 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=fail (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 n198si10584025ybg.136.2021.02.05.15.19.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:19: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=fail header.i=@linaro.org header.s=google header.b=olJJhU8r; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ANx-0005xa-TI for patch@linaro.org; Fri, 05 Feb 2021 18:19:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3H-0002jW-7Y for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:11 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:46300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3D-0003eQ-F3 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:10 -0500 Received: by mail-pg1-x52c.google.com with SMTP id r38so5546679pgk.13 for ; Fri, 05 Feb 2021 14:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rFjHhw95AixicSl/izmOOxjEy3QBcrFO1Yxm9VLmZkM=; b=olJJhU8rGEOS1yBaVIXr0dJNgNicTpeEZ2iLIHX6tJ/OsOnF3QkYPsBDEv0EFz2Uhg qyUfV/dcI+Eplg3pyra+vDebPo5MOiWNs/VGOuBn8frkX1ULXn8nS2WijX94IjuHpwk8 Pxon1SkFKz/aXcMMwt4aogFfAJb696/Fppd/a4eToNRzYtJ50L+52L8OwXVsONOsaR7j tURpQJhCHM47zt+jzAOShT8nCOA/1cKEV5+XOkm/26mrTsBsdbAU+mUvqrnoVaq9UP3X YBS9mCBkLa5tzwmTn84I4brEAOA0ZyB4LubnAzmJCKJVChslOo3mWupqzSPGAFVoDxmC bi1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rFjHhw95AixicSl/izmOOxjEy3QBcrFO1Yxm9VLmZkM=; b=miNuRIhdjE2Bu27xqIY7MfO10zIXH1fe0uD5+ayW7xvdcKJM5UrsfAlN0iV1n2ZVm0 sHQdTFpuVh4qOWZtzELQpJTMwdGamE8CrPnIu9N4jWMNQaNwVpzmUYG2jKqzM26KQA/U 5PYyc4J36PvvtjUApVEbflUuU/dYpCLs8R5bBUMC1KEAgt0Lo/H0XuPAwcwx2zuTJ7ID cfqODsBBLtJRh7m7Sb59TdUxYouBYUguphVQCe0pOMM2autcroWoYSFe+BGFXJrEmMB+ JUcI+hVsBLG6Z+BEssIrJhUSJjiRPe7aP6B4g7Wv62y/JoU4cVKP0aKnB5pnLw7+u4L+ Ag7g== X-Gm-Message-State: AOAM530s+a14WYjJGIYh+AfUsDjaJkUWgz/aPZjQbOh2E1wRVhr8gIQB 7U4hM90W8qYY0LbP1/py2KXjfxxDmNs84gU4 X-Received: by 2002:a62:1995:0:b029:1c0:c4d8:adcb with SMTP id 143-20020a6219950000b02901c0c4d8adcbmr6759034pfz.60.1612565886013; Fri, 05 Feb 2021 14:58:06 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 38/46] cpu: move cc->transaction_failed to tcg_ops Date: Fri, 5 Feb 2021 12:56:42 -1000 Message-Id: <20210205225650.1330794-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson [claudio: wrap target code around CONFIG_TCG and !CONFIG_USER_ONLY] avoiding its use in headers used by common_ss code (should be poisoned). Note: need to be careful with the use of CONFIG_USER_ONLY, Message-Id: <20210204163931.7358-11-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 28 +++++++++++++--------------- hw/mips/jazz.c | 9 +++++++-- target/alpha/cpu.c | 2 +- target/arm/cpu.c | 4 ++-- target/m68k/cpu.c | 2 +- target/microblaze/cpu.c | 2 +- target/mips/cpu.c | 4 +++- target/riscv/cpu.c | 2 +- target/riscv/cpu_helper.c | 2 +- target/sparc/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- target/xtensa/helper.c | 4 ++-- 12 files changed, 34 insertions(+), 29 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 60cf20bf05..41ce1daefc 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -122,6 +122,14 @@ typedef struct TcgCpuOperations { /** @debug_excp_handler: Callback for handling debug exceptions */ void (*debug_excp_handler)(CPUState *cpu); + /** + * @do_transaction_failed: Callback for handling failed memory transactions + * (ie bus faults or external aborts; not MMU faults) + */ + void (*do_transaction_failed)(CPUState *cpu, hwaddr physaddr, vaddr addr, + unsigned size, MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr); } TcgCpuOperations; /** @@ -133,8 +141,6 @@ typedef struct TcgCpuOperations { * @has_work: Callback for checking if there is work to do. * @do_unaligned_access: Callback for unaligned access handling, if * the target defines #TARGET_ALIGNED_ONLY. - * @do_transaction_failed: Callback for handling failed memory transactions - * (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU which supports * runtime configurable endianness is currently big-endian. Non-configurable * CPUs can use the default implementation of this method. This method should @@ -203,10 +209,6 @@ struct CPUClass { void (*do_unaligned_access)(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); - void (*do_transaction_failed)(CPUState *cpu, hwaddr physaddr, vaddr addr, - unsigned size, MMUAccessType access_type, - int mmu_idx, MemTxAttrs attrs, - MemTxResult response, uintptr_t retaddr); bool (*virtio_is_big_endian)(CPUState *cpu); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, uint8_t *buf, int len, bool is_write); @@ -879,9 +881,6 @@ CPUState *cpu_by_arch_id(int64_t id); void cpu_interrupt(CPUState *cpu, int mask); -#ifdef NEED_CPU_H - -#ifdef CONFIG_SOFTMMU static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) @@ -900,14 +899,13 @@ static inline void cpu_transaction_failed(CPUState *cpu, hwaddr physaddr, { CPUClass *cc = CPU_GET_CLASS(cpu); - if (!cpu->ignore_memory_transaction_failures && cc->do_transaction_failed) { - cc->do_transaction_failed(cpu, physaddr, addr, size, access_type, - mmu_idx, attrs, response, retaddr); + if (!cpu->ignore_memory_transaction_failures && + cc->tcg_ops.do_transaction_failed) { + cc->tcg_ops.do_transaction_failed(cpu, physaddr, addr, size, + access_type, mmu_idx, attrs, + response, retaddr); } } -#endif - -#endif /* NEED_CPU_H */ /** * cpu_set_pc: diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index f9442731dd..46c71a0ac8 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -116,6 +116,8 @@ static const MemoryRegionOps dma_dummy_ops = { #define MAGNUM_BIOS_SIZE_MAX 0x7e000 #define MAGNUM_BIOS_SIZE \ (BIOS_SIZE < MAGNUM_BIOS_SIZE_MAX ? BIOS_SIZE : MAGNUM_BIOS_SIZE_MAX) + +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static void (*real_do_transaction_failed)(CPUState *cpu, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type, @@ -137,6 +139,7 @@ static void mips_jazz_do_transaction_failed(CPUState *cs, hwaddr physaddr, (*real_do_transaction_failed)(cs, physaddr, addr, size, access_type, mmu_idx, attrs, response, retaddr); } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ static void mips_jazz_init(MachineState *machine, enum jazz_model_e jazz_model) @@ -205,8 +208,10 @@ static void mips_jazz_init(MachineState *machine, * memory region that catches all memory accesses, as we do on Malta. */ cc = CPU_GET_CLASS(cpu); - real_do_transaction_failed = cc->do_transaction_failed; - cc->do_transaction_failed = mips_jazz_do_transaction_failed; +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) + real_do_transaction_failed = cc->tcg_ops.do_transaction_failed; + cc->tcg_ops.do_transaction_failed = mips_jazz_do_transaction_failed; +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ /* allocate RAM */ memory_region_add_subregion(address_space, 0, machine->ram); diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 66f1166672..a1696bebeb 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -225,7 +225,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_write_register = alpha_cpu_gdb_write_register; cc->tcg_ops.tlb_fill = alpha_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->do_transaction_failed = alpha_cpu_do_transaction_failed; + cc->tcg_ops.do_transaction_failed = alpha_cpu_do_transaction_failed; cc->do_unaligned_access = alpha_cpu_do_unaligned_access; cc->get_phys_page_debug = alpha_cpu_get_phys_page_debug; dc->vmsd = &vmstate_alpha_cpu; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index dfb2398392..bd1882944c 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2283,11 +2283,11 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->debug_check_watchpoint = arm_debug_check_watchpoint; cc->do_unaligned_access = arm_cpu_do_unaligned_access; #if !defined(CONFIG_USER_ONLY) - cc->do_transaction_failed = arm_cpu_do_transaction_failed; + cc->tcg_ops.do_transaction_failed = arm_cpu_do_transaction_failed; cc->adjust_watchpoint_address = arm_adjust_watchpoint_address; cc->tcg_ops.do_interrupt = arm_cpu_do_interrupt; #endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ -#endif +#endif /* CONFIG_TCG */ } #ifdef CONFIG_KVM diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 69093a621f..e68b933c84 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -473,7 +473,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) cc->gdb_write_register = m68k_cpu_gdb_write_register; cc->tcg_ops.tlb_fill = m68k_cpu_tlb_fill; #if defined(CONFIG_SOFTMMU) - cc->do_transaction_failed = m68k_cpu_transaction_failed; + cc->tcg_ops.do_transaction_failed = m68k_cpu_transaction_failed; cc->get_phys_page_debug = m68k_cpu_get_phys_page_debug; dc->vmsd = &vmstate_m68k_cpu; #endif diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index c93e44b8e5..e405f6422d 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -374,7 +374,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_write_register = mb_cpu_gdb_write_register; cc->tcg_ops.tlb_fill = mb_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->do_transaction_failed = mb_cpu_transaction_failed; + cc->tcg_ops.do_transaction_failed = mb_cpu_transaction_failed; cc->get_phys_page_attrs_debug = mb_cpu_get_phys_page_attrs_debug; dc->vmsd = &vmstate_mb_cpu; #endif diff --git a/target/mips/cpu.c b/target/mips/cpu.c index a88a138a8d..ed2a7664e9 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -681,7 +681,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->gdb_read_register = mips_cpu_gdb_read_register; cc->gdb_write_register = mips_cpu_gdb_write_register; #ifndef CONFIG_USER_ONLY - cc->do_transaction_failed = mips_cpu_do_transaction_failed; cc->do_unaligned_access = mips_cpu_do_unaligned_access; cc->get_phys_page_debug = mips_cpu_get_phys_page_debug; cc->vmsd = &vmstate_mips_cpu; @@ -693,6 +692,9 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->tcg_ops.cpu_exec_interrupt = mips_cpu_exec_interrupt; cc->tcg_ops.synchronize_from_tb = mips_cpu_synchronize_from_tb; cc->tcg_ops.tlb_fill = mips_cpu_tlb_fill; +#ifndef CONFIG_USER_ONLY + cc->tcg_ops.do_transaction_failed = mips_cpu_do_transaction_failed; +#endif /* CONFIG_USER_ONLY */ #endif /* CONFIG_TCG */ cc->gdb_num_core_regs = 73; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 345b78fc3d..9a23af9a9d 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -609,7 +609,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->gdb_stop_before_watchpoint = true; cc->disas_set_info = riscv_cpu_disas_set_info; #ifndef CONFIG_USER_ONLY - cc->do_transaction_failed = riscv_cpu_do_transaction_failed; + cc->tcg_ops.do_transaction_failed = riscv_cpu_do_transaction_failed; cc->do_unaligned_access = riscv_cpu_do_unaligned_access; cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug; /* For now, mark unmigratable: */ diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index f8350f5f78..2f43939fb6 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -671,7 +671,7 @@ void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr, env->badaddr = addr; riscv_raise_exception(env, cs->exception_index, retaddr); } -#endif +#endif /* !CONFIG_USER_ONLY */ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 871b2a83c6..8d6d7c1f83 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -875,7 +875,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_write_register = sparc_cpu_gdb_write_register; cc->tcg_ops.tlb_fill = sparc_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->do_transaction_failed = sparc_cpu_do_transaction_failed; + cc->tcg_ops.do_transaction_failed = sparc_cpu_do_transaction_failed; cc->do_unaligned_access = sparc_cpu_do_unaligned_access; cc->get_phys_page_debug = sparc_cpu_get_phys_page_debug; cc->vmsd = &vmstate_sparc_cpu; diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 3ff025f0fe..fc52fde696 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -205,7 +205,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) #ifndef CONFIG_USER_ONLY cc->do_unaligned_access = xtensa_cpu_do_unaligned_access; cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug; - cc->do_transaction_failed = xtensa_cpu_do_transaction_failed; + cc->tcg_ops.do_transaction_failed = xtensa_cpu_do_transaction_failed; #endif cc->tcg_ops.debug_excp_handler = xtensa_breakpoint_handler; cc->disas_set_info = xtensa_cpu_disas_set_info; diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 05e2b7f70a..eeffee297d 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -261,7 +261,7 @@ bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, cpu_loop_exit_restore(cs, retaddr); } -#else +#else /* !CONFIG_USER_ONLY */ void xtensa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, @@ -337,4 +337,4 @@ void xtensa_runstall(CPUXtensaState *env, bool runstall) qemu_cpu_kick(cpu); } } -#endif +#endif /* !CONFIG_USER_ONLY */ From patchwork Fri Feb 5 22:56:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377025 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2589113ejt; Fri, 5 Feb 2021 15:25:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLTCVZAofv0JBZGPB31I9Ir+f8WKckjzz6VRnknz96WmSUd/R3nwVLPUTBlpJ99NeYzkTe X-Received: by 2002:a25:fc1a:: with SMTP id v26mr8295545ybd.331.1612567535981; Fri, 05 Feb 2021 15:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567535; cv=none; d=google.com; s=arc-20160816; b=oyihdNS44ESEEJ2bxTGjg+l60q4PnMDPles/YOTrFECSzYcWYIks8r6fLsv1Fy5WmG 0BHW97DgowSR2LkUvde/lrPb1kr7BZ8mxzyInYRuiujqUs4broetfYQCYhN/m+Npoc7u Fskno6BmLSdccPrL/uGATEbT1yl5trvdBjsOay4+ty0XAnmra2lqFAy2w5EO8nnQ2GME CX7HVIRRaxBCatm3IXdNieGmU9VBZiEXTsvgWR+kcjm4MsWf5bavGYN428sNy+bqW7za Kv+263xZcuIa96syjJKv8dm/yaoDfO5UNMIMIocKsrmSzOlfGGLH6cuIio45/Y+3Mkcy dvuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=FcCELB2kKFhziXG0pF3hQfmZ0calh6Fx/iI1uJGJgvk=; b=HNtLu7YVsS2Q9nm7mm5BMnpt7VnjCFv9i9CssX+kVScBSJhHj809CZUdNwTrkJnKSb 1mKSM+pL2kqRkIHjXuirhpPg4ANTXNz9aY0RzIViaUzmWW0u425PLUyl15KCXyK2hgLU QkvlJoKLPrdZG4v7FLqL0E5LMYR8TxxCPFi2H8CQnsTlVdS92epzA6NQkajONhNUgAGT gxd8D1bmj6+R2KPSO2S4UY2/IK2r1Vap8h2HZ3eMd8i8JGOcMULPzZdEIq0luPzKatFH taFDOrxUwDqFSNAxvmNLvE7+aECKCQ9xYBKfIhLI94nzKC1AjMkTtA93KSP/UpYRUJB/ zXUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hI6D+B2D; 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=fail (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 e133si9563938yba.267.2021.02.05.15.25.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:25:35 -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=fail header.i=@linaro.org header.s=google header.b=hI6D+B2D; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8ATn-0005Qd-Bz for patch@linaro.org; Fri, 05 Feb 2021 18:25:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3I-0002np-PF for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:12 -0500 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:33117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3G-0003ex-Iz for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:12 -0500 Received: by mail-pf1-x42c.google.com with SMTP id o20so5326245pfu.0 for ; Fri, 05 Feb 2021 14:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FcCELB2kKFhziXG0pF3hQfmZ0calh6Fx/iI1uJGJgvk=; b=hI6D+B2D9m0g7maDq+dl+sfYVEnlA6khmnzc41UnpvMd1yt9a0oWkJ34uak3CrMiRv ZiI/0vZ3tiwb/Cde0yjTN7H3HjDXetvte+xCA4oQorPuVQG0M7KGJeLz8nIAyXhd8G5b mbLKqwKS/TFbd1dmQW9aBBCX7oUqUuTEgSYLWm3buP92TEZzhkM2+90IfXWEZysvRFyI 5oGKHaNHnNsseYeH/hkZNbJdPcyn5rQxpR/JklAeqWAi3rlJMcHn2yMaj7hGyt94GtkC WR3kYGmWEy314vj1EcYmnBH/lKGNKXg4dlRwI/9nZJ4WthxzB2Ui7MtboH+C4u+Z5hHx hXCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FcCELB2kKFhziXG0pF3hQfmZ0calh6Fx/iI1uJGJgvk=; b=Ta5nV+mWr+Quyc7JSfdiQjkWm2m8GAJ/0Cke7ePchUAu3juZuAbp4XAyciPsjrugfd 3lKFVicyANA8CeA7uEvp4vX6Xtf0jOSQErE7HyAOVkqi2FHYuayJx6Y6gW3FNlIdyxn9 Buqy89UEggIKMBdYo+obsGEVp7I+RoK/8JNJaG4KVSmD7E3kjb7tmUbGtEAXMrzdIFmQ w2VFeeYBnu78mJRZYehmEp15QDY2GNNoakr8kSxZS7pAM+5CwJoRupJ1NBWqNQARgrYA 0KWqMALhU3UKp2K1cXAGIhGPePnr0IJ6rfuC9zSpusGEHhetEOKzoXXDWgnEfjFY6ju8 0IMQ== X-Gm-Message-State: AOAM530HZ48p/tp60QWlKtrvq0f0va5yzaalwubInKvgWeikwGcUyFdl NIvS5jjRhx5cklvxawztDjZ8EzXbCtaK/v0q X-Received: by 2002:aa7:8d12:0:b029:1ae:4344:3b4f with SMTP id j18-20020aa78d120000b02901ae43443b4fmr6292782pfe.16.1612565887803; Fri, 05 Feb 2021 14:58:07 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 39/46] cpu: move do_unaligned_access to tcg_ops Date: Fri, 5 Feb 2021 12:56:43 -1000 Message-Id: <20210205225650.1330794-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana make it consistently SOFTMMU-only. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson [claudio: make the field presence in cpu.h unconditional, removing the ifdefs] Message-Id: <20210204163931.7358-12-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 13 +++++++------ target/alpha/cpu.c | 2 +- target/arm/cpu.c | 2 +- target/hppa/cpu.c | 4 +++- target/microblaze/cpu.c | 2 +- target/mips/cpu.c | 3 ++- target/nios2/cpu.c | 2 +- target/riscv/cpu.c | 2 +- target/s390x/cpu.c | 2 +- target/s390x/excp_helper.c | 2 +- target/sh4/cpu.c | 2 +- target/sparc/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- target/ppc/translate_init.c.inc | 2 +- 14 files changed, 23 insertions(+), 19 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 41ce1daefc..063814eaa4 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -130,6 +130,12 @@ typedef struct TcgCpuOperations { unsigned size, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr); + /** + * @do_unaligned_access: Callback for unaligned access handling + */ + void (*do_unaligned_access)(CPUState *cpu, vaddr addr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr); } TcgCpuOperations; /** @@ -139,8 +145,6 @@ typedef struct TcgCpuOperations { * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. * @has_work: Callback for checking if there is work to do. - * @do_unaligned_access: Callback for unaligned access handling, if - * the target defines #TARGET_ALIGNED_ONLY. * @virtio_is_big_endian: Callback to return %true if a CPU which supports * runtime configurable endianness is currently big-endian. Non-configurable * CPUs can use the default implementation of this method. This method should @@ -206,9 +210,6 @@ struct CPUClass { int reset_dump_flags; bool (*has_work)(CPUState *cpu); - void (*do_unaligned_access)(CPUState *cpu, vaddr addr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr); bool (*virtio_is_big_endian)(CPUState *cpu); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, uint8_t *buf, int len, bool is_write); @@ -887,7 +888,7 @@ static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr, { CPUClass *cc = CPU_GET_CLASS(cpu); - cc->do_unaligned_access(cpu, addr, access_type, mmu_idx, retaddr); + cc->tcg_ops.do_unaligned_access(cpu, addr, access_type, mmu_idx, retaddr); } static inline void cpu_transaction_failed(CPUState *cpu, hwaddr physaddr, diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index a1696bebeb..0710298e5a 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -226,7 +226,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.tlb_fill = alpha_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->tcg_ops.do_transaction_failed = alpha_cpu_do_transaction_failed; - cc->do_unaligned_access = alpha_cpu_do_unaligned_access; + cc->tcg_ops.do_unaligned_access = alpha_cpu_do_unaligned_access; cc->get_phys_page_debug = alpha_cpu_get_phys_page_debug; dc->vmsd = &vmstate_alpha_cpu; #endif diff --git a/target/arm/cpu.c b/target/arm/cpu.c index bd1882944c..aa264eec0a 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2281,9 +2281,9 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.tlb_fill = arm_cpu_tlb_fill; cc->tcg_ops.debug_excp_handler = arm_debug_excp_handler; cc->debug_check_watchpoint = arm_debug_check_watchpoint; - cc->do_unaligned_access = arm_cpu_do_unaligned_access; #if !defined(CONFIG_USER_ONLY) cc->tcg_ops.do_transaction_failed = arm_cpu_do_transaction_failed; + cc->tcg_ops.do_unaligned_access = arm_cpu_do_unaligned_access; cc->adjust_watchpoint_address = arm_adjust_watchpoint_address; cc->tcg_ops.do_interrupt = arm_cpu_do_interrupt; #endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 68233acf53..fd7f849a1c 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -71,6 +71,7 @@ static void hppa_cpu_disas_set_info(CPUState *cs, disassemble_info *info) info->print_insn = print_insn_hppa; } +#ifndef CONFIG_USER_ONLY static void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) @@ -87,6 +88,7 @@ static void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, cpu_loop_exit_restore(cs, retaddr); } +#endif /* CONFIG_USER_ONLY */ static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) { @@ -150,9 +152,9 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.tlb_fill = hppa_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = hppa_cpu_get_phys_page_debug; + cc->tcg_ops.do_unaligned_access = hppa_cpu_do_unaligned_access; dc->vmsd = &vmstate_hppa_cpu; #endif - cc->do_unaligned_access = hppa_cpu_do_unaligned_access; cc->disas_set_info = hppa_cpu_disas_set_info; cc->tcg_ops.initialize = hppa_translate_init; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index e405f6422d..6678310f51 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -365,7 +365,6 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = mb_cpu_class_by_name; cc->has_work = mb_cpu_has_work; cc->tcg_ops.do_interrupt = mb_cpu_do_interrupt; - cc->do_unaligned_access = mb_cpu_do_unaligned_access; cc->tcg_ops.cpu_exec_interrupt = mb_cpu_exec_interrupt; cc->dump_state = mb_cpu_dump_state; cc->set_pc = mb_cpu_set_pc; @@ -375,6 +374,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.tlb_fill = mb_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->tcg_ops.do_transaction_failed = mb_cpu_transaction_failed; + cc->tcg_ops.do_unaligned_access = mb_cpu_do_unaligned_access; cc->get_phys_page_attrs_debug = mb_cpu_get_phys_page_attrs_debug; dc->vmsd = &vmstate_mb_cpu; #endif diff --git a/target/mips/cpu.c b/target/mips/cpu.c index ed2a7664e9..1e93e295cc 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -681,7 +681,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->gdb_read_register = mips_cpu_gdb_read_register; cc->gdb_write_register = mips_cpu_gdb_write_register; #ifndef CONFIG_USER_ONLY - cc->do_unaligned_access = mips_cpu_do_unaligned_access; cc->get_phys_page_debug = mips_cpu_get_phys_page_debug; cc->vmsd = &vmstate_mips_cpu; #endif @@ -694,6 +693,8 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->tcg_ops.tlb_fill = mips_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->tcg_ops.do_transaction_failed = mips_cpu_do_transaction_failed; + cc->tcg_ops.do_unaligned_access = mips_cpu_do_unaligned_access; + #endif /* CONFIG_USER_ONLY */ #endif /* CONFIG_TCG */ diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index b5fe779ceb..c43aa3d4c4 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -228,7 +228,7 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) cc->disas_set_info = nios2_cpu_disas_set_info; cc->tcg_ops.tlb_fill = nios2_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->do_unaligned_access = nios2_cpu_do_unaligned_access; + cc->tcg_ops.do_unaligned_access = nios2_cpu_do_unaligned_access; cc->get_phys_page_debug = nios2_cpu_get_phys_page_debug; #endif cc->gdb_read_register = nios2_cpu_gdb_read_register; diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 9a23af9a9d..5e85fd58b6 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -610,7 +610,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->disas_set_info = riscv_cpu_disas_set_info; #ifndef CONFIG_USER_ONLY cc->tcg_ops.do_transaction_failed = riscv_cpu_do_transaction_failed; - cc->do_unaligned_access = riscv_cpu_do_unaligned_access; + cc->tcg_ops.do_unaligned_access = riscv_cpu_do_unaligned_access; cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug; /* For now, mark unmigratable: */ cc->vmsd = &vmstate_riscv_cpu; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index e6cf933594..a723ede8d1 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -510,7 +510,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) #ifdef CONFIG_TCG cc->tcg_ops.cpu_exec_interrupt = s390_cpu_exec_interrupt; cc->tcg_ops.debug_excp_handler = s390x_cpu_debug_excp_handler; - cc->do_unaligned_access = s390x_cpu_do_unaligned_access; + cc->tcg_ops.do_unaligned_access = s390x_cpu_do_unaligned_access; #endif #endif cc->disas_set_info = s390_cpu_disas_set_info; diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index 9cf66d3690..ce16af394b 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -634,4 +634,4 @@ void HELPER(monitor_call)(CPUS390XState *env, uint64_t monitor_code, } } -#endif /* CONFIG_USER_ONLY */ +#endif /* !CONFIG_USER_ONLY */ diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index f69360fc16..292152b562 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -228,7 +228,7 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_write_register = superh_cpu_gdb_write_register; cc->tcg_ops.tlb_fill = superh_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->do_unaligned_access = superh_cpu_do_unaligned_access; + cc->tcg_ops.do_unaligned_access = superh_cpu_do_unaligned_access; cc->get_phys_page_debug = superh_cpu_get_phys_page_debug; #endif cc->disas_set_info = superh_cpu_disas_set_info; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 8d6d7c1f83..1b785f60df 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -876,7 +876,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.tlb_fill = sparc_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->tcg_ops.do_transaction_failed = sparc_cpu_do_transaction_failed; - cc->do_unaligned_access = sparc_cpu_do_unaligned_access; + cc->tcg_ops.do_unaligned_access = sparc_cpu_do_unaligned_access; cc->get_phys_page_debug = sparc_cpu_get_phys_page_debug; cc->vmsd = &vmstate_sparc_cpu; #endif diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index fc52fde696..4b6381569f 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -203,7 +203,7 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_stop_before_watchpoint = true; cc->tcg_ops.tlb_fill = xtensa_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->do_unaligned_access = xtensa_cpu_do_unaligned_access; + cc->tcg_ops.do_unaligned_access = xtensa_cpu_do_unaligned_access; cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug; cc->tcg_ops.do_transaction_failed = xtensa_cpu_do_transaction_failed; #endif diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc index b16430a9d4..27ab243c6e 100644 --- a/target/ppc/translate_init.c.inc +++ b/target/ppc/translate_init.c.inc @@ -10850,7 +10850,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) cc->set_pc = ppc_cpu_set_pc; cc->gdb_read_register = ppc_cpu_gdb_read_register; cc->gdb_write_register = ppc_cpu_gdb_write_register; - cc->do_unaligned_access = ppc_cpu_do_unaligned_access; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = ppc_cpu_get_phys_page_debug; cc->vmsd = &vmstate_ppc_cpu; @@ -10887,6 +10886,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #ifndef CONFIG_USER_ONLY cc->tcg_ops.cpu_exec_enter = ppc_cpu_exec_enter; cc->tcg_ops.cpu_exec_exit = ppc_cpu_exec_exit; + cc->tcg_ops.do_unaligned_access = ppc_cpu_do_unaligned_access; #endif /* !CONFIG_USER_ONLY */ #endif /* CONFIG_TCG */ From patchwork Fri Feb 5 22:56:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377030 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2590981ejt; Fri, 5 Feb 2021 15:29:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJz30otLDyZlrlUAeRqOkCs+mftmgrRxN/YoFxC+IbT1ja6j5Rk8xmVsct9fVS6HYR5t2QzG X-Received: by 2002:a25:b3c2:: with SMTP id x2mr9513770ybf.304.1612567760281; Fri, 05 Feb 2021 15:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567760; cv=none; d=google.com; s=arc-20160816; b=MuQPdnfOEUHoHaGc6V3l53u8nZgZZAMfZDtSPpc3OTEmuXEuXVLeCvdTLiE6Lr7Es5 DoQ0DH6NF3topr+E2nH2rXGNgvpFOo7JrXsLbMgcGCpvWQsJjxKqj+zcqOhf80XLo8nH WRRakdgA0byamIa5kYP2nP71huC0TZ53YI2K7tUyWM+KxfN7YmhY6gdEZctjwOsjvSgz wyM9WgtDUMK1uFfyjr8Z0CpSSpXc/U7qyTj91l3Skcm8c1o/9jffqBTh+eAMhR9TiOdW fzJ/sDx2hxLRN/bTYccsFyL+mSEP/7hndrWAKJowk88mTiyxCNeSP4d3abQMjOZfXAGB 7HcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=cBSZecFHJJp/usGc+3/heP75DKhmYnZ0kaH0ekZQKBs=; b=CegwF/kjrhMHOCX5D5hqKEgaE+DVM3t/79ZZhUAZTU3Bu21hbwkKnSsOn/reZcm/tj VHuewjEtIOYL12oiHPtW4Bcrk/k1wLHumKu0PdQj+ZsrxNfvE/QL5LHwlnnBDOTZI2V6 CZiZkBGJ+pTO2uK8+F34mbRyLo3BMEUlgK9nFa2Rw9+nZmYKus9f35gCASB4KShjdyAr 1VSCswOl1L2LPlfaffeuQwHHvPWvqpMSNLOVOlV8CpzLjY8ZxWFBSBmeqZxo9f6zHSOQ Q3t4whqU6skfEG911VgfaPA+sFRNhltFfbx1CDo3k5L+F5ZB1qKYHPnksLO+0CykNYVa CUkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JGy7VPrH; 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=fail (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 n190si12098895ybn.445.2021.02.05.15.29.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:29:20 -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=fail header.i=@linaro.org header.s=google header.b=JGy7VPrH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AXP-0000i0-MP for patch@linaro.org; Fri, 05 Feb 2021 18:29:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3J-0002oc-1k for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:13 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:37879) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3H-0003g0-7r for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:12 -0500 Received: by mail-pg1-x532.google.com with SMTP id z21so5586060pgj.4 for ; Fri, 05 Feb 2021 14:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cBSZecFHJJp/usGc+3/heP75DKhmYnZ0kaH0ekZQKBs=; b=JGy7VPrHFvp6Q5MFOHFT7S+4keAzms7339nHI3a/B2GazBwJY8NXdWPHU4G8shMB6F IjTaGvuJjc/qM4oHqXO0f7HarSFamue0w0DJ8Ln0ggUVssIXcsJKiKkvZSVobSzYcWmV GpL2EHXalAHQLrKax+Tf1lFxorkg5I8WlWtUscAqctbGG/f55+wjXn786DRzOzhBdh7W BWyAz4vwExVcAQ0nPjLuYascgX2ym1qEbSfuEbHVZR/Bd89y8hpIOl72XaBJi+Y8wSuq +8h/+s8oihx6o2lQ/agricg023jkX+xkbpncEA9ZIBabOCSrIMUeW4aQJq/aqgBjPLW7 ODYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cBSZecFHJJp/usGc+3/heP75DKhmYnZ0kaH0ekZQKBs=; b=UwRLnJPFEMziWnp7iqZrzpasIX9vufIk6XuBHXHKaA7yjxA0khLDP2FVD/S/NkZ10M AmtjXJ78NlKeMjs+SdYUiyZ3mNIv+AV0PMBqQbA10piUkq0CP/6rdIOkXpcpLCgVa8Bn aiSzf5CRBfJC9aDylio4oZnv2dMNmtPWLwGNNFQy53gGBA1Y2hoMsZ9UMsfbnvTgmIe/ 3rnAfEMH3OVhu9h+VilC2lW+nGm5ominyQ+GBvRvqoRNCoc5phnwm43HT7rD4uq4k209 9ho6SLyAuzL7okqLZCln+sQtP6Z8RBTFTktp4HnnF/fZojZIgzGrB8i5M2nT9TcPSKDH QAOA== X-Gm-Message-State: AOAM533ZECa0WrUY/phXKnyZlZYp/0h9w1me6YDsSCrQFNid7VtOmwVx 7GN1agF2sq8W40ZEAHod5tm60WEiK/yCZZ3q X-Received: by 2002:aa7:8bce:0:b029:1b8:f395:87a with SMTP id s14-20020aa78bce0000b02901b8f395087amr6500518pfd.36.1612565889820; Fri, 05 Feb 2021 14:58:09 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 40/46] physmem: make watchpoint checking code TCG-only Date: Fri, 5 Feb 2021 12:56:44 -1000 Message-Id: <20210205225650.1330794-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana cpu_check_watchpoint, watchpoint_address_matches are TCG-only. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Message-Id: <20210204163931.7358-13-cfontana@suse.de> Signed-off-by: Richard Henderson --- softmmu/physmem.c | 141 +++++++++++++++++++++++----------------------- 1 file changed, 72 insertions(+), 69 deletions(-) -- 2.25.1 diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 60760a3bdc..51ed600bf9 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -840,6 +840,7 @@ void cpu_watchpoint_remove_all(CPUState *cpu, int mask) } } +#ifdef CONFIG_TCG /* Return true if this watchpoint address matches the specified * access (ie the address range covered by the watchpoint overlaps * partially or completely with the address range covered by the @@ -873,6 +874,77 @@ int cpu_watchpoint_address_matches(CPUState *cpu, vaddr addr, vaddr len) return ret; } +/* Generate a debug exception if a watchpoint has been hit. */ +void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, + MemTxAttrs attrs, int flags, uintptr_t ra) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + CPUWatchpoint *wp; + + assert(tcg_enabled()); + if (cpu->watchpoint_hit) { + /* + * We re-entered the check after replacing the TB. + * Now raise the debug interrupt so that it will + * trigger after the current instruction. + */ + qemu_mutex_lock_iothread(); + cpu_interrupt(cpu, CPU_INTERRUPT_DEBUG); + qemu_mutex_unlock_iothread(); + return; + } + + addr = cc->adjust_watchpoint_address(cpu, addr, len); + QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) { + if (watchpoint_address_matches(wp, addr, len) + && (wp->flags & flags)) { + if (replay_running_debug()) { + /* + * Don't process the watchpoints when we are + * in a reverse debugging operation. + */ + replay_breakpoint(); + return; + } + if (flags == BP_MEM_READ) { + wp->flags |= BP_WATCHPOINT_HIT_READ; + } else { + wp->flags |= BP_WATCHPOINT_HIT_WRITE; + } + wp->hitaddr = MAX(addr, wp->vaddr); + wp->hitattrs = attrs; + if (!cpu->watchpoint_hit) { + if (wp->flags & BP_CPU && + !cc->debug_check_watchpoint(cpu, wp)) { + wp->flags &= ~BP_WATCHPOINT_HIT; + continue; + } + cpu->watchpoint_hit = wp; + + mmap_lock(); + tb_check_watchpoint(cpu, ra); + if (wp->flags & BP_STOP_BEFORE_ACCESS) { + cpu->exception_index = EXCP_DEBUG; + mmap_unlock(); + cpu_loop_exit_restore(cpu, ra); + } else { + /* Force execution of one insn next time. */ + cpu->cflags_next_tb = 1 | curr_cflags(); + mmap_unlock(); + if (ra) { + cpu_restore_state(cpu, ra, true); + } + cpu_loop_exit_noexc(cpu); + } + } + } else { + wp->flags &= ~BP_WATCHPOINT_HIT; + } + } +} + +#endif /* CONFIG_TCG */ + /* Called from RCU critical section */ static RAMBlock *qemu_get_ram_block(ram_addr_t addr) { @@ -2359,75 +2431,6 @@ ram_addr_t qemu_ram_addr_from_host(void *ptr) return block->offset + offset; } -/* Generate a debug exception if a watchpoint has been hit. */ -void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, - MemTxAttrs attrs, int flags, uintptr_t ra) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - CPUWatchpoint *wp; - - assert(tcg_enabled()); - if (cpu->watchpoint_hit) { - /* - * We re-entered the check after replacing the TB. - * Now raise the debug interrupt so that it will - * trigger after the current instruction. - */ - qemu_mutex_lock_iothread(); - cpu_interrupt(cpu, CPU_INTERRUPT_DEBUG); - qemu_mutex_unlock_iothread(); - return; - } - - addr = cc->adjust_watchpoint_address(cpu, addr, len); - QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) { - if (watchpoint_address_matches(wp, addr, len) - && (wp->flags & flags)) { - if (replay_running_debug()) { - /* - * Don't process the watchpoints when we are - * in a reverse debugging operation. - */ - replay_breakpoint(); - return; - } - if (flags == BP_MEM_READ) { - wp->flags |= BP_WATCHPOINT_HIT_READ; - } else { - wp->flags |= BP_WATCHPOINT_HIT_WRITE; - } - wp->hitaddr = MAX(addr, wp->vaddr); - wp->hitattrs = attrs; - if (!cpu->watchpoint_hit) { - if (wp->flags & BP_CPU && - !cc->debug_check_watchpoint(cpu, wp)) { - wp->flags &= ~BP_WATCHPOINT_HIT; - continue; - } - cpu->watchpoint_hit = wp; - - mmap_lock(); - tb_check_watchpoint(cpu, ra); - if (wp->flags & BP_STOP_BEFORE_ACCESS) { - cpu->exception_index = EXCP_DEBUG; - mmap_unlock(); - cpu_loop_exit_restore(cpu, ra); - } else { - /* Force execution of one insn next time. */ - cpu->cflags_next_tb = 1 | curr_cflags(); - mmap_unlock(); - if (ra) { - cpu_restore_state(cpu, ra, true); - } - cpu_loop_exit_noexc(cpu); - } - } - } else { - wp->flags &= ~BP_WATCHPOINT_HIT; - } - } -} - static MemTxResult flatview_read(FlatView *fv, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len); static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs attrs, From patchwork Fri Feb 5 22:56:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377031 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2591425ejt; Fri, 5 Feb 2021 15:30:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyHm7Y2a7MGPl+GwyFmgpoT/VLPgYINTaHgb9/rVtkUdffKr69IvNXihVi08iWvDc4vJNq X-Received: by 2002:a25:d4c7:: with SMTP id m190mr9991428ybf.174.1612567809001; Fri, 05 Feb 2021 15:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567808; cv=none; d=google.com; s=arc-20160816; b=XKjoGxs2kpVeAiE5oeOmhf+TofxL9BuvDSuftyfjlhUHrPxSxrzESkjahYr+hQg4ma cm5YND3K5X7p463KwIViHSk6AY65UZr266N09dUejTXcxpHfpU37EjhxbDSW9r9t/QPm R66sDkLKyCSQSI/ynRXw1m78ldir3rGStxqeWo6x+FqC31VDe5mTc94lLfsE2s6+XB1c /gX1fOmF1qQX0BrlHlqI8rJacIsbXBSn79d62N3cpiFchgSAooeIkZ9ImGAR8CKHlZ1I Zw4j3l7UMWD1c8MSv9KotXXT309H+kDH7+eZ8rHYGld0blTh6u84arWX2IAF1cmvVyTi xrlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=TB1xKftdAin96vEzndzCr5EtfRDX0MhFc87zNoWIuTY=; b=YAJaj4aXAK7C50aP2nUJGw09Ucj4HTxxlOz1oerM0yPgKpWocbTdriPpUg/P7r50HE Z0VGHx6b/NE1pkBnNQHN7AqkOdmSFj8pKgYDBBrbM/4PQP0PgvI/Iy1MX6fjzDAou9Vo 9Lv6gQ0mLpzXIwUKbJA+ky5tnE9PZ57wG1jwO/kkphlzz2PuqYkxOp12UmYJ4oWBsAI9 OIufFOydWiswjE2VPd+IB3ZJKzELlgbuGXt8CxvH3Gc1X+v5+KFjpLhED93+ZmbGexwW 2SnGtsTnOH5xzLBflgaWRKv8fHpuiaTTKzAeNiWUEyQvrdByjPjV6MA7d9PnWNlaUhie vCzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=r6Ss6O93; 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=fail (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 i16si10374442ybq.31.2021.02.05.15.30.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:30:08 -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=fail header.i=@linaro.org header.s=google header.b=r6Ss6O93; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AYC-0001rG-DJ for patch@linaro.org; Fri, 05 Feb 2021 18:30:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3L-0002rp-Ro for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:15 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:40847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3J-0003h9-4l for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:15 -0500 Received: by mail-pf1-x432.google.com with SMTP id i63so5297553pfg.7 for ; Fri, 05 Feb 2021 14:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TB1xKftdAin96vEzndzCr5EtfRDX0MhFc87zNoWIuTY=; b=r6Ss6O93kX6PunhBqd8+Ntul2yab1i5L6opEqWIm0Q/+bjUvytC1YMEkWQ70KnVYlB 4fcMTWAUWqdovXyJBI56BUfJrUBm0oR5JRqpwe3aNb6R2htwKhnldrtQWj1ueYP5dxY/ YEx9iXvUAZVClEXI1Lrs+H2TmzG9MdqArjc7q6URo/WvEEs4FWMAzPMmwG5LF3AuFFp+ h1nmTiDegvNvVhmYN4iBStGsA8dcs7WkgS5XzlRRz1PQGrrpKysgnvGylS2KWFJlfEPx jfb457O+wMSHMoAInjo7dB5gM2izk6e79u+0oQjH+GaZppw03ctWZbSLZjGmqT+70gI2 UQGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TB1xKftdAin96vEzndzCr5EtfRDX0MhFc87zNoWIuTY=; b=lK2BaOjaCa0vqwCBy/km6iJuNtYuEha8ya5Shh67/FPH8dhnOyMOv8InhOeeazjHvH AIZegHTt8NdTsBmOoCyRPlm4G3uy4bO/ZfPnUHPQ5hchZhJpY37VeLJ/jYeA7Q/6puCt CXw72EFlw5koHMf+KleXO4nR57u/qv5Bj2Z65J9j/w5AV2lhyeyL0Ut3HkHjIB2ZlH0j fLRod/RMpXCmwifYGNmMVZ+445SlN02oPNg8Vd198c9HXgQh1tJHXpsQLp4pDCp8DnEG j8GzVt2jtlsFHGZMLncbs877W4KKGut7/M408qVMO33Pp8RL5zvqB9t/A+0Mw1vLi5mC HizQ== X-Gm-Message-State: AOAM532qoBqSKO+frD+ic0oFjgvai9kBzs8W1/Lwbx+rrNKRXUi4BFzH DsWoys0hGvGGZMljnSihhqaUU7KCln2bSwkS X-Received: by 2002:a63:1214:: with SMTP id h20mr6282220pgl.379.1612565891873; Fri, 05 Feb 2021 14:58:11 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 41/46] cpu: move adjust_watchpoint_address to tcg_ops Date: Fri, 5 Feb 2021 12:56:45 -1000 Message-Id: <20210205225650.1330794-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana commit 40612000599e ("arm: Correctly handle watchpoints for BE32 CPUs") introduced this ARM-specific, TCG-specific hack to adjust the address, before checking it with cpu_check_watchpoint. Make adjust_watchpoint_address optional and move it to tcg_ops. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Message-Id: <20210204163931.7358-14-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 6 +++++- hw/core/cpu.c | 6 ------ softmmu/physmem.c | 5 ++++- target/arm/cpu.c | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 063814eaa4..832dd26e92 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -136,6 +136,11 @@ typedef struct TcgCpuOperations { void (*do_unaligned_access)(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); + /** + * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM + */ + vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len); + } TcgCpuOperations; /** @@ -244,7 +249,6 @@ struct CPUClass { const char * (*gdb_get_dynamic_xml)(CPUState *cpu, const char *xmlname); void (*disas_set_info)(CPUState *cpu, disassemble_info *info); - vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len); const char *deprecation_note; /* Keep non-pointer data at the end to minimize holes. */ diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 57542b6906..3d5bf9fe02 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -383,11 +383,6 @@ static int64_t cpu_common_get_arch_id(CPUState *cpu) return cpu->cpu_index; } -static vaddr cpu_adjust_watchpoint_address(CPUState *cpu, vaddr addr, int len) -{ - return addr; -} - static Property cpu_common_props[] = { #ifndef CONFIG_USER_ONLY /* Create a memory property for softmmu CPU object, @@ -421,7 +416,6 @@ static void cpu_class_init(ObjectClass *klass, void *data) k->gdb_write_register = cpu_common_gdb_write_register; k->virtio_is_big_endian = cpu_common_virtio_is_big_endian; k->debug_check_watchpoint = cpu_common_debug_check_watchpoint; - k->adjust_watchpoint_address = cpu_adjust_watchpoint_address; set_bit(DEVICE_CATEGORY_CPU, dc->categories); dc->realize = cpu_common_realizefn; dc->unrealize = cpu_common_unrealizefn; diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 51ed600bf9..3d9a9c39bd 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -894,7 +894,10 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, return; } - addr = cc->adjust_watchpoint_address(cpu, addr, len); + if (cc->tcg_ops.adjust_watchpoint_address) { + /* this is currently used only by ARM BE32 */ + addr = cc->tcg_ops.adjust_watchpoint_address(cpu, addr, len); + } QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) { if (watchpoint_address_matches(wp, addr, len) && (wp->flags & flags)) { diff --git a/target/arm/cpu.c b/target/arm/cpu.c index aa264eec0a..2a14431065 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2284,7 +2284,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) #if !defined(CONFIG_USER_ONLY) cc->tcg_ops.do_transaction_failed = arm_cpu_do_transaction_failed; cc->tcg_ops.do_unaligned_access = arm_cpu_do_unaligned_access; - cc->adjust_watchpoint_address = arm_adjust_watchpoint_address; + cc->tcg_ops.adjust_watchpoint_address = arm_adjust_watchpoint_address; cc->tcg_ops.do_interrupt = arm_cpu_do_interrupt; #endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ #endif /* CONFIG_TCG */ From patchwork Fri Feb 5 22:56:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377026 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2589431ejt; Fri, 5 Feb 2021 15:26:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFiOgYA1z3J0MGhBxPcR3zMhvZWQLwML+V3/X6k7oBfYUc91+sUA1OcIA94iAegPGq3sbE X-Received: by 2002:a25:cb83:: with SMTP id b125mr9612870ybg.192.1612567577506; Fri, 05 Feb 2021 15:26:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567577; cv=none; d=google.com; s=arc-20160816; b=rqIamy4HTj8VTaEysLfyUINFrZDDGUHybTHzT0VLlbNQrCy0zNYHc2XCW/Bq3FnkfD ZBUQhHdAGNHlh5k0rfnHJexyPrb2aSZJUoVCo6ItK7AEV+tAMZn71fj2kCSlSmcbOonI UDxwyC4sBqXiMUAHtbvMDWfAXnThn3tlHhidYyVnVEr1cbP5nWvWfD6jdokMudI65yP+ L9qGWnOJyaXO6OWmlxWXkpPYQwaaUfU3hLUPMIbb+zTKlnrt+3+eV380nmwIDLWCn8tR wu5VPrFd8bA50+4eqVzsv4dg6agKTlj+yZQOoBE8NEAUQlbw2KAUAa7IuGjxLYVG1ZUM 3vtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=cw7C2/8Hm5Mq4WanVG/o7OnGCD6iSp3z66Fxb9TU/eA=; b=lLK9lcZKBAc/LNDDMLZMADd3m+uZ0A3FHTBoHoyJQyPB+3wB1kBWVyhR/jQpEwTZk5 P+0+8hqOT6AycSs7p3qkKhO6KBJglByPaR6Z690ERKEt/utcYSZlzU+xv173aH9s1ozs zWDA6MYG450p1uxydDf/AmdM2W47M0SnRzFiC5COHlUoAYxfFT3VfUthWWx4ajdNdqhY LlhGU4UXPLCXKIcXyRfhzjAC7mBXC0S6ba/HZPBdZGySnZDu2gV/WDJA4bHlVic/WgJ/ 1iKRvzI4Pvy6NbXapv7D4Zn1uIxQKgbQgZ2x4Ob1UtxKgu/UCSSgesMvO5jqMqFNEPse exEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uCtUDeQ+; 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=fail (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 e128si9911316ybc.362.2021.02.05.15.26.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:26:17 -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=fail header.i=@linaro.org header.s=google header.b=uCtUDeQ+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AUS-0005aT-SH for patch@linaro.org; Fri, 05 Feb 2021 18:26:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3O-0002y3-24 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:18 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:38288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3M-0003hi-3e for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:17 -0500 Received: by mail-pf1-x42a.google.com with SMTP id d26so4064767pfn.5 for ; Fri, 05 Feb 2021 14:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cw7C2/8Hm5Mq4WanVG/o7OnGCD6iSp3z66Fxb9TU/eA=; b=uCtUDeQ+1o1dpRkpPNWq6Duzwjjx1n8EcqVu0sjxq6hzZCRxTjkSwLuDaemCzrsWEc dSx1WlejbDZ6A0pOSqG/aNi0ZgeSJVt4HK/2f2oklKgDq95ijvz6rP2dHotokgzrmP67 7AL/n3q4TEaov/ycmrzpSY8p6GcHLp2FJGYws9obNgOdniDG2VNLmKplBP+A10dNDDuT wxilEZ9vdkUl9C/lF9G9sL5sahOtu92NToJ/OXNeFRPeSeq9G5Uw1w4TXh+vmOV/hVzv Wz3axF+HOXHkM+tgdEbctF9nxEUlvijJYK6M7jEYnsxeLsmgxlI0aeG0qssWwLCZhzE+ iuCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cw7C2/8Hm5Mq4WanVG/o7OnGCD6iSp3z66Fxb9TU/eA=; b=LOZHRufu1PXYw78Cdjv+UiJZr67xO2EIzTYjY5ztNUB5wSIvu+9WeTffmzQKbA0g5v xwDtVE2HCm0hXDPnnKPKAZR29IU7eRhicg8LXWhKLgPJh7qHEnQ7PRPxnjaCvBcmXA4O oDC9NT/TDt6CUXSqTFBmplrxr/OsBeq3qqi2IYLuK0PtARSrvQmOhHDVfSyW2D1xKBkk ZvL4Eh63boNRH+irEDBimgbyHRCEA4LUA0VZICJbJyczSm+2aeNC+X4jSLqhbVwBjFdu iXhJl/kIY28SvBORh2LABy9xqYjYW8iO++dXSSzMNKt6qvA8R6DYy0sZ92VhyLDMB9KB twfw== X-Gm-Message-State: AOAM531I4tEH38wJuX07ANwhJtyBoDR1BJaAV5Phr3/pj7bGw9NbEgu4 ql27U85j37duIKwCXPV3ukHylkXQBRozGB4m X-Received: by 2002:a63:4966:: with SMTP id y38mr6359004pgk.428.1612565893859; Fri, 05 Feb 2021 14:58:13 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 42/46] cpu: move debug_check_watchpoint to tcg_ops Date: Fri, 5 Feb 2021 12:56:46 -1000 Message-Id: <20210205225650.1330794-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana commit 568496c0c0f1 ("cpu: Add callback to check architectural") and commit 3826121d9298 ("target-arm: Implement checking of fired") introduced an ARM-specific hack for cpu_check_watchpoint. Make debug_check_watchpoint optional, and move it to tcg_ops. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Message-Id: <20210204163931.7358-15-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 9 ++++++--- accel/tcg/user-exec.c | 3 ++- hw/core/cpu.c | 9 --------- softmmu/physmem.c | 4 ++-- target/arm/cpu.c | 4 ++-- 5 files changed, 12 insertions(+), 17 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 832dd26e92..e76a49754d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -141,6 +141,12 @@ typedef struct TcgCpuOperations { */ vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len); + /** + * @debug_check_watchpoint: return true if the architectural + * watchpoint whose address has matched should really fire, used by ARM + */ + bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp); + } TcgCpuOperations; /** @@ -177,8 +183,6 @@ typedef struct TcgCpuOperations { * a memory access with the specified memory transaction attributes. * @gdb_read_register: Callback for letting GDB read a register. * @gdb_write_register: Callback for letting GDB write a register. - * @debug_check_watchpoint: Callback: return true if the architectural - * watchpoint whose address has matched should really fire. * @write_elf64_note: Callback for writing a CPU-specific ELF note to a * 64-bit VM coredump. * @write_elf32_qemunote: Callback for writing a CPU- and QEMU-specific ELF @@ -232,7 +236,6 @@ struct CPUClass { int (*asidx_from_attrs)(CPUState *cpu, MemTxAttrs attrs); int (*gdb_read_register)(CPUState *cpu, GByteArray *buf, int reg); int (*gdb_write_register)(CPUState *cpu, uint8_t *buf, int reg); - bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp); int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu, int cpuid, void *opaque); diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 5509dd53e9..9e6e188d19 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -187,7 +187,8 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info, clear_helper_retaddr(); cc = CPU_GET_CLASS(cpu); - cc->tcg_ops.tlb_fill(cpu, address, 0, access_type, MMU_USER_IDX, false, pc); + cc->tcg_ops.tlb_fill(cpu, address, 0, access_type, + MMU_USER_IDX, false, pc); g_assert_not_reached(); } diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 3d5bf9fe02..00330ba07d 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -186,14 +186,6 @@ static int cpu_common_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg) return 0; } -static bool cpu_common_debug_check_watchpoint(CPUState *cpu, CPUWatchpoint *wp) -{ - /* If no extra check is required, QEMU watchpoint match can be considered - * as an architectural match. - */ - return true; -} - static bool cpu_common_virtio_is_big_endian(CPUState *cpu) { return target_words_bigendian(); @@ -415,7 +407,6 @@ static void cpu_class_init(ObjectClass *klass, void *data) k->gdb_read_register = cpu_common_gdb_read_register; k->gdb_write_register = cpu_common_gdb_write_register; k->virtio_is_big_endian = cpu_common_virtio_is_big_endian; - k->debug_check_watchpoint = cpu_common_debug_check_watchpoint; set_bit(DEVICE_CATEGORY_CPU, dc->categories); dc->realize = cpu_common_realizefn; dc->unrealize = cpu_common_unrealizefn; diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 3d9a9c39bd..9e64cf7adf 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -917,8 +917,8 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, wp->hitaddr = MAX(addr, wp->vaddr); wp->hitattrs = attrs; if (!cpu->watchpoint_hit) { - if (wp->flags & BP_CPU && - !cc->debug_check_watchpoint(cpu, wp)) { + if (wp->flags & BP_CPU && cc->tcg_ops.debug_check_watchpoint && + !cc->tcg_ops.debug_check_watchpoint(cpu, wp)) { wp->flags &= ~BP_WATCHPOINT_HIT; continue; } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 2a14431065..c9a66d3103 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2280,12 +2280,12 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->tcg_ops.synchronize_from_tb = arm_cpu_synchronize_from_tb; cc->tcg_ops.tlb_fill = arm_cpu_tlb_fill; cc->tcg_ops.debug_excp_handler = arm_debug_excp_handler; - cc->debug_check_watchpoint = arm_debug_check_watchpoint; #if !defined(CONFIG_USER_ONLY) + cc->tcg_ops.do_interrupt = arm_cpu_do_interrupt; cc->tcg_ops.do_transaction_failed = arm_cpu_do_transaction_failed; cc->tcg_ops.do_unaligned_access = arm_cpu_do_unaligned_access; cc->tcg_ops.adjust_watchpoint_address = arm_adjust_watchpoint_address; - cc->tcg_ops.do_interrupt = arm_cpu_do_interrupt; + cc->tcg_ops.debug_check_watchpoint = arm_debug_check_watchpoint; #endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ #endif /* CONFIG_TCG */ } From patchwork Fri Feb 5 22:56:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377019 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2586120ejt; Fri, 5 Feb 2021 15:19:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5tkpeXavNQ6CEd6HG/9bNfOh/77aHNf0g2H9J8qadyysKaT0GzWahVWh8A2Vga1Ehts6/ X-Received: by 2002:a25:2341:: with SMTP id j62mr10277637ybj.217.1612567190453; Fri, 05 Feb 2021 15:19:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567190; cv=none; d=google.com; s=arc-20160816; b=P+6gUJxkdmIOtGKpENU4h0Z1a5yQ3Ec9RUGhac0EZfLAMww6DJIASfrNkt5G0A+OQo JntUbM9/6TXOSRcm6n1PAN53Xx/ijagZ3ZpWC1g7wA/igIVMoVVJRH99C/UU2JQMOaSZ EAPL/vgI6pnEKQF5iCmv7oFa7PEo7R2SJOnfPPpeqsy44eMw14egEdXytsiy3nURecKL C/H9WpBY3seqyf2BW8iznQ4GWSxgrg/oXSDAMt0k3QW+Jgf4NqyDhDD0KQ/KCR5lpxA4 ChmrXNeQcnqiacmFr8b9jVvkQ2vhXKUnOWA5X24ZKRY/0SNRuphmuxE6llM4A2Hm43iK se9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=CDNDNmQVrH9FyBtOR/vi1j3G0RlDrYz84M7eOMXNK0Y=; b=RZN9k0yxNmf3FGhPEcMXNQbwANI8J9GkqrB4IKugbNuwPBQyF3qIngtsj8FDqq8qT9 mLn8uQZF6/aTB5XFJ03O0jlQVYVCxlAzGzNL4Sp4uadT7klQ8eVZM3Hz9mjCsk5S5sZt DOvIjpZHQxM+joxa/OWnu2y2ZrdMlMGSZAWQBe/Kc3bH5aoEIaCeN6w/n6OXt0u+rUCA Q1VcCJb/vLtylwlv3BkSjprlsqgCyTN4D0263zgYKQhGeBl9csIzrjc0LzyUSXOXmFVd s09CrBD4soWOsV/OZxtVD/2gYQYtMvqtaT9p6HW+bMbTe4ghDrvnJkFhfHKOQIe2g5cr dSXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gCzSHseh; 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 f36si10944813ybi.328.2021.02.05.15.19.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:19:50 -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=gCzSHseh; 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]:53110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AOD-0006AL-Iz for patch@linaro.org; Fri, 05 Feb 2021 18:19:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3U-0003BM-0l for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:24 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:34052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3O-0003jJ-0g for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:23 -0500 Received: by mail-pg1-x536.google.com with SMTP id o7so5598067pgl.1 for ; Fri, 05 Feb 2021 14:58:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CDNDNmQVrH9FyBtOR/vi1j3G0RlDrYz84M7eOMXNK0Y=; b=gCzSHsehdILOE8mmsaXoi6yj6ZWep+nzraEGSf8qESevsMx1qaKSAHkU6CWg3o+hj4 khYnbWh3qGzFQynXaFGkaWp0MBVxUVGVpLo2K5eohf5HIZrGbG2YE8E6D+xn63Zc39q7 7Oh9z6zvhS+GL75SArTIAPWEZNHlp0WXWG6IXLfvjrViMBWf1+JzV9dy1eYiXfILFEqY I1yAWzIC4zCNfyq0liH+nu3kSG8cR5mAPbTYKgUTYRPzsLqjsuiylUnBwFxhMx9Rjzo3 qCPFJLos6JcxkVRA4SnvUMbmWtFTGPVT0IrbvyP2ZTGtZ2g9MOMaqIe6vNvxDHQhOygK ES8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CDNDNmQVrH9FyBtOR/vi1j3G0RlDrYz84M7eOMXNK0Y=; b=IHNR2LGQl5Jvv4irDRnynh+DUd1PKBLS4WdMYPl5LK+HUs2PtJ7edH9FgRJAolmr3a uQTEC0bcuhM3vUXfEKhfa0WMp32bS6QexxNqVfLJFRtZqCe6j2+kfkgSZb0dh6VhxVrk zjl+E4NBxdT1YdeR2Rx/OWJ5JfrThollcqtBnnIDPUb+QFyxJz7me4a1vBeqvQVxFUUn nVgWEg4iJhAOv45Lu8M5TBjcWw9+gkABDdOZfGnJBokpFOvsjKZ94YETMDH5HsLQxdt3 ECsysqPTaDDgxddXqC5Ni45XmsX4v+/cbIhEcxgnmvvkCVb8GBXHqRnsjGdkTEFOX/f6 w72Q== X-Gm-Message-State: AOAM532rpx1zzIKCRt/+LtUZmVX65+sXZVmAxJlEa3XfAn4Z0bonZ3V8 Z0jhY2f1jkxq1s417b7laNoJOwiq7Ts2BJ5L X-Received: by 2002:a63:dd17:: with SMTP id t23mr6627687pgg.320.1612565896418; Fri, 05 Feb 2021 14:58:16 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 43/46] cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass Date: Fri, 5 Feb 2021 12:56:47 -1000 Message-Id: <20210205225650.1330794-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana we cannot in principle make the TCG Operations field definitions conditional on CONFIG_TCG in code that is included by both common_ss and specific_ss modules. Therefore, what we can do safely to restrict the TCG fields to TCG-only builds, is to move all tcg cpu operations into a separate header file, which is only included by TCG, target-specific code. This leaves just a NULL pointer in the cpu.h for the non-TCG builds. This also tidies up the code in all targets a bit, having all TCG cpu operations neatly contained by a dedicated data struct. Signed-off-by: Claudio Fontana Message-Id: <20210204163931.7358-16-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 103 ++------------------------------ include/hw/core/tcg-cpu-ops.h | 97 ++++++++++++++++++++++++++++++ target/arm/internals.h | 6 ++ accel/tcg/cpu-exec.c | 27 +++++---- accel/tcg/cputlb.c | 35 +++++++++-- accel/tcg/user-exec.c | 9 +-- hw/mips/jazz.c | 7 ++- softmmu/physmem.c | 13 ++-- target/alpha/cpu.c | 21 +++++-- target/arm/cpu.c | 41 ++++++++----- target/arm/cpu64.c | 7 +-- target/arm/cpu_tcg.c | 28 +++++++-- target/avr/cpu.c | 19 ++++-- target/avr/helper.c | 5 +- target/cris/cpu.c | 43 ++++++++----- target/cris/helper.c | 5 +- target/hppa/cpu.c | 22 ++++--- target/i386/tcg/tcg-cpu.c | 26 ++++---- target/lm32/cpu.c | 19 ++++-- target/m68k/cpu.c | 19 ++++-- target/microblaze/cpu.c | 25 +++++--- target/mips/cpu.c | 36 +++++++---- target/moxie/cpu.c | 15 ++++- target/nios2/cpu.c | 18 ++++-- target/openrisc/cpu.c | 17 ++++-- target/riscv/cpu.c | 23 ++++--- target/rx/cpu.c | 20 +++++-- target/s390x/cpu.c | 33 ++++++---- target/sh4/cpu.c | 21 +++++-- target/sparc/cpu.c | 25 +++++--- target/tilegx/cpu.c | 17 ++++-- target/tricore/cpu.c | 12 +++- target/unicore32/cpu.c | 17 ++++-- target/xtensa/cpu.c | 23 ++++--- target/ppc/translate_init.c.inc | 33 ++++++---- MAINTAINERS | 1 + 36 files changed, 582 insertions(+), 306 deletions(-) create mode 100644 include/hw/core/tcg-cpu-ops.h -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e76a49754d..4f6c6b18c9 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -76,78 +76,8 @@ typedef struct CPUWatchpoint CPUWatchpoint; struct TranslationBlock; -/** - * struct TcgCpuOperations: TCG operations specific to a CPU class - */ -typedef struct TcgCpuOperations { - /** - * @initialize: Initalize TCG state - * - * Called when the first CPU is realized. - */ - void (*initialize)(void); - /** - * @synchronize_from_tb: Synchronize state from a TCG #TranslationBlock - * - * This is called when we abandon execution of a TB before starting it, - * and must set all parts of the CPU state which the previous TB in the - * chain may not have updated. - * By default, when this is NULL, a call is made to @set_pc(tb->pc). - * - * If more state needs to be restored, the target must implement a - * function to restore all the state, and register it here. - */ - void (*synchronize_from_tb)(CPUState *cpu, - const struct TranslationBlock *tb); - /** @cpu_exec_enter: Callback for cpu_exec preparation */ - void (*cpu_exec_enter)(CPUState *cpu); - /** @cpu_exec_exit: Callback for cpu_exec cleanup */ - void (*cpu_exec_exit)(CPUState *cpu); - /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */ - bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); - /** @do_interrupt: Callback for interrupt handling. */ - void (*do_interrupt)(CPUState *cpu); - /** - * @tlb_fill: Handle a softmmu tlb miss or user-only address fault - * - * For system mode, if the access is valid, call tlb_set_page - * and return true; if the access is invalid, and probe is - * true, return false; otherwise raise an exception and do - * not return. For user-only mode, always raise an exception - * and do not return. - */ - bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr); - /** @debug_excp_handler: Callback for handling debug exceptions */ - void (*debug_excp_handler)(CPUState *cpu); - - /** - * @do_transaction_failed: Callback for handling failed memory transactions - * (ie bus faults or external aborts; not MMU faults) - */ - void (*do_transaction_failed)(CPUState *cpu, hwaddr physaddr, vaddr addr, - unsigned size, MMUAccessType access_type, - int mmu_idx, MemTxAttrs attrs, - MemTxResult response, uintptr_t retaddr); - /** - * @do_unaligned_access: Callback for unaligned access handling - */ - void (*do_unaligned_access)(CPUState *cpu, vaddr addr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr); - /** - * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM - */ - vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len); - - /** - * @debug_check_watchpoint: return true if the architectural - * watchpoint whose address has matched should really fire, used by ARM - */ - bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp); - -} TcgCpuOperations; +/* see tcg-cpu-ops.h */ +struct TCGCPUOps; /** * CPUClass: @@ -258,7 +188,8 @@ struct CPUClass { int gdb_num_core_regs; bool gdb_stop_before_watchpoint; - TcgCpuOperations tcg_ops; + /* when TCG is not available, this pointer is NULL */ + struct TCGCPUOps *tcg_ops; }; /* @@ -889,32 +820,6 @@ CPUState *cpu_by_arch_id(int64_t id); void cpu_interrupt(CPUState *cpu, int mask); -static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr, - MMUAccessType access_type, - int mmu_idx, uintptr_t retaddr) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - - cc->tcg_ops.do_unaligned_access(cpu, addr, access_type, mmu_idx, retaddr); -} - -static inline void cpu_transaction_failed(CPUState *cpu, hwaddr physaddr, - vaddr addr, unsigned size, - MMUAccessType access_type, - int mmu_idx, MemTxAttrs attrs, - MemTxResult response, - uintptr_t retaddr) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - - if (!cpu->ignore_memory_transaction_failures && - cc->tcg_ops.do_transaction_failed) { - cc->tcg_ops.do_transaction_failed(cpu, physaddr, addr, size, - access_type, mmu_idx, attrs, - response, retaddr); - } -} - /** * cpu_set_pc: * @cpu: The CPU to set the program counter for. diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h new file mode 100644 index 0000000000..ccc97d1894 --- /dev/null +++ b/include/hw/core/tcg-cpu-ops.h @@ -0,0 +1,97 @@ +/* + * TCG CPU-specific operations + * + * Copyright 2021 SUSE LLC + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef TCG_CPU_OPS_H +#define TCG_CPU_OPS_H + +#include "hw/core/cpu.h" + +struct TCGCPUOps { + /** + * @initialize: Initalize TCG state + * + * Called when the first CPU is realized. + */ + void (*initialize)(void); + /** + * @synchronize_from_tb: Synchronize state from a TCG #TranslationBlock + * + * This is called when we abandon execution of a TB before starting it, + * and must set all parts of the CPU state which the previous TB in the + * chain may not have updated. + * By default, when this is NULL, a call is made to @set_pc(tb->pc). + * + * If more state needs to be restored, the target must implement a + * function to restore all the state, and register it here. + */ + void (*synchronize_from_tb)(CPUState *cpu, + const struct TranslationBlock *tb); + /** @cpu_exec_enter: Callback for cpu_exec preparation */ + void (*cpu_exec_enter)(CPUState *cpu); + /** @cpu_exec_exit: Callback for cpu_exec cleanup */ + void (*cpu_exec_exit)(CPUState *cpu); + /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */ + bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); + /** + * @do_interrupt: Callback for interrupt handling. + * + * note that this is in general SOFTMMU only, but it actually isn't + * because of an x86 hack (accel/tcg/cpu-exec.c), so we cannot put it + * in the SOFTMMU section in general. + */ + void (*do_interrupt)(CPUState *cpu); + /** + * @tlb_fill: Handle a softmmu tlb miss or user-only address fault + * + * For system mode, if the access is valid, call tlb_set_page + * and return true; if the access is invalid, and probe is + * true, return false; otherwise raise an exception and do + * not return. For user-only mode, always raise an exception + * and do not return. + */ + bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, + MMUAccessType access_type, int mmu_idx, + bool probe, uintptr_t retaddr); + /** @debug_excp_handler: Callback for handling debug exceptions */ + void (*debug_excp_handler)(CPUState *cpu); + +#ifdef NEED_CPU_H +#ifdef CONFIG_SOFTMMU + /** + * @do_transaction_failed: Callback for handling failed memory transactions + * (ie bus faults or external aborts; not MMU faults) + */ + void (*do_transaction_failed)(CPUState *cpu, hwaddr physaddr, vaddr addr, + unsigned size, MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr); + /** + * @do_unaligned_access: Callback for unaligned access handling + */ + void (*do_unaligned_access)(CPUState *cpu, vaddr addr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr); + + /** + * @adjust_watchpoint_address: hack for cpu_check_watchpoint used by ARM + */ + vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len); + + /** + * @debug_check_watchpoint: return true if the architectural + * watchpoint whose address has matched should really fire, used by ARM + */ + bool (*debug_check_watchpoint)(CPUState *cpu, CPUWatchpoint *wp); + +#endif /* CONFIG_SOFTMMU */ +#endif /* NEED_CPU_H */ + +}; + +#endif /* TCG_CPU_OPS_H */ diff --git a/target/arm/internals.h b/target/arm/internals.h index 853fa88fd6..448982dd2f 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -171,6 +171,12 @@ static inline int r14_bank_number(int mode) void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu); void arm_translate_init(void); +#ifdef CONFIG_TCG +void arm_cpu_synchronize_from_tb(CPUState *cs, + const struct TranslationBlock *tb); +#endif /* CONFIG_TCG */ + + enum arm_fprounding { FPROUNDING_TIEEVEN, FPROUNDING_POSINF, diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 633ee3ef9e..d9ef69121c 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -21,6 +21,7 @@ #include "qemu-common.h" #include "qemu/qemu-print.h" #include "cpu.h" +#include "hw/core/tcg-cpu-ops.h" #include "trace.h" #include "disas/disas.h" #include "exec/exec-all.h" @@ -213,8 +214,8 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) TARGET_FMT_lx "] %s\n", last_tb->tc.ptr, last_tb->pc, lookup_symbol(last_tb->pc)); - if (cc->tcg_ops.synchronize_from_tb) { - cc->tcg_ops.synchronize_from_tb(cpu, last_tb); + if (cc->tcg_ops->synchronize_from_tb) { + cc->tcg_ops->synchronize_from_tb(cpu, last_tb); } else { assert(cc->set_pc); cc->set_pc(cpu, last_tb->pc); @@ -262,8 +263,8 @@ static void cpu_exec_enter(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->tcg_ops.cpu_exec_enter) { - cc->tcg_ops.cpu_exec_enter(cpu); + if (cc->tcg_ops->cpu_exec_enter) { + cc->tcg_ops->cpu_exec_enter(cpu); } } @@ -271,8 +272,8 @@ static void cpu_exec_exit(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->tcg_ops.cpu_exec_exit) { - cc->tcg_ops.cpu_exec_exit(cpu); + if (cc->tcg_ops->cpu_exec_exit) { + cc->tcg_ops->cpu_exec_exit(cpu); } } @@ -512,8 +513,8 @@ static inline void cpu_handle_debug_exception(CPUState *cpu) } } - if (cc->tcg_ops.debug_excp_handler) { - cc->tcg_ops.debug_excp_handler(cpu); + if (cc->tcg_ops->debug_excp_handler) { + cc->tcg_ops->debug_excp_handler(cpu); } } @@ -547,7 +548,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) loop */ #if defined(TARGET_I386) CPUClass *cc = CPU_GET_CLASS(cpu); - cc->tcg_ops.do_interrupt(cpu); + cc->tcg_ops->do_interrupt(cpu); #endif *ret = cpu->exception_index; cpu->exception_index = -1; @@ -556,7 +557,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) if (replay_exception()) { CPUClass *cc = CPU_GET_CLASS(cpu); qemu_mutex_lock_iothread(); - cc->tcg_ops.do_interrupt(cpu); + cc->tcg_ops->do_interrupt(cpu); qemu_mutex_unlock_iothread(); cpu->exception_index = -1; @@ -655,8 +656,8 @@ 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 { - if (cc->tcg_ops.cpu_exec_interrupt && - cc->tcg_ops.cpu_exec_interrupt(cpu, interrupt_request)) { + if (cc->tcg_ops->cpu_exec_interrupt && + cc->tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { if (need_replay_interrupt(interrupt_request)) { replay_interrupt(); } @@ -834,7 +835,7 @@ void tcg_exec_realizefn(CPUState *cpu, Error **errp) CPUClass *cc = CPU_GET_CLASS(cpu); if (!tcg_target_initialized) { - cc->tcg_ops.initialize(); + cc->tcg_ops->initialize(); tcg_target_initialized = true; } tlb_init(cpu); diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b7717803b8..8a7b779270 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "cpu.h" +#include "hw/core/tcg-cpu-ops.h" #include "exec/exec-all.h" #include "exec/memory.h" #include "exec/address-spaces.h" @@ -1305,11 +1306,37 @@ static void tlb_fill(CPUState *cpu, target_ulong addr, int size, * This is not a probe, so only valid return is success; failure * should result in exception + longjmp to the cpu loop. */ - ok = cc->tcg_ops.tlb_fill(cpu, addr, size, - access_type, mmu_idx, false, retaddr); + ok = cc->tcg_ops->tlb_fill(cpu, addr, size, + access_type, mmu_idx, false, retaddr); assert(ok); } +static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr, + MMUAccessType access_type, + int mmu_idx, uintptr_t retaddr) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + cc->tcg_ops->do_unaligned_access(cpu, addr, access_type, mmu_idx, retaddr); +} + +static inline void cpu_transaction_failed(CPUState *cpu, hwaddr physaddr, + vaddr addr, unsigned size, + MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, + uintptr_t retaddr) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + if (!cpu->ignore_memory_transaction_failures && + cc->tcg_ops->do_transaction_failed) { + cc->tcg_ops->do_transaction_failed(cpu, physaddr, addr, size, + access_type, mmu_idx, attrs, + response, retaddr); + } +} + static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, int mmu_idx, target_ulong addr, uintptr_t retaddr, MMUAccessType access_type, MemOp op) @@ -1577,8 +1604,8 @@ static int probe_access_internal(CPUArchState *env, target_ulong addr, CPUState *cs = env_cpu(env); CPUClass *cc = CPU_GET_CLASS(cs); - if (!cc->tcg_ops.tlb_fill(cs, addr, fault_size, access_type, - mmu_idx, nonfault, retaddr)) { + if (!cc->tcg_ops->tlb_fill(cs, addr, fault_size, access_type, + mmu_idx, nonfault, retaddr)) { /* Non-faulting page table read failed. */ *phost = NULL; return TLB_INVALID_MASK; diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 9e6e188d19..0b6f56ca40 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" #include "cpu.h" +#include "hw/core/tcg-cpu-ops.h" #include "disas/disas.h" #include "exec/exec-all.h" #include "tcg/tcg.h" @@ -187,8 +188,8 @@ static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info, clear_helper_retaddr(); cc = CPU_GET_CLASS(cpu); - cc->tcg_ops.tlb_fill(cpu, address, 0, access_type, - MMU_USER_IDX, false, pc); + cc->tcg_ops->tlb_fill(cpu, address, 0, access_type, + MMU_USER_IDX, false, pc); g_assert_not_reached(); } @@ -218,8 +219,8 @@ static int probe_access_internal(CPUArchState *env, target_ulong addr, } else { CPUState *cpu = env_cpu(env); CPUClass *cc = CPU_GET_CLASS(cpu); - cc->tcg_ops.tlb_fill(cpu, addr, fault_size, access_type, - MMU_USER_IDX, false, ra); + cc->tcg_ops->tlb_fill(cpu, addr, fault_size, access_type, + MMU_USER_IDX, false, ra); g_assert_not_reached(); } } diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 46c71a0ac8..83c8086062 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -53,6 +53,9 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/help_option.h" +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" +#endif /* CONFIG_TCG */ enum jazz_model_e { JAZZ_MAGNUM, @@ -209,8 +212,8 @@ static void mips_jazz_init(MachineState *machine, */ cc = CPU_GET_CLASS(cpu); #if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) - real_do_transaction_failed = cc->tcg_ops.do_transaction_failed; - cc->tcg_ops.do_transaction_failed = mips_jazz_do_transaction_failed; + real_do_transaction_failed = cc->tcg_ops->do_transaction_failed; + cc->tcg_ops->do_transaction_failed = mips_jazz_do_transaction_failed; #endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ /* allocate RAM */ diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 9e64cf7adf..243c3097d3 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -24,6 +24,11 @@ #include "qemu/cutils.h" #include "qemu/cacheflush.h" #include "cpu.h" + +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" +#endif /* CONFIG_TCG */ + #include "exec/exec-all.h" #include "exec/target_page.h" #include "hw/qdev-core.h" @@ -894,9 +899,9 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, return; } - if (cc->tcg_ops.adjust_watchpoint_address) { + if (cc->tcg_ops->adjust_watchpoint_address) { /* this is currently used only by ARM BE32 */ - addr = cc->tcg_ops.adjust_watchpoint_address(cpu, addr, len); + addr = cc->tcg_ops->adjust_watchpoint_address(cpu, addr, len); } QTAILQ_FOREACH(wp, &cpu->watchpoints, entry) { if (watchpoint_address_matches(wp, addr, len) @@ -917,8 +922,8 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, vaddr len, wp->hitaddr = MAX(addr, wp->vaddr); wp->hitattrs = attrs; if (!cpu->watchpoint_hit) { - if (wp->flags & BP_CPU && cc->tcg_ops.debug_check_watchpoint && - !cc->tcg_ops.debug_check_watchpoint(cpu, wp)) { + if (wp->flags & BP_CPU && cc->tcg_ops->debug_check_watchpoint && + !cc->tcg_ops->debug_check_watchpoint(cpu, wp)) { wp->flags &= ~BP_WATCHPOINT_HIT; continue; } diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 0710298e5a..27192b62e2 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -206,6 +206,20 @@ static void alpha_cpu_initfn(Object *obj) #endif } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps alpha_tcg_ops = { + .initialize = alpha_translate_init, + .cpu_exec_interrupt = alpha_cpu_exec_interrupt, + .tlb_fill = alpha_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = alpha_cpu_do_interrupt, + .do_transaction_failed = alpha_cpu_do_transaction_failed, + .do_unaligned_access = alpha_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; + static void alpha_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -217,22 +231,17 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = alpha_cpu_class_by_name; cc->has_work = alpha_cpu_has_work; - cc->tcg_ops.do_interrupt = alpha_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = alpha_cpu_exec_interrupt; cc->dump_state = alpha_cpu_dump_state; cc->set_pc = alpha_cpu_set_pc; cc->gdb_read_register = alpha_cpu_gdb_read_register; cc->gdb_write_register = alpha_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = alpha_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_transaction_failed = alpha_cpu_do_transaction_failed; - cc->tcg_ops.do_unaligned_access = alpha_cpu_do_unaligned_access; cc->get_phys_page_debug = alpha_cpu_get_phys_page_debug; dc->vmsd = &vmstate_alpha_cpu; #endif cc->disas_set_info = alpha_cpu_disas_set_info; - cc->tcg_ops.initialize = alpha_translate_init; + cc->tcg_ops = &alpha_tcg_ops; cc->gdb_num_core_regs = 67; } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index c9a66d3103..8ddb2556f8 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -26,6 +26,9 @@ #include "qapi/error.h" #include "qapi/visitor.h" #include "cpu.h" +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" +#endif /* CONFIG_TCG */ #include "internals.h" #include "exec/exec-all.h" #include "hw/qdev-properties.h" @@ -55,8 +58,8 @@ static void arm_cpu_set_pc(CPUState *cs, vaddr value) } #ifdef CONFIG_TCG -static void arm_cpu_synchronize_from_tb(CPUState *cs, - const TranslationBlock *tb) +void arm_cpu_synchronize_from_tb(CPUState *cs, + const TranslationBlock *tb) { ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; @@ -590,7 +593,7 @@ bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt_request) found: cs->exception_index = excp_idx; env->exception.target_el = target_el; - cc->tcg_ops.do_interrupt(cs); + cc->tcg_ops->do_interrupt(cs); return true; } @@ -2242,6 +2245,24 @@ static gchar *arm_gdb_arch_name(CPUState *cs) return g_strdup("arm"); } +#ifdef CONFIG_TCG +static struct TCGCPUOps arm_tcg_ops = { + .initialize = arm_translate_init, + .synchronize_from_tb = arm_cpu_synchronize_from_tb, + .cpu_exec_interrupt = arm_cpu_exec_interrupt, + .tlb_fill = arm_cpu_tlb_fill, + .debug_excp_handler = arm_debug_excp_handler, + +#if !defined(CONFIG_USER_ONLY) + .do_interrupt = arm_cpu_do_interrupt, + .do_transaction_failed = arm_cpu_do_transaction_failed, + .do_unaligned_access = arm_cpu_do_unaligned_access, + .adjust_watchpoint_address = arm_adjust_watchpoint_address, + .debug_check_watchpoint = arm_debug_check_watchpoint, +#endif /* !CONFIG_USER_ONLY */ +}; +#endif /* CONFIG_TCG */ + static void arm_cpu_class_init(ObjectClass *oc, void *data) { ARMCPUClass *acc = ARM_CPU_CLASS(oc); @@ -2274,19 +2295,9 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_get_dynamic_xml = arm_gdb_get_dynamic_xml; cc->gdb_stop_before_watchpoint = true; cc->disas_set_info = arm_disas_set_info; + #ifdef CONFIG_TCG - cc->tcg_ops.initialize = arm_translate_init; - cc->tcg_ops.cpu_exec_interrupt = arm_cpu_exec_interrupt; - cc->tcg_ops.synchronize_from_tb = arm_cpu_synchronize_from_tb; - cc->tcg_ops.tlb_fill = arm_cpu_tlb_fill; - cc->tcg_ops.debug_excp_handler = arm_debug_excp_handler; -#if !defined(CONFIG_USER_ONLY) - cc->tcg_ops.do_interrupt = arm_cpu_do_interrupt; - cc->tcg_ops.do_transaction_failed = arm_cpu_do_transaction_failed; - cc->tcg_ops.do_unaligned_access = arm_cpu_do_unaligned_access; - cc->tcg_ops.adjust_watchpoint_address = arm_adjust_watchpoint_address; - cc->tcg_ops.debug_check_watchpoint = arm_debug_check_watchpoint; -#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ + cc->tcg_ops = &arm_tcg_ops; #endif /* CONFIG_TCG */ } diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index a9a1cdb871..10c5118176 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -21,6 +21,9 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "cpu.h" +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" +#endif /* CONFIG_TCG */ #include "qemu/module.h" #if !defined(CONFIG_USER_ONLY) #include "hw/loader.h" @@ -805,10 +808,6 @@ static void aarch64_cpu_class_init(ObjectClass *oc, void *data) { CPUClass *cc = CPU_CLASS(oc); -#ifdef CONFIG_TCG - cc->tcg_ops.cpu_exec_interrupt = arm_cpu_exec_interrupt; -#endif /* CONFIG_TCG */ - cc->gdb_read_register = aarch64_cpu_gdb_read_register; cc->gdb_write_register = aarch64_cpu_gdb_write_register; cc->gdb_num_core_regs = 34; diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index d9c160f1ac..c29b434c60 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c @@ -10,6 +10,9 @@ #include "qemu/osdep.h" #include "cpu.h" +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" +#endif /* CONFIG_TCG */ #include "internals.h" /* CPU models. These are not needed for the AArch64 linux-user build. */ @@ -34,7 +37,7 @@ static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (interrupt_request & CPU_INTERRUPT_HARD && (armv7m_nvic_can_take_pending_exception(env->nvic))) { cs->exception_index = EXCP_IRQ; - cc->tcg_ops.do_interrupt(cs); + cc->tcg_ops->do_interrupt(cs); ret = true; } return ret; @@ -660,6 +663,24 @@ static void pxa270c5_initfn(Object *obj) cpu->reset_sctlr = 0x00000078; } +#ifdef CONFIG_TCG +static struct TCGCPUOps arm_v7m_tcg_ops = { + .initialize = arm_translate_init, + .synchronize_from_tb = arm_cpu_synchronize_from_tb, + .cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt, + .tlb_fill = arm_cpu_tlb_fill, + .debug_excp_handler = arm_debug_excp_handler, + +#if !defined(CONFIG_USER_ONLY) + .do_interrupt = arm_v7m_cpu_do_interrupt, + .do_transaction_failed = arm_cpu_do_transaction_failed, + .do_unaligned_access = arm_cpu_do_unaligned_access, + .adjust_watchpoint_address = arm_adjust_watchpoint_address, + .debug_check_watchpoint = arm_debug_check_watchpoint, +#endif /* !CONFIG_USER_ONLY */ +}; +#endif /* CONFIG_TCG */ + static void arm_v7m_class_init(ObjectClass *oc, void *data) { ARMCPUClass *acc = ARM_CPU_CLASS(oc); @@ -667,10 +688,7 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) acc->info = data; #ifdef CONFIG_TCG - cc->tcg_ops.cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt; -#ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_interrupt = arm_v7m_cpu_do_interrupt; -#endif + cc->tcg_ops = &arm_v7m_tcg_ops; #endif /* CONFIG_TCG */ cc->gdb_core_xml_file = "arm-m-profile.xml"; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 476e645b37..fa0f8e0e80 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -184,6 +184,19 @@ static void avr_cpu_dump_state(CPUState *cs, FILE *f, int flags) qemu_fprintf(f, "\n"); } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps avr_tcg_ops = { + .initialize = avr_cpu_tcg_init, + .synchronize_from_tb = avr_cpu_synchronize_from_tb, + .cpu_exec_interrupt = avr_cpu_exec_interrupt, + .tlb_fill = avr_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = avr_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + static void avr_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -198,21 +211,17 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = avr_cpu_class_by_name; cc->has_work = avr_cpu_has_work; - cc->tcg_ops.do_interrupt = avr_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = avr_cpu_exec_interrupt; cc->dump_state = avr_cpu_dump_state; cc->set_pc = avr_cpu_set_pc; cc->memory_rw_debug = avr_cpu_memory_rw_debug; cc->get_phys_page_debug = avr_cpu_get_phys_page_debug; - cc->tcg_ops.tlb_fill = avr_cpu_tlb_fill; cc->vmsd = &vms_avr_cpu; cc->disas_set_info = avr_cpu_disas_set_info; - cc->tcg_ops.initialize = avr_cpu_tcg_init; - cc->tcg_ops.synchronize_from_tb = avr_cpu_synchronize_from_tb; cc->gdb_read_register = avr_cpu_gdb_read_register; cc->gdb_write_register = avr_cpu_gdb_write_register; cc->gdb_num_core_regs = 35; cc->gdb_core_xml_file = "avr-cpu.xml"; + cc->tcg_ops = &avr_tcg_ops; } /* diff --git a/target/avr/helper.c b/target/avr/helper.c index 69d3b6181f..65880b9928 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" +#include "hw/core/tcg-cpu-ops.h" #include "exec/exec-all.h" #include "exec/address-spaces.h" #include "exec/helper-proto.h" @@ -34,7 +35,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (interrupt_request & CPU_INTERRUPT_RESET) { if (cpu_interrupts_enabled(env)) { cs->exception_index = EXCP_RESET; - cc->tcg_ops.do_interrupt(cs); + cc->tcg_ops->do_interrupt(cs); cs->interrupt_request &= ~CPU_INTERRUPT_RESET; @@ -45,7 +46,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (cpu_interrupts_enabled(env) && env->intsrc != 0) { int index = ctz32(env->intsrc); cs->exception_index = EXCP_INT(index); - cc->tcg_ops.do_interrupt(cs); + cc->tcg_ops->do_interrupt(cs); env->intsrc &= env->intsrc - 1; /* clear the interrupt */ cs->interrupt_request &= ~CPU_INTERRUPT_HARD; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index b65743e8ca..ed983380fc 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -193,15 +193,36 @@ static void cris_cpu_initfn(Object *obj) #endif } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps crisv10_tcg_ops = { + .initialize = cris_initialize_crisv10_tcg, + .cpu_exec_interrupt = cris_cpu_exec_interrupt, + .tlb_fill = cris_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = crisv10_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + +static struct TCGCPUOps crisv32_tcg_ops = { + .initialize = cris_initialize_tcg, + .cpu_exec_interrupt = cris_cpu_exec_interrupt, + .tlb_fill = cris_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = cris_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + static void crisv8_cpu_class_init(ObjectClass *oc, void *data) { CPUClass *cc = CPU_CLASS(oc); CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 8; - cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops = &crisv10_tcg_ops; } static void crisv9_cpu_class_init(ObjectClass *oc, void *data) @@ -210,9 +231,8 @@ static void crisv9_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 9; - cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops = &crisv10_tcg_ops; } static void crisv10_cpu_class_init(ObjectClass *oc, void *data) @@ -221,9 +241,8 @@ static void crisv10_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 10; - cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops = &crisv10_tcg_ops; } static void crisv11_cpu_class_init(ObjectClass *oc, void *data) @@ -232,9 +251,8 @@ static void crisv11_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 11; - cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops = &crisv10_tcg_ops; } static void crisv17_cpu_class_init(ObjectClass *oc, void *data) @@ -243,16 +261,17 @@ static void crisv17_cpu_class_init(ObjectClass *oc, void *data) CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 17; - cc->tcg_ops.do_interrupt = crisv10_cpu_do_interrupt; cc->gdb_read_register = crisv10_cpu_gdb_read_register; - cc->tcg_ops.initialize = cris_initialize_crisv10_tcg; + cc->tcg_ops = &crisv10_tcg_ops; } static void crisv32_cpu_class_init(ObjectClass *oc, void *data) { + CPUClass *cc = CPU_CLASS(oc); CRISCPUClass *ccc = CRIS_CPU_CLASS(oc); ccc->vr = 32; + cc->tcg_ops = &crisv32_tcg_ops; } static void cris_cpu_class_init(ObjectClass *oc, void *data) @@ -268,13 +287,10 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = cris_cpu_class_by_name; cc->has_work = cris_cpu_has_work; - cc->tcg_ops.do_interrupt = cris_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = cris_cpu_exec_interrupt; cc->dump_state = cris_cpu_dump_state; cc->set_pc = cris_cpu_set_pc; cc->gdb_read_register = cris_cpu_gdb_read_register; cc->gdb_write_register = cris_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = cris_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = cris_cpu_get_phys_page_debug; dc->vmsd = &vmstate_cris_cpu; @@ -284,7 +300,6 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_stop_before_watchpoint = true; cc->disas_set_info = cris_disas_set_info; - cc->tcg_ops.initialize = cris_initialize_tcg; } #define DEFINE_CRIS_CPU_TYPE(cpu_model, initfn) \ diff --git a/target/cris/helper.c b/target/cris/helper.c index 1f4d6f7d45..7e3bb58fe1 100644 --- a/target/cris/helper.c +++ b/target/cris/helper.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" +#include "hw/core/tcg-cpu-ops.h" #include "mmu.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" @@ -299,7 +300,7 @@ bool cris_cpu_exec_interrupt(CPUState *cs, int interrupt_request) && (env->pregs[PR_CCS] & I_FLAG) && !env->locked_irq) { cs->exception_index = EXCP_IRQ; - cc->tcg_ops.do_interrupt(cs); + cc->tcg_ops->do_interrupt(cs); ret = true; } if (interrupt_request & CPU_INTERRUPT_NMI) { @@ -311,7 +312,7 @@ bool cris_cpu_exec_interrupt(CPUState *cs, int interrupt_request) } if ((env->pregs[PR_CCS] & m_flag_archval)) { cs->exception_index = EXCP_NMI; - cc->tcg_ops.do_interrupt(cs); + cc->tcg_ops->do_interrupt(cs); ret = true; } } diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index fd7f849a1c..d8fad52d1f 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -131,6 +131,20 @@ static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) return object_class_by_name(TYPE_HPPA_CPU); } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps hppa_tcg_ops = { + .initialize = hppa_translate_init, + .synchronize_from_tb = hppa_cpu_synchronize_from_tb, + .cpu_exec_interrupt = hppa_cpu_exec_interrupt, + .tlb_fill = hppa_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = hppa_cpu_do_interrupt, + .do_unaligned_access = hppa_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; + static void hppa_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -142,23 +156,17 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = hppa_cpu_class_by_name; cc->has_work = hppa_cpu_has_work; - cc->tcg_ops.do_interrupt = hppa_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = hppa_cpu_exec_interrupt; cc->dump_state = hppa_cpu_dump_state; cc->set_pc = hppa_cpu_set_pc; - cc->tcg_ops.synchronize_from_tb = hppa_cpu_synchronize_from_tb; cc->gdb_read_register = hppa_cpu_gdb_read_register; cc->gdb_write_register = hppa_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = hppa_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = hppa_cpu_get_phys_page_debug; - cc->tcg_ops.do_unaligned_access = hppa_cpu_do_unaligned_access; dc->vmsd = &vmstate_hppa_cpu; #endif cc->disas_set_info = hppa_cpu_disas_set_info; - cc->tcg_ops.initialize = hppa_translate_init; - cc->gdb_num_core_regs = 128; + cc->tcg_ops = &hppa_tcg_ops; } static const TypeInfo hppa_cpu_type_info = { diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 4a53cd89e2..1e125d2175 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -57,16 +57,22 @@ static void x86_cpu_synchronize_from_tb(CPUState *cs, cpu->env.eip = tb->pc - tb->cs_base; } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps x86_tcg_ops = { + .initialize = tcg_x86_init, + .synchronize_from_tb = x86_cpu_synchronize_from_tb, + .cpu_exec_enter = x86_cpu_exec_enter, + .cpu_exec_exit = x86_cpu_exec_exit, + .cpu_exec_interrupt = x86_cpu_exec_interrupt, + .do_interrupt = x86_cpu_do_interrupt, + .tlb_fill = x86_cpu_tlb_fill, +#ifndef CONFIG_USER_ONLY + .debug_excp_handler = breakpoint_handler, +#endif /* !CONFIG_USER_ONLY */ +}; + void tcg_cpu_common_class_init(CPUClass *cc) { - cc->tcg_ops.do_interrupt = x86_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = x86_cpu_exec_interrupt; - cc->tcg_ops.synchronize_from_tb = x86_cpu_synchronize_from_tb; - cc->tcg_ops.cpu_exec_enter = x86_cpu_exec_enter; - cc->tcg_ops.cpu_exec_exit = x86_cpu_exec_exit; - cc->tcg_ops.initialize = tcg_x86_init; - cc->tcg_ops.tlb_fill = x86_cpu_tlb_fill; -#ifndef CONFIG_USER_ONLY - cc->tcg_ops.debug_excp_handler = breakpoint_handler; -#endif + cc->tcg_ops = &x86_tcg_ops; } diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index fb3761b749..c23d72874c 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -210,6 +210,19 @@ static ObjectClass *lm32_cpu_class_by_name(const char *cpu_model) return oc; } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps lm32_tcg_ops = { + .initialize = lm32_translate_init, + .cpu_exec_interrupt = lm32_cpu_exec_interrupt, + .tlb_fill = lm32_cpu_tlb_fill, + .debug_excp_handler = lm32_debug_excp_handler, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = lm32_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + static void lm32_cpu_class_init(ObjectClass *oc, void *data) { LM32CPUClass *lcc = LM32_CPU_CLASS(oc); @@ -222,22 +235,18 @@ static void lm32_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = lm32_cpu_class_by_name; cc->has_work = lm32_cpu_has_work; - cc->tcg_ops.do_interrupt = lm32_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = lm32_cpu_exec_interrupt; cc->dump_state = lm32_cpu_dump_state; cc->set_pc = lm32_cpu_set_pc; cc->gdb_read_register = lm32_cpu_gdb_read_register; cc->gdb_write_register = lm32_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = lm32_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = lm32_cpu_get_phys_page_debug; cc->vmsd = &vmstate_lm32_cpu; #endif cc->gdb_num_core_regs = 32 + 7; cc->gdb_stop_before_watchpoint = true; - cc->tcg_ops.debug_excp_handler = lm32_debug_excp_handler; cc->disas_set_info = lm32_cpu_disas_set_info; - cc->tcg_ops.initialize = lm32_translate_init; + cc->tcg_ops = &lm32_tcg_ops; } #define DEFINE_LM32_CPU_TYPE(cpu_model, initfn) \ diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index e68b933c84..c6fde8132b 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -453,6 +453,19 @@ static const VMStateDescription vmstate_m68k_cpu = { }; #endif +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps m68k_tcg_ops = { + .initialize = m68k_tcg_init, + .cpu_exec_interrupt = m68k_cpu_exec_interrupt, + .tlb_fill = m68k_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = m68k_cpu_do_interrupt, + .do_transaction_failed = m68k_cpu_transaction_failed, +#endif /* !CONFIG_USER_ONLY */ +}; + static void m68k_cpu_class_init(ObjectClass *c, void *data) { M68kCPUClass *mcc = M68K_CPU_CLASS(c); @@ -465,22 +478,18 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = m68k_cpu_class_by_name; cc->has_work = m68k_cpu_has_work; - cc->tcg_ops.do_interrupt = m68k_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = m68k_cpu_exec_interrupt; cc->dump_state = m68k_cpu_dump_state; cc->set_pc = m68k_cpu_set_pc; cc->gdb_read_register = m68k_cpu_gdb_read_register; cc->gdb_write_register = m68k_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = m68k_cpu_tlb_fill; #if defined(CONFIG_SOFTMMU) - cc->tcg_ops.do_transaction_failed = m68k_cpu_transaction_failed; cc->get_phys_page_debug = m68k_cpu_get_phys_page_debug; dc->vmsd = &vmstate_m68k_cpu; #endif cc->disas_set_info = m68k_cpu_disas_set_info; - cc->tcg_ops.initialize = m68k_tcg_init; cc->gdb_num_core_regs = 18; + cc->tcg_ops = &m68k_tcg_ops; } static void m68k_cpu_class_init_cf_core(ObjectClass *c, void *data) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 6678310f51..433ba20203 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -352,6 +352,21 @@ static ObjectClass *mb_cpu_class_by_name(const char *cpu_model) return object_class_by_name(TYPE_MICROBLAZE_CPU); } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps mb_tcg_ops = { + .initialize = mb_tcg_init, + .synchronize_from_tb = mb_cpu_synchronize_from_tb, + .cpu_exec_interrupt = mb_cpu_exec_interrupt, + .tlb_fill = mb_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = mb_cpu_do_interrupt, + .do_transaction_failed = mb_cpu_transaction_failed, + .do_unaligned_access = mb_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; + static void mb_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -364,17 +379,13 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = mb_cpu_class_by_name; cc->has_work = mb_cpu_has_work; - cc->tcg_ops.do_interrupt = mb_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = mb_cpu_exec_interrupt; + cc->dump_state = mb_cpu_dump_state; cc->set_pc = mb_cpu_set_pc; - cc->tcg_ops.synchronize_from_tb = mb_cpu_synchronize_from_tb; cc->gdb_read_register = mb_cpu_gdb_read_register; cc->gdb_write_register = mb_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = mb_cpu_tlb_fill; + #ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_transaction_failed = mb_cpu_transaction_failed; - cc->tcg_ops.do_unaligned_access = mb_cpu_do_unaligned_access; cc->get_phys_page_attrs_debug = mb_cpu_get_phys_page_attrs_debug; dc->vmsd = &vmstate_mb_cpu; #endif @@ -382,7 +393,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_num_core_regs = 32 + 27; cc->disas_set_info = mb_disas_set_info; - cc->tcg_ops.initialize = mb_tcg_init; + cc->tcg_ops = &mb_tcg_ops; } static const TypeInfo mb_cpu_type_info = { diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 1e93e295cc..ad163ead62 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -663,6 +663,26 @@ static Property mips_cpu_properties[] = { DEFINE_PROP_END_OF_LIST() }; +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" +/* + * NB: cannot be const, as some elements are changed for specific + * mips hardware (see hw/mips/jazz.c). + */ +static struct TCGCPUOps mips_tcg_ops = { + .initialize = mips_tcg_init, + .synchronize_from_tb = mips_cpu_synchronize_from_tb, + .cpu_exec_interrupt = mips_cpu_exec_interrupt, + .tlb_fill = mips_cpu_tlb_fill, + +#if !defined(CONFIG_USER_ONLY) + .do_interrupt = mips_cpu_do_interrupt, + .do_transaction_failed = mips_cpu_do_transaction_failed, + .do_unaligned_access = mips_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; +#endif /* CONFIG_TCG */ + static void mips_cpu_class_init(ObjectClass *c, void *data) { MIPSCPUClass *mcc = MIPS_CPU_CLASS(c); @@ -685,21 +705,11 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) cc->vmsd = &vmstate_mips_cpu; #endif cc->disas_set_info = mips_cpu_disas_set_info; -#ifdef CONFIG_TCG - cc->tcg_ops.initialize = mips_tcg_init; - cc->tcg_ops.do_interrupt = mips_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = mips_cpu_exec_interrupt; - cc->tcg_ops.synchronize_from_tb = mips_cpu_synchronize_from_tb; - cc->tcg_ops.tlb_fill = mips_cpu_tlb_fill; -#ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_transaction_failed = mips_cpu_do_transaction_failed; - cc->tcg_ops.do_unaligned_access = mips_cpu_do_unaligned_access; - -#endif /* CONFIG_USER_ONLY */ -#endif /* CONFIG_TCG */ - cc->gdb_num_core_regs = 73; cc->gdb_stop_before_watchpoint = true; +#ifdef CONFIG_TCG + cc->tcg_ops = &mips_tcg_ops; +#endif /* CONFIG_TCG */ } static const TypeInfo mips_cpu_type_info = { diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 36bef4d357..83bec34d36 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -94,6 +94,17 @@ static ObjectClass *moxie_cpu_class_by_name(const char *cpu_model) return oc; } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps moxie_tcg_ops = { + .initialize = moxie_translate_init, + .tlb_fill = moxie_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = moxie_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + static void moxie_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -107,16 +118,14 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = moxie_cpu_class_by_name; cc->has_work = moxie_cpu_has_work; - cc->tcg_ops.do_interrupt = moxie_cpu_do_interrupt; cc->dump_state = moxie_cpu_dump_state; cc->set_pc = moxie_cpu_set_pc; - cc->tcg_ops.tlb_fill = moxie_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = moxie_cpu_get_phys_page_debug; cc->vmsd = &vmstate_moxie_cpu; #endif cc->disas_set_info = moxie_cpu_disas_set_info; - cc->tcg_ops.initialize = moxie_translate_init; + cc->tcg_ops = &moxie_tcg_ops; } static void moxielite_initfn(Object *obj) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index c43aa3d4c4..e9c9fc3a38 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -207,6 +207,18 @@ static Property nios2_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps nios2_tcg_ops = { + .initialize = nios2_tcg_init, + .cpu_exec_interrupt = nios2_cpu_exec_interrupt, + .tlb_fill = nios2_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = nios2_cpu_do_interrupt, + .do_unaligned_access = nios2_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; static void nios2_cpu_class_init(ObjectClass *oc, void *data) { @@ -221,20 +233,16 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = nios2_cpu_class_by_name; cc->has_work = nios2_cpu_has_work; - cc->tcg_ops.do_interrupt = nios2_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = nios2_cpu_exec_interrupt; cc->dump_state = nios2_cpu_dump_state; cc->set_pc = nios2_cpu_set_pc; cc->disas_set_info = nios2_cpu_disas_set_info; - cc->tcg_ops.tlb_fill = nios2_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_unaligned_access = nios2_cpu_do_unaligned_access; cc->get_phys_page_debug = nios2_cpu_get_phys_page_debug; #endif cc->gdb_read_register = nios2_cpu_gdb_read_register; cc->gdb_write_register = nios2_cpu_gdb_write_register; cc->gdb_num_core_regs = 49; - cc->tcg_ops.initialize = nios2_tcg_init; + cc->tcg_ops = &nios2_tcg_ops; } static const TypeInfo nios2_cpu_type_info = { diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 1a31f7564f..2c64842f46 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -174,6 +174,18 @@ static void openrisc_any_initfn(Object *obj) | (IMMUCFGR_NTS & (ctz32(TLB_SIZE) << 2)); } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps openrisc_tcg_ops = { + .initialize = openrisc_translate_init, + .cpu_exec_interrupt = openrisc_cpu_exec_interrupt, + .tlb_fill = openrisc_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = openrisc_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + static void openrisc_cpu_class_init(ObjectClass *oc, void *data) { OpenRISCCPUClass *occ = OPENRISC_CPU_CLASS(oc); @@ -186,20 +198,17 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = openrisc_cpu_class_by_name; cc->has_work = openrisc_cpu_has_work; - cc->tcg_ops.do_interrupt = openrisc_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = openrisc_cpu_exec_interrupt; cc->dump_state = openrisc_cpu_dump_state; cc->set_pc = openrisc_cpu_set_pc; cc->gdb_read_register = openrisc_cpu_gdb_read_register; cc->gdb_write_register = openrisc_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = openrisc_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug = openrisc_cpu_get_phys_page_debug; dc->vmsd = &vmstate_openrisc_cpu; #endif cc->gdb_num_core_regs = 32 + 3; - cc->tcg_ops.initialize = openrisc_translate_init; cc->disas_set_info = openrisc_disas_set_info; + cc->tcg_ops = &openrisc_tcg_ops; } /* Sort alphabetically by type name, except for "any". */ diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 5e85fd58b6..16f1a34238 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -580,6 +580,21 @@ static const char *riscv_gdb_get_dynamic_xml(CPUState *cs, const char *xmlname) return NULL; } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps riscv_tcg_ops = { + .initialize = riscv_translate_init, + .synchronize_from_tb = riscv_cpu_synchronize_from_tb, + .cpu_exec_interrupt = riscv_cpu_exec_interrupt, + .tlb_fill = riscv_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = riscv_cpu_do_interrupt, + .do_transaction_failed = riscv_cpu_do_transaction_failed, + .do_unaligned_access = riscv_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; + static void riscv_cpu_class_init(ObjectClass *c, void *data) { RISCVCPUClass *mcc = RISCV_CPU_CLASS(c); @@ -593,11 +608,8 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->class_by_name = riscv_cpu_class_by_name; cc->has_work = riscv_cpu_has_work; - cc->tcg_ops.do_interrupt = riscv_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = riscv_cpu_exec_interrupt; cc->dump_state = riscv_cpu_dump_state; cc->set_pc = riscv_cpu_set_pc; - cc->tcg_ops.synchronize_from_tb = riscv_cpu_synchronize_from_tb; cc->gdb_read_register = riscv_cpu_gdb_read_register; cc->gdb_write_register = riscv_cpu_gdb_write_register; cc->gdb_num_core_regs = 33; @@ -609,16 +621,13 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) cc->gdb_stop_before_watchpoint = true; cc->disas_set_info = riscv_cpu_disas_set_info; #ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_transaction_failed = riscv_cpu_do_transaction_failed; - cc->tcg_ops.do_unaligned_access = riscv_cpu_do_unaligned_access; cc->get_phys_page_debug = riscv_cpu_get_phys_page_debug; /* For now, mark unmigratable: */ cc->vmsd = &vmstate_riscv_cpu; #endif cc->gdb_arch_name = riscv_gdb_arch_name; cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml; - cc->tcg_ops.initialize = riscv_translate_init; - cc->tcg_ops.tlb_fill = riscv_cpu_tlb_fill; + cc->tcg_ops = &riscv_tcg_ops; device_class_set_props(dc, riscv_cpu_properties); } diff --git a/target/rx/cpu.c b/target/rx/cpu.c index e79f009cbd..7ac6618b26 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -173,6 +173,19 @@ static void rx_cpu_init(Object *obj) qdev_init_gpio_in(DEVICE(cpu), rx_cpu_set_irq, 2); } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps rx_tcg_ops = { + .initialize = rx_translate_init, + .synchronize_from_tb = rx_cpu_synchronize_from_tb, + .cpu_exec_interrupt = rx_cpu_exec_interrupt, + .tlb_fill = rx_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = rx_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + static void rx_cpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -186,20 +199,17 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) cc->class_by_name = rx_cpu_class_by_name; cc->has_work = rx_cpu_has_work; - cc->tcg_ops.do_interrupt = rx_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = rx_cpu_exec_interrupt; cc->dump_state = rx_cpu_dump_state; cc->set_pc = rx_cpu_set_pc; - cc->tcg_ops.synchronize_from_tb = rx_cpu_synchronize_from_tb; + cc->gdb_read_register = rx_cpu_gdb_read_register; cc->gdb_write_register = rx_cpu_gdb_write_register; cc->get_phys_page_debug = rx_cpu_get_phys_page_debug; cc->disas_set_info = rx_cpu_disas_set_info; - cc->tcg_ops.initialize = rx_translate_init; - cc->tcg_ops.tlb_fill = rx_cpu_tlb_fill; cc->gdb_num_core_regs = 26; cc->gdb_core_xml_file = "rx-core.xml"; + cc->tcg_ops = &rx_tcg_ops; } static const TypeInfo rx_cpu_info = { diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index a723ede8d1..d35eb39a1b 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -477,6 +477,22 @@ static void s390_cpu_reset_full(DeviceState *dev) return s390_cpu_reset(s, S390_CPU_RESET_CLEAR); } +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps s390_tcg_ops = { + .initialize = s390x_translate_init, + .tlb_fill = s390_cpu_tlb_fill, + +#if !defined(CONFIG_USER_ONLY) + .cpu_exec_interrupt = s390_cpu_exec_interrupt, + .do_interrupt = s390_cpu_do_interrupt, + .debug_excp_handler = s390x_cpu_debug_excp_handler, + .do_unaligned_access = s390x_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; +#endif /* CONFIG_TCG */ + static void s390_cpu_class_init(ObjectClass *oc, void *data) { S390CPUClass *scc = S390_CPU_CLASS(oc); @@ -495,9 +511,6 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) scc->reset = s390_cpu_reset; cc->class_by_name = s390_cpu_class_by_name, cc->has_work = s390_cpu_has_work; -#ifdef CONFIG_TCG - cc->tcg_ops.do_interrupt = s390_cpu_do_interrupt; -#endif cc->dump_state = s390_cpu_dump_state; cc->set_pc = s390_cpu_set_pc; cc->gdb_read_register = s390_cpu_gdb_read_register; @@ -507,23 +520,17 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) cc->vmsd = &vmstate_s390_cpu; cc->get_crash_info = s390_cpu_get_crash_info; cc->write_elf64_note = s390_cpu_write_elf64_note; -#ifdef CONFIG_TCG - cc->tcg_ops.cpu_exec_interrupt = s390_cpu_exec_interrupt; - cc->tcg_ops.debug_excp_handler = s390x_cpu_debug_excp_handler; - cc->tcg_ops.do_unaligned_access = s390x_cpu_do_unaligned_access; -#endif #endif cc->disas_set_info = s390_cpu_disas_set_info; -#ifdef CONFIG_TCG - cc->tcg_ops.initialize = s390x_translate_init; - cc->tcg_ops.tlb_fill = s390_cpu_tlb_fill; -#endif - cc->gdb_num_core_regs = S390_NUM_CORE_REGS; cc->gdb_core_xml_file = "s390x-core64.xml"; cc->gdb_arch_name = s390_gdb_arch_name; s390_cpu_model_class_register_props(oc); + +#ifdef CONFIG_TCG + cc->tcg_ops = &s390_tcg_ops; +#endif /* CONFIG_TCG */ } static const TypeInfo s390_cpu_type_info = { diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 292152b562..a78d283bc8 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -206,6 +206,20 @@ static const VMStateDescription vmstate_sh_cpu = { .unmigratable = 1, }; +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps superh_tcg_ops = { + .initialize = sh4_translate_init, + .synchronize_from_tb = superh_cpu_synchronize_from_tb, + .cpu_exec_interrupt = superh_cpu_exec_interrupt, + .tlb_fill = superh_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = superh_cpu_do_interrupt, + .do_unaligned_access = superh_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; + static void superh_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -219,24 +233,19 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = superh_cpu_class_by_name; cc->has_work = superh_cpu_has_work; - cc->tcg_ops.do_interrupt = superh_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = superh_cpu_exec_interrupt; cc->dump_state = superh_cpu_dump_state; cc->set_pc = superh_cpu_set_pc; - cc->tcg_ops.synchronize_from_tb = superh_cpu_synchronize_from_tb; cc->gdb_read_register = superh_cpu_gdb_read_register; cc->gdb_write_register = superh_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = superh_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_unaligned_access = superh_cpu_do_unaligned_access; cc->get_phys_page_debug = superh_cpu_get_phys_page_debug; #endif cc->disas_set_info = superh_cpu_disas_set_info; - cc->tcg_ops.initialize = sh4_translate_init; cc->gdb_num_core_regs = 59; dc->vmsd = &vmstate_sh_cpu; + cc->tcg_ops = &superh_tcg_ops; } #define DEFINE_SUPERH_CPU_TYPE(type_name, cinit, initfn) \ diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 1b785f60df..aece2c7dc8 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -848,6 +848,23 @@ static Property sparc_cpu_properties[] = { DEFINE_PROP_END_OF_LIST() }; +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps sparc_tcg_ops = { + .initialize = sparc_tcg_init, + .synchronize_from_tb = sparc_cpu_synchronize_from_tb, + .cpu_exec_interrupt = sparc_cpu_exec_interrupt, + .tlb_fill = sparc_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = sparc_cpu_do_interrupt, + .do_transaction_failed = sparc_cpu_do_transaction_failed, + .do_unaligned_access = sparc_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; +#endif /* CONFIG_TCG */ + static void sparc_cpu_class_init(ObjectClass *oc, void *data) { SPARCCPUClass *scc = SPARC_CPU_CLASS(oc); @@ -863,31 +880,25 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = sparc_cpu_class_by_name; cc->parse_features = sparc_cpu_parse_features; cc->has_work = sparc_cpu_has_work; - cc->tcg_ops.do_interrupt = sparc_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = sparc_cpu_exec_interrupt; cc->dump_state = sparc_cpu_dump_state; #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) cc->memory_rw_debug = sparc_cpu_memory_rw_debug; #endif cc->set_pc = sparc_cpu_set_pc; - cc->tcg_ops.synchronize_from_tb = sparc_cpu_synchronize_from_tb; cc->gdb_read_register = sparc_cpu_gdb_read_register; cc->gdb_write_register = sparc_cpu_gdb_write_register; - cc->tcg_ops.tlb_fill = sparc_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_transaction_failed = sparc_cpu_do_transaction_failed; - cc->tcg_ops.do_unaligned_access = sparc_cpu_do_unaligned_access; cc->get_phys_page_debug = sparc_cpu_get_phys_page_debug; cc->vmsd = &vmstate_sparc_cpu; #endif cc->disas_set_info = cpu_sparc_disas_set_info; - cc->tcg_ops.initialize = sparc_tcg_init; #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) cc->gdb_num_core_regs = 86; #else cc->gdb_num_core_regs = 72; #endif + cc->tcg_ops = &sparc_tcg_ops; } static const TypeInfo sparc_cpu_type_info = { diff --git a/target/tilegx/cpu.c b/target/tilegx/cpu.c index 7d4ead4ef1..d969c2f133 100644 --- a/target/tilegx/cpu.c +++ b/target/tilegx/cpu.c @@ -134,6 +134,18 @@ static bool tilegx_cpu_exec_interrupt(CPUState *cs, int interrupt_request) return false; } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps tilegx_tcg_ops = { + .initialize = tilegx_tcg_init, + .cpu_exec_interrupt = tilegx_cpu_exec_interrupt, + .tlb_fill = tilegx_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = tilegx_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + static void tilegx_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -147,13 +159,10 @@ static void tilegx_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = tilegx_cpu_class_by_name; cc->has_work = tilegx_cpu_has_work; - cc->tcg_ops.do_interrupt = tilegx_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = tilegx_cpu_exec_interrupt; cc->dump_state = tilegx_cpu_dump_state; cc->set_pc = tilegx_cpu_set_pc; - cc->tcg_ops.tlb_fill = tilegx_cpu_tlb_fill; cc->gdb_num_core_regs = 0; - cc->tcg_ops.initialize = tilegx_tcg_init; + cc->tcg_ops = &tilegx_tcg_ops; } static const TypeInfo tilegx_cpu_type_info = { diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 9b21b640e2..0b1e139bcb 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -142,6 +142,14 @@ static void tc27x_initfn(Object *obj) set_feature(&cpu->env, TRICORE_FEATURE_161); } +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps tricore_tcg_ops = { + .initialize = tricore_tcg_init, + .synchronize_from_tb = tricore_cpu_synchronize_from_tb, + .tlb_fill = tricore_cpu_tlb_fill, +}; + static void tricore_cpu_class_init(ObjectClass *c, void *data) { TriCoreCPUClass *mcc = TRICORE_CPU_CLASS(c); @@ -162,10 +170,8 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) cc->dump_state = tricore_cpu_dump_state; cc->set_pc = tricore_cpu_set_pc; - cc->tcg_ops.synchronize_from_tb = tricore_cpu_synchronize_from_tb; cc->get_phys_page_debug = tricore_cpu_get_phys_page_debug; - cc->tcg_ops.initialize = tricore_tcg_init; - cc->tcg_ops.tlb_fill = tricore_cpu_tlb_fill; + cc->tcg_ops = &tricore_tcg_ops; } #define DEFINE_TRICORE_CPU_TYPE(cpu_model, initfn) \ diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index e27ffc571a..0258884f84 100644 --- a/target/unicore32/cpu.c +++ b/target/unicore32/cpu.c @@ -120,6 +120,18 @@ static const VMStateDescription vmstate_uc32_cpu = { .unmigratable = 1, }; +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps uc32_tcg_ops = { + .initialize = uc32_translate_init, + .cpu_exec_interrupt = uc32_cpu_exec_interrupt, + .tlb_fill = uc32_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = uc32_cpu_do_interrupt, +#endif /* !CONFIG_USER_ONLY */ +}; + static void uc32_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -131,14 +143,11 @@ static void uc32_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = uc32_cpu_class_by_name; cc->has_work = uc32_cpu_has_work; - cc->tcg_ops.do_interrupt = uc32_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = uc32_cpu_exec_interrupt; cc->dump_state = uc32_cpu_dump_state; cc->set_pc = uc32_cpu_set_pc; - cc->tcg_ops.tlb_fill = uc32_cpu_tlb_fill; cc->get_phys_page_debug = uc32_cpu_get_phys_page_debug; - cc->tcg_ops.initialize = uc32_translate_init; dc->vmsd = &vmstate_uc32_cpu; + cc->tcg_ops = &uc32_tcg_ops; } #define DEFINE_UNICORE32_CPU_TYPE(cpu_model, initfn) \ diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 4b6381569f..e2b2c7a71c 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -181,6 +181,21 @@ static const VMStateDescription vmstate_xtensa_cpu = { .unmigratable = 1, }; +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps xtensa_tcg_ops = { + .initialize = xtensa_translate_init, + .cpu_exec_interrupt = xtensa_cpu_exec_interrupt, + .tlb_fill = xtensa_cpu_tlb_fill, + .debug_excp_handler = xtensa_breakpoint_handler, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = xtensa_cpu_do_interrupt, + .do_transaction_failed = xtensa_cpu_do_transaction_failed, + .do_unaligned_access = xtensa_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; + static void xtensa_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -194,23 +209,17 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = xtensa_cpu_class_by_name; cc->has_work = xtensa_cpu_has_work; - cc->tcg_ops.do_interrupt = xtensa_cpu_do_interrupt; - cc->tcg_ops.cpu_exec_interrupt = xtensa_cpu_exec_interrupt; cc->dump_state = xtensa_cpu_dump_state; cc->set_pc = xtensa_cpu_set_pc; cc->gdb_read_register = xtensa_cpu_gdb_read_register; cc->gdb_write_register = xtensa_cpu_gdb_write_register; cc->gdb_stop_before_watchpoint = true; - cc->tcg_ops.tlb_fill = xtensa_cpu_tlb_fill; #ifndef CONFIG_USER_ONLY - cc->tcg_ops.do_unaligned_access = xtensa_cpu_do_unaligned_access; cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug; - cc->tcg_ops.do_transaction_failed = xtensa_cpu_do_transaction_failed; #endif - cc->tcg_ops.debug_excp_handler = xtensa_breakpoint_handler; cc->disas_set_info = xtensa_cpu_disas_set_info; - cc->tcg_ops.initialize = xtensa_translate_init; dc->vmsd = &vmstate_xtensa_cpu; + cc->tcg_ops = &xtensa_tcg_ops; } static const TypeInfo xtensa_cpu_type_info = { diff --git a/target/ppc/translate_init.c.inc b/target/ppc/translate_init.c.inc index 27ab243c6e..9867d0a6e4 100644 --- a/target/ppc/translate_init.c.inc +++ b/target/ppc/translate_init.c.inc @@ -10827,6 +10827,23 @@ static Property ppc_cpu_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +#ifdef CONFIG_TCG +#include "hw/core/tcg-cpu-ops.h" + +static struct TCGCPUOps ppc_tcg_ops = { + .initialize = ppc_translate_init, + .cpu_exec_interrupt = ppc_cpu_exec_interrupt, + .tlb_fill = ppc_cpu_tlb_fill, + +#ifndef CONFIG_USER_ONLY + .do_interrupt = ppc_cpu_do_interrupt, + .cpu_exec_enter = ppc_cpu_exec_enter, + .cpu_exec_exit = ppc_cpu_exec_exit, + .do_unaligned_access = ppc_cpu_do_unaligned_access, +#endif /* !CONFIG_USER_ONLY */ +}; +#endif /* CONFIG_TCG */ + static void ppc_cpu_class_init(ObjectClass *oc, void *data) { PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); @@ -10878,21 +10895,13 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #ifndef CONFIG_USER_ONLY cc->virtio_is_big_endian = ppc_cpu_is_big_endian; #endif -#ifdef CONFIG_TCG - cc->tcg_ops.initialize = ppc_translate_init; - cc->tcg_ops.cpu_exec_interrupt = ppc_cpu_exec_interrupt; - cc->tcg_ops.do_interrupt = ppc_cpu_do_interrupt; - cc->tcg_ops.tlb_fill = ppc_cpu_tlb_fill; -#ifndef CONFIG_USER_ONLY - cc->tcg_ops.cpu_exec_enter = ppc_cpu_exec_enter; - cc->tcg_ops.cpu_exec_exit = ppc_cpu_exec_exit; - cc->tcg_ops.do_unaligned_access = ppc_cpu_do_unaligned_access; -#endif /* !CONFIG_USER_ONLY */ -#endif /* CONFIG_TCG */ - cc->disas_set_info = ppc_disas_set_info; dc->fw_name = "PowerPC,UNKNOWN"; + +#ifdef CONFIG_TCG + cc->tcg_ops = &ppc_tcg_ops; +#endif /* CONFIG_TCG */ } static const TypeInfo ppc_cpu_type_info = { diff --git a/MAINTAINERS b/MAINTAINERS index 00626941f1..c8559b34d7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -129,6 +129,7 @@ F: include/exec/helper*.h F: include/exec/tb-hash.h F: include/sysemu/cpus.h F: include/sysemu/tcg.h +F: include/hw/core/tcg-cpu-ops.h FPU emulation M: Aurelien Jarno From patchwork Fri Feb 5 22:56:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377032 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2592268ejt; Fri, 5 Feb 2021 15:31:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRSLy0xnxJqaHPvj9rl1h5N0yTI7HanQPdVJrveEtP5trr4hflO5WGTI8CtqOTL0QYdrNA X-Received: by 2002:a25:83cb:: with SMTP id v11mr9636461ybm.263.1612567896675; Fri, 05 Feb 2021 15:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567896; cv=none; d=google.com; s=arc-20160816; b=OUJ2CvX2SKtyFAthU22G7npi/OHPU2pizBzro50W+h9lmnXK171I91HxldyxYR71oB gX2vQy5LhHu6V3U5pAuGpD132RlK+iSDl/4bchCgkR/tY5DQg2B4TDYC9CFttgSHluTI gwsirZb4lgVzuKmKHPcnl17FYMv9sNS3jTPkckQ5rnhm2aFLEEsFXMItyjNhpu5t7lY2 u3BVFBFKYCogHZA99BFkFH+2NzpBhjRg9SZqgUtdNusdv9lovvYG9EJkCjywKrykJriN 0VuAz0eAPqJuFVAQKHqY1MzR0vWbQ2bRrycgXtVcFfX2SnqPYnFVhoGqOhXhhiY8Kwd9 yJlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=hC0ePCVt1JmhoDAyyniytXRwmtoGo5AfNgG4i+5MWuE=; b=osQS8yhnGMSHO0UX+4Z7qbM2nquBjG2k1OABdyzgW+ATSUvj5mphmlwJHL+xXqRcnp 1KLKK9C9G+uoVwI5lIkVZH1luYpCc5WogW0voG9Icfct49whIFM0Hn7foY2w17Z6sBva Ct9RHcYbSLIT9edutzcNvKdK+nGpTxBBspunKka7qtHu6+8viBcNSPEalbItX2jP7gtW KqxWsa/v49tnNzE2B+5SP2if9rWA4GQARuzCclNW21uQKGPRavdnBudxJnnr5MNvqB3E d+dZUAdYsMqVHlTGuAGqrahc+oPyIppOjbJXpSNCETJfx4G6BWfbKhGtPa7Yp17NL+uz eevA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tR572N2I; 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=fail (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 4si10062008ybh.138.2021.02.05.15.31.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:31:36 -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=fail header.i=@linaro.org header.s=google header.b=tR572N2I; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AZb-0002h9-UG for patch@linaro.org; Fri, 05 Feb 2021 18:31:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3T-00039I-8F for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:23 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:38420) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3P-0003k8-If for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:23 -0500 Received: by mail-pg1-x534.google.com with SMTP id o16so5579458pgg.5 for ; Fri, 05 Feb 2021 14:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hC0ePCVt1JmhoDAyyniytXRwmtoGo5AfNgG4i+5MWuE=; b=tR572N2IWOZkS6w/41xY1GI7k5TsFLFfug2ZY9MXihsES7pxWPM0v76dMQ9o06mK0K o61Z68HrPquGJ7FclTVNNxgDkgmn+/s2YnmyVcGYiB42f+F45ciWTmsy+PbgFVA2EYcj 6ppryhLII7AzL4aNIRs/IdtALhyEP7ZDcIPP3pmaTla7mgRDMUQON1oLOiBt7S7hZyfG qKqbtJT1UuRjw8N5nog6M9lvFlmUlSYib6d6DEGAogC33Nx0tFj5Cftf7+oMN+Qx2fF7 yxp9mt8Swctfft2piCTCshMSrn/rwVjDc0SvFqZzpozWnODNsd/S/4TNyCxUIZbqAaH3 ht4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hC0ePCVt1JmhoDAyyniytXRwmtoGo5AfNgG4i+5MWuE=; b=VBjoc8CN/B5D1TuMh1Rf8CCmYFQA2U3UKT+8ASh2hJBcfIghdYYEWr55vt6e1FpsF0 n8PtbeKIz+TwcHCGv161RtCM+xIr7yedP1udaIT53rXEgQHvsqJ8aqQKi0mmUkD7hvI1 Fc6BZ9DwUva2ogLdo8znFLOaOUhrufsv9gQ7BM+xl2C3eVZF7r5AzEgd8ZgrIheI+cIF HEm43+Zm06s2V64AU950GL/81OAaUsiO7v001rXNRoEoMufXBQZnKc1uZZo0Y/RdbkgM TPutJzKpm4khubtSIl/+/iE2EyQm8fI48x9FsYN5s6M5NGAat5tYYUbiouDmkdwjKi4x QnYA== X-Gm-Message-State: AOAM532G6gBgZX03k+dWtMfMO2XcC8itE2954HmKByxRv6jhWHTt0xWS B3+dQ1vHO8Ksk4ShQ0sjwspyG4qFYGE+aNcH X-Received: by 2002:a63:ac19:: with SMTP id v25mr6496730pge.258.1612565898245; Fri, 05 Feb 2021 14:58:18 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 44/46] accel: extend AccelState and AccelClass to user-mode Date: Fri, 5 Feb 2021 12:56:48 -1000 Message-Id: <20210205225650.1330794-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée [claudio: rebased on Richard's splitwx work] Signed-off-by: Claudio Fontana Message-Id: <20210204163931.7358-17-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/boards.h | 2 +- include/{sysemu => qemu}/accel.h | 14 +++++---- include/sysemu/hvf.h | 2 +- include/sysemu/kvm.h | 2 +- include/sysemu/kvm_int.h | 2 +- target/i386/hvf/hvf-i386.h | 2 +- accel/accel-common.c | 50 ++++++++++++++++++++++++++++++ accel/{accel.c => accel-softmmu.c} | 27 ++-------------- accel/accel-user.c | 24 ++++++++++++++ accel/qtest/qtest.c | 2 +- accel/tcg/tcg-all.c | 15 +++++++-- accel/xen/xen-all.c | 2 +- bsd-user/main.c | 6 +++- linux-user/main.c | 6 +++- softmmu/memory.c | 2 +- softmmu/qtest.c | 2 +- softmmu/vl.c | 2 +- target/i386/hax/hax-all.c | 2 +- target/i386/hvf/hvf.c | 2 +- target/i386/hvf/x86_task.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- MAINTAINERS | 2 +- accel/meson.build | 4 ++- accel/tcg/meson.build | 2 +- 24 files changed, 125 insertions(+), 53 deletions(-) rename include/{sysemu => qemu}/accel.h (95%) create mode 100644 accel/accel-common.c rename accel/{accel.c => accel-softmmu.c} (75%) create mode 100644 accel/accel-user.c -- 2.25.1 diff --git a/include/hw/boards.h b/include/hw/boards.h index 17b1f3f0b9..85af4faf76 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -6,7 +6,7 @@ #include "exec/memory.h" #include "sysemu/hostmem.h" #include "sysemu/blockdev.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "qapi/qapi-types-machine.h" #include "qemu/module.h" #include "qom/object.h" diff --git a/include/sysemu/accel.h b/include/qemu/accel.h similarity index 95% rename from include/sysemu/accel.h rename to include/qemu/accel.h index e08b8ab8fa..fac4a18703 100644 --- a/include/sysemu/accel.h +++ b/include/qemu/accel.h @@ -20,8 +20,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#ifndef HW_ACCEL_H -#define HW_ACCEL_H +#ifndef QEMU_ACCEL_H +#define QEMU_ACCEL_H #include "qom/object.h" #include "exec/hwaddr.h" @@ -37,8 +37,8 @@ typedef struct AccelClass { /*< public >*/ const char *name; -#ifndef CONFIG_USER_ONLY int (*init_machine)(MachineState *ms); +#ifndef CONFIG_USER_ONLY void (*setup_post)(MachineState *ms, AccelState *accel); bool (*has_memory)(MachineState *ms, AddressSpace *as, hwaddr start_addr, hwaddr size); @@ -67,11 +67,13 @@ typedef struct AccelClass { OBJECT_GET_CLASS(AccelClass, (obj), TYPE_ACCEL) AccelClass *accel_find(const char *opt_name); +AccelState *current_accel(void); + +#ifndef CONFIG_USER_ONLY int accel_init_machine(AccelState *accel, MachineState *ms); /* Called just before os_setup_post (ie just before drop OS privs) */ void accel_setup_post(MachineState *ms); +#endif /* !CONFIG_USER_ONLY */ -AccelState *current_accel(void); - -#endif +#endif /* QEMU_ACCEL_H */ diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index f893768df9..c98636bc81 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -13,7 +13,7 @@ #ifndef HVF_H #define HVF_H -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "qom/object.h" #ifdef CONFIG_HVF diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index bb5d5cf497..739682f3c3 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -17,7 +17,7 @@ #include "qemu/queue.h" #include "hw/core/cpu.h" #include "exec/memattrs.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "qom/object.h" #ifdef NEED_CPU_H diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index 65740806da..ccb8869f01 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -10,7 +10,7 @@ #define QEMU_KVM_INT_H #include "exec/memory.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "sysemu/kvm.h" typedef struct KVMSlot diff --git a/target/i386/hvf/hvf-i386.h b/target/i386/hvf/hvf-i386.h index e0edffd077..50b914fd67 100644 --- a/target/i386/hvf/hvf-i386.h +++ b/target/i386/hvf/hvf-i386.h @@ -16,7 +16,7 @@ #ifndef HVF_I386_H #define HVF_I386_H -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "sysemu/hvf.h" #include "cpu.h" #include "x86.h" diff --git a/accel/accel-common.c b/accel/accel-common.c new file mode 100644 index 0000000000..ddec8cb5ae --- /dev/null +++ b/accel/accel-common.c @@ -0,0 +1,50 @@ +/* + * QEMU accel class, components common to system emulation and user mode + * + * Copyright (c) 2003-2008 Fabrice Bellard + * Copyright (c) 2014 Red Hat Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "qemu/accel.h" + +static const TypeInfo accel_type = { + .name = TYPE_ACCEL, + .parent = TYPE_OBJECT, + .class_size = sizeof(AccelClass), + .instance_size = sizeof(AccelState), +}; + +/* Lookup AccelClass from opt_name. Returns NULL if not found */ +AccelClass *accel_find(const char *opt_name) +{ + char *class_name = g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name); + AccelClass *ac = ACCEL_CLASS(object_class_by_name(class_name)); + g_free(class_name); + return ac; +} + +static void register_accel_types(void) +{ + type_register_static(&accel_type); +} + +type_init(register_accel_types); diff --git a/accel/accel.c b/accel/accel-softmmu.c similarity index 75% rename from accel/accel.c rename to accel/accel-softmmu.c index cb555e3b06..f89da8f9d1 100644 --- a/accel/accel.c +++ b/accel/accel-softmmu.c @@ -1,5 +1,5 @@ /* - * QEMU System Emulator, accelerator interfaces + * QEMU accel class, system emulation components * * Copyright (c) 2003-2008 Fabrice Bellard * Copyright (c) 2014 Red Hat Inc. @@ -24,28 +24,12 @@ */ #include "qemu/osdep.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "hw/boards.h" #include "sysemu/arch_init.h" #include "sysemu/sysemu.h" #include "qom/object.h" -static const TypeInfo accel_type = { - .name = TYPE_ACCEL, - .parent = TYPE_OBJECT, - .class_size = sizeof(AccelClass), - .instance_size = sizeof(AccelState), -}; - -/* Lookup AccelClass from opt_name. Returns NULL if not found */ -AccelClass *accel_find(const char *opt_name) -{ - char *class_name = g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name); - AccelClass *ac = ACCEL_CLASS(object_class_by_name(class_name)); - g_free(class_name); - return ac; -} - int accel_init_machine(AccelState *accel, MachineState *ms) { AccelClass *acc = ACCEL_GET_CLASS(accel); @@ -76,10 +60,3 @@ void accel_setup_post(MachineState *ms) acc->setup_post(ms, accel); } } - -static void register_accel_types(void) -{ - type_register_static(&accel_type); -} - -type_init(register_accel_types); diff --git a/accel/accel-user.c b/accel/accel-user.c new file mode 100644 index 0000000000..22b6a1a1a8 --- /dev/null +++ b/accel/accel-user.c @@ -0,0 +1,24 @@ +/* + * QEMU accel class, user-mode components + * + * Copyright 2021 SUSE LLC + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/accel.h" + +AccelState *current_accel(void) +{ + static AccelState *accel; + + if (!accel) { + AccelClass *ac = accel_find("tcg"); + + g_assert(ac != NULL); + accel = ACCEL(object_new_with_class(OBJECT_CLASS(ac))); + } + return accel; +} diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index b282cea5cf..b4e731cb2b 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -17,7 +17,7 @@ #include "qemu/module.h" #include "qemu/option.h" #include "qemu/config-file.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "sysemu/qtest.h" #include "sysemu/cpus.h" #include "sysemu/cpu-timers.h" diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 2eea8c32ee..642a7b94a7 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -30,9 +30,12 @@ #include "tcg/tcg.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/boards.h" +#include "qemu/accel.h" #include "qapi/qapi-builtin-visit.h" + +#ifndef CONFIG_USER_ONLY #include "tcg-cpus.h" +#endif /* CONFIG_USER_ONLY */ struct TCGState { AccelState parent_obj; @@ -97,7 +100,7 @@ static void tcg_accel_instance_init(Object *obj) s->mttcg_enabled = default_mttcg_enabled(); /* If debugging enabled, default "auto on", otherwise off. */ -#ifdef CONFIG_DEBUG_TCG +#if defined(CONFIG_DEBUG_TCG) && !defined(CONFIG_USER_ONLY) s->splitwx_enabled = -1; #else s->splitwx_enabled = 0; @@ -114,8 +117,12 @@ static int tcg_init(MachineState *ms) mttcg_enabled = s->mttcg_enabled; /* - * Initialize TCG regions + * Initialize TCG regions only for softmmu. + * + * This needs to be done later for user mode, because the prologue + * generation needs to be delayed so that GUEST_BASE is already set. */ +#ifndef CONFIG_USER_ONLY tcg_region_init(); if (mttcg_enabled) { @@ -125,6 +132,8 @@ static int tcg_init(MachineState *ms) } else { cpus_register_accel(&tcg_cpus_rr); } +#endif /* !CONFIG_USER_ONLY */ + return 0; } diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 878a4089d9..594aaf6b49 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -15,7 +15,7 @@ #include "hw/xen/xen-legacy-backend.h" #include "hw/xen/xen_pt.h" #include "chardev/char.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "sysemu/cpus.h" #include "sysemu/xen.h" #include "sysemu/runstate.h" diff --git a/bsd-user/main.c b/bsd-user/main.c index 65163e1396..6501164e05 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/units.h" +#include "qemu/accel.h" #include "sysemu/tcg.h" #include "qemu-version.h" #include @@ -909,8 +910,11 @@ int main(int argc, char **argv) } /* init tcg before creating CPUs and to get qemu_host_page_size */ - tcg_exec_init(0, false); + { + AccelClass *ac = ACCEL_GET_CLASS(current_accel()); + ac->init_machine(NULL); + } cpu_type = parse_cpu_option(cpu_model); cpu = cpu_create(cpu_type); env = cpu->env_ptr; diff --git a/linux-user/main.c b/linux-user/main.c index bb4e55e8fc..7ed23d9a29 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/units.h" +#include "qemu/accel.h" #include "sysemu/tcg.h" #include "qemu-version.h" #include @@ -701,8 +702,11 @@ int main(int argc, char **argv, char **envp) cpu_type = parse_cpu_option(cpu_model); /* init tcg before creating CPUs and to get qemu_host_page_size */ - tcg_exec_init(0, false); + { + AccelClass *ac = ACCEL_GET_CLASS(current_accel()); + ac->init_machine(NULL); + } cpu = cpu_create(cpu_type); env = cpu->env_ptr; cpu_reset(cpu); diff --git a/softmmu/memory.c b/softmmu/memory.c index 676c298b60..c0c814fbb9 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -32,7 +32,7 @@ #include "sysemu/kvm.h" #include "sysemu/runstate.h" #include "sysemu/tcg.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "hw/boards.h" #include "migration/vmstate.h" diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 7965dc9a16..130c366615 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -20,7 +20,7 @@ #include "exec/ioport.h" #include "exec/memory.h" #include "hw/irq.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "sysemu/cpu-timers.h" #include "qemu/config-file.h" #include "qemu/option.h" diff --git a/softmmu/vl.c b/softmmu/vl.c index bd55468669..6105c75bc7 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -44,7 +44,7 @@ #include "qemu/error-report.h" #include "qemu/sockets.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "hw/usb.h" #include "hw/isa/isa.h" #include "hw/scsi/scsi.h" diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c index fecfe8cd6e..d7f4bb44a7 100644 --- a/target/i386/hax/hax-all.c +++ b/target/i386/hax/hax-all.c @@ -28,7 +28,7 @@ #include "exec/address-spaces.h" #include "qemu-common.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" #include "hw/boards.h" diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index ed9356565c..ffc9efa40f 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -69,7 +69,7 @@ #include "exec/address-spaces.h" #include "hw/i386/apic_internal.h" #include "qemu/main-loop.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "target/i386/cpu.h" #include "hvf-cpus.h" diff --git a/target/i386/hvf/x86_task.c b/target/i386/hvf/x86_task.c index 6f04478b3a..d66dfd7669 100644 --- a/target/i386/hvf/x86_task.c +++ b/target/i386/hvf/x86_task.c @@ -28,7 +28,7 @@ #include "hw/i386/apic_internal.h" #include "qemu/main-loop.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "target/i386/cpu.h" // TODO: taskswitch handling diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 985ceba8f8..aa5c876138 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -13,7 +13,7 @@ #include "exec/address-spaces.h" #include "exec/ioport.h" #include "qemu-common.h" -#include "sysemu/accel.h" +#include "qemu/accel.h" #include "sysemu/whpx.h" #include "sysemu/cpus.h" #include "sysemu/runstate.h" diff --git a/MAINTAINERS b/MAINTAINERS index c8559b34d7..9356db50c3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -438,7 +438,7 @@ Overall M: Richard Henderson R: Paolo Bonzini S: Maintained -F: include/sysemu/accel.h +F: include/qemu/accel.h F: accel/accel.c F: accel/Makefile.objs F: accel/stubs/Makefile.objs diff --git a/accel/meson.build b/accel/meson.build index b26cca227a..b44ba30c86 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -1,4 +1,6 @@ -softmmu_ss.add(files('accel.c')) +specific_ss.add(files('accel-common.c')) +softmmu_ss.add(files('accel-softmmu.c')) +user_ss.add(files('accel-user.c')) subdir('qtest') subdir('kvm') diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index f39aab0a0c..424d9bb1fc 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,5 +1,6 @@ tcg_ss = ss.source_set() tcg_ss.add(files( + 'tcg-all.c', 'cpu-exec-common.c', 'cpu-exec.c', 'tcg-runtime-gvec.c', @@ -13,7 +14,6 @@ tcg_ss.add(when: 'CONFIG_PLUGIN', if_true: [files('plugin-gen.c'), libdl]) specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files( - 'tcg-all.c', 'cputlb.c', 'tcg-cpus.c', 'tcg-cpus-mttcg.c', From patchwork Fri Feb 5 22:56:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377033 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2592330ejt; Fri, 5 Feb 2021 15:31:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJziYKrkvKxwlm5u/Uyl3df6QEmahn+FJYI299eE9ilXb6Lijb/nkNjSpJHvuUoFnn8Hr2oF X-Received: by 2002:a25:538a:: with SMTP id h132mr9375694ybb.247.1612567902226; Fri, 05 Feb 2021 15:31:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612567902; cv=none; d=google.com; s=arc-20160816; b=FRb5YyYHmHBFSk9I1XKI7CJM5zmmIgeVgCRVhDgultALAiFc2rxXeGbkOTSBt4PGyB 9eZfegCUDFO7HQWMJwvqwnp3NK27Scr/G92KsGgoM0yzvz2jf5KbNCuS8rZ1LkzP4eE/ vrT4q2FXAGYc4Ng33BEHJHtENGXC5HEr1TBZi60eHsUudgNAl9FeZKVl4FnR9oI3Xzq9 J+Gn+339Aq1HnQnqWBvB1ufFayj0Zz0c489itYSJb2tPk6nzlY3TZ3S47bDc8pB7+TCU QiTUYif3omKRgkRlFKfH1OL7+MaZeWBqC87FOIMwyLTy2ssgxjuNAsC6D1tEeTupfc2Y S5Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=PUWhnTyOI6p8iALfKF506x8diyEWlziVC7qWUMU4QHA=; b=N18VldUGjyo51UOPobokkuQ5R/3tDWIQKxRHH9Q70y+x11/Aa8zFtVaj9IxXBZv2VL J0jKMyE8zFvXd/DFbNnfFBME+1zcIJni0+8osPXe2xwfRrewGG2PeScR8MzPUiMZm17/ lYMv577PRG/kWIn4l49jjl2WfSieaCPwnmYXFEK5J9T4PRN6GtGsZJPkgzL1faVy1DH8 jypo2B3SbTZOqBhycIUytCd12nFPUnYF+JNGQcA4y2lb955kFasbZLkjDBMHHL3aiAkR XROCP6/zEDMchTMn054Sgr7hYqDbgMs1orymqVz+FkIXaE+Ogj9I/ZuDrLUuaJTJav0W w+Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HsROPRz+; 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 k13si10020264ybg.435.2021.02.05.15.31.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:31:42 -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=HsROPRz+; 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]:56390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AZh-0002mo-KI for patch@linaro.org; Fri, 05 Feb 2021 18:31:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3W-0003Gy-7h for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:26 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:33115) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3R-0003kq-Mq for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:25 -0500 Received: by mail-pf1-x429.google.com with SMTP id o20so5326492pfu.0 for ; Fri, 05 Feb 2021 14:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PUWhnTyOI6p8iALfKF506x8diyEWlziVC7qWUMU4QHA=; b=HsROPRz+MxCEgnENeylLd3+X/zZUEWm9zS0zNc5VhHKJYmFhwgXSlZtJt7cZcyznAU tR9vyc6V6tc4Lloo8e/14F7iqZcl3IlVdb7iKe8eVwvPN/bni4/TgLtGaWARv9GTLOq0 Zaxq22NMzJdU49NtWzO50YdqF2InJVgnHSE0BXh7vgWh/giKPw7El7P3wWcTo0s/3mgX 2u79IZhReBzfVC6EEq/mWV4NCoS59vaGz7ekNDqnXpI/WH+eedIZWW00rg8JCNbCe687 +FkHhWmc1RqLndCtPHLwtS4Ydp9HVVHXZy/JD/jhTqXsj7J55GXnvHz0yfDg+SJdSb6E DT5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PUWhnTyOI6p8iALfKF506x8diyEWlziVC7qWUMU4QHA=; b=M35aRAZsPx/tfun3VXhSqMeu4q/2vHSAZ0rQAfX2HKdNLCkQrdu+Tlrm/y1X/fUAUZ G3i2F4DYLlS1WGLx06LjUE6y0IrpDnSj91JG09ZPzPtOzesEAa0GSC1Jy7FuKQItsj1D QZhi9gyyXxGKLdayQsa1jgKxi+ozPbH3FH9RLkOorM4ikwksSbcATRmCFTi2EAWQpYUD IHvPNISwcjP4yVPPVqqnpezVb6hSr1pagTw9Yxh12OQtU1Nz8QOLGQNqJY4o9mandCLz 73EKD5wUDsFyytrcPynVwWpHQwHkYFzFpqxjPSYkhcEdMvYKALtzhlYcYvILrfv+RNbV BCFQ== X-Gm-Message-State: AOAM531WNju71O2HTf1iPWy3CkyBxDmTnqaZIZAoTBia5uaxRA8pt1dg 5fsZ57zlQX5hqHnhGRHKsrCDK6cDhpBMDoTI X-Received: by 2002:a63:5014:: with SMTP id e20mr6541954pgb.152.1612565900178; Fri, 05 Feb 2021 14:58:20 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 45/46] accel: replace struct CpusAccel with AccelOpsClass Date: Fri, 5 Feb 2021 12:56:49 -1000 Message-Id: <20210205225650.1330794-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana This will allow us to centralize the registration of the cpus.c module accelerator operations (in accel/accel-softmmu.c), and trigger it automatically using object hierarchy lookup from the new accel_init_interfaces() initialization step, depending just on which accelerators are available in the code. Rename all tcg-cpus.c, kvm-cpus.c, etc to tcg-accel-ops.c, kvm-accel-ops.c, etc, matching the object type names. Signed-off-by: Claudio Fontana Message-Id: <20210204163931.7358-18-cfontana@suse.de> Signed-off-by: Richard Henderson --- accel/accel-softmmu.h | 15 ++++++ accel/kvm/kvm-cpus.h | 2 - ...g-cpus-icount.h => tcg-accel-ops-icount.h} | 2 + accel/tcg/tcg-accel-ops-mttcg.h | 19 ++++++++ .../tcg/{tcg-cpus-rr.h => tcg-accel-ops-rr.h} | 0 accel/tcg/{tcg-cpus.h => tcg-accel-ops.h} | 6 +-- include/qemu/accel.h | 2 + include/sysemu/accel-ops.h | 45 ++++++++++++++++++ include/sysemu/cpus.h | 26 ++-------- .../i386/hax/{hax-cpus.h => hax-accel-ops.h} | 2 - target/i386/hax/hax-windows.h | 2 +- .../i386/hvf/{hvf-cpus.h => hvf-accel-ops.h} | 2 - .../whpx/{whpx-cpus.h => whpx-accel-ops.h} | 2 - accel/accel-common.c | 11 +++++ accel/accel-softmmu.c | 44 +++++++++++++++-- accel/kvm/{kvm-cpus.c => kvm-accel-ops.c} | 28 ++++++++--- accel/kvm/kvm-all.c | 2 - accel/qtest/qtest.c | 23 ++++++--- ...g-cpus-icount.c => tcg-accel-ops-icount.c} | 21 +++------ ...tcg-cpus-mttcg.c => tcg-accel-ops-mttcg.c} | 14 ++---- .../tcg/{tcg-cpus-rr.c => tcg-accel-ops-rr.c} | 13 ++--- accel/tcg/{tcg-cpus.c => tcg-accel-ops.c} | 47 ++++++++++++++++++- accel/tcg/tcg-all.c | 12 ----- accel/xen/xen-all.c | 24 ++++++---- bsd-user/main.c | 3 +- linux-user/main.c | 1 + softmmu/cpus.c | 12 ++--- softmmu/vl.c | 7 ++- .../i386/hax/{hax-cpus.c => hax-accel-ops.c} | 33 +++++++++---- target/i386/hax/hax-all.c | 5 +- target/i386/hax/hax-mem.c | 2 +- target/i386/hax/hax-posix.c | 2 +- target/i386/hax/hax-windows.c | 2 +- .../i386/hvf/{hvf-cpus.c => hvf-accel-ops.c} | 29 +++++++++--- target/i386/hvf/hvf.c | 3 +- target/i386/hvf/x86hvf.c | 2 +- .../whpx/{whpx-cpus.c => whpx-accel-ops.c} | 33 +++++++++---- target/i386/whpx/whpx-all.c | 7 +-- MAINTAINERS | 3 +- accel/kvm/meson.build | 2 +- accel/tcg/meson.build | 8 ++-- target/i386/hax/meson.build | 2 +- target/i386/hvf/meson.build | 2 +- target/i386/whpx/meson.build | 2 +- 44 files changed, 361 insertions(+), 163 deletions(-) create mode 100644 accel/accel-softmmu.h rename accel/tcg/{tcg-cpus-icount.h => tcg-accel-ops-icount.h} (88%) create mode 100644 accel/tcg/tcg-accel-ops-mttcg.h rename accel/tcg/{tcg-cpus-rr.h => tcg-accel-ops-rr.h} (100%) rename accel/tcg/{tcg-cpus.h => tcg-accel-ops.h} (72%) create mode 100644 include/sysemu/accel-ops.h rename target/i386/hax/{hax-cpus.h => hax-accel-ops.h} (95%) rename target/i386/hvf/{hvf-cpus.h => hvf-accel-ops.h} (94%) rename target/i386/whpx/{whpx-cpus.h => whpx-accel-ops.h} (96%) rename accel/kvm/{kvm-cpus.c => kvm-accel-ops.c} (72%) rename accel/tcg/{tcg-cpus-icount.c => tcg-accel-ops-icount.c} (89%) rename accel/tcg/{tcg-cpus-mttcg.c => tcg-accel-ops-mttcg.c} (92%) rename accel/tcg/{tcg-cpus-rr.c => tcg-accel-ops-rr.c} (97%) rename accel/tcg/{tcg-cpus.c => tcg-accel-ops.c} (63%) rename target/i386/hax/{hax-cpus.c => hax-accel-ops.c} (69%) rename target/i386/hvf/{hvf-cpus.c => hvf-accel-ops.c} (84%) rename target/i386/whpx/{whpx-cpus.c => whpx-accel-ops.c} (71%) -- 2.25.1 diff --git a/accel/accel-softmmu.h b/accel/accel-softmmu.h new file mode 100644 index 0000000000..5e192f1882 --- /dev/null +++ b/accel/accel-softmmu.h @@ -0,0 +1,15 @@ +/* + * QEMU System Emulation accel internal functions + * + * Copyright 2021 SUSE LLC + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef ACCEL_SOFTMMU_H +#define ACCEL_SOFTMMU_H + +void accel_init_ops_interfaces(AccelClass *ac); + +#endif /* ACCEL_SOFTMMU_H */ diff --git a/accel/kvm/kvm-cpus.h b/accel/kvm/kvm-cpus.h index 3df732b816..bf0bd1bee4 100644 --- a/accel/kvm/kvm-cpus.h +++ b/accel/kvm/kvm-cpus.h @@ -12,8 +12,6 @@ #include "sysemu/cpus.h" -extern const CpusAccel kvm_cpus; - int kvm_init_vcpu(CPUState *cpu, Error **errp); int kvm_cpu_exec(CPUState *cpu); void kvm_destroy_vcpu(CPUState *cpu); diff --git a/accel/tcg/tcg-cpus-icount.h b/accel/tcg/tcg-accel-ops-icount.h similarity index 88% rename from accel/tcg/tcg-cpus-icount.h rename to accel/tcg/tcg-accel-ops-icount.h index b695939dfa..d884aa2aaa 100644 --- a/accel/tcg/tcg-cpus-icount.h +++ b/accel/tcg/tcg-accel-ops-icount.h @@ -14,4 +14,6 @@ void icount_handle_deadline(void); void icount_prepare_for_run(CPUState *cpu); void icount_process_data(CPUState *cpu); +void icount_handle_interrupt(CPUState *cpu, int mask); + #endif /* TCG_CPUS_ICOUNT_H */ diff --git a/accel/tcg/tcg-accel-ops-mttcg.h b/accel/tcg/tcg-accel-ops-mttcg.h new file mode 100644 index 0000000000..9fdc5a2ab5 --- /dev/null +++ b/accel/tcg/tcg-accel-ops-mttcg.h @@ -0,0 +1,19 @@ +/* + * QEMU TCG Multi Threaded vCPUs implementation + * + * Copyright 2021 SUSE LLC + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef TCG_CPUS_MTTCG_H +#define TCG_CPUS_MTTCG_H + +/* kick MTTCG vCPU thread */ +void mttcg_kick_vcpu_thread(CPUState *cpu); + +/* start an mttcg vCPU thread */ +void mttcg_start_vcpu_thread(CPUState *cpu); + +#endif /* TCG_CPUS_MTTCG_H */ diff --git a/accel/tcg/tcg-cpus-rr.h b/accel/tcg/tcg-accel-ops-rr.h similarity index 100% rename from accel/tcg/tcg-cpus-rr.h rename to accel/tcg/tcg-accel-ops-rr.h diff --git a/accel/tcg/tcg-cpus.h b/accel/tcg/tcg-accel-ops.h similarity index 72% rename from accel/tcg/tcg-cpus.h rename to accel/tcg/tcg-accel-ops.h index d6893a32f8..48130006de 100644 --- a/accel/tcg/tcg-cpus.h +++ b/accel/tcg/tcg-accel-ops.h @@ -14,12 +14,8 @@ #include "sysemu/cpus.h" -extern const CpusAccel tcg_cpus_mttcg; -extern const CpusAccel tcg_cpus_icount; -extern const CpusAccel tcg_cpus_rr; - void tcg_cpus_destroy(CPUState *cpu); int tcg_cpus_exec(CPUState *cpu); -void tcg_cpus_handle_interrupt(CPUState *cpu, int mask); +void tcg_handle_interrupt(CPUState *cpu, int mask); #endif /* TCG_CPUS_H */ diff --git a/include/qemu/accel.h b/include/qemu/accel.h index fac4a18703..b9d6d69eb8 100644 --- a/include/qemu/accel.h +++ b/include/qemu/accel.h @@ -69,6 +69,8 @@ typedef struct AccelClass { AccelClass *accel_find(const char *opt_name); AccelState *current_accel(void); +void accel_init_interfaces(AccelClass *ac); + #ifndef CONFIG_USER_ONLY int accel_init_machine(AccelState *accel, MachineState *ms); diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h new file mode 100644 index 0000000000..032f6979d7 --- /dev/null +++ b/include/sysemu/accel-ops.h @@ -0,0 +1,45 @@ +/* + * Accelerator OPS, used for cpus.c module + * + * Copyright 2021 SUSE LLC + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef ACCEL_OPS_H +#define ACCEL_OPS_H + +#include "qom/object.h" + +#define ACCEL_OPS_SUFFIX "-ops" +#define TYPE_ACCEL_OPS "accel" ACCEL_OPS_SUFFIX +#define ACCEL_OPS_NAME(name) (name "-" TYPE_ACCEL_OPS) + +typedef struct AccelOpsClass AccelOpsClass; +DECLARE_CLASS_CHECKERS(AccelOpsClass, ACCEL_OPS, TYPE_ACCEL_OPS) + +/* cpus.c operations interface */ +struct AccelOpsClass { + /*< private >*/ + ObjectClass parent_class; + /*< public >*/ + + /* initialization function called when accel is chosen */ + void (*ops_init)(AccelOpsClass *ops); + + void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ + void (*kick_vcpu_thread)(CPUState *cpu); + + void (*synchronize_post_reset)(CPUState *cpu); + void (*synchronize_post_init)(CPUState *cpu); + void (*synchronize_state)(CPUState *cpu); + void (*synchronize_pre_loadvm)(CPUState *cpu); + + void (*handle_interrupt)(CPUState *cpu, int mask); + + int64_t (*get_virtual_clock)(void); + int64_t (*get_elapsed_ticks)(void); +}; + +#endif /* ACCEL_OPS_H */ diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h index e8156728c6..2cd74392e0 100644 --- a/include/sysemu/cpus.h +++ b/include/sysemu/cpus.h @@ -2,30 +2,14 @@ #define QEMU_CPUS_H #include "qemu/timer.h" +#include "sysemu/accel-ops.h" -/* cpus.c */ +/* register accel-specific operations */ +void cpus_register_accel(const AccelOpsClass *i); -/* CPU execution threads */ +/* accel/dummy-cpus.c */ -typedef struct CpusAccel { - void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY */ - void (*kick_vcpu_thread)(CPUState *cpu); - - void (*synchronize_post_reset)(CPUState *cpu); - void (*synchronize_post_init)(CPUState *cpu); - void (*synchronize_state)(CPUState *cpu); - void (*synchronize_pre_loadvm)(CPUState *cpu); - - void (*handle_interrupt)(CPUState *cpu, int mask); - - int64_t (*get_virtual_clock)(void); - int64_t (*get_elapsed_ticks)(void); -} CpusAccel; - -/* register accel-specific cpus interface implementation */ -void cpus_register_accel(const CpusAccel *i); - -/* Create a dummy vcpu for CpusAccel->create_vcpu_thread */ +/* Create a dummy vcpu for AccelOpsClass->create_vcpu_thread */ void dummy_start_vcpu_thread(CPUState *); /* interface available for cpus accelerator threads */ diff --git a/target/i386/hax/hax-cpus.h b/target/i386/hax/hax-accel-ops.h similarity index 95% rename from target/i386/hax/hax-cpus.h rename to target/i386/hax/hax-accel-ops.h index ee8ab7a631..c7698519cd 100644 --- a/target/i386/hax/hax-cpus.h +++ b/target/i386/hax/hax-accel-ops.h @@ -12,8 +12,6 @@ #include "sysemu/cpus.h" -extern const CpusAccel hax_cpus; - #include "hax-interface.h" #include "hax-i386.h" diff --git a/target/i386/hax/hax-windows.h b/target/i386/hax/hax-windows.h index a5ce12d663..b1f5d4f32f 100644 --- a/target/i386/hax/hax-windows.h +++ b/target/i386/hax/hax-windows.h @@ -23,7 +23,7 @@ #include #include -#include "hax-cpus.h" +#include "hax-accel-ops.h" #define HAX_INVALID_FD INVALID_HANDLE_VALUE diff --git a/target/i386/hvf/hvf-cpus.h b/target/i386/hvf/hvf-accel-ops.h similarity index 94% rename from target/i386/hvf/hvf-cpus.h rename to target/i386/hvf/hvf-accel-ops.h index ced31b82c0..8f992da168 100644 --- a/target/i386/hvf/hvf-cpus.h +++ b/target/i386/hvf/hvf-accel-ops.h @@ -12,8 +12,6 @@ #include "sysemu/cpus.h" -extern const CpusAccel hvf_cpus; - int hvf_init_vcpu(CPUState *); int hvf_vcpu_exec(CPUState *); void hvf_cpu_synchronize_state(CPUState *); diff --git a/target/i386/whpx/whpx-cpus.h b/target/i386/whpx/whpx-accel-ops.h similarity index 96% rename from target/i386/whpx/whpx-cpus.h rename to target/i386/whpx/whpx-accel-ops.h index bdb367d1d0..2dee6d61ea 100644 --- a/target/i386/whpx/whpx-cpus.h +++ b/target/i386/whpx/whpx-accel-ops.h @@ -12,8 +12,6 @@ #include "sysemu/cpus.h" -extern const CpusAccel whpx_cpus; - int whpx_init_vcpu(CPUState *cpu); int whpx_vcpu_exec(CPUState *cpu); void whpx_destroy_vcpu(CPUState *cpu); diff --git a/accel/accel-common.c b/accel/accel-common.c index ddec8cb5ae..6b59873419 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -26,6 +26,10 @@ #include "qemu/osdep.h" #include "qemu/accel.h" +#ifndef CONFIG_USER_ONLY +#include "accel-softmmu.h" +#endif /* !CONFIG_USER_ONLY */ + static const TypeInfo accel_type = { .name = TYPE_ACCEL, .parent = TYPE_OBJECT, @@ -42,6 +46,13 @@ AccelClass *accel_find(const char *opt_name) return ac; } +void accel_init_interfaces(AccelClass *ac) +{ +#ifndef CONFIG_USER_ONLY + accel_init_ops_interfaces(ac); +#endif /* !CONFIG_USER_ONLY */ +} + static void register_accel_types(void) { type_register_static(&accel_type); diff --git a/accel/accel-softmmu.c b/accel/accel-softmmu.c index f89da8f9d1..50fa5acaa4 100644 --- a/accel/accel-softmmu.c +++ b/accel/accel-softmmu.c @@ -26,9 +26,9 @@ #include "qemu/osdep.h" #include "qemu/accel.h" #include "hw/boards.h" -#include "sysemu/arch_init.h" -#include "sysemu/sysemu.h" -#include "qom/object.h" +#include "sysemu/cpus.h" + +#include "accel-softmmu.h" int accel_init_machine(AccelState *accel, MachineState *ms) { @@ -60,3 +60,41 @@ void accel_setup_post(MachineState *ms) acc->setup_post(ms, accel); } } + +/* initialize the arch-independent accel operation interfaces */ +void accel_init_ops_interfaces(AccelClass *ac) +{ + const char *ac_name; + char *ops_name; + AccelOpsClass *ops; + + ac_name = object_class_get_name(OBJECT_CLASS(ac)); + g_assert(ac_name != NULL); + + ops_name = g_strdup_printf("%s" ACCEL_OPS_SUFFIX, ac_name); + ops = ACCEL_OPS_CLASS(object_class_by_name(ops_name)); + g_free(ops_name); + + /* + * all accelerators need to define ops, providing at least a mandatory + * non-NULL create_vcpu_thread operation. + */ + g_assert(ops != NULL); + if (ops->ops_init) { + ops->ops_init(ops); + } + cpus_register_accel(ops); +} + +static const TypeInfo accel_ops_type_info = { + .name = TYPE_ACCEL_OPS, + .parent = TYPE_OBJECT, + .abstract = true, + .class_size = sizeof(AccelOpsClass), +}; + +static void accel_softmmu_register_types(void) +{ + type_register_static(&accel_ops_type_info); +} +type_init(accel_softmmu_register_types); diff --git a/accel/kvm/kvm-cpus.c b/accel/kvm/kvm-accel-ops.c similarity index 72% rename from accel/kvm/kvm-cpus.c rename to accel/kvm/kvm-accel-ops.c index d809b1e74c..7516c67a3f 100644 --- a/accel/kvm/kvm-cpus.c +++ b/accel/kvm/kvm-accel-ops.c @@ -74,11 +74,27 @@ static void kvm_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } -const CpusAccel kvm_cpus = { - .create_vcpu_thread = kvm_start_vcpu_thread, +static void kvm_accel_ops_class_init(ObjectClass *oc, void *data) +{ + AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - .synchronize_post_reset = kvm_cpu_synchronize_post_reset, - .synchronize_post_init = kvm_cpu_synchronize_post_init, - .synchronize_state = kvm_cpu_synchronize_state, - .synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm, + ops->create_vcpu_thread = kvm_start_vcpu_thread; + ops->synchronize_post_reset = kvm_cpu_synchronize_post_reset; + ops->synchronize_post_init = kvm_cpu_synchronize_post_init; + ops->synchronize_state = kvm_cpu_synchronize_state; + ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm; +} + +static const TypeInfo kvm_accel_ops_type = { + .name = ACCEL_OPS_NAME("kvm"), + + .parent = TYPE_ACCEL_OPS, + .class_init = kvm_accel_ops_class_init, + .abstract = true, }; + +static void kvm_accel_ops_register_types(void) +{ + type_register_static(&kvm_accel_ops_type); +} +type_init(kvm_accel_ops_register_types); diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 3feb17d965..5164d838b9 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2256,8 +2256,6 @@ static int kvm_init(MachineState *ms) ret = ram_block_discard_disable(true); assert(!ret); } - - cpus_register_accel(&kvm_cpus); return 0; err: diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index b4e731cb2b..edb29f6fa4 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -25,14 +25,8 @@ #include "qemu/main-loop.h" #include "hw/core/cpu.h" -const CpusAccel qtest_cpus = { - .create_vcpu_thread = dummy_start_vcpu_thread, - .get_virtual_clock = qtest_get_virtual_clock, -}; - static int qtest_init_accel(MachineState *ms) { - cpus_register_accel(&qtest_cpus); return 0; } @@ -52,9 +46,26 @@ static const TypeInfo qtest_accel_type = { .class_init = qtest_accel_class_init, }; +static void qtest_accel_ops_class_init(ObjectClass *oc, void *data) +{ + AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); + + ops->create_vcpu_thread = dummy_start_vcpu_thread; + ops->get_virtual_clock = qtest_get_virtual_clock; +}; + +static const TypeInfo qtest_accel_ops_type = { + .name = ACCEL_OPS_NAME("qtest"), + + .parent = TYPE_ACCEL_OPS, + .class_init = qtest_accel_ops_class_init, + .abstract = true, +}; + static void qtest_type_init(void) { type_register_static(&qtest_accel_type); + type_register_static(&qtest_accel_ops_type); } type_init(qtest_type_init); diff --git a/accel/tcg/tcg-cpus-icount.c b/accel/tcg/tcg-accel-ops-icount.c similarity index 89% rename from accel/tcg/tcg-cpus-icount.c rename to accel/tcg/tcg-accel-ops-icount.c index 9f45432275..87762b469c 100644 --- a/accel/tcg/tcg-cpus-icount.c +++ b/accel/tcg/tcg-accel-ops-icount.c @@ -32,9 +32,9 @@ #include "exec/exec-all.h" #include "hw/boards.h" -#include "tcg-cpus.h" -#include "tcg-cpus-icount.h" -#include "tcg-cpus-rr.h" +#include "tcg-accel-ops.h" +#include "tcg-accel-ops-icount.h" +#include "tcg-accel-ops-rr.h" static int64_t icount_get_limit(void) { @@ -93,7 +93,7 @@ void icount_prepare_for_run(CPUState *cpu) /* * These should always be cleared by icount_process_data after * each vCPU execution. However u16.high can be raised - * asynchronously by cpu_exit/cpu_interrupt/tcg_cpus_handle_interrupt + * asynchronously by cpu_exit/cpu_interrupt/tcg_handle_interrupt */ g_assert(cpu_neg(cpu)->icount_decr.u16.low == 0); g_assert(cpu->icount_extra == 0); @@ -125,23 +125,14 @@ void icount_process_data(CPUState *cpu) replay_mutex_unlock(); } -static void icount_handle_interrupt(CPUState *cpu, int mask) +void icount_handle_interrupt(CPUState *cpu, int mask) { int old_mask = cpu->interrupt_request; - tcg_cpus_handle_interrupt(cpu, mask); + tcg_handle_interrupt(cpu, mask); if (qemu_cpu_is_self(cpu) && !cpu->can_do_io && (mask & ~old_mask) != 0) { cpu_abort(cpu, "Raised interrupt while not in I/O function"); } } - -const CpusAccel tcg_cpus_icount = { - .create_vcpu_thread = rr_start_vcpu_thread, - .kick_vcpu_thread = rr_kick_vcpu_thread, - - .handle_interrupt = icount_handle_interrupt, - .get_virtual_clock = icount_get, - .get_elapsed_ticks = icount_get, -}; diff --git a/accel/tcg/tcg-cpus-mttcg.c b/accel/tcg/tcg-accel-ops-mttcg.c similarity index 92% rename from accel/tcg/tcg-cpus-mttcg.c rename to accel/tcg/tcg-accel-ops-mttcg.c index 9c3767d260..42973fb062 100644 --- a/accel/tcg/tcg-cpus-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -32,7 +32,8 @@ #include "exec/exec-all.h" #include "hw/boards.h" -#include "tcg-cpus.h" +#include "tcg-accel-ops.h" +#include "tcg-accel-ops-mttcg.h" /* * In the multi-threaded case each vCPU has its own thread. The TLS @@ -103,12 +104,12 @@ static void *mttcg_cpu_thread_fn(void *arg) return NULL; } -static void mttcg_kick_vcpu_thread(CPUState *cpu) +void mttcg_kick_vcpu_thread(CPUState *cpu) { cpu_exit(cpu); } -static void mttcg_start_vcpu_thread(CPUState *cpu) +void mttcg_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; @@ -131,10 +132,3 @@ static void mttcg_start_vcpu_thread(CPUState *cpu) cpu->hThread = qemu_thread_get_handle(cpu->thread); #endif } - -const CpusAccel tcg_cpus_mttcg = { - .create_vcpu_thread = mttcg_start_vcpu_thread, - .kick_vcpu_thread = mttcg_kick_vcpu_thread, - - .handle_interrupt = tcg_cpus_handle_interrupt, -}; diff --git a/accel/tcg/tcg-cpus-rr.c b/accel/tcg/tcg-accel-ops-rr.c similarity index 97% rename from accel/tcg/tcg-cpus-rr.c rename to accel/tcg/tcg-accel-ops-rr.c index 0181d2e4eb..4a66055e0d 100644 --- a/accel/tcg/tcg-cpus-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -32,9 +32,9 @@ #include "exec/exec-all.h" #include "hw/boards.h" -#include "tcg-cpus.h" -#include "tcg-cpus-rr.h" -#include "tcg-cpus-icount.h" +#include "tcg-accel-ops.h" +#include "tcg-accel-ops-rr.h" +#include "tcg-accel-ops-icount.h" /* Kick all RR vCPUs */ void rr_kick_vcpu_thread(CPUState *unused) @@ -296,10 +296,3 @@ void rr_start_vcpu_thread(CPUState *cpu) cpu->created = true; } } - -const CpusAccel tcg_cpus_rr = { - .create_vcpu_thread = rr_start_vcpu_thread, - .kick_vcpu_thread = rr_kick_vcpu_thread, - - .handle_interrupt = tcg_cpus_handle_interrupt, -}; diff --git a/accel/tcg/tcg-cpus.c b/accel/tcg/tcg-accel-ops.c similarity index 63% rename from accel/tcg/tcg-cpus.c rename to accel/tcg/tcg-accel-ops.c index e335f9f155..6144d9df87 100644 --- a/accel/tcg/tcg-cpus.c +++ b/accel/tcg/tcg-accel-ops.c @@ -34,7 +34,10 @@ #include "exec/exec-all.h" #include "hw/boards.h" -#include "tcg-cpus.h" +#include "tcg-accel-ops.h" +#include "tcg-accel-ops-mttcg.h" +#include "tcg-accel-ops-rr.h" +#include "tcg-accel-ops-icount.h" /* common functionality among all TCG variants */ @@ -64,7 +67,7 @@ int tcg_cpus_exec(CPUState *cpu) } /* mask must never be zero, except for A20 change call */ -void tcg_cpus_handle_interrupt(CPUState *cpu, int mask) +void tcg_handle_interrupt(CPUState *cpu, int mask) { g_assert(qemu_mutex_iothread_locked()); @@ -80,3 +83,43 @@ void tcg_cpus_handle_interrupt(CPUState *cpu, int mask) qatomic_set(&cpu_neg(cpu)->icount_decr.u16.high, -1); } } + +static void tcg_accel_ops_init(AccelOpsClass *ops) +{ + if (qemu_tcg_mttcg_enabled()) { + ops->create_vcpu_thread = mttcg_start_vcpu_thread; + ops->kick_vcpu_thread = mttcg_kick_vcpu_thread; + ops->handle_interrupt = tcg_handle_interrupt; + } else if (icount_enabled()) { + ops->create_vcpu_thread = rr_start_vcpu_thread; + ops->kick_vcpu_thread = rr_kick_vcpu_thread; + ops->handle_interrupt = icount_handle_interrupt; + ops->get_virtual_clock = icount_get; + ops->get_elapsed_ticks = icount_get; + } else { + ops->create_vcpu_thread = rr_start_vcpu_thread; + ops->kick_vcpu_thread = rr_kick_vcpu_thread; + ops->handle_interrupt = tcg_handle_interrupt; + } +} + +static void tcg_accel_ops_class_init(ObjectClass *oc, void *data) +{ + AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); + + ops->ops_init = tcg_accel_ops_init; +} + +static const TypeInfo tcg_accel_ops_type = { + .name = ACCEL_OPS_NAME("tcg"), + + .parent = TYPE_ACCEL_OPS, + .class_init = tcg_accel_ops_class_init, + .abstract = true, +}; + +static void tcg_accel_ops_register_types(void) +{ + type_register_static(&tcg_accel_ops_type); +} +type_init(tcg_accel_ops_register_types); diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 642a7b94a7..e378c2db73 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -33,10 +33,6 @@ #include "qemu/accel.h" #include "qapi/qapi-builtin-visit.h" -#ifndef CONFIG_USER_ONLY -#include "tcg-cpus.h" -#endif /* CONFIG_USER_ONLY */ - struct TCGState { AccelState parent_obj; @@ -124,14 +120,6 @@ static int tcg_init(MachineState *ms) */ #ifndef CONFIG_USER_ONLY tcg_region_init(); - - if (mttcg_enabled) { - cpus_register_accel(&tcg_cpus_mttcg); - } else if (icount_enabled()) { - cpus_register_accel(&tcg_cpus_icount); - } else { - cpus_register_accel(&tcg_cpus_rr); - } #endif /* !CONFIG_USER_ONLY */ return 0; diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 594aaf6b49..e9d2d6aaaa 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -154,10 +154,6 @@ static void xen_setup_post(MachineState *ms, AccelState *accel) } } -const CpusAccel xen_cpus = { - .create_vcpu_thread = dummy_start_vcpu_thread, -}; - static int xen_init(MachineState *ms) { MachineClass *mc = MACHINE_GET_CLASS(ms); @@ -185,9 +181,6 @@ static int xen_init(MachineState *ms) * opt out of system RAM being allocated by generic code */ mc->default_ram_id = NULL; - - cpus_register_accel(&xen_cpus); - return 0; } @@ -222,9 +215,24 @@ static const TypeInfo xen_accel_type = { .class_init = xen_accel_class_init, }; +static void xen_accel_ops_class_init(ObjectClass *oc, void *data) +{ + AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); + + ops->create_vcpu_thread = dummy_start_vcpu_thread; +} + +static const TypeInfo xen_accel_ops_type = { + .name = ACCEL_OPS_NAME("xen"), + + .parent = TYPE_ACCEL_OPS, + .class_init = xen_accel_ops_class_init, + .abstract = true, +}; + static void xen_type_init(void) { type_register_static(&xen_accel_type); + type_register_static(&xen_accel_ops_type); } - type_init(xen_type_init); diff --git a/bsd-user/main.c b/bsd-user/main.c index 6501164e05..7cc08024e3 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -909,13 +909,14 @@ int main(int argc, char **argv) #endif } + cpu_type = parse_cpu_option(cpu_model); /* init tcg before creating CPUs and to get qemu_host_page_size */ { AccelClass *ac = ACCEL_GET_CLASS(current_accel()); ac->init_machine(NULL); + accel_init_interfaces(ac); } - cpu_type = parse_cpu_option(cpu_model); cpu = cpu_create(cpu_type); env = cpu->env_ptr; #if defined(TARGET_SPARC) || defined(TARGET_PPC) diff --git a/linux-user/main.c b/linux-user/main.c index 7ed23d9a29..2e3c169878 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -706,6 +706,7 @@ int main(int argc, char **argv, char **envp) AccelClass *ac = ACCEL_GET_CLASS(current_accel()); ac->init_machine(NULL); + accel_init_interfaces(ac); } cpu = cpu_create(cpu_type); env = cpu->env_ptr; diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 1dc20b9dc3..112eba9d54 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -128,7 +128,7 @@ void hw_error(const char *fmt, ...) /* * The chosen accelerator is supposed to register this. */ -static const CpusAccel *cpus_accel; +static const AccelOpsClass *cpus_accel; void cpu_synchronize_all_states(void) { @@ -594,11 +594,11 @@ void cpu_remove_sync(CPUState *cpu) qemu_mutex_lock_iothread(); } -void cpus_register_accel(const CpusAccel *ca) +void cpus_register_accel(const AccelOpsClass *ops) { - assert(ca != NULL); - assert(ca->create_vcpu_thread != NULL); /* mandatory */ - cpus_accel = ca; + assert(ops != NULL); + assert(ops->create_vcpu_thread != NULL); /* mandatory */ + cpus_accel = ops; } void qemu_init_vcpu(CPUState *cpu) @@ -618,7 +618,7 @@ void qemu_init_vcpu(CPUState *cpu) cpu_address_space_init(cpu, 0, "cpu-memory", cpu->memory); } - /* accelerators all implement the CpusAccel interface */ + /* accelerators all implement the AccelOpsClass */ g_assert(cpus_accel != NULL && cpus_accel->create_vcpu_thread != NULL); cpus_accel->create_vcpu_thread(cpu); diff --git a/softmmu/vl.c b/softmmu/vl.c index 6105c75bc7..2bf94ece9c 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1726,7 +1726,8 @@ static bool object_create_early(const char *type, QemuOpts *opts) return false; } - /* Allocation of large amounts of memory may delay + /* + * Allocation of large amounts of memory may delay * chardev initialization for too long, and trigger timeouts * on software that waits for a monitor socket to be created * (e.g. libvirt). @@ -3497,7 +3498,7 @@ void qemu_init(int argc, char **argv, char **envp) * * Machine compat properties: object_set_machine_compat_props(). * Accelerator compat props: object_set_accelerator_compat_props(), - * called from configure_accelerator(). + * called from do_configure_accelerator(). */ machine_class = MACHINE_GET_CLASS(current_machine); @@ -3519,6 +3520,8 @@ void qemu_init(int argc, char **argv, char **envp) if (cpu_option) { current_machine->cpu_type = parse_cpu_option(cpu_option); } + /* NB: for machine none cpu_type could STILL be NULL here! */ + accel_init_interfaces(ACCEL_GET_CLASS(current_machine->accelerator)); qemu_resolve_machine_memdev(); parse_numa_opts(current_machine); diff --git a/target/i386/hax/hax-cpus.c b/target/i386/hax/hax-accel-ops.c similarity index 69% rename from target/i386/hax/hax-cpus.c rename to target/i386/hax/hax-accel-ops.c index f72c85bd49..136630e9b2 100644 --- a/target/i386/hax/hax-cpus.c +++ b/target/i386/hax/hax-accel-ops.c @@ -26,7 +26,7 @@ #include "sysemu/cpus.h" #include "qemu/guest-random.h" -#include "hax-cpus.h" +#include "hax-accel-ops.h" static void *hax_cpu_thread_fn(void *arg) { @@ -74,12 +74,29 @@ static void hax_start_vcpu_thread(CPUState *cpu) #endif } -const CpusAccel hax_cpus = { - .create_vcpu_thread = hax_start_vcpu_thread, - .kick_vcpu_thread = hax_kick_vcpu_thread, +static void hax_accel_ops_class_init(ObjectClass *oc, void *data) +{ + AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - .synchronize_post_reset = hax_cpu_synchronize_post_reset, - .synchronize_post_init = hax_cpu_synchronize_post_init, - .synchronize_state = hax_cpu_synchronize_state, - .synchronize_pre_loadvm = hax_cpu_synchronize_pre_loadvm, + ops->create_vcpu_thread = hax_start_vcpu_thread; + ops->kick_vcpu_thread = hax_kick_vcpu_thread; + + ops->synchronize_post_reset = hax_cpu_synchronize_post_reset; + ops->synchronize_post_init = hax_cpu_synchronize_post_init; + ops->synchronize_state = hax_cpu_synchronize_state; + ops->synchronize_pre_loadvm = hax_cpu_synchronize_pre_loadvm; +} + +static const TypeInfo hax_accel_ops_type = { + .name = ACCEL_OPS_NAME("hax"), + + .parent = TYPE_ACCEL_OPS, + .class_init = hax_accel_ops_class_init, + .abstract = true, }; + +static void hax_accel_ops_register_types(void) +{ + type_register_static(&hax_accel_ops_type); +} +type_init(hax_accel_ops_register_types); diff --git a/target/i386/hax/hax-all.c b/target/i386/hax/hax-all.c index d7f4bb44a7..bf65ed6fa9 100644 --- a/target/i386/hax/hax-all.c +++ b/target/i386/hax/hax-all.c @@ -33,7 +33,7 @@ #include "sysemu/runstate.h" #include "hw/boards.h" -#include "hax-cpus.h" +#include "hax-accel-ops.h" #define DEBUG_HAX 0 @@ -364,9 +364,6 @@ static int hax_accel_init(MachineState *ms) !ret ? "working" : "not working", !ret ? "fast virt" : "emulation"); } - if (ret == 0) { - cpus_register_accel(&hax_cpus); - } return ret; } diff --git a/target/i386/hax/hax-mem.c b/target/i386/hax/hax-mem.c index 71e637cf16..35495f5e82 100644 --- a/target/i386/hax/hax-mem.c +++ b/target/i386/hax/hax-mem.c @@ -13,7 +13,7 @@ #include "exec/address-spaces.h" #include "qemu/error-report.h" -#include "hax-cpus.h" +#include "hax-accel-ops.h" #include "qemu/queue.h" #define DEBUG_HAX_MEM 0 diff --git a/target/i386/hax/hax-posix.c b/target/i386/hax/hax-posix.c index 735a749d4b..ac1a51096e 100644 --- a/target/i386/hax/hax-posix.c +++ b/target/i386/hax/hax-posix.c @@ -15,7 +15,7 @@ #include #include "sysemu/cpus.h" -#include "hax-cpus.h" +#include "hax-accel-ops.h" hax_fd hax_mod_open(void) { diff --git a/target/i386/hax/hax-windows.c b/target/i386/hax/hax-windows.c index 6c82dfb54f..59afa213a6 100644 --- a/target/i386/hax/hax-windows.c +++ b/target/i386/hax/hax-windows.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "hax-cpus.h" +#include "hax-accel-ops.h" /* * return 0 when success, -1 when driver not loaded, diff --git a/target/i386/hvf/hvf-cpus.c b/target/i386/hvf/hvf-accel-ops.c similarity index 84% rename from target/i386/hvf/hvf-cpus.c rename to target/i386/hvf/hvf-accel-ops.c index 817b3d7452..cbaad238e0 100644 --- a/target/i386/hvf/hvf-cpus.c +++ b/target/i386/hvf/hvf-accel-ops.c @@ -55,7 +55,7 @@ #include "target/i386/cpu.h" #include "qemu/guest-random.h" -#include "hvf-cpus.h" +#include "hvf-accel-ops.h" /* * The HVF-specific vCPU thread function. This one should only run when the host @@ -121,11 +121,26 @@ static void hvf_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } -const CpusAccel hvf_cpus = { - .create_vcpu_thread = hvf_start_vcpu_thread, +static void hvf_accel_ops_class_init(ObjectClass *oc, void *data) +{ + AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - .synchronize_post_reset = hvf_cpu_synchronize_post_reset, - .synchronize_post_init = hvf_cpu_synchronize_post_init, - .synchronize_state = hvf_cpu_synchronize_state, - .synchronize_pre_loadvm = hvf_cpu_synchronize_pre_loadvm, + ops->create_vcpu_thread = hvf_start_vcpu_thread; + + ops->synchronize_post_reset = hvf_cpu_synchronize_post_reset; + ops->synchronize_post_init = hvf_cpu_synchronize_post_init; + ops->synchronize_state = hvf_cpu_synchronize_state; + ops->synchronize_pre_loadvm = hvf_cpu_synchronize_pre_loadvm; }; +static const TypeInfo hvf_accel_ops_type = { + .name = ACCEL_OPS_NAME("hvf"), + + .parent = TYPE_ACCEL_OPS, + .class_init = hvf_accel_ops_class_init, + .abstract = true, +}; +static void hvf_accel_ops_register_types(void) +{ + type_register_static(&hvf_accel_ops_type); +} +type_init(hvf_accel_ops_register_types); diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index ffc9efa40f..5b90dcdf88 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -72,7 +72,7 @@ #include "qemu/accel.h" #include "target/i386/cpu.h" -#include "hvf-cpus.h" +#include "hvf-accel-ops.h" HVFState *hvf_state; @@ -887,7 +887,6 @@ static int hvf_accel_init(MachineState *ms) hvf_state = s; memory_listener_register(&hvf_memory_listener, &address_space_memory); - cpus_register_accel(&hvf_cpus); return 0; } diff --git a/target/i386/hvf/x86hvf.c b/target/i386/hvf/x86hvf.c index bbec412b6c..0d7533742e 100644 --- a/target/i386/hvf/x86hvf.c +++ b/target/i386/hvf/x86hvf.c @@ -32,7 +32,7 @@ #include #include -#include "hvf-cpus.h" +#include "hvf-accel-ops.h" void hvf_set_segment(struct CPUState *cpu, struct vmx_segment *vmx_seg, SegmentCache *qseg, bool is_tr) diff --git a/target/i386/whpx/whpx-cpus.c b/target/i386/whpx/whpx-accel-ops.c similarity index 71% rename from target/i386/whpx/whpx-cpus.c rename to target/i386/whpx/whpx-accel-ops.c index f7e69881a3..6bc47c5309 100644 --- a/target/i386/whpx/whpx-cpus.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -16,7 +16,7 @@ #include "sysemu/whpx.h" #include "whpx-internal.h" -#include "whpx-cpus.h" +#include "whpx-accel-ops.h" static void *whpx_cpu_thread_fn(void *arg) { @@ -83,12 +83,29 @@ static void whpx_kick_vcpu_thread(CPUState *cpu) } } -const CpusAccel whpx_cpus = { - .create_vcpu_thread = whpx_start_vcpu_thread, - .kick_vcpu_thread = whpx_kick_vcpu_thread, +static void whpx_accel_ops_class_init(ObjectClass *oc, void *data) +{ + AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); - .synchronize_post_reset = whpx_cpu_synchronize_post_reset, - .synchronize_post_init = whpx_cpu_synchronize_post_init, - .synchronize_state = whpx_cpu_synchronize_state, - .synchronize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm, + ops->create_vcpu_thread = whpx_start_vcpu_thread; + ops->kick_vcpu_thread = whpx_kick_vcpu_thread; + + ops->synchronize_post_reset = whpx_cpu_synchronize_post_reset; + ops->synchronize_post_init = whpx_cpu_synchronize_post_init; + ops->synchronize_state = whpx_cpu_synchronize_state; + ops->synchronize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm; +} + +static const TypeInfo whpx_accel_ops_type = { + .name = ACCEL_OPS_NAME("whpx"), + + .parent = TYPE_ACCEL_OPS, + .class_init = whpx_accel_ops_class_init, + .abstract = true, }; + +static void whpx_accel_ops_register_types(void) +{ + type_register_static(&whpx_accel_ops_type); +} +type_init(whpx_accel_ops_register_types); diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index aa5c876138..f0a35df3bb 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -28,8 +28,11 @@ #include "migration/blocker.h" #include -#include "whpx-cpus.h" #include "whpx-internal.h" +#include "whpx-accel-ops.h" + +#include +#include #define HYPERV_APIC_BUS_FREQUENCY (200000000ULL) @@ -1846,8 +1849,6 @@ static int whpx_accel_init(MachineState *ms) whpx_memory_init(); - cpus_register_accel(&whpx_cpus); - printf("Windows Hypervisor Platform accelerator is operational\n"); return 0; diff --git a/MAINTAINERS b/MAINTAINERS index 9356db50c3..2e63561ad0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -439,7 +439,8 @@ M: Richard Henderson R: Paolo Bonzini S: Maintained F: include/qemu/accel.h -F: accel/accel.c +F: include/sysemu/accel-ops.h +F: accel/accel-*.c F: accel/Makefile.objs F: accel/stubs/Makefile.objs diff --git a/accel/kvm/meson.build b/accel/kvm/meson.build index 7e9dafe24c..8d219bea50 100644 --- a/accel/kvm/meson.build +++ b/accel/kvm/meson.build @@ -1,7 +1,7 @@ kvm_ss = ss.source_set() kvm_ss.add(files( 'kvm-all.c', - 'kvm-cpus.c', + 'kvm-accel-ops.c', )) kvm_ss.add(when: 'CONFIG_SEV', if_false: files('sev-stub.c')) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 424d9bb1fc..1236ac7b91 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -15,8 +15,8 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files( 'cputlb.c', - 'tcg-cpus.c', - 'tcg-cpus-mttcg.c', - 'tcg-cpus-icount.c', - 'tcg-cpus-rr.c' + 'tcg-accel-ops.c', + 'tcg-accel-ops-mttcg.c', + 'tcg-accel-ops-icount.c', + 'tcg-accel-ops-rr.c' )) diff --git a/target/i386/hax/meson.build b/target/i386/hax/meson.build index 77ea431b30..d6c520fb6b 100644 --- a/target/i386/hax/meson.build +++ b/target/i386/hax/meson.build @@ -1,7 +1,7 @@ i386_softmmu_ss.add(when: 'CONFIG_HAX', if_true: files( 'hax-all.c', 'hax-mem.c', - 'hax-cpus.c', + 'hax-accel-ops.c', )) i386_softmmu_ss.add(when: ['CONFIG_HAX', 'CONFIG_POSIX'], if_true: files('hax-posix.c')) i386_softmmu_ss.add(when: ['CONFIG_HAX', 'CONFIG_WIN32'], if_true: files('hax-windows.c')) diff --git a/target/i386/hvf/meson.build b/target/i386/hvf/meson.build index 409c9a3f14..e9eb5a5da8 100644 --- a/target/i386/hvf/meson.build +++ b/target/i386/hvf/meson.build @@ -1,6 +1,6 @@ i386_softmmu_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files( 'hvf.c', - 'hvf-cpus.c', + 'hvf-accel-ops.c', 'x86.c', 'x86_cpuid.c', 'x86_decode.c', diff --git a/target/i386/whpx/meson.build b/target/i386/whpx/meson.build index d8aa683999..95fc31eb81 100644 --- a/target/i386/whpx/meson.build +++ b/target/i386/whpx/meson.build @@ -1,5 +1,5 @@ i386_softmmu_ss.add(when: 'CONFIG_WHPX', if_true: files( 'whpx-all.c', 'whpx-apic.c', - 'whpx-cpus.c', + 'whpx-accel-ops.c', )) From patchwork Fri Feb 5 22:56:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 377034 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp2593419ejt; Fri, 5 Feb 2021 15:33:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFiaUm/yL1s3O04GZorCA3rkE+13fLzLA0WLUqBn0AeiueTMknuIMFIjjuWZMXewFU3UeA X-Received: by 2002:a25:d683:: with SMTP id n125mr10107622ybg.256.1612568016833; Fri, 05 Feb 2021 15:33:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612568016; cv=none; d=google.com; s=arc-20160816; b=1Eav5EfCYh+Qmrm/uaomHQpDRfDMBUEWhha1S9yuS9ATKFChJukLQHIj90YVG8CDp2 9OiX3pDBKTeD3gZC12TX/jnpZ5cGBsd5vE5JtAbaC6klXaHi2UKHCRcUMM1xHDAMaNq+ cpwZeWQsU1rf9kUtvfNAiakX+ax4CeNs5TV3r+DnKClEyWuhh+ouiH41EvW9BrXnGDK0 Mrxpy5Lo1JKqr/K/9kA1it61CC5tqwD47d6xg8nSzg5JnG8pTDpIPYfpmUjzvxxA0oNn xZJBCgh1GHROhQk/zbvNeeRvTRM0GH4igumbwxQQ0ZLrYJa8bulPGJTGVz1HaViL1DCc ggLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=ZpT0a90ks+5DiP5UMdif8NtnBjPr0Hz5e7GTI8mhROE=; b=ZVvGY7ThOpthlYollNGicpJwphk2wL3BbdZSDr61Om1tsa2esZvWyfhsVxYArMk8vC dszJkfwtFYrhZLRd2rEzyDT/nwohanFVHPH2pe0r6S/SUNTuB7vJCFYAGMu1lWKb+Yls gt87jVlJrHJs2tg6Qey6l186ZQw/FrGiedi2dn6wk9CGZR/gz3mjmERS3Ccjq34gvaoN CRCRpvq87gMhIVemHvCi9Eip1H5pSMK2AIsHQEUeaxAJ3AVyne6tvucT/rSjqfrXug2P MQnk1UMt3ZH2KCdLUjzNd/kuRGKPq0tzvbXPTdchzJEOvjRNH9whRPBZIWYxD00MupcG SfbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zhqRtXyg; 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 e62si10118464ybf.418.2021.02.05.15.33.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Feb 2021 15:33:36 -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=zhqRtXyg; 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]:60322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8AbY-0004SE-75 for patch@linaro.org; Fri, 05 Feb 2021 18:33:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8A3W-0003Im-VK for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:26 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:36598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8A3U-0003lX-83 for qemu-devel@nongnu.org; Fri, 05 Feb 2021 17:58:26 -0500 Received: by mail-pj1-x1033.google.com with SMTP id gx20so4657100pjb.1 for ; Fri, 05 Feb 2021 14:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZpT0a90ks+5DiP5UMdif8NtnBjPr0Hz5e7GTI8mhROE=; b=zhqRtXygHDduFVHeM9fJqYeV3OdwbVt5Ckjx9axmOIn697tDejuzYkw5t+CHaHZjRl HLkMaXDuhm4nElJvu44wrHVAQvQpUDI/hKCsIW237sQrq3HloMbfUHm2GydZLju4Hebr 1IAB2HGTWG7TAf97YfUGYj49j7Vf0TMc5PsYE+TVHJTImATegBHq++r16MENOIYwMHP+ CGXtXNnoeegriKTTEDvuH8ecnDeyGNdOWbEc+FW/LXCRJSSCJ6E62KgeNeNwWKRURJ2C s4PnBY+JVWLuWMeoG9+LeZEM2WF4jG4Lc6zqXjxPjqkfmzZSiqQs88yvzbO4sxQnCFZu RMFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZpT0a90ks+5DiP5UMdif8NtnBjPr0Hz5e7GTI8mhROE=; b=o26iEzawA6FqfwsfTH+7i271VP2voZ21D4hyRUG1gA1LhmosbieCSXLFfN+ITJaVLL RbIyVi70Sc9tYCfsZ93BrH8u+l/6yPjh/5UBbPFHDRKL02G1T2E5fVapQCc5AdwdAxce iEikG2G9kAiB958lGQR7J1iWripySsgx0bifJLL7pe8ngKnvGFgqYVOqK3YieJoQiyDS MPNKWQGJ1i4P7bPSAHF/b+pEi49g6XNFvhXYbGyv/+OgS30e0ep1YHp/fMqsRuUWrUMW TkXt3ZJxWXVZD8f1XpJ6GwoH40OuHWWBtYcxTVKhkbriCT4Z78KlJ8yQbmpLjkIZgTFb 8C+A== X-Gm-Message-State: AOAM530oqN1DIgJ05R/+cu9NOUlZ3Ggj965evrEB3KXDZfLRn3YN/qxj 87iTD0b1zFmMfHcUbuP3dsIUoSKUNtc0o8iP X-Received: by 2002:a17:90a:d09:: with SMTP id t9mr6526999pja.139.1612565901807; Fri, 05 Feb 2021 14:58:21 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id c23sm12155149pgc.72.2021.02.05.14.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 14:58:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 46/46] accel: introduce AccelCPUClass extending CPUClass Date: Fri, 5 Feb 2021 12:56:50 -1000 Message-Id: <20210205225650.1330794-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205225650.1330794-1-richard.henderson@linaro.org> References: <20210205225650.1330794-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana add a new optional interface to CPUClass, which allows accelerators to extend the CPUClass with additional accelerator-specific initializations. This will allow to separate the target cpu code that is specific to each accelerator, and register it automatically with object hierarchy lookup depending on accelerator code availability, as part of the accel_init_interfaces() initialization step. Signed-off-by: Claudio Fontana Message-Id: <20210204163931.7358-19-cfontana@suse.de> Signed-off-by: Richard Henderson --- include/hw/core/accel-cpu.h | 38 ++++++++++++++++++++++++++++++++ include/hw/core/cpu.h | 4 ++++ accel/accel-common.c | 44 +++++++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + 4 files changed, 87 insertions(+) create mode 100644 include/hw/core/accel-cpu.h -- 2.25.1 diff --git a/include/hw/core/accel-cpu.h b/include/hw/core/accel-cpu.h new file mode 100644 index 0000000000..24a6697412 --- /dev/null +++ b/include/hw/core/accel-cpu.h @@ -0,0 +1,38 @@ +/* + * Accelerator interface, specializes CPUClass + * This header is used only by target-specific code. + * + * Copyright 2021 SUSE LLC + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef ACCEL_CPU_H +#define ACCEL_CPU_H + +/* + * This header is used to define new accelerator-specific target-specific + * accelerator cpu subclasses. + * It uses CPU_RESOLVING_TYPE, so this is clearly target-specific. + * + * Do not try to use for any other purpose than the implementation of new + * subclasses in target/, or the accel implementation itself in accel/ + */ + +#define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE +#define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU) +typedef struct AccelCPUClass AccelCPUClass; +DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) + +typedef struct AccelCPUClass { + /*< private >*/ + ObjectClass parent_class; + /*< public >*/ + + void (*cpu_class_init)(CPUClass *cc); + void (*cpu_instance_init)(CPUState *cpu); + void (*cpu_realizefn)(CPUState *cpu, Error **errp); +} AccelCPUClass; + +#endif /* ACCEL_CPU_H */ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 4f6c6b18c9..38d813c389 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -79,6 +79,9 @@ struct TranslationBlock; /* see tcg-cpu-ops.h */ struct TCGCPUOps; +/* see accel-cpu.h */ +struct AccelCPUClass; + /** * CPUClass: * @class_by_name: Callback to map -cpu command line model name to an @@ -187,6 +190,7 @@ struct CPUClass { /* Keep non-pointer data at the end to minimize holes. */ int gdb_num_core_regs; bool gdb_stop_before_watchpoint; + struct AccelCPUClass *accel_cpu; /* when TCG is not available, this pointer is NULL */ struct TCGCPUOps *tcg_ops; diff --git a/accel/accel-common.c b/accel/accel-common.c index 6b59873419..9901b0531c 100644 --- a/accel/accel-common.c +++ b/accel/accel-common.c @@ -26,6 +26,9 @@ #include "qemu/osdep.h" #include "qemu/accel.h" +#include "cpu.h" +#include "hw/core/accel-cpu.h" + #ifndef CONFIG_USER_ONLY #include "accel-softmmu.h" #endif /* !CONFIG_USER_ONLY */ @@ -46,16 +49,57 @@ AccelClass *accel_find(const char *opt_name) return ac; } +static void accel_init_cpu_int_aux(ObjectClass *klass, void *opaque) +{ + CPUClass *cc = CPU_CLASS(klass); + AccelCPUClass *accel_cpu = opaque; + + cc->accel_cpu = accel_cpu; + if (accel_cpu->cpu_class_init) { + accel_cpu->cpu_class_init(cc); + } +} + +/* initialize the arch-specific accel CpuClass interfaces */ +static void accel_init_cpu_interfaces(AccelClass *ac) +{ + const char *ac_name; /* AccelClass name */ + char *acc_name; /* AccelCPUClass name */ + ObjectClass *acc; /* AccelCPUClass */ + + ac_name = object_class_get_name(OBJECT_CLASS(ac)); + g_assert(ac_name != NULL); + + acc_name = g_strdup_printf("%s-%s", ac_name, CPU_RESOLVING_TYPE); + acc = object_class_by_name(acc_name); + g_free(acc_name); + + if (acc) { + object_class_foreach(accel_init_cpu_int_aux, + CPU_RESOLVING_TYPE, false, acc); + } +} + void accel_init_interfaces(AccelClass *ac) { #ifndef CONFIG_USER_ONLY accel_init_ops_interfaces(ac); #endif /* !CONFIG_USER_ONLY */ + + accel_init_cpu_interfaces(ac); } +static const TypeInfo accel_cpu_type = { + .name = TYPE_ACCEL_CPU, + .parent = TYPE_OBJECT, + .abstract = true, + .class_size = sizeof(AccelCPUClass), +}; + static void register_accel_types(void) { type_register_static(&accel_type); + type_register_static(&accel_cpu_type); } type_init(register_accel_types); diff --git a/MAINTAINERS b/MAINTAINERS index 2e63561ad0..8d8b0bf966 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -440,6 +440,7 @@ R: Paolo Bonzini S: Maintained F: include/qemu/accel.h F: include/sysemu/accel-ops.h +F: include/hw/core/accel-cpu.h F: accel/accel-*.c F: accel/Makefile.objs F: accel/stubs/Makefile.objs