From patchwork Tue Mar 19 15:42:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781110 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1995810wrs; Tue, 19 Mar 2024 08:45:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUdNYIp/mflDka9bjStKmj2DzzX5ZSPA/JcLAQAVAMI3j56KLaTpnOVMhxyBncCmoiUz/k98cgs/j0q3vgAhLgr X-Google-Smtp-Source: AGHT+IFoVj9br8tEq8H/F0n4cO0hb+Es7wVVySWwEL1GeQ3e9LtcHB6j8BfhCNOR8KTACBCB5sNN X-Received: by 2002:ac8:5a8a:0:b0:42f:1631:a52d with SMTP id c10-20020ac85a8a000000b0042f1631a52dmr3031629qtc.48.1710863116421; Tue, 19 Mar 2024 08:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863116; cv=none; d=google.com; s=arc-20160816; b=kInGxhoTScX/8ZgzH+pGlA+fZULoEGHn8boCnTlVxo2G6jANt8quIPQFwegSzsfRgO uzzpOKkcE7ZdI2s3Iw9KJKzqcvI53kodldL12iVdwm5Dkfdxg61W4zCHKZHgxS6uJZaz LDTzgDFzifpgVQpY5iEwK1IU43ryD+gzKPJlj/V+UfoBiULUlAScFzOqnkEfSScDHQ9l aKyc5x387ZDUhuh/V5yylFi7UPaWg5IlPL5f2ZS33nTmNRwoXPEDuyI36jXZ/DBQz++8 SRoW/yV/wfvFcNqmykXDyLYuMdQVlJUwmh92C+hVlhqqILEWT0ygYEZJ0hrOfkLT7vC6 T4dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UuEAK7pSccwrCzu7hxaK2/2f3QdH4s+KeUETWrTDkmI=; fh=NuPLMlVFc4cfvp2Oa5z7LIdyagRbnbQ6Uh9klhOYydE=; b=URM890VPVYByLYD3aMk1hT2WkGfzsm2NshlkJRcFwR7Imy5oaZUAM8oloE14dExItj WF7WCZgrNLkGs9fkNIydDmRXOpvB+jkSCQxKpbzpJxoRHiah+Uao40IG+A6Tvl0bHUC3 qYvGAhKmEFJnvepxxwxXdNMJr0m8uxQHNH6jE6AvK/r/HiPL2I/4JrRuCGIjibcQZCr5 GRUjajqcq6BgZljHfJpenJUDA8fPJx8HOJe4n6v0enEBcZJyAXBVnHNIh5LHTxL23G0l hfmggDqXlvu9NfHKG1SfUHv/d/v6yT7QEkGDtQK6YhP/750/boPO7pBBWzXyycWdIIIM Lwug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HwRJUTyv; 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 g20-20020ac85814000000b00430d3fcf0d3si4245011qtg.689.2024.03.19.08.45.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:45:16 -0700 (PDT) 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=HwRJUTyv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbcT-0005Eb-0A; Tue, 19 Mar 2024 11:43:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbcR-0005D8-8p for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:15 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbcK-0004lW-DY for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:14 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-414617882b3so10515805e9.3 for ; Tue, 19 Mar 2024 08:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710862986; x=1711467786; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UuEAK7pSccwrCzu7hxaK2/2f3QdH4s+KeUETWrTDkmI=; b=HwRJUTyvxHIoyfcsI9rTdFZUKEObmCEulrwneWFcy8lKikqBS3H2bgpP9xEAijpsjo G/3sLRDVKMFhVzSCChyfLxIJFiLnIosR/gJQai42DfiArhp+3pe9dcNpMXsGP2y753bH 2484zeTOLVLqnXQ3fwBZ1cH1ZmbgqbO8FqRW2+D99i2nzPN5CuqdrqiWOVEsdy20b7m9 yrsXwSe7VKQH1hMobtNXc4FZIDItsXgS//Oq3P2o4n1KKFG939e4/tE/rEl/dnmy2VFz ejV5pBW0tleLZl7WgHPAkieyQthuZL1W5jKE3dLbJSmfvjK3mCNDU4fxYfkE2bi5GVCD aDnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710862986; x=1711467786; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UuEAK7pSccwrCzu7hxaK2/2f3QdH4s+KeUETWrTDkmI=; b=tXZO6XEV7clEk4Uypcr/CzWxQGY2igYDwgPpC5juoCxO8izDLIYV7ivwq7BN9VfFCX 8NtccC3JsX3LAJ59UcHB4CFU1Ms4VPGiDtCpw663/HI3mUVtQBN0xjflSvlSEZsb25aG a0ymEK887k8ZlCS3Kru5JqUm30T/Xtmjjv67wZ0UVmT1Xoc8F02SH7/DO0HaJ1qarNAo QCFdnDoJx9WUdRSPltMKBH4nmPipEf9FGL5Q2QpIR6wfZ5UZJJPphy8iZAz/55J0HaPD 2GajDUuemkZ+sCmhvo8o2Ecm4LCkjfU+13DlQ2Heh2SRh4sG2GaKlBfbhS16HtFzvnA/ nsKQ== X-Gm-Message-State: AOJu0YztaGB90nrKhnyP2szBzaTTvr3J9FO85G0utteag1fDmifV2ntf aOaDzZuKuvOhn+3d/r0TxtQUjMxaJfg3Iovs3n4bKBu55BiqpLfSlR9Uk2VHrPnt+Zihgpk8utL E X-Received: by 2002:a05:600c:a47:b0:414:860:bdc9 with SMTP id c7-20020a05600c0a4700b004140860bdc9mr6982443wmq.33.1710862986594; Tue, 19 Mar 2024 08:43:06 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id l12-20020a05600c4f0c00b0041409d4841dsm10415982wmq.33.2024.03.19.08.43.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH-for-9.1 01/27] accel/tcg: Ensure frontends define restore_state_to_opc handler Date: Tue, 19 Mar 2024 16:42:30 +0100 Message-ID: <20240319154258.71206-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5c70748060..987e6164f7 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1069,7 +1069,10 @@ bool tcg_exec_realizefn(CPUState *cpu, Error **errp) static bool tcg_target_initialized; if (!tcg_target_initialized) { - cpu->cc->tcg_ops->initialize(); + const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; + + assert(tcg_ops->restore_state_to_opc); + tcg_ops->initialize(); tcg_target_initialized = true; } From patchwork Tue Mar 19 15:42:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781107 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1995346wrs; Tue, 19 Mar 2024 08:44:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVfGodwlRjakA1x4mZ8qQBSCRP+sntWKR+TZsJEXpsdwUkFZmA/6YPZSXth3el2kVn+nRo+mvYqJoCXsD9THYTj X-Google-Smtp-Source: AGHT+IGbd3y6NcWwXj41y5hxI2426516pNbncOlWYAjyOlMvmanPpqrWJEZDrMiv0LTY0ILV6ioo X-Received: by 2002:a05:622a:1450:b0:430:a815:af7b with SMTP id v16-20020a05622a145000b00430a815af7bmr2749651qtx.23.1710863051659; Tue, 19 Mar 2024 08:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863051; cv=none; d=google.com; s=arc-20160816; b=0KAqovQ9ek9omyKo5m8yjThyCcVhcnjyoYQTrWUJOq+6XnePKyaTFp3y3vZ3mUa2vl Al6W9Gmqcv+GRx/AwnJm3Ur/n2jnMGlc1T66tJMnFixjildRtY48bU94/GtCoqOMyUjM GH8Nx9fjkKyzsMjZn7wzwEUmf2cKPL60RTACIIYQjo5iVHXYliSD5lVXPZcK0NFPu01G b6crQwaoeDl/spe9v62cmlZspsKofk1uxuHBm+5cj0yOkHVVJTNZ14ygquIgNujEC5cw glZhY+O2H/61RLKwWnB/LUR0D8yLvez/25S26+1svL5h4rNDWNAgA2Ri2EiVwk5Cl6ct tnrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=new3hB1/RFA2taMVx8452jvGfTxveGkjivBgpLY9vi4=; fh=KWs6emMBdmzCqhVoMZCOGEtFjobBQJLpKizMis01IJw=; b=IyjXHXsOrrA+IIYmbb30ihxJ4ooFf+O9jdEctuM3o89j7CO933ZQS1i3bm+pr2vJfw W5n/bJzSb1aBonpb9MGX4dq7NDNk85eCfyfRDfQVPULBLMeAqmxClrnb5qQ0VWkv90Fc WowL7oU+GlSUbvosIAVv4rkxawktAsW7IJUR//EalcOZmlUHJh9Cf89l4xQRHAIzNHiE cPC+aBWyp4y1p8jKXb+6Lok9vMGNqzud0F0Bl4lgMFwm41bD1XzVJje8bfVyHFbZlnjt qrk7GbTepCQ069BwttnAAMmUjQU8LQwxss9/+PgPNAJPCrMoZefFRFcK9SjC0DrfjokF m0jQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TM6rYJXk; 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 f37-20020a05622a1a2500b00430d74d14f6si3734943qtb.503.2024.03.19.08.44.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:44:11 -0700 (PDT) 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=TM6rYJXk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbcX-0005JM-8n; Tue, 19 Mar 2024 11:43:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbcW-0005Gl-2T for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:20 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbcS-0004nI-5S for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:19 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41409fd8b6bso22676985e9.1 for ; Tue, 19 Mar 2024 08:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710862994; x=1711467794; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=new3hB1/RFA2taMVx8452jvGfTxveGkjivBgpLY9vi4=; b=TM6rYJXk9kFlnej/e78jkrI0jr0BKGdurkGmgK+6tGA3NJmmu4Oh2E27qBt2VZ8tNN QH5gCJ65hGkFPCuDk0ROtDzJTqWV9fehAd/eAQ7JT74OmfmQ13lcaZ60xtQVunEq/uFo dB61nj2Rju089Fu5rkQvlilgk2dZqckhDTQKznORgkFUoeIeMJRtvufpdKfIt5Np8Rj6 ys2CuY4JR4LFgS+owXpU9JZBXhZOL1e19AxoSIA58q7QwpLrn7zP1dfWwSJlbvJzJUEx BI5ngkotjKV4/70FZZjRYJ7IUMhfnwrKiErcfNfs/gE4TOmpZc0xf8uOZ1hRgNMr2tCo tbnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710862994; x=1711467794; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=new3hB1/RFA2taMVx8452jvGfTxveGkjivBgpLY9vi4=; b=BGFvlTcop0nokKFEqvue+SKOWO9IWDjepc0MRgKA6l07cF4bHMOBgRSza0XH4LcmNV iFF4kiCZwCUoVdILKBo1sFlT4mKyjwZG/Kh7EmX+aeMI7J+6uCFwFhAt26R8Zwbo6/8c NEggurP7ERrnYxYwdGosOLwwGH8A7fWYXf2jegJpK/5k3ur4ypr8lUTrfRLqs4Em6szq 87rMmo3jz9UTc4p6lQ1HjmLsdiCLijGAX5wqg9ldT89Excvpkm1osPrnRC3nw9jnxlEX BT3JR+pgk79Yok1cbQL5RXF0HtEgIYxJb0gTOFBe4+Vq1N/OO1zRLAmrgnRnN6/qiz8z fO/g== X-Gm-Message-State: AOJu0YwZ3bLcPsf4N8a592k3hugwiu7rBEM9XyKpvWQHqD9xtREC5fEi tEuqTzWh9QyTxAN2J1sn98wfkqbTjfMW4Pe68A4yuwTJJo0vOCp2q/yOd3DBJjCMwWmtQI9x1lN 4 X-Received: by 2002:a05:600c:1992:b0:414:c48:a90 with SMTP id t18-20020a05600c199200b004140c480a90mr5817173wmq.24.1710862994286; Tue, 19 Mar 2024 08:43:14 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id t6-20020a05600c450600b004133365bbc6sm21728612wmo.19.2024.03.19.08.43.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Peter Maydell , Michael Rolnik , "Edgar E. Iglesias" , Brian Cain , Song Gao , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Stafford Horne , Nicholas Piggin , Daniel Henrique Barboza , Yoshinori Sato , Thomas Huth , David Hildenbrand , Ilya Leoshkevich , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH-for-9.1 02/27] accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler Date: Tue, 19 Mar 2024 16:42:31 +0100 Message-ID: <20240319154258.71206-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We want a single cpu_get_tb_cpu_state() for all targets, but each of them already define it. Introduce a generic target-agnostic cpu_get_tb_cpu_state() method when per-target TARGET_HAS_CPU_GET_TB_CPU_STATE is not defined. Currently all targets define it, but they are going to be converted one by one. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-target.h | 2 ++ include/hw/core/tcg-cpu-ops.h | 3 +++ target/alpha/cpu.h | 2 ++ target/arm/cpu.h | 2 ++ target/avr/cpu.h | 2 ++ target/cris/cpu.h | 2 ++ target/hexagon/cpu.h | 2 ++ target/hppa/cpu.h | 2 ++ target/i386/cpu.h | 2 ++ target/loongarch/cpu.h | 2 ++ target/m68k/cpu.h | 2 ++ target/microblaze/cpu.h | 2 ++ target/mips/cpu.h | 2 ++ target/nios2/cpu.h | 2 ++ target/openrisc/cpu.h | 2 ++ target/ppc/cpu.h | 2 ++ target/rx/cpu.h | 2 ++ target/s390x/cpu.h | 2 ++ target/sparc/cpu.h | 2 ++ target/xtensa/cpu.h | 2 ++ accel/tcg/translate-all.c | 10 ++++++++++ 21 files changed, 51 insertions(+) diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index 4e36cf858e..10a45d3b9c 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -79,6 +79,8 @@ TranslationBlock *tb_link_page(TranslationBlock *tb); bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, uintptr_t host_pc); +void cpu_get_tb_cpu_state(CPUArchState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags); bool tcg_exec_realizefn(CPUState *cpu, Error **errp); void tcg_exec_unrealizefn(CPUState *cpu); diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index bf8ff8e3ee..0ad9949950 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -49,6 +49,9 @@ struct TCGCPUOps { /** @debug_excp_handler: Callback for handling debug exceptions */ void (*debug_excp_handler)(CPUState *cpu); + void (*get_cpu_state)(CPUArchState *cpu, vaddr *pc, + uint64_t *cs_base, uint32_t *flags); + #ifdef NEED_CPU_H #ifdef CONFIG_USER_ONLY /** diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 7188a409a0..16b0f8a097 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -467,6 +467,8 @@ void alpha_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, MemTxResult response, uintptr_t retaddr); #endif +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUAlphaState *env, vaddr *pc, uint64_t *cs_base, uint32_t *pflags) { diff --git a/target/arm/cpu.h b/target/arm/cpu.h index bc0c84873f..d20e2bd90e 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3151,6 +3151,8 @@ static inline bool arm_cpu_bswap_data(CPUARMState *env) } #endif +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + void cpu_get_tb_cpu_state(CPUARMState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags); diff --git a/target/avr/cpu.h b/target/avr/cpu.h index d185d20dcb..0c0aa580f5 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -193,6 +193,8 @@ enum { TB_FLAGS_SKIP = 2, }; +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUAVRState *env, vaddr *pc, uint64_t *cs_base, uint32_t *pflags) { diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 3904e5448c..dbd6fb05f0 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -273,6 +273,8 @@ enum { #include "exec/cpu-all.h" +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUCRISState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 3eef58fe8f..935a9c3276 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -134,6 +134,8 @@ struct ArchCPU { FIELD(TB_FLAGS, IS_TIGHT_LOOP, 0, 1) +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUHexagonState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index a92dc352cb..cdb2904936 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -314,6 +314,8 @@ hwaddr hppa_abs_to_phys_pa2_w1(vaddr addr); #define TB_FLAG_PRIV_SHIFT 8 #define TB_FLAG_UNALIGN 0x400 +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, uint64_t *cs_base, uint32_t *pflags) { diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 952174bb6f..954495fff0 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2354,6 +2354,8 @@ static inline int cpu_mmu_index_kernel(CPUX86State *env) #include "hw/i386/apic.h" #endif +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUX86State *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index ec37579fd6..d814ba08dd 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -443,6 +443,8 @@ static inline void set_pc(CPULoongArchState *env, uint64_t value) #define HW_FLAGS_VA32 0x20 #define HW_FLAGS_EUEN_ASXE 0x40 +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPULoongArchState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 346427e144..2790d61115 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -604,6 +604,8 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, #define TB_FLAGS_TRACE 16 #define TB_FLAGS_TRACE_BIT (1 << TB_FLAGS_TRACE) +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUM68KState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index c0c7574dbd..8058dcac7f 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -415,6 +415,8 @@ void mb_tcg_init(void); /* Ensure there is no overlap between the two masks. */ QEMU_BUILD_BUG_ON(MSR_TB_MASK & IFLAGS_TB_MASK); +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUMBState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 7329226d39..caa12a2dd3 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1362,6 +1362,8 @@ void cpu_mips_clock_init(MIPSCPU *cpu); /* helper.c */ target_ulong exception_resume_pc(CPUMIPSState *env); +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 4164a3432e..32002b819a 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -286,6 +286,8 @@ FIELD(TBFLAGS, CRS0, 0, 1) /* Set if CRS == 0. */ FIELD(TBFLAGS, U, 1, 1) /* Overlaps CR_STATUS_U */ FIELD(TBFLAGS, R0_0, 2, 1) /* Set if R0 == 0. */ +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUNios2State *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index b1b7db5cbd..d42800242f 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -351,6 +351,8 @@ static inline void cpu_set_gpr(CPUOpenRISCState *env, int i, uint32_t val) env->shadow_gpr[0][i] = val; } +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUOpenRISCState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 67e6b2effd..ced4e53024 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -2716,6 +2716,8 @@ void cpu_write_xer(CPUPPCState *env, target_ulong xer); */ #define is_book3s_arch2x(ctx) (!!((ctx)->insns_flags & PPC_SEGMENT_64B)) +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + #ifdef CONFIG_DEBUG_TCG void cpu_get_tb_cpu_state(CPUPPCState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags); diff --git a/target/rx/cpu.h b/target/rx/cpu.h index c53593d7aa..996f121bcd 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -149,6 +149,8 @@ void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte); #define RX_CPU_IRQ 0 #define RX_CPU_FIR 1 +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPURXState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 43a46a5a06..2e184aabf5 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -416,6 +416,8 @@ static inline int s390x_env_mmu_index(CPUS390XState *env, bool ifetch) #include "tcg/tcg_s390x.h" +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index f3cdd17c62..ae55cd15a4 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -747,6 +747,8 @@ trap_state* cpu_tsptr(CPUSPARCState* env); #define TB_FLAG_HYPER (1 << 7) #define TB_FLAG_ASI_SHIFT 24 +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc, uint64_t *cs_base, uint32_t *pflags) { diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 6b8d0636d2..3826b779e4 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -734,6 +734,8 @@ static inline uint32_t xtensa_replicate_windowstart(CPUXtensaState *env) #include "exec/cpu-all.h" +#define TARGET_HAS_CPU_GET_TB_CPU_STATE + static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c1f57e894a..7b538d2b9c 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -221,6 +221,16 @@ void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, cpu->cc->tcg_ops->restore_state_to_opc(cpu, tb, data); } +#ifndef TARGET_HAS_CPU_GET_TB_CPU_STATE +void cpu_get_tb_cpu_state(CPUArchState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + CPUState *cpu = env_cpu(env); + + cpu->cc->tcg_ops->get_cpu_state(env, pc, cs_base, flags); +} +#endif + bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc) { /* From patchwork Tue Mar 19 15:42:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781118 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996744wrs; Tue, 19 Mar 2024 08:47:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/2gQ+F4u968tNI3aNsitrB1f2s1TLUfiY8aL27/XILous6Cg/LgQ0DQ1jG+CSlWkQSBq54EwnzxIPsgXmnF4f X-Google-Smtp-Source: AGHT+IGK+htpbNIt4H2XUqBvCDJUiOwdpQIpI+kWDiv4mzYVxRBVslM657mDNjiVZZG3YxcLHsGq X-Received: by 2002:a05:620a:22c1:b0:789:f627:6a4d with SMTP id o1-20020a05620a22c100b00789f6276a4dmr7309353qki.75.1710863245969; Tue, 19 Mar 2024 08:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863245; cv=none; d=google.com; s=arc-20160816; b=oVNVTga2T36aZbpJse5okqrsIML82LlJYzBnC7Ti2EJFxMkt4/RlsAqGzUB092wHn8 DOlY5TFh6+myUwR6SrIH80oajb8yyDcnQZ3qzENO7tbliFlXD2b7BnQpdLwH2gOEAh3i G2HYTU3Wgrx/TL3qjQ1s864RytSmtaUWwlEL0gd0Ggo4L194F+NsP2oI/tG7D3kV8LZO TCzSlhEysoG9/LM3svAPrCKo0ZvKyw1YI/AFUaMKeAzgQn2EpWg75cmQbCLAYwyA0OpH Mn1XjmT/pggbb9knHcx6AIBpQuPkpsxiV2s+yPcREhhWDooffSAp4tOkghc/sbjczbQT 7HIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qQ0F9e1tiLbg+1mSpsh71oFSOMQcPQZFv/kc9q+gvBc=; fh=4MeBauBJBoNvn/JdNDNA8obdNi8WkyFXHqMtQhjC48A=; b=hBcYC6Roq4rGeima9Mps4VVEQtiwRaVvtKBrUcld/0/TY+s5dkoUJrwEtXRkqUgN3H nfVDxyRDa4u0geiNFVNwDxDP8W4YHkxiKjYB68Tvum95oz0LwyOtjqMY3XjQWV1yDs0P RD8JKCiBD+eo8QsktfUBGdJWAutl9FEgmAYIJEIIWkIyv1FRPYCjwvNHMsGWSuCybF2x 13DVvGE9RU2NU8LJEj86diPGzQwjREhF0pxEN8sr1k3LI5quvF4+f1nYQPFrKI+2Q5wA 64EcQ2wREO9vyEvsS9lXoVmsnkk35gHGGQnO6TnTAO/j7NW4ugog8O/AqvQ5r2gRZGdS sR9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U3+Hk1+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 c18-20020a05620a135200b00789e95905dasi8244506qkl.33.2024.03.19.08.47.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:47:25 -0700 (PDT) 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=U3+Hk1+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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbcd-0005Oe-Po; Tue, 19 Mar 2024 11:43:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbca-0005Mo-Dq for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:24 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbcY-0004oy-1a for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:24 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41412411622so15723495e9.2 for ; Tue, 19 Mar 2024 08:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863000; x=1711467800; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qQ0F9e1tiLbg+1mSpsh71oFSOMQcPQZFv/kc9q+gvBc=; b=U3+Hk1+1IjfFgD9aUYE90eQUkdWhVW7+WQckOfPjvpH2kLWDDBY266+fl9Ic9II09V AQPHxh4jYUboYmFXULIrNLfvr8VA0bPwMqrO3iZwe6BXskLp8lthxNNEdGhcSByFn4cD R+09jq68w/x3ZYk2cX+nXKwUbbwG0tll+Fcico3pdySZyuynb1rBaGEh9qdrkzRqQxjX xW1cVi+KhUQEAGleQzcL47orwYrsUWQqDLqOZ6rtw8fyZv2VP3tBU+jGmXXQqNNAQ9/o jSEiD4ieZWNXeQ1XatVYbz0OxDvEL7TCgyb6FZVHPc1qcjJ8xkBlOZK1mKt0whmV6uKN nn+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863000; x=1711467800; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qQ0F9e1tiLbg+1mSpsh71oFSOMQcPQZFv/kc9q+gvBc=; b=ub0q9CeXdYaCWcJ2AyS1DUxjuosngPpKuZiLeV2BE/lDNslKkEH76SfoQ0R4B2vOGi ESddTomFYw5AoRLVCJI3n0aZRYtNcbyeHrAxF96FnrSG8WIrx6MdTHkORMgBOOoOBD8s ZOi4+nOLukGGaKtJEyuxy5kr7LcxzOqZRHoI2U+eowq3FDe5SHIZNXzDzEtg/rUy62Hi PJbe0R7W5NzKyyo8AYTkZrM2qoRd5fs6H+ESS3jh8brQV908BZUOG/KSKaDVrf7aCsbF CZ8KK85xybok2je5aOS2JAFMF+nh7oMlvRGN0iI0r6u7rcl6LsyYjaGkNntcCxdW4w16 P3YQ== X-Gm-Message-State: AOJu0YxDRP3AnyNI3+w4PSoRR3tlgEc/XTvAEBPBBcyhG9d42p/rzZh2 iDyC7tdh/wpkqZLbf8/4QBQfATGjHiYael7ECtWApSaXWNQt7uwZrSTyQOrm+v0BuzLLLEXWFCX D X-Received: by 2002:a05:6000:184b:b0:33f:8e6d:ab7c with SMTP id c11-20020a056000184b00b0033f8e6dab7cmr8021706wri.71.1710863000174; Tue, 19 Mar 2024 08:43:20 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id i2-20020adff302000000b0033e9fca1e49sm12609575wro.60.2024.03.19.08.43.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 03/27] target/alpha: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:32 +0100 Message-ID: <20240319154258.71206-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.h | 13 ------------- target/alpha/cpu.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index 16b0f8a097..b7f294d08a 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -467,19 +467,6 @@ void alpha_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, MemTxResult response, uintptr_t retaddr); #endif -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUAlphaState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags) -{ - *pc = env->pc; - *cs_base = 0; - *pflags = env->flags & ENV_FLAG_TB_MASK; -#ifdef CONFIG_USER_ONLY - *pflags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; -#endif -} - #ifdef CONFIG_USER_ONLY /* Copied from linux ieee_swcr_to_fpcr. */ static inline uint64_t alpha_ieee_swcr_to_fpcr(uint64_t swcr) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 05f9ee41e9..7efeda02dc 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -49,6 +49,17 @@ static void alpha_restore_state_to_opc(CPUState *cs, cpu->env.pc = data[0]; } +static void alpha_get_cpu_state(CPUAlphaState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags) +{ + *pc = env->pc; + *cs_base = 0; + *pflags = env->flags & ENV_FLAG_TB_MASK; +#ifdef CONFIG_USER_ONLY + *pflags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; +#endif +} + static bool alpha_cpu_has_work(CPUState *cs) { /* Here we are checking to see if the CPU should wake up from HALT. @@ -194,6 +205,7 @@ static const struct SysemuCPUOps alpha_sysemu_ops = { static const TCGCPUOps alpha_tcg_ops = { .initialize = alpha_translate_init, .restore_state_to_opc = alpha_restore_state_to_opc, + .get_cpu_state = alpha_get_cpu_state, #ifdef CONFIG_USER_ONLY .record_sigsegv = alpha_cpu_record_sigsegv, From patchwork Tue Mar 19 15:42:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781120 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996932wrs; Tue, 19 Mar 2024 08:47:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW7SHNJeynBHuVoxvseISmbiPY2lzAsbGrapwcNZn/Huae5wY62MyZASNez7JSB7N2FdCYBtqZeIjLVlb4qtzc8 X-Google-Smtp-Source: AGHT+IH1sSK5VzD20C0z11GFAZP/1+C0549/xJ3zbF418a3NPpsl4APDZTZSBMsaXi/cU6SN2HpN X-Received: by 2002:a05:6214:2d03:b0:696:3802:3597 with SMTP id mz3-20020a0562142d0300b0069638023597mr2776173qvb.15.1710863270367; Tue, 19 Mar 2024 08:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863270; cv=none; d=google.com; s=arc-20160816; b=TdMTxUava6HQI5LOZ+6tly9iRbBsGDG2q+TcPzyPBFCNFrQDZr68O5DBskcHYpIeCi 1zg2aA5vExlldS+ECvMmpOADnIill0HiiLFGLknXlCv0193QjGR8Q3mydcVdYZ0vZMUf CT50Z/oPh9kOusArWjuq5dMymj4OpZjlp7I3x8F17rX9UwF98aKt7m6JAw0SFhZtRiFO iXfNTEJKEWE4VX1oimrscREse9sWznHr+rj91J781EV0fyszhJr9VQcarcULTAW0zHmt AMnLACT4eocmT42POaEJ7QSrtsLe95niBz+978yzw/HIEXpKL29HAOeKE0aEU+gNKhw/ 0G6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NgNkzc9TKRqSufr7q2jowH4Mnpr7+ZnLD1X9Wx4INOA=; fh=CWlHSUlS4Mijl0M/gtp3ZQe+a2gObXJw9KXu4yesCeo=; b=BQGB8z/8vWW7J37rd1gD7MbF8DmL6kjz2TSxMNgy1UNnjWcWP/VTbTxAhYkG05rzxo HFFC6qdP9FIsd+c5aGL3DiMg13UOm4BdojACVF2ZexlKXS+blKpNTKOvTWQKqD6kIcKt s9/m1fSITolJBYVaNRLpMfzKwFfqADXwzuaD7vvcSuAL9JWWOWA4+iU6XLx5AoAMG6bM 6MXc/xPo50s07eGzykLajNk8eZMDiHTn1jOGLU4OnSaHQASCPoJHP03zueRmcqU2h8og UZpBb9mVDWgXW9I0naA/nYfqTZ2O7GsSDpFF5ASzJu+fFHBXt/qhAEKE86x7uPrspW2q pJjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r+Ok3mal; 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 gy11-20020a056214242b00b00690dc2d9d92si10779115qvb.218.2024.03.19.08.47.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:47:50 -0700 (PDT) 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=r+Ok3mal; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbcj-0005Rw-7D; Tue, 19 Mar 2024 11:43:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbcg-0005QV-B8 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:30 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbcd-0004q9-OD for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:29 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-41461c256c4so9409215e9.0 for ; Tue, 19 Mar 2024 08:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863006; x=1711467806; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NgNkzc9TKRqSufr7q2jowH4Mnpr7+ZnLD1X9Wx4INOA=; b=r+Ok3maluSmr1kXNeSb6q+w2dnmADv5ccASjV8CDE+7/CC0JR+4XYf5Wx+pJsVAp5G 7ycRFblmI+65NJGgSyctH+3RikgJPieiGOFOMC92Rw9oUVWGha3O8RK1fuT1+MhHcuil 6BCvp1qe6w46x3+BfR8B0KmeOQFJ/NCYDnDcqwe/jdQC1S0X4O8ilL+WDKWdSN2P1FmW LVDW92fCzYsfUiiU0uJ3uxS2BZNHAFzDfkwDm2/Vv4yuQBGgmWGD3QUz0WB7neve9JSl aTJToG/YN9JQWmXigoStSc8u8eEI5rNtdzNgpNQjpn1IeAQvPeCzOo2F1mfR0i1sDIjb iHnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863006; x=1711467806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NgNkzc9TKRqSufr7q2jowH4Mnpr7+ZnLD1X9Wx4INOA=; b=Opurge8Ak0aD8+MgjgPTw0T0rM8ALS2FTqeT+Ao78Nycd0DlvGPpIqfY4zNAceRa1v /J7gRnwc/AQESGDAknsDM+7mEWFdEx0cQOoJ1PTMMwnpR+nKqnAjItxcyjLJG7d+vPSx 4xGZTSU88X7FJGAijVprJSRKRcwCq0O657OEn6ZjCtO/jfh/FhwRjHH20ZdVRhlQEBjz CU2fQqnO0Ara4J9TtdEca9Cji/OgVldPBFp+9Kg1AvJeuSGoUos0Iha6wJE78PayGqVa P7wPptHfJEChkw5+ne08FwUKcMTPorImyHeZZIMkaL5bAVebBp1bl6b4KS3gZ5r38IWX smqw== X-Gm-Message-State: AOJu0YzU5Q905/mM1oCm2bqsCUsyylGFW1/C0MI51nRF3gxSmOb8ZPfh yQRShYfvrVhMHKmtjTPMFibWPnp9DN6larb6qYuBFQcltjxiNXLG6VwQpcc7NvZcsL3AvxTZwmB U X-Received: by 2002:a05:600c:4f11:b0:414:1eb:3010 with SMTP id l17-20020a05600c4f1100b0041401eb3010mr2169239wmq.17.1710863006089; Tue, 19 Mar 2024 08:43:26 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id w9-20020a05600c474900b0041408af4b34sm11116488wmo.10.2024.03.19.08.43.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH-for-9.1 04/27] target/arm: Restrict TCG-specific declarations Date: Tue, 19 Mar 2024 16:42:33 +0100 Message-ID: <20240319154258.71206-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- target/arm/internals.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index dd3da211a3..087caaf2bd 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -346,13 +346,13 @@ void register_cp_regs_for_features(ARMCPU *cpu); void init_cpreg_list(ARMCPU *cpu); void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu); + +#ifdef CONFIG_TCG void arm_translate_init(void); void arm_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data); - -#ifdef CONFIG_TCG void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); #endif /* CONFIG_TCG */ From patchwork Tue Mar 19 15:42:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781108 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1995598wrs; Tue, 19 Mar 2024 08:44:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWFg+89XUdsByd8zUtdV1gu3tWDwd5OMQ0A1ZAk69dx4mX1UPIh3P0lHZGxAGSDm/JPXrV00sMh2fOrO31Y2c0S X-Google-Smtp-Source: AGHT+IEbDmvlf2Y1ip35YwKOyywUOQOmTevVuGfNckvsuRRqabFJjjCIGUxbcTD2FzifKavp8z8v X-Received: by 2002:a05:6808:3011:b0:3c2:400f:5302 with SMTP id ay17-20020a056808301100b003c2400f5302mr18956162oib.33.1710863089254; Tue, 19 Mar 2024 08:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863089; cv=none; d=google.com; s=arc-20160816; b=l93E7+ZeQZ8yp7++E+2wSbhR4oiI8twpmKM27WDROLVcUI5o3HmRAdP+mFDVMuDM8g 3mgP/0f6NwOy5Gj/MD+pzH0+gWuboiJfErYyq79+24Ch+mcWrpaWzTw3yt1xtVGMJSDj H01M9XMgiQbPeBW69kX3JvGjqnJopxFev3v4sGhovmFeF/5cchQlmCe32v7eoHS/E9H9 tFFSpU9qAZeYnefobQ3NGkuhdp8QvVjDmY1NXnscG4JYOFRxcYS8Ifw6FMYfBsO9bYr0 xnwNiRjh2zhvvIutGbA+Z02I0qWI+nhn/WttbSW63IWbXwDK6BQy7HxjbB2ypb7hNVxh XhhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tpNrOmMKfl0DvRbVcOp4RsIWsRWfZfygeoHOWL6CLc0=; fh=CWlHSUlS4Mijl0M/gtp3ZQe+a2gObXJw9KXu4yesCeo=; b=AbStmJ0zPE6MVB3bYzLJVt/zfJm7+DKrItjztT+MmSkEqeV7ODV4Mv6kcyaAVvxQ1s H78H7dzD5kaKC/bXc0+zuuXDlOVzNJ1E4TY1qRt00o6HARJ7mHa0PTdiOJ8eUpXT+zXy bxnh5UYOCu3ZcHmIoox2bCGrB6EAnzbntDTxYzqCbhB7Ys3+PQ77AbkDTLbLPD/XTSjj MgIGESkqNxj8/Xg6y85M2qsRfaQhXSY3hbIi/j+roPxQXxanHqro0jWVMdXUP18+Y9Za /6FuiyWYbquux3ORXDnukCPqt1579BC28X+2JE/w74vFy1Zik+kZ1nU8pMiZK98lQc+u tERw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WLHb/r2S"; 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 r2-20020a0562140c4200b00690b39eeba4si11252399qvj.444.2024.03.19.08.44.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:44:49 -0700 (PDT) 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="WLHb/r2S"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbcs-0005Vt-Tm; Tue, 19 Mar 2024 11:43:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbcq-0005Ug-GP for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:42 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbck-0004rH-9l for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:40 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-41412e6b2cfso14948465e9.2 for ; Tue, 19 Mar 2024 08:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863012; x=1711467812; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tpNrOmMKfl0DvRbVcOp4RsIWsRWfZfygeoHOWL6CLc0=; b=WLHb/r2SCxCGp+SHNgNkxz00nvzqclCxeFKGxhnyzrEyx/stYDVJFg/8VMHHDfjUxg 0DeMNyjYwQ5xcT253p3Rb2XlOWq3O98qbltqKzA8NE5bM4XRoo5UsJCGiKebVxJBlDvE +n3d7JkllKHI0+EcBUTP7fCyguoZ73FzTPolSJkuTPYL/ryF55UYpHBKF6iiAo6yQQHO a6NR9B5rOAIZfGIf/1KCKP38IVgYqwBaTPqAoBAL3NMyaNcz7UTaId0W3GWbcV6s3ts2 yPHTgGvwyD2gcUwdVnevAuOFTSwQHKO4yh4WW0Xgl3QVfKkFEpDKdKy77Am309w475Us QhaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863012; x=1711467812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tpNrOmMKfl0DvRbVcOp4RsIWsRWfZfygeoHOWL6CLc0=; b=nIOXpO3Pqfv26GH8vWGLGSd0teA4IsGEG5WZtOgDku7nwibwBTevkiYmg7sMieUwy2 B0VrsE1RaQVgM4D7f15cQuA05hyHkkIx1OKh9avhG1nqlURVUUJ4epA99fVZc/EkqbUz iUyImUgR5rPr7jDzaT2wP7PZuD36YUJwutS/otQp14eKJJqmp654+0iAQlRLRb/d48Q0 9kdBvtfF11kdqkb95fcQBCL/Pvsw0/B+GtH6ABZGi54oZQDEYnDBnBmKtHCNRru8xek5 bJiuplF/XTKHkHgZU8gZegDjwEMM8A/K0bS8PUCymI7GEBBYW26NHuXaE+5sJikMiBPJ cjlQ== X-Gm-Message-State: AOJu0YyNp8HAL22m6dgHk9tKFE9cP2EChRJZYsQ+lo3Xh8zVq/m/80Mj hQ+n4JhYK+YKTmWkg0zrSF7R7pzmQ8UAHeB/2GywfScWn/DjOBBX2m+UtQAsmb+jrrWaEgkzimn k X-Received: by 2002:a05:600c:4f53:b0:414:ed4:e959 with SMTP id m19-20020a05600c4f5300b004140ed4e959mr6134890wmq.41.1710863011795; Tue, 19 Mar 2024 08:43:31 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id r8-20020a05600c458800b0041409c1af05sm10579703wmo.21.2024.03.19.08.43.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH-for-9.1 05/27] target/arm: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:34 +0100 Message-ID: <20240319154258.71206-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Move mve_no_pred() along because it is only used by arm_get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.h | 5 -- target/arm/internals.h | 2 + target/arm/cpu.c | 110 +++++++++++++++++++++++++++++++++++++++ target/arm/helper.c | 109 -------------------------------------- target/arm/tcg-stubs.c | 4 -- target/arm/tcg/cpu-v7m.c | 1 + 6 files changed, 113 insertions(+), 118 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index d20e2bd90e..c563ff2b77 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3151,11 +3151,6 @@ static inline bool arm_cpu_bswap_data(CPUARMState *env) } #endif -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -void cpu_get_tb_cpu_state(CPUARMState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags); - enum { QEMU_PSCI_CONDUIT_DISABLED = 0, QEMU_PSCI_CONDUIT_SMC = 1, diff --git a/target/arm/internals.h b/target/arm/internals.h index 087caaf2bd..5daef30569 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -353,6 +353,8 @@ void arm_translate_init(void); void arm_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data); +void arm_get_cpu_state(CPUARMState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags); void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); #endif /* CONFIG_TCG */ diff --git a/target/arm/cpu.c b/target/arm/cpu.c index ab8d007a86..8e41e1c427 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -120,6 +120,115 @@ void arm_restore_state_to_opc(CPUState *cs, env->exception.syndrome = data[2] << ARM_INSN_START_WORD2_SHIFT; } } + +static bool mve_no_pred(CPUARMState *env) +{ + /* + * Return true if there is definitely no predication of MVE + * instructions by VPR or LTPSIZE. (Returning false even if there + * isn't any predication is OK; generated code will just be + * a little worse.) + * If the CPU does not implement MVE then this TB flag is always 0. + * + * NOTE: if you change this logic, the "recalculate s->mve_no_pred" + * logic in gen_update_fp_context() needs to be updated to match. + * + * We do not include the effect of the ECI bits here -- they are + * tracked in other TB flags. This simplifies the logic for + * "when did we emit code that changes the MVE_NO_PRED TB flag + * and thus need to end the TB?". + */ + if (cpu_isar_feature(aa32_mve, env_archcpu(env))) { + return false; + } + if (env->v7m.vpr) { + return false; + } + if (env->v7m.ltpsize < 4) { + return false; + } + return true; +} + +void arm_get_cpu_state(CPUARMState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags) +{ + CPUARMTBFlags flags; + + assert_hflags_rebuild_correctly(env); + flags = env->hflags; + + if (EX_TBFLAG_ANY(flags, AARCH64_STATE)) { + *pc = env->pc; + if (cpu_isar_feature(aa64_bti, env_archcpu(env))) { + DP_TBFLAG_A64(flags, BTYPE, env->btype); + } + } else { + *pc = env->regs[15]; + + if (arm_feature(env, ARM_FEATURE_M)) { + if (arm_feature(env, ARM_FEATURE_M_SECURITY) && + FIELD_EX32(env->v7m.fpccr[M_REG_S], V7M_FPCCR, S) + != env->v7m.secure) { + DP_TBFLAG_M32(flags, FPCCR_S_WRONG, 1); + } + + if ((env->v7m.fpccr[env->v7m.secure] & R_V7M_FPCCR_ASPEN_MASK) && + (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK) || + (env->v7m.secure && + !(env->v7m.control[M_REG_S] & R_V7M_CONTROL_SFPA_MASK)))) { + /* + * ASPEN is set, but FPCA/SFPA indicate that there is no + * active FP context; we must create a new FP context before + * executing any FP insn. + */ + DP_TBFLAG_M32(flags, NEW_FP_CTXT_NEEDED, 1); + } + + bool is_secure = env->v7m.fpccr[M_REG_S] & R_V7M_FPCCR_S_MASK; + if (env->v7m.fpccr[is_secure] & R_V7M_FPCCR_LSPACT_MASK) { + DP_TBFLAG_M32(flags, LSPACT, 1); + } + + if (mve_no_pred(env)) { + DP_TBFLAG_M32(flags, MVE_NO_PRED, 1); + } + } else { + /* + * Note that XSCALE_CPAR shares bits with VECSTRIDE. + * Note that VECLEN+VECSTRIDE are RES0 for M-profile. + */ + if (arm_feature(env, ARM_FEATURE_XSCALE)) { + DP_TBFLAG_A32(flags, XSCALE_CPAR, env->cp15.c15_cpar); + } else { + DP_TBFLAG_A32(flags, VECLEN, env->vfp.vec_len); + DP_TBFLAG_A32(flags, VECSTRIDE, env->vfp.vec_stride); + } + if (env->vfp.xregs[ARM_VFP_FPEXC] & (1 << 30)) { + DP_TBFLAG_A32(flags, VFPEN, 1); + } + } + + DP_TBFLAG_AM32(flags, THUMB, env->thumb); + DP_TBFLAG_AM32(flags, CONDEXEC, env->condexec_bits); + } + + /* + * The SS_ACTIVE and PSTATE_SS bits correspond to the state machine + * states defined in the ARM ARM for software singlestep: + * SS_ACTIVE PSTATE.SS State + * 0 x Inactive (the TB flag for SS is always 0) + * 1 0 Active-pending + * 1 1 Active-not-pending + * SS_ACTIVE is set in hflags; PSTATE__SS is computed every TB. + */ + if (EX_TBFLAG_ANY(flags, SS_ACTIVE) && (env->pstate & PSTATE_SS)) { + DP_TBFLAG_ANY(flags, PSTATE__SS, 1); + } + + *pflags = flags.flags; + *cs_base = flags.flags2; +} #endif /* CONFIG_TCG */ static bool arm_cpu_has_work(CPUState *cs) @@ -2479,6 +2588,7 @@ static const TCGCPUOps arm_tcg_ops = { .synchronize_from_tb = arm_cpu_synchronize_from_tb, .debug_excp_handler = arm_debug_excp_handler, .restore_state_to_opc = arm_restore_state_to_opc, + .get_cpu_state = arm_get_cpu_state, #ifdef CONFIG_USER_ONLY .record_sigsegv = arm_cpu_record_sigsegv, diff --git a/target/arm/helper.c b/target/arm/helper.c index 3f3a5b55d4..e50bec27d9 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -12509,115 +12509,6 @@ ARMMMUIdx arm_mmu_idx(CPUARMState *env) return arm_mmu_idx_el(env, arm_current_el(env)); } -static bool mve_no_pred(CPUARMState *env) -{ - /* - * Return true if there is definitely no predication of MVE - * instructions by VPR or LTPSIZE. (Returning false even if there - * isn't any predication is OK; generated code will just be - * a little worse.) - * If the CPU does not implement MVE then this TB flag is always 0. - * - * NOTE: if you change this logic, the "recalculate s->mve_no_pred" - * logic in gen_update_fp_context() needs to be updated to match. - * - * We do not include the effect of the ECI bits here -- they are - * tracked in other TB flags. This simplifies the logic for - * "when did we emit code that changes the MVE_NO_PRED TB flag - * and thus need to end the TB?". - */ - if (cpu_isar_feature(aa32_mve, env_archcpu(env))) { - return false; - } - if (env->v7m.vpr) { - return false; - } - if (env->v7m.ltpsize < 4) { - return false; - } - return true; -} - -void cpu_get_tb_cpu_state(CPUARMState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags) -{ - CPUARMTBFlags flags; - - assert_hflags_rebuild_correctly(env); - flags = env->hflags; - - if (EX_TBFLAG_ANY(flags, AARCH64_STATE)) { - *pc = env->pc; - if (cpu_isar_feature(aa64_bti, env_archcpu(env))) { - DP_TBFLAG_A64(flags, BTYPE, env->btype); - } - } else { - *pc = env->regs[15]; - - if (arm_feature(env, ARM_FEATURE_M)) { - if (arm_feature(env, ARM_FEATURE_M_SECURITY) && - FIELD_EX32(env->v7m.fpccr[M_REG_S], V7M_FPCCR, S) - != env->v7m.secure) { - DP_TBFLAG_M32(flags, FPCCR_S_WRONG, 1); - } - - if ((env->v7m.fpccr[env->v7m.secure] & R_V7M_FPCCR_ASPEN_MASK) && - (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK) || - (env->v7m.secure && - !(env->v7m.control[M_REG_S] & R_V7M_CONTROL_SFPA_MASK)))) { - /* - * ASPEN is set, but FPCA/SFPA indicate that there is no - * active FP context; we must create a new FP context before - * executing any FP insn. - */ - DP_TBFLAG_M32(flags, NEW_FP_CTXT_NEEDED, 1); - } - - bool is_secure = env->v7m.fpccr[M_REG_S] & R_V7M_FPCCR_S_MASK; - if (env->v7m.fpccr[is_secure] & R_V7M_FPCCR_LSPACT_MASK) { - DP_TBFLAG_M32(flags, LSPACT, 1); - } - - if (mve_no_pred(env)) { - DP_TBFLAG_M32(flags, MVE_NO_PRED, 1); - } - } else { - /* - * Note that XSCALE_CPAR shares bits with VECSTRIDE. - * Note that VECLEN+VECSTRIDE are RES0 for M-profile. - */ - if (arm_feature(env, ARM_FEATURE_XSCALE)) { - DP_TBFLAG_A32(flags, XSCALE_CPAR, env->cp15.c15_cpar); - } else { - DP_TBFLAG_A32(flags, VECLEN, env->vfp.vec_len); - DP_TBFLAG_A32(flags, VECSTRIDE, env->vfp.vec_stride); - } - if (env->vfp.xregs[ARM_VFP_FPEXC] & (1 << 30)) { - DP_TBFLAG_A32(flags, VFPEN, 1); - } - } - - DP_TBFLAG_AM32(flags, THUMB, env->thumb); - DP_TBFLAG_AM32(flags, CONDEXEC, env->condexec_bits); - } - - /* - * The SS_ACTIVE and PSTATE_SS bits correspond to the state machine - * states defined in the ARM ARM for software singlestep: - * SS_ACTIVE PSTATE.SS State - * 0 x Inactive (the TB flag for SS is always 0) - * 1 0 Active-pending - * 1 1 Active-not-pending - * SS_ACTIVE is set in hflags; PSTATE__SS is computed every TB. - */ - if (EX_TBFLAG_ANY(flags, SS_ACTIVE) && (env->pstate & PSTATE_SS)) { - DP_TBFLAG_ANY(flags, PSTATE__SS, 1); - } - - *pflags = flags.flags; - *cs_base = flags.flags2; -} - #ifdef TARGET_AARCH64 /* * The manual says that when SVE is enabled and VQ is widened the diff --git a/target/arm/tcg-stubs.c b/target/arm/tcg-stubs.c index 152b172e24..1a7ddb3664 100644 --- a/target/arm/tcg-stubs.c +++ b/target/arm/tcg-stubs.c @@ -21,7 +21,3 @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome, { g_assert_not_reached(); } -/* Temporarily while cpu_get_tb_cpu_state() is still in common code */ -void assert_hflags_rebuild_correctly(CPUARMState *env) -{ -} diff --git a/target/arm/tcg/cpu-v7m.c b/target/arm/tcg/cpu-v7m.c index c059c681e9..de4a1ff81b 100644 --- a/target/arm/tcg/cpu-v7m.c +++ b/target/arm/tcg/cpu-v7m.c @@ -237,6 +237,7 @@ static const TCGCPUOps arm_v7m_tcg_ops = { .synchronize_from_tb = arm_cpu_synchronize_from_tb, .debug_excp_handler = arm_debug_excp_handler, .restore_state_to_opc = arm_restore_state_to_opc, + .get_cpu_state = arm_get_cpu_state, #ifdef CONFIG_USER_ONLY .record_sigsegv = arm_cpu_record_sigsegv, From patchwork Tue Mar 19 15:42:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781115 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996134wrs; Tue, 19 Mar 2024 08:46:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX85o+vYYvhDTGeovuIcKJGM5oEue5pxi17VunzYhzPVcmub1XFXfiV6OYlLyTiaxsufJ8gJElssZXz7dU4HFz4 X-Google-Smtp-Source: AGHT+IHnWuCI3Vi0d5mwxhxF+3qaUYHKMfBgN39xsmJgqj89DRQGtVhkKTbur3OcZ93aF9P/adYk X-Received: by 2002:a05:620a:3907:b0:78a:f69:b946 with SMTP id qr7-20020a05620a390700b0078a0f69b946mr3735988qkn.47.1710863160552; Tue, 19 Mar 2024 08:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863160; cv=none; d=google.com; s=arc-20160816; b=jpLGCqlShoTQcJrguKzfu+gvPN04oa/MGVXwCteLk0exf1oUvQYUAW5tBCsBtZ3Nuh 5Tuc20Pwa9hPlRqVrhrqWasaPlvnhAm8QWU0GZkJuyvL0WPvOcDateD8FEp4f8lngQf1 PIvaxNMxDqeGbFXDSIdh1/GCy/bzU91XHPv/7mX8fEaub9RjfAQh01KepxpculFQp8YZ 0+TcpTeU2XDQ4eXYQPrx6UFZQYEsPdrZYMZmvQVdhi8MXI1BAx38BL0IgIZJVXGcGvXX wQvPTEGNUMv/AqDDcliecxRJy1EF0DRW+ULOhoMHGODrHBvTqOxrDrbvOYSd/ktiSBrS 7/iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2kOlmQKWOdk+OL6bKivQd41MjZmQhEJZYUXe/hoRFYk=; fh=lWwWqzoqGOarx109Fc7K3KXcIJSuF/n6zOA5f0d2tfY=; b=k53GA9t2r3CE4YCMxajblyVnfigyx3/NoH054EW7S7H9+Z+g903ewyIT+1uyrjtqxD /Trj/REGxxYLFAZwNnMnwtP0Lw47Waw8HIqaHqcXLuRQNll12bXgBvrbF4HopNTBMSDV PTNCRk05xDg8mKXT1zEPI/QpRVJvmlM3PQzNdganjym9PsBBsQEAFQCWXwZRwbiY1nOm muV1MXpZKBIfUd21pmJveZvIP4/DBflXsQ/3yYaasbDqX0tk3yFCuYbMdi4Xkqdpuwrj UNWO0nlrNOmUVy0q/Z4hBHuf5dN5tIgMWedI0L8C7GzBrvrz453KGMARDXziCl/WPrWH g4LA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jurkxHUV; 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 k15-20020a05620a0b8f00b00789ec87f253si7313794qkh.73.2024.03.19.08.46.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:46:00 -0700 (PDT) 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=jurkxHUV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbcu-0005Wr-2T; Tue, 19 Mar 2024 11:43:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbcr-0005Ul-Lf for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:42 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbcp-0004rz-Nw for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:41 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-33ed7ba1a42so2099346f8f.2 for ; Tue, 19 Mar 2024 08:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863017; x=1711467817; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2kOlmQKWOdk+OL6bKivQd41MjZmQhEJZYUXe/hoRFYk=; b=jurkxHUVSIc24pBN3Fram4I9F2nMu1vzIsCMPSHhb8nZY+uyWIsKB6g7frflcdsSKJ hJhotZYFeA3Ya3hDNNmCYnGewuZPKg8FWSIuyAFX4xywyzrFxpVsga7kPq+JGSLA8eTk t4qsTnQoATBPNSGH6sQDGx0lJbUX6JskzVgqer+QmWEAIy0b1DwnQH4PbN1raHoGY4I3 qVt84nVvwSX9+0OFc60ozt/ThHVAvqf278FtE0XYmzZNmiONz7G6CGuJsLfRL8NUORWb GmvW8a2JWXvkb0sdEig8dEhLgn9NXwS3qAed2qpQiE3zqWtoDyklWFBrDrN9iZiahp/S z4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863017; x=1711467817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2kOlmQKWOdk+OL6bKivQd41MjZmQhEJZYUXe/hoRFYk=; b=SeROMYIRFsKFikU1zGOb6LIbh2WAkKiivznG9pGoh2uxU3CTn7mbn5O2l89kqcTFD8 zqh+S2+u7gu+677xxsxFzPqNupuQFMQiAz5rRKE4FghKmHH1WM08IAnFQ4m+EQ2MB0go l6Vp+fbSj3nlxln1frn+fNx3MsWm+CFbR9LIEFZG583uBrE/EJronT43bzBrboDOgYAc dymClJvvxQqUBDqAG2XCkvQN9SstGsy6DF7ymEpzETtgmO8JsP9c0Jiq15nDOyM0IFf2 4SodFOLVDH4MR+tczaQzKwZ41lDsUPNqsi5Kh/8F2gccS1+LB/i1bjFn6bnuX02xXn49 JOqQ== X-Gm-Message-State: AOJu0Yx8dIIcInxODXxiQaUg3FCEk8gk3vcl3Yi79ZwLEnKXODZL7KVJ 6m4wzRCRVFFs/uoCOjFiX/zSeRDvYNyLSmO2Peo2S+tlu2abxn8NextCFO8FrMp1nibyCSXihYt A X-Received: by 2002:a5d:5190:0:b0:33d:82a1:626d with SMTP id k16-20020a5d5190000000b0033d82a1626dmr1877582wrv.38.1710863017273; Tue, 19 Mar 2024 08:43:37 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id h11-20020a5d504b000000b0033e7a102cfesm12592441wrt.64.2024.03.19.08.43.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Rolnik Subject: [PATCH-for-9.1 06/27] target/avr: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:35 +0100 Message-ID: <20240319154258.71206-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/avr/cpu.h | 20 -------------------- target/avr/cpu.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 0c0aa580f5..284041a87a 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -193,26 +193,6 @@ enum { TB_FLAGS_SKIP = 2, }; -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUAVRState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags) -{ - uint32_t flags = 0; - - *pc = env->pc_w * 2; - *cs_base = 0; - - if (env->fullacc) { - flags |= TB_FLAGS_FULL_ACCESS; - } - if (env->skip) { - flags |= TB_FLAGS_SKIP; - } - - *pflags = flags; -} - static inline int cpu_interrupts_enabled(CPUAVRState *env) { return env->sregI != 0; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 45ee1b5f89..c765f49c9f 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -66,6 +66,24 @@ static void avr_restore_state_to_opc(CPUState *cs, cpu_env(cs)->pc_w = data[0]; } +static void avr_get_cpu_state(CPUAVRState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags) +{ + uint32_t flags = 0; + + *pc = env->pc_w * 2; + *cs_base = 0; + + if (env->fullacc) { + flags |= TB_FLAGS_FULL_ACCESS; + } + if (env->skip) { + flags |= TB_FLAGS_SKIP; + } + + *pflags = flags; +} + static void avr_cpu_reset_hold(Object *obj) { CPUState *cs = CPU(obj); @@ -209,6 +227,7 @@ static const TCGCPUOps avr_tcg_ops = { .initialize = avr_cpu_tcg_init, .synchronize_from_tb = avr_cpu_synchronize_from_tb, .restore_state_to_opc = avr_restore_state_to_opc, + .get_cpu_state = avr_get_cpu_state, .cpu_exec_interrupt = avr_cpu_exec_interrupt, .tlb_fill = avr_cpu_tlb_fill, .do_interrupt = avr_cpu_do_interrupt, From patchwork Tue Mar 19 15:42:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781109 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1995795wrs; Tue, 19 Mar 2024 08:45:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV8OR8RGVCgR9T432EOVCyPN+IKvfRVXxj6bM+B1hBO1FBe3KHOdi+MgNM9GVeQZC02uGTtNy0JTc/frHCFKkoI X-Google-Smtp-Source: AGHT+IEYmFqEXlt4MzU3BC/TB27/kCRam4M+0jRseXk77icsRE9fM/92JqlZUTxcKYAQkV7kI1ll X-Received: by 2002:a05:622a:1a1a:b0:430:d2b8:5753 with SMTP id f26-20020a05622a1a1a00b00430d2b85753mr3285544qtb.28.1710863113940; Tue, 19 Mar 2024 08:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863113; cv=none; d=google.com; s=arc-20160816; b=YR1xAuZQ8pbzaz0DVQ5e8cO8EUSlnWU4q7pIWgokDBRSaspA/2PM/mJvmozJsoB9IQ BSmPgvvhReKeapEt53XqtS0g950ADL3L3bVplB7JEcZ60bO1CpDgUhC1lsrbincrN2uH QeRgAKkV2l06g4Iw+aAFnjIJy+KGWBjTHGt8jV0V/XEYRQF2wgWO13eGDeYpTrp8ECQz h7oBjv70mnFjW6ur1C4U/itlu27hb968/lStZU2sM/HO8+f8fybrxc7a9hMuaMWtIqXu bUX+z8qpbXN6JBLXjOAnMCpv8YktqKqI4pyr8S0e0mv/b5D18uSa+5mNAGWUz9g0uhqP 3CKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wt+1/nVbm4UwUNrHtwVfJccIMKB4kkx/gPc6B1UnmDE=; fh=8Pzz7K/FQo1q7xIq/JV6RYDisF54mivkmBc3zg+OmUM=; b=QC6/fAXr/hJsYYQcrYZixV9w9FabSqPj8dU26dz3sRHa2Wu6f5Mv4r+x+BxTPdRTDY mBiqbDqhfKN8dBZA+HUkUFmGCQA6h+8bG2RBdM32b1wEkZXi6pVg/LWjLF4LUK+cLFAg pjdeL27y2vosjcQmkRk5vdeNPFZlmovTSdR3mCnNQC1Yq5YzmwWO3kYPCwHmLLNIRPBb I8FX+JoWBtBbK3CtfYcNWKhvxER+rWXO0TpbHlHuCaq9GTXintwWgbIK0nZzY3+RSYP7 sxNzaBxL2mSq+wMCbJIVzQcqMuCPPG7idHY9dgi2snI/m9kTz7qDRq3WF1xab+m8gE5L q1iw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M+xLodN6; 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 b11-20020a05622a020b00b00430cad99fa6si5114976qtx.773.2024.03.19.08.45.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:45:13 -0700 (PDT) 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=M+xLodN6; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbd0-0005aO-7n; Tue, 19 Mar 2024 11:43:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbcy-0005Zk-Uz for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:48 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbcu-0004tc-UR for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:48 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2d2505352e6so64679001fa.3 for ; Tue, 19 Mar 2024 08:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863023; x=1711467823; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wt+1/nVbm4UwUNrHtwVfJccIMKB4kkx/gPc6B1UnmDE=; b=M+xLodN6o4YytlQ0BuvMaMGvZHAc4IcZDYBgEDDHXEFUS44nQZFSjkqpDYr4DHfcEs 29EgGNGLkO6rvEpMO7dCBrx6OB5m8tyMBx7V+xvpvLPSDYIM7Ux171sNGs07EwFJDFMh Y2TI9jRMctvbh6VmepB/xOfm06Um/OYbDrsSlkvcJ2KMqOm8dUfcIe6K4TBSXYvnaoAm 5dktWuUHwZsh58Ob4dmVSFoP8yrHVZD171OlK8FdoLbdZCL6DRT5/+BvzCybVm1Ubaxw T45xUKDv9fniInOmNzHQzWAqbR3lOLQ2G+BfVUh9FRU/XuA+CVdEPaaToMMxnQ7tv4I2 3u2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863023; x=1711467823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wt+1/nVbm4UwUNrHtwVfJccIMKB4kkx/gPc6B1UnmDE=; b=ESTRv4UFVRN/c5MaoAsiizsz6qsoiin6IL7hVxHnSec1QdM+vizRE+mNuLqSCYOhB0 S0gx16jZA/7/mdUZFqQIyaUx5TQ1gJfZGs1mKXxT5tGEZAmCp18GWMH+q6vKuLqL/Wfo 2yrHu7/woF2KKhr6b9dzGJNyBR/zcWw2mcA9ilu27lw49ZCipiVTGpRr32sIVWhzjAsQ n9sP53uj+GgiMNmcVzMeGh4maPxU4GepE/RRy1azKQlrG1NgGS7BzmAdnQFnDGgQ+9bO SCL/6U5hPYrF1+IgFdzmjys4HUKKlULxO3y//jdX0dGEwFrikcWFdXhxEvPhEbly7PBs 5frQ== X-Gm-Message-State: AOJu0YySFkaAuxWhSJ+oi6SyvmZbFzYRKMdwdMazaBeuHPI2i3vYRITz 8/uYZn2gabikAoQYJqnh8pmNjuyMC8Yvl/gR7WNWM+HzIjuF+bZbJfskNIPxYW6EjjFQ7Evz78Z g X-Received: by 2002:a2e:6d02:0:b0:2d2:e44e:a5cc with SMTP id i2-20020a2e6d02000000b002d2e44ea5ccmr10123039ljc.46.1710863022845; Tue, 19 Mar 2024 08:43:42 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id fm24-20020a05600c0c1800b00414650448a7sm2379716wmb.11.2024.03.19.08.43.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PATCH-for-9.1 07/27] target/cris: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:36 +0100 Message-ID: <20240319154258.71206-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/cris/cpu.h | 12 ------------ target/cris/cpu.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/target/cris/cpu.h b/target/cris/cpu.h index dbd6fb05f0..6df53f49c4 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -273,16 +273,4 @@ enum { #include "exec/cpu-all.h" -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUCRISState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - *cs_base = 0; - *flags = env->dslot | - (env->pregs[PR_CCS] & (S_FLAG | P_FLAG | U_FLAG - | X_FLAG | PFIX_FLAG)); -} - #endif diff --git a/target/cris/cpu.c b/target/cris/cpu.c index eb4bddcb7e..8d0b92b96d 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -51,6 +51,15 @@ static void cris_restore_state_to_opc(CPUState *cs, cpu->env.pc = data[0]; } +static void cris_get_cpu_state(CPUCRISState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + *cs_base = 0; + *flags = env->dslot | + (env->pregs[PR_CCS] & (S_FLAG | P_FLAG | U_FLAG | X_FLAG | PFIX_FLAG)); +} + static bool cris_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); @@ -182,6 +191,7 @@ static const struct SysemuCPUOps cris_sysemu_ops = { static const TCGCPUOps crisv10_tcg_ops = { .initialize = cris_initialize_crisv10_tcg, .restore_state_to_opc = cris_restore_state_to_opc, + .get_cpu_state = cris_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = cris_cpu_tlb_fill, @@ -193,6 +203,7 @@ static const TCGCPUOps crisv10_tcg_ops = { static const TCGCPUOps crisv32_tcg_ops = { .initialize = cris_initialize_tcg, .restore_state_to_opc = cris_restore_state_to_opc, + .get_cpu_state = cris_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = cris_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781126 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997732wrs; Tue, 19 Mar 2024 08:49:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUY13W/xybLteD5GNA0HtgieEoEsWFXx9cwkUtZD7hoyzujkXMvmBCuzVsf3ZXDk6jFCqNEO1hdZX3QwDetw1ud X-Google-Smtp-Source: AGHT+IG6TUdfVWmiBJ9l1fbvf/BWhBsbDaDMQbDrQ8/hyIfTCIs6NRsk7OyApZPNSoQOkbotMprJ X-Received: by 2002:a05:620a:95c:b0:789:ec76:d350 with SMTP id w28-20020a05620a095c00b00789ec76d350mr9041782qkw.33.1710863395477; Tue, 19 Mar 2024 08:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863395; cv=none; d=google.com; s=arc-20160816; b=pCW3OrBWp7aaDGxSXcL2eudl+Q4sN2R0rSViKbPVqacGxfXbGzhAKUAHasnQPafry9 OdPsltiT1uIH9RVmRG9fVnxbQoUPXct7585Oh/NQZY1FzGGOe7ZSl1nxMdzzNkDQyff0 yF/U4y9dojAMfZEv/MN7qE/1iID/jqPfr6HNXWPoRyB5V00RkBy40kuc5bcd/uZZynoz HKMTutEiiWBU69AcVWIUalh7K8w4c2j1NFg0Ma8XM9nLrzkgpJE6X0lcCONefKg1BLWn dC5kUj1kQiZq3b+uF0zpoq0tCgPlfoUlMsrzfX2aPCptznyCOgR1D4nOU/wBn/5Gc0h4 gXfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Uhrck07YAgtzhdFq8/D5fUYa0OpjmAt0ZJzdbBj3AUo=; fh=nbq5obhj6wYn1f5Y/HjoNWg24fdQbUCP4WUs+ZHF++U=; b=QEBSPJdzIVkpxKlvYHWtbxo/XEfASdCVgm5Sn1610vMemDOPh8iAQO5pTniSBsor6b Xt4OmUKC82DfGWPnnGnS3z26cGXOkD0ZKUKCLuuvHfkPwnzrap7AnWs28vTZ5I8uGy16 Qtsqgsqfzy0D3EDOqsdtpvkXsK18KKwtCLFaZ0IgE7PPtQ5NJILBdqx6BmgQ6eT4mkhQ H4DZitrlhne1dE/89PPYw06b8GOjb3KO3Qv3lBP9fRBtB8076nw/Fb1IKF6IgdLBLJ8D oNBAMAHsxZiSn1niMmtb4ov2G/6dZ4WHMhATZYN/4WGrMS4DEKI9R9tY4nh3QsqvwudS Hf7w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rqu/EkyS"; 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 i3-20020a05620a0a0300b00789f7960f32si5482580qka.781.2024.03.19.08.49.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:49:55 -0700 (PDT) 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="rqu/EkyS"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbdf-0006UP-D9; Tue, 19 Mar 2024 11:44:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdF-0005tO-N7 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:07 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbd0-0004yL-Ln for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:05 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-34005b5927eso2061204f8f.1 for ; Tue, 19 Mar 2024 08:43:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863029; x=1711467829; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Uhrck07YAgtzhdFq8/D5fUYa0OpjmAt0ZJzdbBj3AUo=; b=rqu/EkySLXxLuBe89w6+sgPOBt2YinqCHysLniu6snnzBNL0LM9Bmucbl7hpMAlhRc wK6EIlb0wdHq1Tq3kC00WQx5fIVIlkd66wez6jZle/PqAOclD/riKF3cY48sXRFdjF3P UKLFEALzORtN1EEkRQf73vv/KeMQlDe3G98Hx+L+kJAsz6aVx0cUNV2Yzdn6ZaLmkSGE xNzYXKnGdXllCg5gyzd3VBKov1gE/9/6NFVUmD9sPWfaFEuuah5tauEgI7c/YEg9uwVY hEk1nYTE1xoDdBEpZVjvha33LJvi7pAaiMwqFtLORvN9N4B6/XDG5YKbOhRbnYON+HRO cd/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863029; x=1711467829; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uhrck07YAgtzhdFq8/D5fUYa0OpjmAt0ZJzdbBj3AUo=; b=nw/hMWlStgXmXdxvPjN/YvXtWHI4udklNhtOXANiQB2rZ964UHP/V/TMeC4QQpqCB9 g/17DE5LvWCz7LH8GYwxf6rvqfpJvgAX+f/8eP/bT1uPm4T1zWwL9kKb1a/8j+QQrr1X PTpOeKnwO2rMceeQVos8Dj6DI6tfG35q2u0HYwoYeWtAscKAuNG67VSVBWDL2SjS0Jw4 iWCg2dLerS/P9A+YkGw5R+3FeYDI0H5TIOLJnsWna5f5P4nwHzqaBFyJZffVP7iiWz5n 13XzMS4pPTvyTJMXIx/QOLujQ9VhjxM1/cK2+wPXr8fop/8gUH9aJziIi5VGUn5YTQEk iXvw== X-Gm-Message-State: AOJu0YziZ07Si2ih/PjyevmUT8ZOL3v65i8acaLlh+3zXuH/CptULU2o q/AkZLzXn/KhQ4jzVujDLhtjPECxyDOMsXAHfoIlDlopBVd+dQ4mUSpZ6hZsH8lWq+83kzhFhRq W X-Received: by 2002:a5d:6a46:0:b0:33e:cc2e:8286 with SMTP id t6-20020a5d6a46000000b0033ecc2e8286mr9495145wrw.59.1710863028662; Tue, 19 Mar 2024 08:43:48 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id w10-20020adff9ca000000b0033e72e104c5sm12591686wrr.34.2024.03.19.08.43.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Brian Cain Subject: [PATCH-for-9.1 08/27] target/hexagon: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:37 +0100 Message-ID: <20240319154258.71206-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Brian Cain --- target/hexagon/cpu.h | 14 -------------- target/hexagon/cpu.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 935a9c3276..1d42c33827 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -134,20 +134,6 @@ struct ArchCPU { FIELD(TB_FLAGS, IS_TIGHT_LOOP, 0, 1) -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUHexagonState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - uint32_t hex_flags = 0; - *pc = env->gpr[HEX_REG_PC]; - *cs_base = 0; - if (*pc == env->gpr[HEX_REG_SA0]) { - hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, IS_TIGHT_LOOP, 1); - } - *flags = hex_flags; -} - typedef HexagonCPU ArchCPU; void hexagon_translate_init(void); diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 3a716b9be3..5e0a9441f2 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -273,6 +273,18 @@ static void hexagon_restore_state_to_opc(CPUState *cs, cpu_env(cs)->gpr[HEX_REG_PC] = data[0]; } +static void hexagon_get_cpu_state(CPUHexagonState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + uint32_t hex_flags = 0; + *pc = env->gpr[HEX_REG_PC]; + *cs_base = 0; + if (*pc == env->gpr[HEX_REG_SA0]) { + hex_flags = FIELD_DP32(hex_flags, TB_FLAGS, IS_TIGHT_LOOP, 1); + } + *flags = hex_flags; +} + static void hexagon_cpu_reset_hold(Object *obj) { CPUState *cs = CPU(obj); @@ -327,6 +339,7 @@ static const TCGCPUOps hexagon_tcg_ops = { .initialize = hexagon_translate_init, .synchronize_from_tb = hexagon_cpu_synchronize_from_tb, .restore_state_to_opc = hexagon_restore_state_to_opc, + .get_cpu_state = hexagon_get_cpu_state, }; static void hexagon_cpu_class_init(ObjectClass *c, void *data) From patchwork Tue Mar 19 15:42:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781127 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997740wrs; Tue, 19 Mar 2024 08:49:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpR3kr30v4xK13otyflfDLIV7RB2PzrZ/0B+9RfktPd6MU4WMnhPqWt5mQ2IQ0VQKsM0IyTtAQcg5N87hArvA/ X-Google-Smtp-Source: AGHT+IGWX+4/+n/1sGUS9S7CZgeouwW9yQhlMDiptmaH7D7DQSubUSqXNOMg8TKHycURqoVVcGky X-Received: by 2002:a05:620a:384c:b0:789:f096:a917 with SMTP id po12-20020a05620a384c00b00789f096a917mr2825815qkn.41.1710863396857; Tue, 19 Mar 2024 08:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863396; cv=none; d=google.com; s=arc-20160816; b=UWrIV0FPeLU19mKVlsLrY7kQ7hFxPWjk2eAkfPBIM+3eO+qAP9gGK+7RKENvaBF4nk zwgCiE1FMgZyh29uK3VUoKyd0girFCkx6gmdqCoHa0aWKwAhdSUVfCaVacnzSM5p1pzA YsipxaqerCMyEAGaEIP96XwUScOAOSvH70m4EgDzXT+58TLCu5VsxDSTW0qqZ89KcDVt 1WtCQOYXTY/dTq7svQTBVpEaw01RMZO7E2scFVLb1rC/dkq1Q2i9Y/bjeawjH82JuEGx At77LPSfL94KgxCL5FJqksIryPo3T94p1DEZlp6fkTrwiugmRUv3o1wj41DbFtkVUhkj VxVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t3jAlnMMCXdnlaBpDRUrvP0z17b0GYkDdt6gJNRf5/M=; fh=4MeBauBJBoNvn/JdNDNA8obdNi8WkyFXHqMtQhjC48A=; b=lxYA3F9DVF12pSVEDaK6tWaIsB1BXUT4n3hcTZAqZ8UQmTs9hf/n6fa4eu4fvC0gea E2bkLB1gi1BNNHbSCRdum4vJX0ey96KLHMb1BLNshCS6BPdnUzRUxhL7wAO8S4BpClgg tPaE6LodjYzkxZDA2l17gqg9mb+4CxudUuqBXvdoOqnBGScfub0U1qQIuEh9iIbQQ/jf RLDjK7ySNAYbpd2NQGmi6VBKngoxB7x5kH+6tph30cGbwTx/AAOgtOeIa/M/yhTsssuF fPekDcd+qV1eqaKnAkS9kuW2foQ9KBh85OcdO/bVAup96AygjmeFt/wKHeQ/eEleoO1v 8+4A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gk8RxjF4; 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 d2-20020a05620a204200b00789e9045355si8445753qka.453.2024.03.19.08.49.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:49:56 -0700 (PDT) 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=gk8RxjF4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbdg-0006al-1R; Tue, 19 Mar 2024 11:44:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdH-0005vl-JN for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:09 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbd8-00052C-9J for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:06 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5157af37806so1070901e87.0 for ; Tue, 19 Mar 2024 08:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863034; x=1711467834; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t3jAlnMMCXdnlaBpDRUrvP0z17b0GYkDdt6gJNRf5/M=; b=gk8RxjF4dRv5mDJtAzKIf5SxxB0vVxgxbZFAiEjdwnK9GSKZDDlbtjDo+3U8um0KYA BnvjK970PetZXAlrNTB8LSnfwoRtRgIgahB5BCLzn4oY1RDJIQJDQhRAFMzyqn5cCi/n QmtSf9E8Z/lwzNE000f9qsNpGUVFB7gp67mZ+pf2pO5coYhfZLx6yYTdLCM2mZHf+xMS AjGcsfeZXznL/7nd2J9G7CtKh15zV3CvE/6qC+Kil/k2USoOZybtOrmSbV714Y9LHZGW R0yUTDG4xIJA5/2gzq2L4UwHLHd68E6Ety1asbnI5y6zO3S+EdmCJNXWlIyxFW/8pAYe gjZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863034; x=1711467834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t3jAlnMMCXdnlaBpDRUrvP0z17b0GYkDdt6gJNRf5/M=; b=Wc/yS68jPQj6Q8NIeMo1TlFi8DEr6AnWNlDv/gM3xLE+NaTRG89PSdxkMrCJ17SNju 4z4kpPDt2KG0+1gx+JURiBAu+pJS2Etkq1lhutL/wGi2qS6+H3ilwfkVsS69mS18Hrtg eCZuQKJp3LFQSjil2zqweTBiYiTxWPm4Or0CXqYTXVsc9rE1sxJRuOGuQUbgKB6mL9gn KBpkKMzdkVZdHAEy3a3TLnLnTWOZcVHXcqOLFcVmB2MnwN0T9+9vyHjpbtbvWCKlkaG2 Rg8klFKOBYixBqMvjkVk7IXXfK2REQHHo4Tsu1875de+gHwCon7U3aBafD36A+LYipc0 8B9w== X-Gm-Message-State: AOJu0YzhTx7RL+yt5wRCWSm5daRNJGTVJ424q/Qb69BalQgYRpJion2s nyrOwkRwXzIh8aX6hXRSRoRL/OCC9oW2gib5u5Adh4hsYNky8z2hcCKMNTGn6yUO6GA3B1BIjf4 R X-Received: by 2002:a2e:be8a:0:b0:2d4:522e:62f3 with SMTP id a10-20020a2ebe8a000000b002d4522e62f3mr11483591ljr.44.1710863034373; Tue, 19 Mar 2024 08:43:54 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id n2-20020a5d4002000000b0033e93e00f68sm12609359wrp.61.2024.03.19.08.43.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 09/27] target/hppa: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:38 +0100 Message-ID: <20240319154258.71206-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/hppa/cpu.h | 44 -------------------------------------------- target/hppa/cpu.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index cdb2904936..9bc54124c1 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -314,50 +314,6 @@ hwaddr hppa_abs_to_phys_pa2_w1(vaddr addr); #define TB_FLAG_PRIV_SHIFT 8 #define TB_FLAG_UNALIGN 0x400 -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUHPPAState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags) -{ - uint32_t flags = env->psw_n * PSW_N; - - /* TB lookup assumes that PC contains the complete virtual address. - If we leave space+offset separate, we'll get ITLB misses to an - incomplete virtual address. This also means that we must separate - out current cpu privilege from the low bits of IAOQ_F. */ -#ifdef CONFIG_USER_ONLY - *pc = env->iaoq_f & -4; - *cs_base = env->iaoq_b & -4; - flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; -#else - /* ??? E, T, H, L, B bits need to be here, when implemented. */ - flags |= env->psw & (PSW_W | PSW_C | PSW_D | PSW_P); - flags |= (env->iaoq_f & 3) << TB_FLAG_PRIV_SHIFT; - - *pc = hppa_form_gva_psw(env->psw, (env->psw & PSW_C ? env->iasq_f : 0), - env->iaoq_f & -4); - *cs_base = env->iasq_f; - - /* Insert a difference between IAOQ_B and IAOQ_F within the otherwise zero - low 32-bits of CS_BASE. This will succeed for all direct branches, - which is the primary case we care about -- using goto_tb within a page. - Failure is indicated by a zero difference. */ - if (env->iasq_f == env->iasq_b) { - target_long diff = env->iaoq_b - env->iaoq_f; - if (diff == (int32_t)diff) { - *cs_base |= (uint32_t)diff; - } - } - if ((env->sr[4] == env->sr[5]) - & (env->sr[4] == env->sr[6]) - & (env->sr[4] == env->sr[7])) { - flags |= TB_FLAG_SR_SAME; - } -#endif - - *pflags = flags; -} - target_ulong cpu_hppa_get_psw(CPUHPPAState *env); void cpu_hppa_put_psw(CPUHPPAState *env, target_ulong); void cpu_hppa_loaded_fr0(CPUHPPAState *env); diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 3831cb6db2..f2dc1e79e9 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -89,6 +89,48 @@ static void hppa_restore_state_to_opc(CPUState *cs, cpu->env.psw_n = 0; } +static void hppa_get_cpu_state(CPUHPPAState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags) +{ + uint32_t flags = env->psw_n * PSW_N; + + /* TB lookup assumes that PC contains the complete virtual address. + If we leave space+offset separate, we'll get ITLB misses to an + incomplete virtual address. This also means that we must separate + out current cpu privilege from the low bits of IAOQ_F. */ +#ifdef CONFIG_USER_ONLY + *pc = env->iaoq_f & -4; + *cs_base = env->iaoq_b & -4; + flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; +#else + /* ??? E, T, H, L, B bits need to be here, when implemented. */ + flags |= env->psw & (PSW_W | PSW_C | PSW_D | PSW_P); + flags |= (env->iaoq_f & 3) << TB_FLAG_PRIV_SHIFT; + + *pc = hppa_form_gva_psw(env->psw, (env->psw & PSW_C ? env->iasq_f : 0), + env->iaoq_f & -4); + *cs_base = env->iasq_f; + + /* Insert a difference between IAOQ_B and IAOQ_F within the otherwise zero + low 32-bits of CS_BASE. This will succeed for all direct branches, + which is the primary case we care about -- using goto_tb within a page. + Failure is indicated by a zero difference. */ + if (env->iasq_f == env->iasq_b) { + target_long diff = env->iaoq_b - env->iaoq_f; + if (diff == (int32_t)diff) { + *cs_base |= (uint32_t)diff; + } + } + if ((env->sr[4] == env->sr[5]) + & (env->sr[4] == env->sr[6]) + & (env->sr[4] == env->sr[7])) { + flags |= TB_FLAG_SR_SAME; + } +#endif + + *pflags = flags; +} + static bool hppa_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); @@ -186,6 +228,7 @@ static const TCGCPUOps hppa_tcg_ops = { .initialize = hppa_translate_init, .synchronize_from_tb = hppa_cpu_synchronize_from_tb, .restore_state_to_opc = hppa_restore_state_to_opc, + .get_cpu_state = hppa_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = hppa_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781125 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997696wrs; Tue, 19 Mar 2024 08:49:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXyFdsVtuTBn5pQ3peJI9EMjJYMjl/XziabzHZbzsFo+RemT1FdCQtdZ+CKY1cY6rz4/J1Squf6fPlxqvceo0BH X-Google-Smtp-Source: AGHT+IEvcyS2JcE01GTpXnt4bk/3r/KQduN2TDBqYfYL5P2+u0w9HpCfDAHem/eEBJRHzYDijjkc X-Received: by 2002:a05:620a:389a:b0:789:df6e:c412 with SMTP id qp26-20020a05620a389a00b00789df6ec412mr16849472qkn.24.1710863392062; Tue, 19 Mar 2024 08:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863392; cv=none; d=google.com; s=arc-20160816; b=F0vsWrKeYUp4SHidcW79ybI7j+FWgQLVkYPUE+x4pHnXNpfo3L+iz5yLy84S1zq8cp 5NpRvCD4YQ/wF42rXqxofQ63c8s4Pdh2+51rBXuuWIQFbV1N7x4S5mqRU5gbS3hIONeF PT8JNoJlozBLx9FXbOQVWfwR3LRdTlFDrRFFfiH6Sp4W6o4HALQ5Ef6GBZpRFSABexc0 6Qk6khn4UupbunwTsyfBdkm79c6IndJR2U6w7+p1N8/c5nrb9GtAfpfzhkwzo6OgXMWH JL8NhPZFhSe5tNOFORxzoGCGgnzPvFqG0OYV98mZl5AXqt9vkV0HAqMXUqRUifIobBXS sS1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j7owAJrs+Pq1wtN5iEuRd7D9oJWUcLUFndnuD7FxVak=; fh=5TCg2N8lfbGObzZ/c69RjToOhmT67ZBakWl3x+TH8jY=; b=CiMGen4MBZfourd/TotTLcLPhSzyuLEoME4FfFQLqYU9r95JM+SKkDwY4Hsu8Z7yNU SxKhWEYB7jY/VRbzsImk9x8VrSwnOm3peBofqHEj/lwM3GyjajM63xQtgTS5ZtwTIlA6 2F2bqMTjB01vfgS5KUXz3TQmCgSmo+mK3yYsgSXMyi/h3856/uL0pypFVnSKotNvEaWd +90kxxI8pzuvJcZkQyJNEnJdMY4O/mv9zc3QmiLqPW20+tGSO7K70p+JZiIG4giNr+QS jA00U52a0bf89J7NeYzwm8UwkamrHuimfvkZlC8Hvve8TCyOVhO+B2y22OD9C1lIZf2H TCsQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CxT1DYqd; 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 l2-20020a05620a210200b00789e4b38b21si9266937qkl.431.2024.03.19.08.49.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:49:52 -0700 (PDT) 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=CxT1DYqd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbdk-0006xR-3p; Tue, 19 Mar 2024 11:44:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdL-00060C-B6 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:14 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdD-00053F-42 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:08 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41413f7b2dfso14209355e9.2 for ; Tue, 19 Mar 2024 08:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863040; x=1711467840; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j7owAJrs+Pq1wtN5iEuRd7D9oJWUcLUFndnuD7FxVak=; b=CxT1DYqduBuo7jh1s3Atk2ea4hwd8bl8FQSlasG5Y+TlwP4GAYi+1WLElSpNoyQcZW Xv8NGDFynY7Z3qn2M0Vmd8N3OXgOI61TknkB+nsZhU7tFGmtF2Kt6BQVfRs4OfIZS8/y 8e9mDs0bOu7YpNSH0aoNBn1ZOU+aRr0izAql0IPzz3DuWu5x4B7ENr5MBJdcQcLpGkk8 AkGswTh1gJYKdLnqaq/VzhZQlcAQPrI0Yunww/ukLO6CAwYZcgY/Mz0JUA2yIK7+2dfk NJZr64zCl15Fjwik4qJxGderB3uZoqi1jLQjE6+b3d/r/spEQhJ4ZWzRd0uWIyWhNVpE hLXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863040; x=1711467840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j7owAJrs+Pq1wtN5iEuRd7D9oJWUcLUFndnuD7FxVak=; b=Svg9aCGu6EBCY2Puuv/pQNtQqPHLZBL02PtI6o/Mb8KwWOsZ7r2vd0ogU9C7wyUtcQ AGZqpAb14W6SQ/ZwcfpIB6slmm+9t8JkVk/Oy1+8W8yd9qcBuxgtaESH1zRqRQQR4NiF gB/50iUmA9Dpa6E+y32rxX7xfp6eC/1z7CqreMoVmeaVVFIWKNBY2Ll+p28S1aVVPS3I igeNSFFknnW8SIN5FQ0RSYgfRKeri6afsDykQ5WzrfD4Q2PtZN2WCWJx52SPGfEB8S2p kt5K0tDhpdtQeI4uLgYSkwrJvifSlz8BWa+aFWlXGjBiVjPh+SvORGKhxkZ/Nij5M98c ebYQ== X-Gm-Message-State: AOJu0YxSVUwu0pdZHD9Ryzp3MjNUJkp0LQixnRMXdQUR8GtxUFzgrr6w jxfehYKQGrRobGuCcTXDynWLfIXhXKRy/7DCcsnvCcxnDa0+q3fYyLe/2LWP3ekQaENWN9p/LCj h X-Received: by 2002:a05:6000:bc6:b0:33e:c974:1294 with SMTP id dm6-20020a0560000bc600b0033ec9741294mr10840337wrb.17.1710863039961; Tue, 19 Mar 2024 08:43:59 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id b16-20020adfee90000000b0033ec7182673sm12742529wro.52.2024.03.19.08.43.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Eduardo Habkost Subject: [PATCH-for-9.1 10/27] target/i386: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:39 +0100 Message-ID: <20240319154258.71206-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Note, now x86_get_cpu_state() is restricted to TCG. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.h | 16 ---------------- target/i386/cpu.c | 2 +- target/i386/tcg/tcg-cpu.c | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 954495fff0..390abc969e 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2354,22 +2354,6 @@ static inline int cpu_mmu_index_kernel(CPUX86State *env) #include "hw/i386/apic.h" #endif -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUX86State *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *flags = env->hflags | - (env->eflags & (IOPL_MASK | TF_MASK | RF_MASK | VM_MASK | AC_MASK)); - if (env->hflags & HF_CS64_MASK) { - *cs_base = 0; - *pc = env->eip; - } else { - *cs_base = env->segs[R_CS].base; - *pc = (uint32_t)(*cs_base + env->eip); - } -} - void do_cpu_init(X86CPU *cpu); #define MCE_INJECT_BROADCAST 1 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9a210d8d92..249b6fe0bb 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -7679,7 +7679,7 @@ static vaddr x86_cpu_get_pc(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); - /* Match cpu_get_tb_cpu_state. */ + /* Match x86_get_cpu_state. */ return cpu->env.eip + cpu->env.segs[R_CS].base; } diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index cca19cd40e..a89c11a34b 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -93,6 +93,20 @@ static void x86_restore_state_to_opc(CPUState *cs, } } +static inline void x86_get_cpu_state(CPUX86State *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *flags = env->hflags | + (env->eflags & (IOPL_MASK | TF_MASK | RF_MASK | VM_MASK | AC_MASK)); + if (env->hflags & HF_CS64_MASK) { + *cs_base = 0; + *pc = env->eip; + } else { + *cs_base = env->segs[R_CS].base; + *pc = (uint32_t)(*cs_base + env->eip); + } +} + #ifndef CONFIG_USER_ONLY static bool x86_debug_check_breakpoint(CPUState *cs) { @@ -110,6 +124,7 @@ static const TCGCPUOps x86_tcg_ops = { .initialize = tcg_x86_init, .synchronize_from_tb = x86_cpu_synchronize_from_tb, .restore_state_to_opc = x86_restore_state_to_opc, + .get_cpu_state = x86_get_cpu_state, .cpu_exec_enter = x86_cpu_exec_enter, .cpu_exec_exit = x86_cpu_exec_exit, #ifdef CONFIG_USER_ONLY From patchwork Tue Mar 19 15:42:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781124 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997057wrs; Tue, 19 Mar 2024 08:48:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX1k3sP54G3RadKx8tlIH32NSL9ZFRDhRpr8w433z5lDRVamsxZib78Sng7tx/yF+NpN/2H5n4in0xpFzxMhID0 X-Google-Smtp-Source: AGHT+IH9Hf22P3UtKdo270oxcq3VSkCaDSqUcy4wmumyDBqnsucnZ3jBqBRjFw724b0gxkMJcJqF X-Received: by 2002:a05:622a:191:b0:430:b7f8:2184 with SMTP id s17-20020a05622a019100b00430b7f82184mr2710935qtw.43.1710863289108; Tue, 19 Mar 2024 08:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863289; cv=none; d=google.com; s=arc-20160816; b=d34H0G28yvEsBvCdLFHsXxuXHPJDM99PzYPVgvxsnnr0DyOKW5OoehQRnSrA/P07e0 rU+jpA2nDyUQPK4ue/B+OHvZfNOpstdRIBqUTyY/aAvK88mytmXyBBRtGWW33MVMFfgQ BCX1LICWEP4hzioyyPzcBmMR51HcfLsrkgJStGyjeisy8kD6FA6VXGAN54iv7R9fteTD FNfppndW9yuYOoVh/rHBLqYnOPZAWP/uykE1j/hGRVnFvCM4m1jnclnrnr6et7sxH7hY OLMLMJEYjT3pVWAzhV9YM2JXr1vRYbwn/9p3nJwdTskVE1HOrhmxNKaIzpUG3wjTYgfX 8gMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9AmlJlFpu+sjCS8Dqdfk+383y3J9XzQtcfIth5cqVHg=; fh=r58utlszYl+o62YBjEcD/9NVId0bjgaUSLuv16LRW3w=; b=fDTIkiq6AEBV0EfGm3As6K7eaUrrmVjDupHxTSNntbtrRVJ0qXTfQchSqRuzvgYNr7 IRMXAeKLB+hlKV+Kyw4XnONw6VzbkHQiW9D7YDdKSSkwnmS6SPRwbXNkK2N+Rgab4BqR +2L752uwEQVESHhhw+9ElpHw+vOviW/tFYenoYjGw4u9UxFrNFpcuWjN1bH8UeI8yLwn VMrYNKJm4XlK6PUx+37MCt1vjo0Q9JRdR2z7TWaG7yDyKsDd4gLd2ouBj27Wh4afTqdN NCODpO12auDG9284KwzvjNhQAIsQ/YApe6EXOfhf/7VVihTz79eoY6rLjUQBsll6ICos fBBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wsBGyhpC; 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 s33-20020a05622a1aa100b00430ef25a531si844163qtc.376.2024.03.19.08.48.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:48:09 -0700 (PDT) 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=wsBGyhpC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbdk-0006zX-8K; Tue, 19 Mar 2024 11:44:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdX-00067d-QK for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:24 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdL-00056B-1C for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:16 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-34005b5927eso2061441f8f.1 for ; Tue, 19 Mar 2024 08:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863045; x=1711467845; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9AmlJlFpu+sjCS8Dqdfk+383y3J9XzQtcfIth5cqVHg=; b=wsBGyhpCm7bq6NdO5kPpoQWgxeNQSAu4E9qxGVPeq+A6TmDzlNEh8QltvW6QOYP4Ah zahqNvc8QiHeoQ34brlJTGbaCQktcZACK5YTEMpYqg111R85zoX1neDLw8fd+CahKdVU Te5TatZAonQR8MOF4xObABTLnt1F+SFF78vZfk+4kO75peM68zwdEW4Hr55pDAS8riJU eAm0FlXKVG0sOWSs76bWd++bsF2Sejm4coO7WdJr0hU66aor9rfQ3T/t2Kw3s0un8B5q kSlMyrSTghrJLJ0OHB6IIOqi6yQ9JqCPZJFfK3+2y+bZsPV6HFp6XDhO+P8h+HF6Ep81 Y+Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863045; x=1711467845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9AmlJlFpu+sjCS8Dqdfk+383y3J9XzQtcfIth5cqVHg=; b=rJwd35YBupRQiwYpwisghLWiGhsCahZnLX9bW0nVgc5svA4iW3asDj+KcmMbVBMrNE cp+SY9PIgG+/dNC9Bs8Sfxvv7NXz0m58EdrvS4+4D50oBwJWDG/cb+JNOilXaH57aPZd PMCTPax66RVhNrZ8G0eUAgMERt2swkEPx+AQIAdUE2/ikt+vtrOXbpaDilBHtMPz/JLV nb8H+1gjxYpvRk3wEHrvcCe5DtUJfbdjMDi36xGp4f7euwGluax4c+NtjNeS+LhXKwWz O7Cm2qTUBK6RJc+VbH2jdqcwv8p+rjE6hlH069ae1p+JerHAQPenvJPh4FDg0sEGumwy jsEg== X-Gm-Message-State: AOJu0Yz1eKbQlcekLVB6TqlMpxqCUszP5OpZL+cgOlM9InG5hq6W+pjA MufRwTPvOXiGr/xgcQoi3MvxLU4ZWOfKkzrfD7I/a16fY64vb0VdnjAE/o835A9Rh9oW9PA1d/9 e X-Received: by 2002:a5d:4ac4:0:b0:33e:bf11:a007 with SMTP id y4-20020a5d4ac4000000b0033ebf11a007mr10698783wrs.31.1710863045475; Tue, 19 Mar 2024 08:44:05 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id dw11-20020a0560000dcb00b0033b66c2d61esm12575894wrb.48.2024.03.19.08.44.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Song Gao Subject: [PATCH-for-9.1 11/27] target/loongarch: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:40 +0100 Message-ID: <20240319154258.71206-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/loongarch/cpu.h | 14 -------------- target/loongarch/cpu.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index d814ba08dd..14f1d37606 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -443,20 +443,6 @@ static inline void set_pc(CPULoongArchState *env, uint64_t value) #define HW_FLAGS_VA32 0x20 #define HW_FLAGS_EUEN_ASXE 0x40 -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPULoongArchState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - *cs_base = 0; - *flags = env->CSR_CRMD & (R_CSR_CRMD_PLV_MASK | R_CSR_CRMD_PG_MASK); - *flags |= FIELD_EX64(env->CSR_EUEN, CSR_EUEN, FPE) * HW_FLAGS_EUEN_FPE; - *flags |= FIELD_EX64(env->CSR_EUEN, CSR_EUEN, SXE) * HW_FLAGS_EUEN_SXE; - *flags |= FIELD_EX64(env->CSR_EUEN, CSR_EUEN, ASXE) * HW_FLAGS_EUEN_ASXE; - *flags |= is_va32(env) * HW_FLAGS_VA32; -} - #include "exec/cpu-all.h" #define CPU_RESOLVING_TYPE TYPE_LOONGARCH_CPU diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index f6ffb3aadb..a2d772ca5f 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -340,6 +340,20 @@ static void loongarch_restore_state_to_opc(CPUState *cs, { set_pc(cpu_env(cs), data[0]); } + +static void loongarch_get_cpu_state(CPULoongArchState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + *cs_base = 0; + *flags = env->CSR_CRMD & (R_CSR_CRMD_PLV_MASK | R_CSR_CRMD_PG_MASK); + *flags |= FIELD_EX64(env->CSR_EUEN, CSR_EUEN, FPE) * HW_FLAGS_EUEN_FPE; + *flags |= FIELD_EX64(env->CSR_EUEN, CSR_EUEN, SXE) * HW_FLAGS_EUEN_SXE; + *flags |= FIELD_EX64(env->CSR_EUEN, CSR_EUEN, ASXE) * HW_FLAGS_EUEN_ASXE; + *flags |= is_va32(env) * HW_FLAGS_VA32; +} + + #endif /* CONFIG_TCG */ static bool loongarch_cpu_has_work(CPUState *cs) @@ -729,6 +743,7 @@ static const TCGCPUOps loongarch_tcg_ops = { .initialize = loongarch_translate_init, .synchronize_from_tb = loongarch_cpu_synchronize_from_tb, .restore_state_to_opc = loongarch_restore_state_to_opc, + .get_cpu_state = loongarch_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = loongarch_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781116 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996150wrs; Tue, 19 Mar 2024 08:46:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXsmn0RGPfa/8QHEBs1YKVxrvc7vzz9TVY5QoYAviOiwXsEwjtLepp0hvuiYo2yBqqR8ladRGNsjnkYHvn/IVGw X-Google-Smtp-Source: AGHT+IGtOZ1z6R3inn6S3yyyaMmJmpOMz64vlCTjyRb0a3nZ89KV1odQ2lZlkedfskZN1tYazcdL X-Received: by 2002:a05:620a:8015:b0:78a:1000:62e with SMTP id ee21-20020a05620a801500b0078a1000062emr3786524qkb.11.1710863162391; Tue, 19 Mar 2024 08:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863162; cv=none; d=google.com; s=arc-20160816; b=kaC0xLrdp3O6CjlZNp8IzONBo1TsInbAB+wF68rHiKs4I/tTPL6AWKP9GLrjc30Oo6 B2uYjiAaR1+Rmxuy6OJdgmoUyU2E8N2jfQDIa763aDlEvpvlSTbYrEg9ZGafJxMZpOKr Ftajjk8TWknsR818JHPtZxrByD/CazEyeN0d2l1/yq64fwzX6QLCVhHo7mi5u0005KHe R76llwFtUDSaDf4p3KRKs5chhKlsyBQuhCkrQr8XUZ/2mh2CVA6zpi/hwkhLroDj/WsG fxBr9T/jJ3wC9lcZyZpbyUV8SfrRE97wJbpGqpQUAaaFlgiZG7MWe4/PnI8Dw+1ixqyp RppQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dfAUn7JpYvclLzB4k+47U+LtLO2gvCUyK6vzKcLd+98=; fh=WvqDxvoM8e7ZRSb34nlYOqwCD62i34bnCKnc6ucYIfk=; b=joK7gIBLBwBqfE8ILLqWqfnTx/8NcOtI37IcYedrSjTOF4qpgKP3xW1gSiuiygr8Wz /fZPkAUAFfVjNoEKvz5JwXx1RoP8Te+KMsHI0Ud2x5JasvnnHqucYUxtDP2VPAdhUFzr lsmJwqGhdJY2UDYJbs+EI/oiNrJOQ0sivwGLKKs3JD62MqupBanKxD55Pjg6effgk9Dd e3QGjvQUYcGkL3EUwsipX05lJecpH5Rw5xT95zKk834wYU6oJP0JeHhHn1VI6274p6Fe lR7F/Ox10RGMJd44RK71xne63tb24dTmhKSX2n5np3kUGNji2L9SaZS2UzGLu5yRabCO S7NQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JBEbn6mw; 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 e18-20020ac85992000000b00430ad97fa2dsi10001136qte.435.2024.03.19.08.46.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:46:02 -0700 (PDT) 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=JBEbn6mw; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbdl-0007HH-W2; Tue, 19 Mar 2024 11:44:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdY-00068e-Il for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:26 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdM-00058f-U2 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:16 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2d48d75ab70so60890771fa.0 for ; Tue, 19 Mar 2024 08:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863051; x=1711467851; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dfAUn7JpYvclLzB4k+47U+LtLO2gvCUyK6vzKcLd+98=; b=JBEbn6mw/a0KI8BBAso4Oe4WjWydFjcRSGsMmIIE0Oyi7y4u2uTjo2V6o4Corg3kPe tTYWLKKnRrqCLAl58QNzd5qbOznF2MtPqqmbdawEOweTC4pOhLFoXF8hMrDkkn2RZoic qz80K6WtFcknrtFBPsaBhqc5xTKUKNBO7r2NNyzO2e07sP6dwOBStjOIsmxceOVvABXE ph/HJm0sVTKu7alP2AxvAnGG9nb4cOKCKiCAw5U8hUn0t872w1xiknHsCjkDQnpjipgq qhDW7O0YEU1NPtKUFsgjGfZPal8oROV/Q62jnveMIr/E7v5bdWNyaG3h/QYKVO0JLOYL aAMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863051; x=1711467851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dfAUn7JpYvclLzB4k+47U+LtLO2gvCUyK6vzKcLd+98=; b=JEQESCSQ5LNQJl0rbu8+T7dkvKRXrEPRYngaXvwjrwKTASfLQG4jbMnqMxJ5v3vPyb LMLSHQdbcUgt/rk0dp3YuH2k2QcQaPLcHPH+qoUAhY29yzNVjzQXZgZ/HrH1QJ+kDscb a5mKJvzWkNSXMfPKZwT8F2sq+Ye4UY8uOfop0lUUOga2kmdnHoi3xqtpnBkdfc2Ps+Y9 4JlYZOp9Hu9aKB9lkWkVngzPHWVHxqygpiPbFfWdQeBSn8YU91MxMKTnKN/ramchCmEw 8neSnP8R6scAzx1x1oPpCFwntIrKh8Y9Bi5OQqX+SIHwq4sO9YOQYfaH0mdA19bTC/xY fdHQ== X-Gm-Message-State: AOJu0YwnNVt8sszvoMWwteIHXH+Fkw1652kaGuXRaCC4yhT24zdFWbjr mifKMvvhbUByH1X1dIoyHSHSwuv+jXDnhSE8sJ8HFjQDO42y2MliMz/6fZIdYWg6h8KtWeaD+ft w X-Received: by 2002:a2e:8645:0:b0:2d4:51f4:dbee with SMTP id i5-20020a2e8645000000b002d451f4dbeemr9931008ljj.53.1710863050839; Tue, 19 Mar 2024 08:44:10 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id g6-20020a05600c4ec600b004140726eac3sm11900174wmq.6.2024.03.19.08.44.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PATCH-for-9.1 12/27] target/m68k: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:41 +0100 Message-ID: <20240319154258.71206-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/m68k/cpu.h | 18 ------------------ target/m68k/cpu.c | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 2790d61115..2f5f973bd4 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -604,24 +604,6 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, #define TB_FLAGS_TRACE 16 #define TB_FLAGS_TRACE_BIT (1 << TB_FLAGS_TRACE) -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUM68KState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - *cs_base = 0; - *flags = (env->macsr >> 4) & TB_FLAGS_MACSR; - if (env->sr & SR_S) { - *flags |= TB_FLAGS_MSR_S; - *flags |= (env->sfc << (TB_FLAGS_SFC_S_BIT - 2)) & TB_FLAGS_SFC_S; - *flags |= (env->dfc << (TB_FLAGS_DFC_S_BIT - 2)) & TB_FLAGS_DFC_S; - } - if (M68K_SR_TRACE(env->sr) == M68K_SR_TRACE_ANY_INS) { - *flags |= TB_FLAGS_TRACE; - } -} - void dump_mmu(CPUM68KState *env); #endif diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 7c8efbb42c..3bb9f58651 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -51,6 +51,22 @@ static void m68k_restore_state_to_opc(CPUState *cs, } } +static void m68k_get_cpu_state(CPUM68KState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + *cs_base = 0; + *flags = (env->macsr >> 4) & TB_FLAGS_MACSR; + if (env->sr & SR_S) { + *flags |= TB_FLAGS_MSR_S; + *flags |= (env->sfc << (TB_FLAGS_SFC_S_BIT - 2)) & TB_FLAGS_SFC_S; + *flags |= (env->dfc << (TB_FLAGS_DFC_S_BIT - 2)) & TB_FLAGS_DFC_S; + } + if (M68K_SR_TRACE(env->sr) == M68K_SR_TRACE_ANY_INS) { + *flags |= TB_FLAGS_TRACE; + } +} + static bool m68k_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; @@ -524,6 +540,7 @@ static const struct SysemuCPUOps m68k_sysemu_ops = { static const TCGCPUOps m68k_tcg_ops = { .initialize = m68k_tcg_init, .restore_state_to_opc = m68k_restore_state_to_opc, + .get_cpu_state = m68k_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = m68k_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781133 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1998414wrs; Tue, 19 Mar 2024 08:51:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU36m7cSszDwwV1p2ISoaN9bjgxa6z9XVZDhJfZxQFEf26S7IPv92B8JRB8b3N5Q/qIQKAHnginFzDOLGs+ePle X-Google-Smtp-Source: AGHT+IFNrPjWT7c4C7Bokf1hZYkO3WkQwT9a9fUywGnzWxytYSqcuCpDdWn8fvg4RB4+3uH7m4gq X-Received: by 2002:a05:6808:1987:b0:3c3:8270:96e2 with SMTP id bj7-20020a056808198700b003c3827096e2mr10995566oib.57.1710863487417; Tue, 19 Mar 2024 08:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863487; cv=none; d=google.com; s=arc-20160816; b=0gp7GeYEOqr1VTh1WJw1qJ8M4nnx7L69hFUe/Yq5ODCC2VbtbBRhynLQ+XSoaxFtNA Tj9Evcjca0hGu0983E7jq4dmAmUwckvdOiXe70kbnHlg54SFreZsTnG2zoYCavkQb3JP /FPL5DVdqUg6rom9X8rBq259bkmPWnBnbENegLatmB81xsg/QXgGafAQA9rOBv9yXhm8 rHPW9YX2yg3FsTPauU0jtOGruy6XbiTbVs4bFgYEiQycbdMF+RIV5p2RiWk6WoNNcUKl GO1cfcGOCYXuGXKIvkQ6SXXAXYRH+sYykah1o/PmTnFWKcnM+OfL585RiSWbarnoMVZE D8Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lFh6leBQNpipJMM3/s/OcU4SdyeufSpSeMnLPrJ3AQ8=; fh=8Pzz7K/FQo1q7xIq/JV6RYDisF54mivkmBc3zg+OmUM=; b=DtZrL5gUZfN00mFPrzn3D0BfRjsawvjjlVBIZ/oePne/+0mG7tjeZQL/Egzg3akxWM zKZrHycR3FYtgwJ5QfH9AW3bbSFTEmO7dBZHqOD2pGoKRaUmZ7FNURncuJXqZzwqJjJ9 HafeF+bXP0zOGwfgS5K8zHJlZHPphlL69K02kkre/pmvpfuLZJRRNvwvpytWMh45Olk9 pncfJEDBYKgBynLotR1bpMU1mFlMhjj8oWT/bbi0H79J3uXFkrobDDIcMM0NOdQWM69Y CP1VzaK9KeRB5I6ltK+iQIR77JIeQcwJyUsxnUANA4q9T7akNXbQPNVsUE1PvFQ1jAu6 EFSw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yj9osDfr; 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 r15-20020ad4576f000000b00691837e4f57si8923116qvx.565.2024.03.19.08.51.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:51:27 -0700 (PDT) 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=yj9osDfr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbe7-00087H-LX; Tue, 19 Mar 2024 11:44:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdj-0006vJ-4D for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:35 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdY-00059L-GT for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:34 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d46d729d89so75978801fa.3 for ; Tue, 19 Mar 2024 08:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863056; x=1711467856; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lFh6leBQNpipJMM3/s/OcU4SdyeufSpSeMnLPrJ3AQ8=; b=yj9osDfrqU7QkCrwjP9VCRrr8Ab0rydLLrs/1x9FJjBFXuQ0PXMVDlL6Q6DF36F8sA TR39483s33mOuLK3ctZR3dSV5E7yVGOSe/9FXHdFrQPYUkY1KK+dGQpo02kwRIMeZkc+ gTZuuOZ4T0G2Nfu744qXzsUPoGhWxWqR7EM6xiZWG57TIpDqO4ou9ezkotyYN3VjXnmQ mWK38+r+43Itli9Twlb39WZywFwGNjoUkuoDTvW3E2Ieu0WWHhl9VofoDcXIqz1I8TgL D/58Y6BG8jw+dkr5kG63Lpjrbt574my5/8OORefyGYvph9ytAii2KxRsvxOKwXDS4bW/ 6W2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863056; x=1711467856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lFh6leBQNpipJMM3/s/OcU4SdyeufSpSeMnLPrJ3AQ8=; b=nGzDyBJCKSlgWJgAYdjEswBIJzusvf1uELbV27yf/wduoGiFIRk4tsDysy/0GUACpp A3bVZ7WQapGy3AEo1rAymdOz3zbe9qaaG7vB9AUWCJARBnjn7xhFArpvxtJMZFaSagXW MryO6bOxptHuY9VFNuTKt4q8hUimo0G/uC5eCysIA8vEooQsFjc0/jdHSk0tPpe5188Q K9NKDRlwOQaEh/oDRcjYCJM2lP7h7PW1oBaxhNtJS6PvBtwdukZMEZQWQkhMFodHwSIx x3vjR5hqvNgGH1o8vdIsUtHdQ9AO9nUlEH/Yval19dF/CsNGDgzIODfO7hghVgUktYGn 3gkg== X-Gm-Message-State: AOJu0YzRQwATnbcEqaVUCrwZRRZe5SITOL1hSiWnAFgpKme5nHBhImQX 5SH5YtiCH+uc488eYlFNi7214WA9VdB7svz83twkRV5iwQdBtmHHoODdiox3sXQWzGFvXV0wqtJ Q X-Received: by 2002:a2e:9653:0:b0:2d3:1bd0:6bcf with SMTP id z19-20020a2e9653000000b002d31bd06bcfmr9018846ljh.8.1710863056510; Tue, 19 Mar 2024 08:44:16 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id g7-20020a05600c310700b0041465879011sm2205757wmo.12.2024.03.19.08.44.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PATCH-for-9.1 13/27] target/microblaze: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:42 +0100 Message-ID: <20240319154258.71206-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.h | 10 ---------- target/microblaze/cpu.c | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 8058dcac7f..956269250c 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -415,16 +415,6 @@ void mb_tcg_init(void); /* Ensure there is no overlap between the two masks. */ QEMU_BUILD_BUG_ON(MSR_TB_MASK & IFLAGS_TB_MASK); -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUMBState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - *flags = (env->iflags & IFLAGS_TB_MASK) | (env->msr & MSR_TB_MASK); - *cs_base = (*flags & IMM_FLAG ? env->imm : 0); -} - #if !defined(CONFIG_USER_ONLY) bool mb_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 96c2b71f7f..ded4c7a0de 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -113,6 +113,14 @@ static void mb_restore_state_to_opc(CPUState *cs, cpu->env.iflags = data[1]; } +static void mb_get_cpu_state(CPUMBState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + *flags = (env->iflags & IFLAGS_TB_MASK) | (env->msr & MSR_TB_MASK); + *cs_base = (*flags & IMM_FLAG ? env->imm : 0); +} + static bool mb_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); @@ -408,6 +416,7 @@ static const TCGCPUOps mb_tcg_ops = { .initialize = mb_tcg_init, .synchronize_from_tb = mb_cpu_synchronize_from_tb, .restore_state_to_opc = mb_restore_state_to_opc, + .get_cpu_state = mb_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = mb_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781113 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996091wrs; Tue, 19 Mar 2024 08:45:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVkVvFKb9m2NWwZeTQQzp3Vv4KJRnCqrmAy/15ZL3UWOsVOWKWbk6EFKNujbFGqkMypRZWdSVawr9QQP6BcEAez X-Google-Smtp-Source: AGHT+IH39xD7D2CYXkOVWWvRcDHpHmq3ur4F3h0GoyTisFkbqx35SnWBdQeTHmkiNwzmNKz1TUKn X-Received: by 2002:a05:6830:10cb:b0:6e6:9528:6136 with SMTP id z11-20020a05683010cb00b006e695286136mr3292904oto.12.1710863155162; Tue, 19 Mar 2024 08:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863155; cv=none; d=google.com; s=arc-20160816; b=UIsvLu0wWNskintuRHDoOEuPCmVUGKDmUe7c9SZswvO0MlwMrF6fQjUAbZJ3EDxHNf odDF2AbwZS8GH6G01Fqwye1J+O4ItDpqUToaOzeZ1Yj2aigYJa7RbNujYQQlw8QBBwK1 fmKxcV1brpKmEweYZkSr0g/BvDdglMm0AbAtYDJrHErJ6uYMkzw1fXUzPhWHvEEgVHh7 upr5gtFqcAEc+LcoOJQyseofwuVGRhxo9ozckm3vHxfLfSqag8sH6c1ymneH6noZTRxm 8Z2uAHEK4kFktkE2/I9FXH6LBDN5AXj8xuzP6heY5tZ1Xg/U7DXA4HY+OgWy3plDW0VZ akxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DikP2L6ARWdRvFee2b+GuSHD2n5uD5QzEz8674gqbFw=; fh=W+mvua5m0kthLVh/N81UHNntZy9+bRbsG7o+MnZuWd8=; b=cjrg1nLW6BTTcaQE7dMulgfzTYG8lZusuVgE82AEeTvexZX1fjb+TE4vLTKshY6T3I KU/pGid3KgrAyI6gZYYzUoexHqMenqqUjmjKHR1Pz3W/j8YDK8wLl26duvxiYwPpDiV7 +5UVSpi+DlSYFryNxYRmJ6Nll1Kf1AhPvgGdYD9TbZlO8URp1qAHFDYArkj3ZOlGCU8o O8EQBkFQuo3cDe9VkjHGrGKECKzKNWuMEKFFG6Jn37gsRIXGI+U+w3nNu8YlGzEOJ5v1 axH7CbVhfBjjfSuucRZg9K90NQdBOk/2p9Aqq9PDyvcfz4up6Tka3xsQ6tg6MTLG56v6 cRsg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zXh3ae0I; 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 vu8-20020a05620a560800b00787b85281e7si11250877qkn.714.2024.03.19.08.45.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:45:55 -0700 (PDT) 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=zXh3ae0I; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbdy-0007qM-T5; Tue, 19 Mar 2024 11:44:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdp-0007XM-41 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:41 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdY-0005BE-En for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:40 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-41462295004so8923485e9.0 for ; Tue, 19 Mar 2024 08:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863062; x=1711467862; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DikP2L6ARWdRvFee2b+GuSHD2n5uD5QzEz8674gqbFw=; b=zXh3ae0I+/g/ICjQH+F22BreXtfQUlFlBxw9CB5c6raSZYiVC6JPuZ6MNjSwddOPaw mMzzCcQ4P5N9omMMZmxhlje91ihdRYgN4yNpt/kN5sPo8GotoFJWI2ZNY0isPkLMYJEO yRNyvdzAucfI/rfhoDtBJU4XTJLemHu1BaVauD9WgE1icpVq4p3ZE3pMT+xcQ2ZgydNy MrZGBsZmC3SVAqHJhAb7AO211gA9FxjwGhc0jK93+9iDKYtI2NInD/Pqt1LgIMfOXhty 565CE0LWg/a6/C87pcyznRWWomEmPvtskIwCE1UQPb/xkfWVvsdRsssot69T8YD226u9 dIIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863062; x=1711467862; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DikP2L6ARWdRvFee2b+GuSHD2n5uD5QzEz8674gqbFw=; b=cR6lw3cugGPMN44vNpFHzD3BY9Tj4Ph0WFOVaa/+hzyymVL0VSaUrqXWLEs254BABo pEla+5rHWoHAqhbdoDPrTiv/go8YoEGX1lYNoKW2559p8T093KzriLOMOFneHA0xyyQy fshmIWOoeAY8xzLJ/p/4+mjUUNHKFuYv+PobYuuWrpty+7nRmb0a8qOCgpG/wF88KMCQ tM0BXZ5vZi1+6R3QjHFTxLvqqCGWqLrmpWMSGpkKVZdSN+2bvSNNBKws7eBLycEnIDgg RWTTaldCCHi3/+w/nt3XHL+0ACWJVoAKk+tZQ+6oVdC6e9isyzGBtdFqfuGxv0dawmSG 9mJQ== X-Gm-Message-State: AOJu0YwrYS46OoFlOV/4tuRSAu4KFyBhMDo8xnglpOQ+V3L8/yhLmaMy g4xkvYZEpJ+S5kFYcFkA8G4ggFmqxsJVqVEs2qT50pU2szYVNw7FZL2ASTskSRtVzI8qHyRpQ5C Q X-Received: by 2002:a5d:5a0e:0:b0:33e:76db:9bf8 with SMTP id bq14-20020a5d5a0e000000b0033e76db9bf8mr13665980wrb.68.1710863062221; Tue, 19 Mar 2024 08:44:22 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id w10-20020adff9ca000000b0033e72e104c5sm12592777wrr.34.2024.03.19.08.44.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH-for-9.1 14/27] target/mips: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:43 +0100 Message-ID: <20240319154258.71206-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.h | 11 ----------- target/mips/tcg/tcg-internal.h | 2 ++ target/mips/cpu.c | 1 + target/mips/tcg/translate.c | 9 +++++++++ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index caa12a2dd3..9d2f7e0194 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1362,17 +1362,6 @@ void cpu_mips_clock_init(MIPSCPU *cpu); /* helper.c */ target_ulong exception_resume_pc(CPUMIPSState *env); -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->active_tc.PC; - *cs_base = 0; - *flags = env->hflags & (MIPS_HFLAG_TMASK | MIPS_HFLAG_BMASK | - MIPS_HFLAG_HWRENA_ULR); -} - /** * mips_cpu_create_with_clock: * @typename: a MIPS CPU type. diff --git a/target/mips/tcg/tcg-internal.h b/target/mips/tcg/tcg-internal.h index aef032c48d..c54d5c64b2 100644 --- a/target/mips/tcg/tcg-internal.h +++ b/target/mips/tcg/tcg-internal.h @@ -24,6 +24,8 @@ G_NORETURN void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, void mips_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data); +void mips_get_cpu_state(CPUMIPSState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags); const char *mips_exception_name(int32_t exception); diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 8d8f690a53..6cc64b7628 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -551,6 +551,7 @@ static const TCGCPUOps mips_tcg_ops = { .initialize = mips_tcg_init, .synchronize_from_tb = mips_cpu_synchronize_from_tb, .restore_state_to_opc = mips_restore_state_to_opc, + .get_cpu_state = mips_get_cpu_state, #if !defined(CONFIG_USER_ONLY) .tlb_fill = mips_cpu_tlb_fill, diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 06c108cc9c..4ecac13a8f 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -15581,3 +15581,12 @@ void mips_restore_state_to_opc(CPUState *cs, break; } } + +void mips_get_cpu_state(CPUMIPSState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->active_tc.PC; + *cs_base = 0; + *flags = env->hflags & (MIPS_HFLAG_TMASK | MIPS_HFLAG_BMASK | + MIPS_HFLAG_HWRENA_ULR); +} From patchwork Tue Mar 19 15:42:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781129 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997972wrs; Tue, 19 Mar 2024 08:50:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVEC4sao3HmpN5sw43FSnu3mRXOzfKqKWXGOVApV/vPCChAN1xzQpJScYDi0mf4yIVlCun+s9S6yvfiuJRACR0e X-Google-Smtp-Source: AGHT+IEyDI9LLA1fKYU+/NGM5q4R3VkC0vbHIgJjrFEsnzehdGAfW9SztnwxVvW1pyIIZQMYE61D X-Received: by 2002:a05:6214:16c9:b0:690:d4e7:1374 with SMTP id d9-20020a05621416c900b00690d4e71374mr5141129qvz.13.1710863429907; Tue, 19 Mar 2024 08:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863429; cv=none; d=google.com; s=arc-20160816; b=QXhhwraZ7SCWrX+SX6Qt/z7YSBziExadYj/ZurGVObLL9VbalcdSDwTrmMfuKhaoc8 jxE4c1dpXn5cKx+SbGUfMdqE12GPcgx4zLAdQ9SP1vaoasTv0ympT8sCdLUbg/FEXyLb I4MNi09fBG1oQW6Xq/kiaKzZaQuAU5Om3HPTQvHLc9+kSw2SNR7NNMiQxK0XDNA6ZL7x IzVwcnbJLleLeh+gx8Pqz1qsyuAyw0V+Zy/miW7wINHyrkNsUhPak8jJccQzVwg9Ea8s 3QSqDHbZILC0Z6e7zQiEbIYqCbgJtkM1ezE9Kz9q5p6KuMpWk6xPLdWGDdeRc50Mautp k92Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=goVPZjhGsrNSLmW6IZIplIeGALKCmKT21+JRh5OPT4g=; fh=p4hGACrHX2X1GiLaiJq9g2IPatQnGX5Ighpc0+KkQYA=; b=jeJttUan/9XscueUY/bqlYY7sfdJr4WiGHRakURF4xm+kCv3QoIuyRPUC6IUyDWCo2 b3uNNW2Rt1EmaEJDg7SOSZ+Z6UZIoCJaI0YC9+bIxfmquAslFcHFSbXRw6b+YdJKPPo8 aqhKukl2+ei5fSd25j9/r2smGWVuyg2lbdHqjK5rToH+bcmk/cAKq+Ik7FVDVAXwMnro 1P5hMgPHyI/TRXv+0oVDhAlWBiX5D5ipBPT/lB67ADo/yrzbEMNy6xDzB/cFozKaOiZN TMu1rXKr6/O3ZB10DYtYs/2eHtupjz9EQ7d+N1y0NeugwJsCmL2wdLFKOuqm82xVETHt EAiQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RF89ge2M; 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 ke8-20020a056214300800b0068fe276cf6esi10828629qvb.330.2024.03.19.08.50.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:50:29 -0700 (PDT) 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=RF89ge2M; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbeE-0000OT-0Y; Tue, 19 Mar 2024 11:45:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdn-0007Uw-Tr for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:40 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdd-0005EA-J9 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:39 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41461c256c4so9418585e9.0 for ; Tue, 19 Mar 2024 08:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863068; x=1711467868; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=goVPZjhGsrNSLmW6IZIplIeGALKCmKT21+JRh5OPT4g=; b=RF89ge2MZ0jHRN0KR97wC/9dNKrOWqZ5vxM1+bvJ3kk78z1eRgfNk6GmenC7ohxWES GHcgFnzAm8Jx34p0plVoWm4BjvSojifDphY+U/zubykc+9Q7pOLhmbLxURSY7HPliMGm nInSFUdVY0T0mbO+Rpqr6NyumiHbHD9IcPsGCUTFUIf/t1u9IS9vLAWHlJ2M7j6zKfRs PilbfkICYH12MtRjOe3UtVLp0j+XhWb5n+38peOWDHAw09MnDDxOF7ksyvR/t9DBpl2j 4XcVAyTnNEokZkCkG0Q3UUYu5/9A9kXTBI9m0857V9JRisLR0PV3/M1WIOLtt6eHLZUh 4n7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863068; x=1711467868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=goVPZjhGsrNSLmW6IZIplIeGALKCmKT21+JRh5OPT4g=; b=JmbrClUXmmFGxm+A2qH7X2vMTieX3Jrqtc0HwpViQXj5X26Hh0Nij+TYXKuBrvWTIr UW+4cDeyV/Mitc2lAUchHnvsv8xwQuap3mle9h5lhFE+VEl8DWpY6KEdTpC0v9bxhVqP xeRP8Wf3aywgp3HpOlmiVMb0bl+wDLU7CT521oMByaz8IFHbpqG1ZDkU0Tj1/MCahFIj hEStS/H6LcvtMoRZEVxbRaEwfiH4PoXuCt0GI9xzPnEzcSpvI1ugbUSnyyaa+bNR8zYU wW1auD/S+jPvlHuyn28kn0dZauEvTv88Fh/69xTy8avzN+b8GaSvm9KuL46WeMEkCBB8 UO8g== X-Gm-Message-State: AOJu0Yxtzq4ghJewbYj1s+twZUPStjfzUGckVYJLMgo70p61w8kO474Z Jv8yxQwO0IYMfBH54P7dUprKWh02MZReFWGr3ZmPcUd6FLgyCsO6HtVj4Xilc4dSlDvCmkY9yih p X-Received: by 2002:a05:600c:314e:b0:413:ee58:db7e with SMTP id h14-20020a05600c314e00b00413ee58db7emr2335980wmo.3.1710863067825; Tue, 19 Mar 2024 08:44:27 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id u6-20020a05600c19c600b0041413546e5bsm5695602wmq.0.2024.03.19.08.44.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Chris Wulff , Marek Vasut Subject: [PATCH-for-9.1 15/27] target/nios2: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:44 +0100 Message-ID: <20240319154258.71206-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/cpu.h | 14 -------------- target/nios2/cpu.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 32002b819a..d0616723fe 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -286,18 +286,4 @@ FIELD(TBFLAGS, CRS0, 0, 1) /* Set if CRS == 0. */ FIELD(TBFLAGS, U, 1, 1) /* Overlaps CR_STATUS_U */ FIELD(TBFLAGS, R0_0, 2, 1) /* Set if R0 == 0. */ -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUNios2State *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - unsigned crs = FIELD_EX32(env->ctrl[CR_STATUS], CR_STATUS, CRS); - - *pc = env->pc; - *cs_base = 0; - *flags = (env->ctrl[CR_STATUS] & CR_STATUS_U) - | (crs ? 0 : R_TBFLAGS_CRS0_MASK) - | (env->regs[0] ? 0 : R_TBFLAGS_R0_0_MASK); -} - #endif /* NIOS2_CPU_H */ diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 679aff5730..d1a98c47ad 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -43,6 +43,18 @@ static void nios2_restore_state_to_opc(CPUState *cs, cpu_env(cs)->pc = data[0]; } +static void nios2_get_cpu_state(CPUNios2State *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + unsigned crs = FIELD_EX32(env->ctrl[CR_STATUS], CR_STATUS, CRS); + + *pc = env->pc; + *cs_base = 0; + *flags = (env->ctrl[CR_STATUS] & CR_STATUS_U) + | (crs ? 0 : R_TBFLAGS_CRS0_MASK) + | (env->regs[0] ? 0 : R_TBFLAGS_R0_0_MASK); +} + static bool nios2_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; @@ -354,6 +366,7 @@ static const struct SysemuCPUOps nios2_sysemu_ops = { static const TCGCPUOps nios2_tcg_ops = { .initialize = nios2_tcg_init, .restore_state_to_opc = nios2_restore_state_to_opc, + .get_cpu_state = nios2_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = nios2_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781134 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1998424wrs; Tue, 19 Mar 2024 08:51:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUzspnebu7QP5QsoOEvs2AlGkvGdv8AF90Ui7pQuY1FLqBHJhQszlBaXPyXtqyQzScspDUVAnJ1GFccG2ellbiB X-Google-Smtp-Source: AGHT+IHKmI46n5noC4fL+UCN6l0AMPKq9Qq/5LPjNKMVROaYuTtuEpEyOgUxyd3cOxVDOgcHIJID X-Received: by 2002:a9d:6e0e:0:b0:6e6:9af5:752b with SMTP id e14-20020a9d6e0e000000b006e69af5752bmr4696568otr.0.1710863488857; Tue, 19 Mar 2024 08:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863488; cv=none; d=google.com; s=arc-20160816; b=df7/vQA/GJweVZtwbOENUxWprICIlALq/P/A8Atoa+2dTjVK23m+WBxEcZplgu3tyD i9gdVYfvnTjiTh06k1+eu4OxTto2NePzK5UvhdUuiJ38w8F6oWEe1fE66zr69GavkND5 lkLTC7Wra8qpxkjOtaFNC6UzyQVygtpI0ScG+/s2pARG0Uy2M8uKCZ1tyfj83m/LrCNQ Wn0z7FeLuuqbwJAwzeNPPpmhymSEgpQiRW69NapidLkWF+8YIYZbUM2YBNGAUygxZV2v 8JUp4cXVamYOKf0vkwkSgGKYr9TPlpJ/TFoioBV/aBxSmifd0bXjUi5eUQB7fvHuuf4q uUlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3lvebIFUNGxL/tpQGaVwXk03NyH8W0xBvPYOuRzOi+E=; fh=1+T57yNu4zgnJELhUlbRYTP6iuMxPmiOjuTNOowPTGU=; b=RH5h+T4/z2oe4NQJpr4IK1U0vDJH2dYgZBfBkaU/iRq3TLwZ2F0Dijf8hBxEI5n1fq DxQQou5jN/9qsimaDel/Vyk4nr/IHXzma5JQBlqcw/h2YH5zzy1CGkxHPAj6GbuiKzJL Pm9BECjczmAf59Sqqkq0RL6OfxR90Gm6rleB4lT0Jr3gn8aWvp9aArjNBTezB92A7/Vq WcqnekAv4/VpKmiHwCaDL21vUypJSRygUgqE3bhYmyafC4V2Cbnwa7VR7FwslmUeI2VH BisfQFZaNipRC+GMZgBKQP7xJMaAFzReYFqIrkfUjQz0TSetEX2HeMFk7stWnGp2Y1kZ aK8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JLVbFVuQ; 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 c21-20020a37e115000000b00789ed981325si7242948qkm.392.2024.03.19.08.51.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:51:28 -0700 (PDT) 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=JLVbFVuQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbe5-00084y-JV; Tue, 19 Mar 2024 11:44:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbds-0007kW-UR for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:46 -0400 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdj-0005H9-IM for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:43 -0400 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2d109e82bd0so75745921fa.3 for ; Tue, 19 Mar 2024 08:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863073; x=1711467873; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3lvebIFUNGxL/tpQGaVwXk03NyH8W0xBvPYOuRzOi+E=; b=JLVbFVuQvyTWpqOjNGhS1mdR4Eb7u9ILbUVxcONSzcRy7xc0qnQm4knfbPtXCXn1lX nIyo5ABEDCuZQFfQsMkDWSKZrKeYx66KZvrjnwGcVGb0RHP47BL2NEcE1HsYtz81NmuB LrIZAwjX/U9GQ9pUuj1UF/CKrpeEvlpEJ8KpaQR0R4w3q9eJNZm7PFQp7uqokzv5XnG3 bKVUO4pn7y+IuL8zff2s0RWyrFvecoIaN3tCpPciHWtTtwQKdxFrSEsE4IBVBrW7gZBj nUGAtg6YaYtQW+C8d+8RW84Okdqsxf7vxtqvnaogGSidp23DZK9tq6ma4Q12TJIZmw3c doYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863073; x=1711467873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3lvebIFUNGxL/tpQGaVwXk03NyH8W0xBvPYOuRzOi+E=; b=UC9pbyBBUhExu5oLcnrUteejgYfSueyeIUAy+EnJbT+nesm1jixX6T60RBLqrWlQs8 I79wJf19gnx8e4xUWgT9iNWVgvAQbaRQqMOHsATDVTSeDOAFVpIqpWi05RIEPdRtkGvC 9sOe41JpjzwzSRFFS4ha/RYMUncsqbrzEC2bVynowjmLVmztIOdEtJqM/onQqEsVtcjo 7f9QsAYKcRkOuOCAmWMwwCQ2oqM4owIRr+ARPGapRVtIRq1Hx+yh+EO+nq0owDTPG5EO lxNZpu98sy5Ie283EGoKzsyjfO0M5jipjQbhLOkb4fKQjKtOMwRDEg4y/OfV2Xzwcrq1 AvMA== X-Gm-Message-State: AOJu0YzqWv2kzx+j0ONOss5Bz5Fpwnfu0Km3a34lOzHDEaH/8VAZwhow V1CKF40TTdtOj3pzC4dClpsVbj131KUyImNOPC9r1UNRDjE9bH7HZWMfPWV5QaVOXyG6sW2haEu J X-Received: by 2002:a2e:88cf:0:b0:2d4:b153:57ab with SMTP id a15-20020a2e88cf000000b002d4b15357abmr1777709ljk.47.1710863073392; Tue, 19 Mar 2024 08:44:33 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id i13-20020a05600c354d00b00414612a43a9sm4000401wmq.28.2024.03.19.08.44.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stafford Horne Subject: [PATCH-for-9.1 16/27] target/openrisc: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:45 +0100 Message-ID: <20240319154258.71206-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::230; envelope-from=philmd@linaro.org; helo=mail-lj1-x230.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/openrisc/cpu.h | 12 ------------ target/openrisc/cpu.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index d42800242f..6997c7534e 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -351,18 +351,6 @@ static inline void cpu_set_gpr(CPUOpenRISCState *env, int i, uint32_t val) env->shadow_gpr[0][i] = val; } -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUOpenRISCState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - *cs_base = 0; - *flags = (env->dflag ? TB_FLAGS_DFLAG : 0) - | (cpu_get_gpr(env, 0) ? 0 : TB_FLAGS_R0_0) - | (env->sr & (SR_SM | SR_DME | SR_IME | SR_OVE)); -} - static inline uint32_t cpu_get_sr(const CPUOpenRISCState *env) { return (env->sr diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 33c45dbf04..ce44ac0316 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -62,6 +62,16 @@ static void openrisc_restore_state_to_opc(CPUState *cs, } } +static void openrisc_get_cpu_state(CPUOpenRISCState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + *cs_base = 0; + *flags = (env->dflag ? TB_FLAGS_DFLAG : 0) + | (cpu_get_gpr(env, 0) ? 0 : TB_FLAGS_R0_0) + | (env->sr & (SR_SM | SR_DME | SR_IME | SR_OVE)); +} + static bool openrisc_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | @@ -229,6 +239,7 @@ static const TCGCPUOps openrisc_tcg_ops = { .initialize = openrisc_translate_init, .synchronize_from_tb = openrisc_cpu_synchronize_from_tb, .restore_state_to_opc = openrisc_restore_state_to_opc, + .get_cpu_state = openrisc_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = openrisc_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781114 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996126wrs; Tue, 19 Mar 2024 08:46:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUJuaOsSBjNvK/4WXoIDyXoxLaAMjLlLiBF6FFioQbE35bhv1QI3Ng2My9hJwhnXEpUuDUucLlP6vywnD4B/yZs X-Google-Smtp-Source: AGHT+IGeirsNAf+UhrWJU/59Q8zgXqN5XjK85IriWsuaDnmc5Yo5iZzenI99aAo5GrmYwyLdM3oV X-Received: by 2002:a05:6808:1490:b0:3c3:595a:e561 with SMTP id e16-20020a056808149000b003c3595ae561mr17431321oiw.10.1710863159897; Tue, 19 Mar 2024 08:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863159; cv=none; d=google.com; s=arc-20160816; b=z9zO2eoqO2PJoT9l9FdB//N2dMfjbWtVYxfWrBInJsXaXFqpaEITYOaikynnkBUDaz UROCRwKeCEcZ1bInha7Go981wIVXfAa/U77lGyyvi/mB//hvwDU6fd7AfyOpr2s6J+2u LeTsMEVmg3evHjaJfHsOLccfgoN/aukSENsAMc8U+Z4DU3OHMvuHetcOEDOkyS1/eqOq tvVL+Q6WqNv2YgmbYdfjoVB7nnNfhsdqeVko5OAbPxTHVZZDA/0kHuZH9YKB/AQQvzPi wsI3WRQwl8EyBAkMufrtmnb51i2oQm8ZmXv8G5qZNWKNpw/2ZOdfA/aSgQyHzl/ahicp twxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SBdrzyRnzam5C+4e/1m5S+T9al1+qhyfeKtl+AUinsY=; fh=29miLo/05aoBg0FXoBKcg0HwkOWF5H76kS5MePHzFjo=; b=ra0VCdV2A1SA6svn5MJV0b04ioA5kSRUCOBcbjyXMSFZBZJzsQbl2/KgX4nygnJHIS P1pisJAQfoGOznN8+7PTkDiW65c/3g7e8ZPV+GjLKYHXb312T8VwS5dP0crp5+wErjMH DB6xOf8Qh6fOz5G/+JWIdRL7ZYu00qDznV1100Ut3dCzgw9jh7ok2nqcuAkDZCcqnCY2 Nol4ujzbAQGAD3IhALSXwd6D9S0RXISMUy451rABUWBKKfxV7YIGMj8Ldv3nxcnXzZz7 Q007Cu/ZF8OlRGEDT9/ETgh5sUCEsfAiVLDfLgCTyQudbDBxgn0yekG3X6T7OvFngDhm nGbQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MKm7VdDH; 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 i14-20020ac85c0e000000b00430eeb583b5si943832qti.87.2024.03.19.08.45.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:45:59 -0700 (PDT) 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=MKm7VdDH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbeC-00006K-5H; Tue, 19 Mar 2024 11:45:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdu-0007lK-Eb for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:47 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdo-0005LV-J7 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:46 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-33fd8a2a407so1679310f8f.2 for ; Tue, 19 Mar 2024 08:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863079; x=1711467879; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SBdrzyRnzam5C+4e/1m5S+T9al1+qhyfeKtl+AUinsY=; b=MKm7VdDHdGihdu4rM1Dq0+9DySDgqkW6/LnWgzQkCC3WbyrfNrkWjIChETeZlHh3jr 1XCtMMB44C5CxFbHY2Y84zEMSNZPe6EezH5mslkjbEZ24t8+SF8LMasMbHSvOuoB2H+b AfKnlo4E+zeKATL/+owc+6i/F5dcx9/ZT10wau/p7JAByohpzS/VjXBN+Vsig0ndJjzo ny0creta1cmRk78ZP1cpF4pxEysm7mmSwKhYBA1BCD56cXAGHSdzrtjhRx/G64Mo38cg x+sgFME8wsKP1Aoia2WbDO7eh/VKKr1kXb48xUu2tGL/pXmQw8/ZBX1Fvo2BobI208I0 3p0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863079; x=1711467879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SBdrzyRnzam5C+4e/1m5S+T9al1+qhyfeKtl+AUinsY=; b=Kf/cKBBvVW8WOuU1PrEI64IIG1++RHeIWCMSlR0LWF+K420MRiww3BW8nBxwBzNm7t eMR7YVAyTG60pNHKEINi+JeU17aANLRnNQlGsey63++hyFLQtcxStph5ZcjKJscvpQDZ S6dpngaSzmH8guuMIUReHjxYCtM30vyY0IbN86aCy1k36+7kJCFYVlixuaYJNFknf4JR 8E4jJP0YqfEeNLdG12ipMYCY1FCDK1raU9iZ59w+K+NzOLE3Z0I688x+GL/7JQJf2mAj 2PHkVR7qcmtFUs/fnJJtBBWgdTiHN+cQSx7TYLSB1ND+/Vd4PsK4rGoiICaBVLpIYEuI C6Fw== X-Gm-Message-State: AOJu0Yx47mGfVNS0QssPmgy8HuL8z1m4FpQsK/UvILfs5E2kvZstseWm UVgUwJXrqywVrEDo1TtlwTCkqcYzjbHAeVlqRg3GxWSRodxv0ZRQhIMcOg6YzZsMlVYKD7m5dpC f X-Received: by 2002:adf:f7c9:0:b0:33e:7719:325d with SMTP id a9-20020adff7c9000000b0033e7719325dmr13239459wrq.2.1710863079000; Tue, 19 Mar 2024 08:44:39 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id y10-20020a5d4aca000000b0033e03d37685sm12668148wrs.55.2024.03.19.08.44.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Daniel Henrique Barboza Subject: [PATCH-for-9.1 17/27] target/ppc: Indent ppc_tcg_ops[] with 4 spaces Date: Tue, 19 Mar 2024 16:42:46 +0100 Message-ID: <20240319154258.71206-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Acked-by: Nicholas Piggin --- target/ppc/cpu_init.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 7e65f08147..464e91faa2 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7360,22 +7360,22 @@ static const struct SysemuCPUOps ppc_sysemu_ops = { #include "hw/core/tcg-cpu-ops.h" static const TCGCPUOps ppc_tcg_ops = { - .initialize = ppc_translate_init, - .restore_state_to_opc = ppc_restore_state_to_opc, + .initialize = ppc_translate_init, + .restore_state_to_opc = ppc_restore_state_to_opc, #ifdef CONFIG_USER_ONLY - .record_sigsegv = ppc_cpu_record_sigsegv, + .record_sigsegv = ppc_cpu_record_sigsegv, #else - .tlb_fill = ppc_cpu_tlb_fill, - .cpu_exec_interrupt = ppc_cpu_exec_interrupt, - .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, - .do_transaction_failed = ppc_cpu_do_transaction_failed, - .debug_excp_handler = ppc_cpu_debug_excp_handler, - .debug_check_breakpoint = ppc_cpu_debug_check_breakpoint, - .debug_check_watchpoint = ppc_cpu_debug_check_watchpoint, + .tlb_fill = ppc_cpu_tlb_fill, + .cpu_exec_interrupt = ppc_cpu_exec_interrupt, + .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, + .do_transaction_failed = ppc_cpu_do_transaction_failed, + .debug_excp_handler = ppc_cpu_debug_excp_handler, + .debug_check_breakpoint = ppc_cpu_debug_check_breakpoint, + .debug_check_watchpoint = ppc_cpu_debug_check_watchpoint, #endif /* !CONFIG_USER_ONLY */ }; #endif /* CONFIG_TCG */ From patchwork Tue Mar 19 15:42:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781132 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1998384wrs; Tue, 19 Mar 2024 08:51:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWBulFRunbe1PYlqk8R4s5QDj/QpeScjFXrm/etaRnTNut3mIX8hARJ2pZ6eCvqwwxkgBQJohtzQD8niCQNupEV X-Google-Smtp-Source: AGHT+IFJwq/W3HdpqIfCaK6x8PcPUj8f4uTAVzDnjKExJL4jC5iFyinu7Qxn8LLshTl8p+/TwpaI X-Received: by 2002:ae9:e41a:0:b0:789:d43b:3702 with SMTP id q26-20020ae9e41a000000b00789d43b3702mr16398037qkc.59.1710863482163; Tue, 19 Mar 2024 08:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863482; cv=none; d=google.com; s=arc-20160816; b=RFRVnVUOyKIrCwYtKv71ZuH0l4PXwrWpvoPQHm6FubLbP6p/sJPT/XAb7bZwkHBJs/ EPmdb2Ue1g70OOK+e033G9RvhrHftW/E+Q+ZAFYbWUA7uHVAqAQmWZ/JdPJfke6aPZoT bu5QDRdtSVOOl4aUqDkpWvS1bQ8uPTwQCBXpjXLsjfN2RQ9Yz5YsD7FvwhHZmXibdfa3 Xyb37ZRATv1qIA28/OE1WYCRKL6zHhqpyMpLvgxWBi9uIQx71+OYVbkgy9fu+5NJJm0d BQ4JQPbjMDv3mVkDRnJghCQTJY6hC0JpfEUwcvY6Byvsc1GN1Re56VMvg6PXvG/bPPum zXsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NFX4++ImuD2EMXqBk24v8xDkpJQsfeFGsz4R2q2Dmzg=; fh=29miLo/05aoBg0FXoBKcg0HwkOWF5H76kS5MePHzFjo=; b=FtJBYHpKlCHACgKldpWKFDe1V1ai/BIR8bPBuzaNK4VatCLi9+39qghm6xjgCuLZdD 5Vrmam1mUJcM9H0BVRU1KjjiORug2PkMDN9kIKULPZzvGbAVpeBndfag5eA7dda9ntyq FwhsDZy6+fS6teQngqI2Gu8Zk4E7yMzHm66lspfHAshQ97869NAQ5yrDyw87FJMKuIxO H7LXTYLgG+a5Pzgx2AfTsWitaonqwq4eAL7zzAZYrTx5inID2BP0HbdBpMjL4CllcwNp N6zTa3fnIWRJ0xDaCUy7w0rlqOLvTlQXfYWtUy+uZbwYP5flsMRqDI3324+Y4JG2fmkJ YH2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v7Nl1bsE; 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 z13-20020a05620a100d00b00787bb6786d9si11605539qkj.513.2024.03.19.08.51.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:51:22 -0700 (PDT) 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=v7Nl1bsE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbeH-0000iQ-My; Tue, 19 Mar 2024 11:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbdz-0007uZ-Mx for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:52 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdu-0005N6-L1 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:50 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-414617882b3so10530275e9.3 for ; Tue, 19 Mar 2024 08:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863085; x=1711467885; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NFX4++ImuD2EMXqBk24v8xDkpJQsfeFGsz4R2q2Dmzg=; b=v7Nl1bsEgu2N1g2/sg8QQa9gd/k9/esWP9SUTdz0DuVGtHzCGqe4yKZkSKfQjF0CUp b3p8YZADPWidLpE+Ck6dWeEg+Ra5gstFKgZd72IHLi7R/s2CA1PgNUqwsfdswFkr9WS5 EXFkzqfXotXmWfsR79J8rrOPUWozUb4SKt2gVjiSRyc5Hiz/D9JjcTIseQtaqubSG5r5 dOSd+9uVeyw8RXB9C2Ih/EPX4xEueMGLC1MU9kLsj+PC8m5v8wYqQfVKtcXutDbYPwT0 MXNOdkFi9rjoFJoXkqFOik2PEzBV5PhGNnWB//irbNqSTnVYnYEzxMxyeav+Nm9I9BvJ 7YlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863085; x=1711467885; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NFX4++ImuD2EMXqBk24v8xDkpJQsfeFGsz4R2q2Dmzg=; b=JxmH7Srpji0w4rwxrDrjqqw7ylzBRIhUA534+QK6b97aNaadAQ9Q01IitrHOqXdLbV Ls1V4Rd455CMBHiYw0Ui7r/E3pPLNldOHIb/vtcH3AKEr4UdYSQqbwWwgni6O5peQ83E GHeArX/TGyROtxYxlDZimSLAneZ1Nh9IF+TKwBjubdmfP6SqTdXIdUciKC5B2DvHloVZ /XZoAZKErc9E6x94vnwr2uOeLLiGxvusk4hoIdG5ePGTKmbSveYUzmD5OlYQRlg5RqJj /E3BD5YMueN1c0a182u0U0MpegrfvTBkj3TRTlEiTcx+h/QtBBxnZoOOv3zl4NOmQ/0I OM0g== X-Gm-Message-State: AOJu0YxTV1ljhIFm1SDElVD+qyCjAEHDKFi0xqGfHT9uelsZyygLOI9p cEt7FXpBl6jHkSIKwlWwO6/TswS8GioIdaKagKQqLhQUFji7CGa2SqlOv1t47PGCR66i8fIigj+ l X-Received: by 2002:a05:600c:1c15:b0:414:c64:f3d0 with SMTP id j21-20020a05600c1c1500b004140c64f3d0mr5088397wms.27.1710863084853; Tue, 19 Mar 2024 08:44:44 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id n20-20020a05600c4f9400b00414610d9223sm4091610wmq.14.2024.03.19.08.44.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Daniel Henrique Barboza Subject: [PATCH-for-9.1 18/27] target/ppc: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:47 +0100 Message-ID: <20240319154258.71206-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(), unifying with the method declared in target/ppc/helper_regs.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Nicholas Piggin --- target/ppc/cpu.h | 16 +++------------- target/ppc/cpu_init.c | 1 + target/ppc/helper_regs.c | 13 +++++++------ 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index ced4e53024..6aa18db335 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -2716,19 +2716,9 @@ void cpu_write_xer(CPUPPCState *env, target_ulong xer); */ #define is_book3s_arch2x(ctx) (!!((ctx)->insns_flags & PPC_SEGMENT_64B)) -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -#ifdef CONFIG_DEBUG_TCG -void cpu_get_tb_cpu_state(CPUPPCState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags); -#else -static inline void cpu_get_tb_cpu_state(CPUPPCState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->nip; - *cs_base = 0; - *flags = env->hflags; -} +#ifdef CONFIG_TCG +void ppc_get_cpu_state(CPUPPCState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags); #endif G_NORETURN void raise_exception(CPUPPCState *env, uint32_t exception); diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 464e91faa2..673559b444 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7362,6 +7362,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = { static const TCGCPUOps ppc_tcg_ops = { .initialize = ppc_translate_init, .restore_state_to_opc = ppc_restore_state_to_opc, + .get_cpu_state = ppc_get_cpu_state, #ifdef CONFIG_USER_ONLY .record_sigsegv = ppc_cpu_record_sigsegv, diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index 25258986e3..e62591067c 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -217,25 +217,26 @@ void hreg_update_pmu_hflags(CPUPPCState *env) env->hflags |= hreg_compute_pmu_hflags_value(env); } -#ifdef CONFIG_DEBUG_TCG -void cpu_get_tb_cpu_state(CPUPPCState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) +#ifdef CONFIG_TCG +void ppc_get_cpu_state(CPUPPCState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) { uint32_t hflags_current = env->hflags; - uint32_t hflags_rebuilt; *pc = env->nip; *cs_base = 0; *flags = hflags_current; - hflags_rebuilt = hreg_compute_hflags_value(env); +#ifdef CONFIG_DEBUG_TCG + uint32_t hflags_rebuilt = hreg_compute_hflags_value(env); if (unlikely(hflags_current != hflags_rebuilt)) { cpu_abort(env_cpu(env), "TCG hflags mismatch (current:0x%08x rebuilt:0x%08x)\n", hflags_current, hflags_rebuilt); } -} #endif +} +#endif /* CONFIG_TCG */ void cpu_interrupt_exittb(CPUState *cs) { From patchwork Tue Mar 19 15:42:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781130 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997993wrs; Tue, 19 Mar 2024 08:50:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCC3t4fkaGQ1osVzBxMokPS4s+wa0q2lpjhBpaAxN6pJE0oVP1eoo+iu4Z0h6CJXu+Y8UyOROXcS3vcnWI3Z5G X-Google-Smtp-Source: AGHT+IFnzPYfmojHvA1cD49kw4unPo6cDkW1cKKlrxmAH2WpuD/pYFJ0YbnnK/cgU3Nt2JT4bNPP X-Received: by 2002:a05:6830:20d9:b0:6e5:3c63:789a with SMTP id z25-20020a05683020d900b006e53c63789amr3633362otq.28.1710863432921; Tue, 19 Mar 2024 08:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863432; cv=none; d=google.com; s=arc-20160816; b=WoR0V9bAz8s6KU66HpLPt7fWV2YLQMk2CKP0r8L1g7vQsK4QEBp9bVYSA9siOJqwg3 lqsTSNxCfVCs+7sg46qKIc6YDhTg+pIDji5lXqWwekA7yf7QHYzTAV6gWeCrgz0ZpWW3 96YByBzyZfik0KrCIWIlm1c0kgif9uXaQUKEJfI8Og1JHZYZv0ap8Wl9N0NhUhiHVwqX bWfwdVJ/7C0dx4KR7C/e2T6xYgaqY8W7dTb3iNkXmticHzMG0J9WcpuPzpdAe1bNBObg r0fbYsNiDPnrNDJBisrQHJUBOqHnEe5VCwqPfHT/NnMGqqASnSPeqk1nauQXXB9teJvp CCgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=llLOSUG/r9mfjCgy2ld/tJJKqoPOBOUeFtNXpO/0qHo=; fh=8nxmtFToIYlfmksInIBBNsY/fXlg8IAuHKO7Ua0uBTk=; b=c/WXqwEdBHaXoq+Oxr7xRwpDaapFTPfFUgrNVh5ew/ONvMpNvA9VZBLCVpPS7lzsy2 kSBfRagXOO5HKy8vBbaQKU3XDPZOSVJcHvsivhqKadrkZSAF/3lTmKbeFDV/jfARi43g eTtRHfXN4x5leE6ndVjsMFBqYcRPxsClwlF/xaSRREhD1LUuWXE36kxQ7DusqUoidOs9 DczeiknWXXeclv1rz+kdxqpaTx9gtHcOixPacYCtzsGpL3f+zm0Tke8HZ60x9fPVxLJK 4iFVnOp6buPyjrWt5v4AQTkjZ4abRfnyYKwjWW2EnVBODp5/TdFHu9y76RuvUdyfp9II K9zw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BP+uOqwa; 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 bj33-20020a05620a192100b00789fa9fffccsi5724106qkb.577.2024.03.19.08.50.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:50:32 -0700 (PDT) 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=BP+uOqwa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbeI-0000kG-8h; Tue, 19 Mar 2024 11:45:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbe5-0008EP-Nd for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:59 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbe0-0005OP-Hq for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:56 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-41467d697a2so3643635e9.1 for ; Tue, 19 Mar 2024 08:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863091; x=1711467891; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=llLOSUG/r9mfjCgy2ld/tJJKqoPOBOUeFtNXpO/0qHo=; b=BP+uOqwaa+4O0/0Jm4W5+DfMmWnITz/V1uW8pj8ps+d7CXMEJZ2HL9yeluSYG+fGRl gCuS5WGXi0E7twJq+xE+K+dKV3HlRj5tbsPLaZoGgg7A8/5KIWReXYhTshSMgnDRL973 d+luuSDq2u9IJ648IyN1y56lm/4lNr5Q9aMws3WTcGVzfsa2PmmIrP/MMbJl4+yFUN71 LPUCjqe39I/QXr7nhYenNsijoT9MKlVw7DYnM+ZxdE86iwmE1+GbRWMEItLmlz7jghcJ VjCxl7MeDhFwp11hRoLfUWkWJfWqrwVgnsWtj6hSyjFjh82/jT5LYrbAqYKEKwAJ+tek M82w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863091; x=1711467891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=llLOSUG/r9mfjCgy2ld/tJJKqoPOBOUeFtNXpO/0qHo=; b=HBVD28RO3y0w8VZluVy0OXWQc7J6G4jCks7B+NnGdLlR8kgvLDpih04ROwEIzXBC1o 66iRuW52iJ8MGflVCDcKo2IyHFr8C0nAkBlUP4SB6sVbUjcWFGETb2+GfzWi/Gn0kMir 62rK5gBbtW1cH632QvC0iiSG29z8I5HAluD2zKvKLRmeQZsC5MEXljdIt7UpiwM0/787 yt6AKJpt3iT6CC04I+zQJbV2o1Xl4TQh51iPLGe7XjHRuyvSBA0xmuLdla82c6+2cC8n XKXByhUwQyn9y8rmeEErUfr83et0EcSnuQ9nEy8sBX9NofsnEVDwPUOieqFI6eNQdTb3 +6fg== X-Gm-Message-State: AOJu0Yz3OxGMg3fmVxcVanX7FGrZ7qgH9SIgfr73rY236j5MWWmIktp4 GZ8JRrpcSGWjsa9z+yeZPcF0ozb2ON+HQngRm4pARRnKB86fpMFEgaxp6jgOJBmsYkgoQJzUhXS i X-Received: by 2002:adf:ce81:0:b0:33f:6ec0:d228 with SMTP id r1-20020adfce81000000b0033f6ec0d228mr6510892wrn.1.1710863090819; Tue, 19 Mar 2024 08:44:50 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id bq24-20020a5d5a18000000b0033ed8643638sm9333011wrb.106.2024.03.19.08.44.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei Subject: [PATCH-for-9.1 19/27] target/riscv: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:48 +0100 Message-ID: <20240319154258.71206-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Note, now riscv_get_cpu_state() is restricted to TCG, and is declared with static scope. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 3 - target/riscv/cpu.c | 2 +- target/riscv/cpu_helper.c | 87 ------------------------ target/riscv/tcg/tcg-cpu.c | 88 +++++++++++++++++++++++++ target/riscv/insn_trans/trans_rvv.c.inc | 2 +- 5 files changed, 90 insertions(+), 92 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 3b1a02b944..d00d1be235 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -704,9 +704,6 @@ static inline uint32_t vext_get_vlmax(uint32_t vlenb, uint32_t vsew, return vlen >> (vsew + 3 - lmul); } -void cpu_get_tb_cpu_state(CPURISCVState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags); - void riscv_cpu_update_mask(CPURISCVState *env); bool riscv_cpu_is_32bit(RISCVCPU *cpu); diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index c160b9216b..ca537d0e0a 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -889,7 +889,7 @@ static vaddr riscv_cpu_get_pc(CPUState *cs) RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; - /* Match cpu_get_tb_cpu_state. */ + /* Match riscv_get_cpu_state. */ if (env->xl == MXL_RV32) { return env->pc & UINT32_MAX; } diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index ce7322011d..e18a269358 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -25,7 +25,6 @@ #include "pmu.h" #include "exec/exec-all.h" #include "instmap.h" -#include "tcg/tcg-op.h" #include "trace.h" #include "semihosting/common-semi.h" #include "sysemu/cpu-timers.h" @@ -62,92 +61,6 @@ int riscv_env_mmu_index(CPURISCVState *env, bool ifetch) #endif } -void cpu_get_tb_cpu_state(CPURISCVState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags) -{ - RISCVCPU *cpu = env_archcpu(env); - RISCVExtStatus fs, vs; - uint32_t flags = 0; - - *pc = env->xl == MXL_RV32 ? env->pc & UINT32_MAX : env->pc; - *cs_base = 0; - - if (cpu->cfg.ext_zve32f) { - /* - * If env->vl equals to VLMAX, we can use generic vector operation - * expanders (GVEC) to accerlate the vector operations. - * However, as LMUL could be a fractional number. The maximum - * vector size can be operated might be less than 8 bytes, - * which is not supported by GVEC. So we set vl_eq_vlmax flag to true - * only when maxsz >= 8 bytes. - */ - - /* lmul encoded as in DisasContext::lmul */ - int8_t lmul = sextract32(FIELD_EX64(env->vtype, VTYPE, VLMUL), 0, 3); - uint32_t vsew = FIELD_EX64(env->vtype, VTYPE, VSEW); - uint32_t vlmax = vext_get_vlmax(cpu->cfg.vlenb, vsew, lmul); - uint32_t maxsz = vlmax << vsew; - bool vl_eq_vlmax = (env->vstart == 0) && (vlmax == env->vl) && - (maxsz >= 8); - flags = FIELD_DP32(flags, TB_FLAGS, VILL, env->vill); - flags = FIELD_DP32(flags, TB_FLAGS, SEW, vsew); - flags = FIELD_DP32(flags, TB_FLAGS, LMUL, - FIELD_EX64(env->vtype, VTYPE, VLMUL)); - flags = FIELD_DP32(flags, TB_FLAGS, VL_EQ_VLMAX, vl_eq_vlmax); - flags = FIELD_DP32(flags, TB_FLAGS, VTA, - FIELD_EX64(env->vtype, VTYPE, VTA)); - flags = FIELD_DP32(flags, TB_FLAGS, VMA, - FIELD_EX64(env->vtype, VTYPE, VMA)); - flags = FIELD_DP32(flags, TB_FLAGS, VSTART_EQ_ZERO, env->vstart == 0); - } else { - flags = FIELD_DP32(flags, TB_FLAGS, VILL, 1); - } - -#ifdef CONFIG_USER_ONLY - fs = EXT_STATUS_DIRTY; - vs = EXT_STATUS_DIRTY; -#else - flags = FIELD_DP32(flags, TB_FLAGS, PRIV, env->priv); - - flags |= riscv_env_mmu_index(env, 0); - fs = get_field(env->mstatus, MSTATUS_FS); - vs = get_field(env->mstatus, MSTATUS_VS); - - if (env->virt_enabled) { - flags = FIELD_DP32(flags, TB_FLAGS, VIRT_ENABLED, 1); - /* - * Merge DISABLED and !DIRTY states using MIN. - * We will set both fields when dirtying. - */ - fs = MIN(fs, get_field(env->mstatus_hs, MSTATUS_FS)); - vs = MIN(vs, get_field(env->mstatus_hs, MSTATUS_VS)); - } - - /* With Zfinx, floating point is enabled/disabled by Smstateen. */ - if (!riscv_has_ext(env, RVF)) { - fs = (smstateen_acc_ok(env, 0, SMSTATEEN0_FCSR) == RISCV_EXCP_NONE) - ? EXT_STATUS_DIRTY : EXT_STATUS_DISABLED; - } - - if (cpu->cfg.debug && !icount_enabled()) { - flags = FIELD_DP32(flags, TB_FLAGS, ITRIGGER, env->itrigger_enabled); - } -#endif - - flags = FIELD_DP32(flags, TB_FLAGS, FS, fs); - flags = FIELD_DP32(flags, TB_FLAGS, VS, vs); - flags = FIELD_DP32(flags, TB_FLAGS, XL, env->xl); - flags = FIELD_DP32(flags, TB_FLAGS, AXL, cpu_address_xl(env)); - if (env->cur_pmmask != 0) { - flags = FIELD_DP32(flags, TB_FLAGS, PM_MASK_ENABLED, 1); - } - if (env->cur_pmbase != 0) { - flags = FIELD_DP32(flags, TB_FLAGS, PM_BASE_ENABLED, 1); - } - - *pflags = flags; -} - void riscv_cpu_update_mask(CPURISCVState *env) { target_ulong mask = 0, base = 0; diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c index ab6db817db..934007673e 100644 --- a/target/riscv/tcg/tcg-cpu.c +++ b/target/riscv/tcg/tcg-cpu.c @@ -31,6 +31,7 @@ #include "hw/core/accel-cpu.h" #include "hw/core/tcg-cpu-ops.h" #include "tcg/tcg.h" +#include "sysemu/cpu-timers.h" /* Hash that stores user set extensions */ static GHashTable *multi_ext_user_opts; @@ -129,10 +130,97 @@ static void riscv_restore_state_to_opc(CPUState *cs, env->bins = data[1]; } +static void riscv_get_cpu_state(CPURISCVState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags) +{ + RISCVCPU *cpu = env_archcpu(env); + RISCVExtStatus fs, vs; + uint32_t flags = 0; + + *pc = env->xl == MXL_RV32 ? env->pc & UINT32_MAX : env->pc; + *cs_base = 0; + + if (cpu->cfg.ext_zve32f) { + /* + * If env->vl equals to VLMAX, we can use generic vector operation + * expanders (GVEC) to accerlate the vector operations. + * However, as LMUL could be a fractional number. The maximum + * vector size can be operated might be less than 8 bytes, + * which is not supported by GVEC. So we set vl_eq_vlmax flag to true + * only when maxsz >= 8 bytes. + */ + + /* lmul encoded as in DisasContext::lmul */ + int8_t lmul = sextract32(FIELD_EX64(env->vtype, VTYPE, VLMUL), 0, 3); + uint32_t vsew = FIELD_EX64(env->vtype, VTYPE, VSEW); + uint32_t vlmax = vext_get_vlmax(cpu->cfg.vlenb, vsew, lmul); + uint32_t maxsz = vlmax << vsew; + bool vl_eq_vlmax = (env->vstart == 0) && (vlmax == env->vl) && + (maxsz >= 8); + flags = FIELD_DP32(flags, TB_FLAGS, VILL, env->vill); + flags = FIELD_DP32(flags, TB_FLAGS, SEW, vsew); + flags = FIELD_DP32(flags, TB_FLAGS, LMUL, + FIELD_EX64(env->vtype, VTYPE, VLMUL)); + flags = FIELD_DP32(flags, TB_FLAGS, VL_EQ_VLMAX, vl_eq_vlmax); + flags = FIELD_DP32(flags, TB_FLAGS, VTA, + FIELD_EX64(env->vtype, VTYPE, VTA)); + flags = FIELD_DP32(flags, TB_FLAGS, VMA, + FIELD_EX64(env->vtype, VTYPE, VMA)); + flags = FIELD_DP32(flags, TB_FLAGS, VSTART_EQ_ZERO, env->vstart == 0); + } else { + flags = FIELD_DP32(flags, TB_FLAGS, VILL, 1); + } + +#ifdef CONFIG_USER_ONLY + fs = EXT_STATUS_DIRTY; + vs = EXT_STATUS_DIRTY; +#else + flags = FIELD_DP32(flags, TB_FLAGS, PRIV, env->priv); + + flags |= riscv_env_mmu_index(env, 0); + fs = get_field(env->mstatus, MSTATUS_FS); + vs = get_field(env->mstatus, MSTATUS_VS); + + if (env->virt_enabled) { + flags = FIELD_DP32(flags, TB_FLAGS, VIRT_ENABLED, 1); + /* + * Merge DISABLED and !DIRTY states using MIN. + * We will set both fields when dirtying. + */ + fs = MIN(fs, get_field(env->mstatus_hs, MSTATUS_FS)); + vs = MIN(vs, get_field(env->mstatus_hs, MSTATUS_VS)); + } + + /* With Zfinx, floating point is enabled/disabled by Smstateen. */ + if (!riscv_has_ext(env, RVF)) { + fs = (smstateen_acc_ok(env, 0, SMSTATEEN0_FCSR) == RISCV_EXCP_NONE) + ? EXT_STATUS_DIRTY : EXT_STATUS_DISABLED; + } + + if (cpu->cfg.debug && !icount_enabled()) { + flags = FIELD_DP32(flags, TB_FLAGS, ITRIGGER, env->itrigger_enabled); + } +#endif + + flags = FIELD_DP32(flags, TB_FLAGS, FS, fs); + flags = FIELD_DP32(flags, TB_FLAGS, VS, vs); + flags = FIELD_DP32(flags, TB_FLAGS, XL, env->xl); + flags = FIELD_DP32(flags, TB_FLAGS, AXL, cpu_address_xl(env)); + if (env->cur_pmmask != 0) { + flags = FIELD_DP32(flags, TB_FLAGS, PM_MASK_ENABLED, 1); + } + if (env->cur_pmbase != 0) { + flags = FIELD_DP32(flags, TB_FLAGS, PM_BASE_ENABLED, 1); + } + + *pflags = flags; +} + static const TCGCPUOps riscv_tcg_ops = { .initialize = riscv_translate_init, .synchronize_from_tb = riscv_cpu_synchronize_from_tb, .restore_state_to_opc = riscv_restore_state_to_opc, + .get_cpu_state = riscv_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = riscv_cpu_tlb_fill, diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index e42728990e..3c16c4852b 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -578,7 +578,7 @@ static bool vext_check_slide(DisasContext *s, int vd, int vs2, } /* - * In cpu_get_tb_cpu_state(), set VILL if RVV was not present. + * In riscv_get_cpu_state(), set VILL if RVV was not present. * So RVV is also be checked in this function. */ static bool vext_check_isa_ill(DisasContext *s) From patchwork Tue Mar 19 15:42:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781117 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996184wrs; Tue, 19 Mar 2024 08:46:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXcbxj1g1tk++IR/RS6Qk007S7ISHUuUcCUPiwNaj94dmfTABz0d4RZwIXqGz+p6z41Nz8A5kbBrT2AtK/PTz8V X-Google-Smtp-Source: AGHT+IF7Dfqj4A9td2eXdzSSrdkBLm7sXSugjJGhqA4PCIDnEkK8RnMoosnSMX0oklnDOTFqMTCF X-Received: by 2002:ad4:524a:0:b0:690:d21c:abe1 with SMTP id s10-20020ad4524a000000b00690d21cabe1mr17632836qvq.62.1710863167484; Tue, 19 Mar 2024 08:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863167; cv=none; d=google.com; s=arc-20160816; b=mFMdQlasWAAGv/M4gfuPbDHiGhHWYEP9nBFACBi9oB0WeeDlV9EEWWMS0C/2J/8POB FM9kSIgXXtjj+nrtj4WR9ssHT1B3ESuknTB8TnlYv5MB1YudzhuIYMSDb02MbmQx4Ope PdJQU1pdcZGasGHBbacTDnzX8R2DXkX/BDPD6q9Aqh5Ljtz08cbRjzPRbqhkE9ZjyMgG 70Wvg2muzL/0680LqsnmpKxehdski7woLZRemFwH/4uOc9EYhMkz1SVJZs1q7w42K6hb AS7rUsj/MT2blzcES/qjOwDemkJs6P0dMmMCruMOprPhO8Kg0k6TZuH/p2emAX5xdHj6 0mwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hwhHMygx0mLENqv0dOkZHirx9fre16Z9mIHYSdz8fsE=; fh=UJGwpiD1w94kNq3h6+bjqd48VbgrymaKe6Q+Ls6ZRFA=; b=aPYuWNsA2h4hCJDsv1t6pdOarwDN0m61oTRcrp6ByJCFL9SImttxle1ApIzgtM0/om z6yYsJiU3SdRbGQ3Pz9ur4nW+T3hA32haTis0z4Wdk6gh5YEfX/18qmsBY+14ulmc5rm KrmJIv8vIeQtLj2uKp/rtVCFppFsrpi0ZIIK42XgBh178yvK+FLqTM5qAJM9h9+CSFfu lvyQzNPwdagDZ1VI5I7U3VYQ/l7fmLNZDO/vUjo0daOngUv5YEaVTg1zlq/fCNYysSjq vbUjShJLla2o/tJVP13b44FG1yk+YFch1Lb0Hcs59Ka7ialfeen3Ixoc6UXPVYCmA85a vGMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZVbjAZg3; 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 wj17-20020a05620a575100b0078819abcb03si10616657qkn.710.2024.03.19.08.46.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:46:07 -0700 (PDT) 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=ZVbjAZg3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbeK-0000uv-OX; Tue, 19 Mar 2024 11:45:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbeI-0000lD-Hk for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:11 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbe7-0005RB-JO for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:10 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-41467d86184so3576275e9.3 for ; Tue, 19 Mar 2024 08:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863096; x=1711467896; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hwhHMygx0mLENqv0dOkZHirx9fre16Z9mIHYSdz8fsE=; b=ZVbjAZg3IT4dLTFQEn9z+KNAMhyeL1YMm274oUPff629OaFDbtEqUAdXzB/O4ggtLq KkLzetDMwZIoqio5Y0qCvrfKziorPTkyLP1kjfpVRIR3qmxUGP4sp7hmIEAC+QSxfNKc B2BD1gfhPLRszkSseY/Ww5YGMBmrX+RKl4GLEuhi+QkNfBT2dIIiXvp750kzBYDyXDzv gSyjOeeo6nWK5aL7c1do6/612hsEtmisVSVsEaYP55/4HlMSS3YO/fdH9ZBuA2iWFpM0 otZgzCTPAxWlxvE82dUhqD09ZbkWdlq8Hgqe1BNwyUWK2b2yPmUyJ89mNDlBgZ2JuCfi kbjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863096; x=1711467896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hwhHMygx0mLENqv0dOkZHirx9fre16Z9mIHYSdz8fsE=; b=DRGnNKq7l84HxPIt6mSAq7Z/ckOjVrN4EmF87HzsZBXycLDnGFeWIJEBuPy+KIeAyC 2ioCBXvW/Ze1WW19XKdf+iCRco6C8hp6QBUvJQJPateup0Ao0086+4/RSj7BCaFGrsc/ aNuKnraHO93ltNjaM3VLa9wQg/amt8/UbWc0cUCxwEiC7TaIA+oByl9rceXS6OiRNsRt zoS3OOg9O1C1vWEGWWCPxriAK73pA0zbWehXS7wkjlM5/btHvGVOCAa4iq9FLpJBhzPR X88BUlaSCbbosWi6m26lGREoD0wsAj6YswZDObjJMT4kxvaIRnh8LPcFt9ZdKy3BoM7Y CTJQ== X-Gm-Message-State: AOJu0YyGcxiEm2MK986Y37wy8GYkhB/qBdf16OP7XSXRBE6eIOttUTTV ijWiQIBMaDfywDK0m1brBvST6VB4Rt1Y2VDtmd8YrTm+O02DyOPzrFdVkb9iFq0AawHYUlscOfF M X-Received: by 2002:adf:ed4f:0:b0:33d:c217:e8a4 with SMTP id u15-20020adfed4f000000b0033dc217e8a4mr11113184wro.14.1710863096299; Tue, 19 Mar 2024 08:44:56 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id i18-20020adffc12000000b0033e786abf84sm12655011wrr.54.2024.03.19.08.44.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yoshinori Sato Subject: [PATCH-for-9.1 20/27] target/rx: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:49 +0100 Message-ID: <20240319154258.71206-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.h | 11 ----------- target/rx/cpu.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/target/rx/cpu.h b/target/rx/cpu.h index 996f121bcd..dcda762212 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -149,17 +149,6 @@ void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte); #define RX_CPU_IRQ 0 #define RX_CPU_FIR 1 -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPURXState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - *cs_base = 0; - *flags = FIELD_DP32(0, PSW, PM, env->psw_pm); - *flags = FIELD_DP32(*flags, PSW, U, env->psw_u); -} - static inline uint32_t rx_cpu_pack_psw(CPURXState *env) { uint32_t psw = 0; diff --git a/target/rx/cpu.c b/target/rx/cpu.c index da673a595d..3b55b09e64 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -58,6 +58,15 @@ static void rx_restore_state_to_opc(CPUState *cs, cpu->env.pc = data[0]; } +static void rx_get_cpu_state(CPURXState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + *cs_base = 0; + *flags = FIELD_DP32(0, PSW, PM, env->psw_pm); + *flags = FIELD_DP32(*flags, PSW, U, env->psw_u); +} + static bool rx_cpu_has_work(CPUState *cs) { return cs->interrupt_request & @@ -187,6 +196,7 @@ static const TCGCPUOps rx_tcg_ops = { .initialize = rx_translate_init, .synchronize_from_tb = rx_cpu_synchronize_from_tb, .restore_state_to_opc = rx_restore_state_to_opc, + .get_cpu_state = rx_get_cpu_state, .tlb_fill = rx_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY From patchwork Tue Mar 19 15:42:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781131 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1998346wrs; Tue, 19 Mar 2024 08:51:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXTgrnL/OaxiAqNQIK4cu3ZW9P0bqMQvHRHAIyIEu48UzDrLIQhpCUZSxqPt5DcrBq73ZDw5gfyNstIv5rRwkJo X-Google-Smtp-Source: AGHT+IG1dV59ATBmZunnxEYwJ50gayBteSzEe9cXxZTThRGHFX38Metdagv3TYCYvDo85zyMji+k X-Received: by 2002:a05:620a:22a7:b0:789:ea39:50c0 with SMTP id p7-20020a05620a22a700b00789ea3950c0mr10376054qkh.33.1710863478029; Tue, 19 Mar 2024 08:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863478; cv=none; d=google.com; s=arc-20160816; b=kSKEV6QJW9U1FG738oZD3kIP+ggFS/N72vvDDZTAwtIGlm/n/VT4rjGU6jn9XBvQcw 09CezDBzm5BCOWGRRnMrI3eGBTSrbubtdc2JsetqvVB2ALjN8d1XKU9zCL889LvdUPrT sUXQHQtZ2e1Q0ii5P3yCwdjAoNyhNBrctbBvqPb31JVGYe8/+0pjGIX6BeOrq5FXri5z 0gWVQhXEk7p2wKNvYHXFbzfSAMRRVYFwyXwRTEjtjJz70ylEC6s9ptvIZLSP93i6rhQI lTaVTMpAUh+T8nBlyPGFxVyeIunz8gqdXiz5ls3Frf7xXx/je80pJwUC/E5/QpTZVM+M EW2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EJDlH3IcOyAIPXzpINjBXtBvgS8Gcx3JXjLnmPdWxeM=; fh=BSBEthqerG3A4vQaks69vR5R2Me6Cg+RdQmcMjIlvao=; b=Xwwc149nPp6attEcbTa98byC8a7iYysLj6+NlV9yNampsohHkqgWD/l6HFdm/BU8Cf 3wF1QJQhtwBK4aE5GLZxniZRkLh3nLefTmfSfAssiJ4J1UkEm0QhHx+zpQTIS97kh6Gs 4BV8AMX4lXtcGHBCd6iTIjOBb1YVbu9DvnDaZtIHUnW8PI9MHhlsUu4wLABbaSBewBeB TKQ3Nepu/nF2a9LLETh6oeei+ahZ0NF6en6xOQMjlnLpDPfeUvTXxLOGF9OtHPrpyR0L GUJSnN1E7qlLDkmzXgXAzuXSDnx1GSavRuHi6EFmS6s8jzrCKqyizQDXvyiIyfRnhJ9V fiWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hE8RTnq/"; 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 os34-20020a05620a812200b007886d4e9640si11413310qkn.146.2024.03.19.08.51.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:51:18 -0700 (PDT) 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="hE8RTnq/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbeO-0001B9-FU; Tue, 19 Mar 2024 11:45:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbeL-0000zw-VT for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:14 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbeF-0005SZ-IM for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:13 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-41465864644so4586245e9.0 for ; Tue, 19 Mar 2024 08:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863102; x=1711467902; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EJDlH3IcOyAIPXzpINjBXtBvgS8Gcx3JXjLnmPdWxeM=; b=hE8RTnq/ClWfhEVo2r5OHgqY/W+Lzq0pFD1B5JiE+JHTY5eNm+rck4WAceJlLf8/Yd D5E1RZ1SJNYM2njYFVnxWrirMCEUWRi8iunskkIYV2x9bXTkiCCtmvShuE4jvxcIRr+B Y5NPki0V+jrDim93T1ARAs2um1ZirzW7mUDgK2EcB7PzqeloLvMRqsw5+PuKHq2zMmh2 ILHuNz27tvpLZ4YmVrvDMQ79FkvbiOCyJ+NRJ04jy9x3W1NEbRznPpEvCkRW3T7jUbMc WpWWFyYtwpjhS0Svxa0Yl1ZGps1lMj0nKfdATI1Pi4nwdxUryvtF5MFeHo4TgZE9gJf5 G31A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863102; x=1711467902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EJDlH3IcOyAIPXzpINjBXtBvgS8Gcx3JXjLnmPdWxeM=; b=FtTdhPfeXE09mah3Gd5Va/2mhOIu92+wle8UnMdxS+20IDbw+zQvRF7Gx9+E6Bhmvm o5poOl5ge1w/zhf9/nTef5wZmX1f387LgKxvjUiV+z5BI5ZqTYkrLNlLSX8TSykRNgPo vMi7RNOnrGMS9HeuiZmqw8ryFf5XgT/MYs+y5IBFLoxbZsS4PNefwdz2XUqmCjqxCbLJ +n+F6dwagAF7CVnRBOjAKdN30oW2fTr0cdEWO6mpyhCMG7w4ljEvaRlyDVHxDcCgHj71 oQYTWdsOEapTyFWcfYkCKHBsBwA64swd2/5OwdSg/G8clFbwPIzJCUnXvpGUQenXYfT6 ML8g== X-Gm-Message-State: AOJu0YxptzBJefkm78lbwB0wgimZi5L0L01MZLtbGHERmRF1T7EIW/G/ AfzVb9fy8mqbFxflh48+xI1yczAZkd0oERyHZCpCG5hTmIdZowABXRPmTfgNiFHLpiog5yTGHRO v X-Received: by 2002:a05:600c:3503:b0:412:c285:1091 with SMTP id h3-20020a05600c350300b00412c2851091mr2952541wmq.7.1710863102010; Tue, 19 Mar 2024 08:45:02 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id fl6-20020a05600c0b8600b00414692977c3sm426238wmb.14.2024.03.19.08.45.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , David Hildenbrand , Ilya Leoshkevich Subject: [PATCH-for-9.1 21/27] target/s390x: Restrict TCG-specific declarations Date: Tue, 19 Mar 2024 16:42:50 +0100 Message-ID: <20240319154258.71206-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- target/s390x/s390x-internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 825252d728..559c9f561d 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -398,10 +398,12 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, /* translate.c */ +#ifdef CONFIG_TCG void s390x_translate_init(void); void s390x_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data); +#endif /* CONFIG_TCG */ /* sigp.c */ int handle_sigp(CPUS390XState *env, uint8_t order, uint64_t r1, uint64_t r3); From patchwork Tue Mar 19 15:42:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781112 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996061wrs; Tue, 19 Mar 2024 08:45:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWwgBLzISy2S3vPBKNHO3BNzLZnNS0aXU99IjyvfhUrcDL5QG0480ieTSkA3L1FqU4L1xgA76v+rUgpycwc1JA6 X-Google-Smtp-Source: AGHT+IFT8xhvHK/L27yDV9D77Y06nJFziahzvzXIbCrRXfZhOLr0LFILNprlJtUBzJSr8RRcE4/p X-Received: by 2002:a05:6870:d253:b0:221:bbb6:3aea with SMTP id h19-20020a056870d25300b00221bbb63aeamr17460100oac.16.1710863150532; Tue, 19 Mar 2024 08:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863150; cv=none; d=google.com; s=arc-20160816; b=R9h7G+yDEm3QaeH40xzygygB2nwRTD3EfDP8cfipiBPDql5Pjc9sf//Rkolb+LZ5Vw KK1FSOi1CElJiKKJI0BE4kQDc0hyoNZ83GnuOpu1QtIIvh+1Rd/gLX7CCMXSXgpzMUaP GRkExvSChmZf83AjjP7E6B128bwWEKorEh+C6TQ9pFtDh/yECogUyZde76CdeQ3uNA98 VeVJfe04lMsUJuROocAF3X2StAGKHi/h/qwsnxjZrk4km4/BS27QHYKTNtLQTBaMJYQM R3aXBGMP+KABEvsYKB0fs4KldV8wHsQGZ7Q6Y0AiVUsfSgXOa1fsBFkoVdFbeuxUObLV VkNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=obVPvpYss9xjXntv+zHtCP4dsVUmvSV/g5EeFxAwv28=; fh=BSBEthqerG3A4vQaks69vR5R2Me6Cg+RdQmcMjIlvao=; b=MgMoTwkNuiIRsSypTU7Wq+JSccpxhns8TUjpnhCUK+Wc2icnlom0F18mXEj0T7qztQ qMac001o4JW4FhlL13GzpaJ2EV4H54v8T5MaTPv0mgLvULc7alJJkZVYNMDaZ9wtSxC5 RfxjxMYrt3QT7Z3g/rqjbvIEoS9VGSufti7x+xW1gwxz/QBD1AjFVYKPk4JSkScqKHKT +nYa7knvFXYpMR1MVtYJuNjG/GEWou/KeYwGBeJ+fa0+k63VvivwVRDUsvKGsSdq7isE OkPHt1I8PQ3pyfC1vo4PT4Dqfs1aNZO2JIWWkpGLwHmzpRVjFshQzHfo/RZFBs4BfKof LnXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JEDll7kW; 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 v3-20020a05620a0f0300b0078861f989a3si12863966qkl.143.2024.03.19.08.45.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:45:50 -0700 (PDT) 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=JEDll7kW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbeU-0001Sl-O1; Tue, 19 Mar 2024 11:45:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbeO-0001Cd-Jf for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:16 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbeH-0005eP-Kt for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:16 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-41409fd8b6bso22694175e9.1 for ; Tue, 19 Mar 2024 08:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863108; x=1711467908; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=obVPvpYss9xjXntv+zHtCP4dsVUmvSV/g5EeFxAwv28=; b=JEDll7kW8NCROw2F/aJWV6dWwlRhSVzzg2Kuv9ZIBGZKFQt/hV9MpxxV6mvDcn9K3q T92fMeK/XBV6e6ZYre6UEx7oRoz4k+qJSnxUUZfWttUk95ZGo9rHsmTHB0K2rG8vG2uL 6yS61X85xMyGYkyqUxOhoYsOH5LRLFLlZ4km6T7UCbR5NK/rfXAx7FdWSfrzmb1ZvTcg pg6UkgJvDN3LlBlYuSeq33dC0VKgKMzTNKEraAgMv9YMybG9KL2KzT5ywHTR13aZsAuI 8EFnYF14YEQ5c+oxAEx7ZWTz4J4kKdGHLe0mBVmrqUT0UA+Q7aVFNsNLm2lA6yDKbM/F O70g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863108; x=1711467908; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=obVPvpYss9xjXntv+zHtCP4dsVUmvSV/g5EeFxAwv28=; b=Cy59xi1riFde/JCSGQVi7vg4z9E1s+shTWwL+CMrhep8s5o6MDfiqWIhhaMHiDDrrM 7ClOTrsmNBICOJvrGcGlbuMqsd4X/xKXVsbJkccfK6niuYqA2HxMrwwJZ1ZgDme/Jov3 n6+tICrKftqDhE3rGCUIGu77i2w4bjqiR0cL9cyDN8Jf06LhQwUMflvn7s5FEOV9Ytti 7ZlJFxeR10OlSod6XIPTLQ5PxAS5dQlyJzkhAdZy7BStvczd5nYunnf+Pu/PjSFLr/oQ T+kaEyBcivm738hLm51mJdyMl+oRVUKp9kY98E8BI5HEIG3Yu+7e9dTM0cQB0dNbqe/Y pAwg== X-Gm-Message-State: AOJu0Yy6ja2wdGgPyX/wTmAYaBKmDqbj0nuBfxF/Y3Yk3Q0W0f7oDY+G 3g8DLLJD/F3/WdOhxGCzaVM9s4gkTPgiXDaAz3wwERsis/bNrM67vjOmtaRFo+jhVxziuSZQKq4 r X-Received: by 2002:adf:fe0d:0:b0:33e:96c1:3da6 with SMTP id n13-20020adffe0d000000b0033e96c13da6mr9902776wrr.65.1710863107848; Tue, 19 Mar 2024 08:45:07 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id v2-20020a5d59c2000000b0033e7503ce7esm6748445wry.46.2024.03.19.08.45.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , David Hildenbrand , Ilya Leoshkevich Subject: [PATCH-for-9.1 22/27] target/s390x: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:51 +0100 Message-ID: <20240319154258.71206-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Note, now s390x_get_cpu_state() is restricted to TCG. Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/cpu.h | 30 ------------------------------ target/s390x/s390x-internal.h | 2 ++ target/s390x/cpu.c | 1 + target/s390x/tcg/mem_helper.c | 2 +- target/s390x/tcg/translate.c | 23 +++++++++++++++++++++++ 5 files changed, 27 insertions(+), 31 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 2e184aabf5..c84ab43928 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -412,36 +412,6 @@ static inline int s390x_env_mmu_index(CPUS390XState *env, bool ifetch) #endif } -#ifdef CONFIG_TCG - -#include "tcg/tcg_s390x.h" - -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUS390XState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - if (env->psw.addr & 1) { - /* - * Instructions must be at even addresses. - * This needs to be checked before address translation. - */ - env->int_pgm_ilen = 2; /* see s390_cpu_tlb_fill() */ - tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0); - } - *pc = env->psw.addr; - *cs_base = env->ex_value; - *flags = (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; - if (env->cregs[0] & CR0_AFP) { - *flags |= FLAG_MASK_AFP; - } - if (env->cregs[0] & CR0_VECTOR) { - *flags |= FLAG_MASK_VECTOR; - } -} - -#endif /* CONFIG_TCG */ - /* PER bits from control register 9 */ #define PER_CR9_EVENT_BRANCH 0x80000000 #define PER_CR9_EVENT_IFETCH 0x40000000 diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 559c9f561d..f9796c2742 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -403,6 +403,8 @@ void s390x_translate_init(void); void s390x_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data); +void s390x_get_cpu_state(CPUS390XState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags); #endif /* CONFIG_TCG */ /* sigp.c */ diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index f7194534ae..afade52b76 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -327,6 +327,7 @@ static void s390_cpu_reset_full(DeviceState *dev) static const TCGCPUOps s390_tcg_ops = { .initialize = s390x_translate_init, .restore_state_to_opc = s390x_restore_state_to_opc, + .get_cpu_state = s390x_get_cpu_state, #ifdef CONFIG_USER_ONLY .record_sigsegv = s390_cpu_record_sigsegv, diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 557831def4..e1d0133439 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -2391,7 +2391,7 @@ uint64_t HELPER(lra)(CPUS390XState *env, uint64_t r1, uint64_t addr) it does not change the program counter. Perform this by recording the modified instruction in env->ex_value. - This will be noticed by cpu_get_tb_cpu_state and thus tb translation. + This will be noticed by s390x_get_cpu_state and thus tb translation. */ void HELPER(ex)(CPUS390XState *env, uint32_t ilen, uint64_t r1, uint64_t addr) { diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 0d0c672c95..bf8d00ecef 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -44,6 +44,7 @@ #include "exec/translator.h" #include "exec/log.h" #include "qemu/atomic128.h" +#include "tcg_s390x.h" #define HELPER_H "helper.h" #include "exec/helper-info.c.inc" @@ -6569,3 +6570,25 @@ void s390x_restore_state_to_opc(CPUState *cs, /* Record ILEN. */ env->int_pgm_ilen = data[2]; } + +void s390x_get_cpu_state(CPUS390XState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + if (env->psw.addr & 1) { + /* + * Instructions must be at even addresses. + * This needs to be checked before address translation. + */ + env->int_pgm_ilen = 2; /* see s390_cpu_tlb_fill() */ + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0); + } + *pc = env->psw.addr; + *cs_base = env->ex_value; + *flags = (env->psw.mask >> FLAG_MASK_PSW_SHIFT) & FLAG_MASK_PSW; + if (env->cregs[0] & CR0_AFP) { + *flags |= FLAG_MASK_AFP; + } + if (env->cregs[0] & CR0_VECTOR) { + *flags |= FLAG_MASK_VECTOR; + } +} From patchwork Tue Mar 19 15:42:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781122 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996970wrs; Tue, 19 Mar 2024 08:47:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXwJ6uDqWLUpAR/1lT10ePmZi4cTgrzuEPZ6Vx8jbYeFPTp/kNbBo7xo2KQiWHNGcxXfZgZVE9ODSRar5xCEpIP X-Google-Smtp-Source: AGHT+IERD/KOlloOPE+py584sCw+21d9qLMlAausiDVaTkcRTIVqtBzDZMtF+xmG4ilkK4BMil0T X-Received: by 2002:ac8:5fd3:0:b0:430:ef95:4927 with SMTP id k19-20020ac85fd3000000b00430ef954927mr1407392qta.2.1710863276228; Tue, 19 Mar 2024 08:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863276; cv=none; d=google.com; s=arc-20160816; b=aYV4BVJ9QZZ+nQkXcH+WLk1ARQQxvcQ8PXLhZQmuXpOOmVOcbmr82ngP3YXFY1Ow6O MPOe37BkvxRfe6cOUZuVA4Nc0KZWR/BrD+aLKD1NLRboQTjhZ/JVDqw4/40Gqn96qLic 2HXR+3Wp4gvjIBKGaYfdBHwgpYpjh/bolvn1OUOrBpWrKEfPfuumtoaRWSewlgyK0SxV 5uGeHmi8LCLoaZemF82Y/trait7EPMCMCbm65TY+51FBpOrT4qegf3lLBWN6Kb9vxjg5 OJES4Ov3QYj6IwvsbbKl/GWBAfPO9p8FSeXIz9x+c1EWiq5mCLwEGIuf2OJNUObnJQKV +64A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UywTiyuwpzYSJP7ec90xP7SAWTKz8NCufjjlUtL7sy8=; fh=UJGwpiD1w94kNq3h6+bjqd48VbgrymaKe6Q+Ls6ZRFA=; b=Wm535cCn3QSxtG0DtrO4RXiclJYslUl5gm9j1OvSaq4iVyf6g/cOXBjaLzrd95nucV PsBG4qe+27dn8pRCpmjKkgJYAcxwVkz3Dt/UBD/D2y5radgeu+PgYG416B+Tzm+53Bat 1L9frHaHDUrAlxy2ZZ9Gyhqdo0/bsLE8ZmDT34vT2hoQLziV5CX7CTK0rZoFRp+3Ufe7 TDvHVnz8H8pZYB5xeDDO6rb6sTqPRu8+BNYANCXNggapI7AtuFf5GrUNcjIAlBCKKvSJ z0BdG6eH5ZqEFdyDym/PED7x7xYfkW5HxAbdQR2x9CsGavOrI5g/NhihIqPOEzW34lRP MEYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VhvMKZ00; 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 l13-20020a05622a050d00b0042ef8934be4si11389959qtx.339.2024.03.19.08.47.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:47:56 -0700 (PDT) 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=VhvMKZ00; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbf1-0002OO-90; Tue, 19 Mar 2024 11:45:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbeT-0001UJ-Hr for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:22 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbeN-0005gh-Ex for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:21 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3417a3151c4so1615948f8f.3 for ; Tue, 19 Mar 2024 08:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863113; x=1711467913; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UywTiyuwpzYSJP7ec90xP7SAWTKz8NCufjjlUtL7sy8=; b=VhvMKZ00oWQCsZlXDW+CDjJhc+7HBvAAuL6u++pQTXOZS25GtXqAHUNqbv3W2yGeaH 8a5299KXs/HOHHuCh9xkuffcmnIP+jTfFQm2SxygBezDnvohumbyBbASnRzIa4dZ6GRv 23zDdDyRAurinokrGNwRTY+mqimy2BLhn2x2Sf5XAzUsO/r9PyTGyKBQb+iIPIxcORx7 iqBS1icQtaL3gA3AH2j/0+lyyFtqBOzNfs5SEHM9IgkUBgL+EEdgGg9ygcMkQzcqKOy3 YHA8T8JC5Es5TdjBI9FVYbpKwyiVAzYCR8DVk53ZwhqWKLr08HHrBWOOLYb48aRGbrtZ DqhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863113; x=1711467913; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UywTiyuwpzYSJP7ec90xP7SAWTKz8NCufjjlUtL7sy8=; b=E3hG9DxPqruKzLJtg4hpz8qKvwzzpn9kJgh+/HPSDznd/LhOSj+hRBnRul7LRGqWZn KItKXKeaKj+FJH+9l6z9vV7SU29BaJguIewekgW1LeALjJe8p0vSrcZ0yy0/wGvwpm4n WUJ1+NK/M3/MLyMTuc9s4vALUKrvICUloDTiq5LIvavuaXngFKle2X6URznMba4IcQyT tkTURPCEYKqky2Kuqu69UnZ4JyVoagtEDEhfELFQJXV+n2P3bKF3bjqkTapVCZIXHgh9 5ntZ859Rh8tbf8bwgLte6JwhATfobpWg5Ox/qepVc3tbScsl5joRYUOsUvRaX2CWKeav l/Mg== X-Gm-Message-State: AOJu0YyCsVgBEcTyyN4uRU+CBsA457pN/G2ie+Kzy1RvN21l/XwsPa/0 A2FUerh9kMocFsVRjWFRHwwOtqsc2TTyJaXdhQekzDuFopg4Ct5clSacrbhgaFt3z7jg0djibhy t X-Received: by 2002:adf:f3c2:0:b0:33e:bb67:9596 with SMTP id g2-20020adff3c2000000b0033ebb679596mr11018901wrp.64.1710863113462; Tue, 19 Mar 2024 08:45:13 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id o9-20020adfe809000000b0033ec6ebf878sm12573736wrm.93.2024.03.19.08.45.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yoshinori Sato Subject: [PATCH-for-9.1 23/27] target/sh4: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:52 +0100 Message-ID: <20240319154258.71206-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/sh4/cpu.h | 15 --------------- target/sh4/cpu.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 9211da6bde..36aff035cf 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -370,19 +370,4 @@ static inline void cpu_write_sr(CPUSH4State *env, target_ulong sr) env->sr = sr & ~((1u << SR_M) | (1u << SR_Q) | (1u << SR_T)); } -static inline void cpu_get_tb_cpu_state(CPUSH4State *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - /* For a gUSA region, notice the end of the region. */ - *cs_base = env->flags & TB_FLAG_GUSA_MASK ? env->gregs[0] : 0; - *flags = env->flags - | (env->fpscr & TB_FLAG_FPSCR_MASK) - | (env->sr & TB_FLAG_SR_MASK) - | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 3 */ -#ifdef CONFIG_USER_ONLY - *flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; -#endif -} - #endif /* SH4_CPU_H */ diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 4f5a4a3d98..9b2b377e29 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -67,6 +67,21 @@ static void superh_restore_state_to_opc(CPUState *cs, */ } +static void sh4_get_cpu_state(CPUSH4State *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + /* For a gUSA region, notice the end of the region. */ + *cs_base = env->flags & TB_FLAG_GUSA_MASK ? env->gregs[0] : 0; + *flags = env->flags + | (env->fpscr & TB_FLAG_FPSCR_MASK) + | (env->sr & TB_FLAG_SR_MASK) + | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 3 */ +#ifdef CONFIG_USER_ONLY + *flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; +#endif +} + #ifndef CONFIG_USER_ONLY static bool superh_io_recompile_replay_branch(CPUState *cs, const TranslationBlock *tb) @@ -250,6 +265,7 @@ static const TCGCPUOps superh_tcg_ops = { .initialize = sh4_translate_init, .synchronize_from_tb = superh_cpu_synchronize_from_tb, .restore_state_to_opc = superh_restore_state_to_opc, + .get_cpu_state = sh4_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = superh_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781121 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996956wrs; Tue, 19 Mar 2024 08:47:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV7Iqc2pMxGGNIhVriignf/UoLhS5EpuhS4WrRsQ1mXenz/4KDw5zLKh6E55A+brbAbNt1sphr9fqANexIh2r1X X-Google-Smtp-Source: AGHT+IE5SiW91TDWB/9uXVTr2sxApYc0WefxZnQVQZHd28o/r/6MOG1snMsf1SqgcGeCzdO+y0hX X-Received: by 2002:a05:622a:249:b0:430:b2ea:5d46 with SMTP id c9-20020a05622a024900b00430b2ea5d46mr14587418qtx.33.1710863274433; Tue, 19 Mar 2024 08:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863274; cv=none; d=google.com; s=arc-20160816; b=kZ0baFc2Az6MxJ6wx6inFvCLs/7HAWQYtE0LYvgXfKKHzf553bnHg/rH+q9zmG/qCr Wk3w3QXQI+LSapdgCalAlY4OH8QyEMgucZq/AI7Mm7PXTOVDsdIQwTJvVhxapUr/Boke PtkCRskUc7kNDD+2ID08efDNiQ3RTVX2VsEAXSSRk1qRz/ThQFOW1nrm4OZY2/P921PQ CqZhwRmrGzKNruJkeN+VEe6ks8LTUz/V28EyokU/GsHxFgK/bkNzOGfIMN37KCsYWPPr v+MC1ZeviscBH1NciekQ5jO3tW/uCYGmqRR8XqpZjs6Ayt0rc36+ObCDWHP4mylWhAJa Klfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7zdeoZffxwGI3lRqW4pFFxiIsmjJu49dy/PfqA3+ths=; fh=Nd50U15WaFI96vo8sDmVrEASGt1rYf6wbZgEvR5Cwvk=; b=09gd658HoyVYlnkx/v7qQqNp4MboYhDTOr1wILmH3ZKoXhzpbofwpM7E50XRzwGrJa cq3iNBYqkHRbP+KTkfEGTm1kJeGVNOFFkoMAgxOR28tzqRUYZjsG/RDh3N9QF79BtNhO RUp6iKNnq83THlYesxYDJWHFrtlCUer/DUoGhktgMq7vIZIqQKol/WdjV2RxWvl9HhTL LRJM/bH0/a3NE68gx5XYM8GN8L5ZnM8svwZTsivG/ixV2bh+bYQy5BWrKE5j7h9/FYX8 a3k2biLhJsT9sIvRiZidog8EPxkWNY0TT3v1GhZRc6fZwu1MlSFRMa6FJ31ySTsrWhf1 IqJQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vSFeQ9kB; 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 u17-20020a05622a199100b00430eed3b5eesi924608qtc.631.2024.03.19.08.47.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:47:54 -0700 (PDT) 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=vSFeQ9kB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbf1-0002P5-Br; Tue, 19 Mar 2024 11:45:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbeX-0001ZV-77 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:27 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbeT-0005kW-2v for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:24 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41464711dc8so6984055e9.1 for ; Tue, 19 Mar 2024 08:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863119; x=1711467919; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7zdeoZffxwGI3lRqW4pFFxiIsmjJu49dy/PfqA3+ths=; b=vSFeQ9kBr6PVLjq69j3dZpgXpl8vq0yfVi2Qo0Oj+uJojuLau5YGBshxuUiaUOVVZU M7k85BHGzbyUKjRcA4LBj9Es5N8LIig20aLhlS6Ijp04nzpliEec5Ox2kiJHqMiB7KPD mWzs2OhngfRGlC65NWlO7xthSSLDAlQzfu8hdCoTrE0plEhjtt+Rm6cd+owfYisFw34W gGwubuBdx4ZMc1X53qQ+2pkNI5lirHL6QEOD0G+A/1wgD2n3MdfF6C46An/2AEraxq5D KW1A9GQfUNBNOmBYQT28E4t1btq0xivfFzbdhcAw5pLS+Q3E/4RZzBhdE3wfUxuTujc6 nelg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863119; x=1711467919; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7zdeoZffxwGI3lRqW4pFFxiIsmjJu49dy/PfqA3+ths=; b=hJebn8q6MyboncdEhXXeIEjf8P8jsiWeni6oR2y9vd9OpeTHc9VAcSnQRwZhnMPg4z Csf7bLVbvBwJi2O8ebjEZQnZmp7qO304plztJoNNX1QECcNZWo0LLGzShf25hkdC2zTh k9GAb0FbO54G9u0ISeQCaDGLEPm4eFEs+PI0o/d/lAaZjMjHONUP4dkadO2936UECNEz IDMdS14G6HHe9yqatZuSC5xDg1uAxd65LsRMTbUzVUHXDfWKkAyf2yhHgQtIhQnP8IaH Emy9SqLHAfXZEIh6r8bOV6ihEf6nLjdQoAQ5/lfFlKX6RitpayjLxDHhEpSaKSdVRPsQ rGuQ== X-Gm-Message-State: AOJu0YwXwb10nmnB8LDI2Uq6flYSf5bMDVIDrH9ggPL0fjpsP8DFGiBb lQkNQJKKDNiQI3tJxq47wYVDK0DYobGUUsCwN1eFy8vBE2jUf+BK6RlceOVYnN/PT6hvD6FTPPl X X-Received: by 2002:a05:600c:524b:b0:413:f3f0:c591 with SMTP id fc11-20020a05600c524b00b00413f3f0c591mr2794850wmb.41.1710863119137; Tue, 19 Mar 2024 08:45:19 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id w16-20020adfcd10000000b0033e5c54d0d9sm12682641wrm.38.2024.03.19.08.45.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH-for-9.1 24/27] target/sparc: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:53 +0100 Message-ID: <20240319154258.71206-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.h | 37 ++----------------------------------- target/sparc/cpu.c | 1 + target/sparc/translate.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index ae55cd15a4..283c235222 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -614,6 +614,8 @@ void sparc_tcg_init(void); void sparc_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data); +void sparc_get_cpu_state(CPUSPARCState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags); /* fop_helper.c */ target_ulong cpu_get_fsr(CPUSPARCState *); @@ -747,41 +749,6 @@ trap_state* cpu_tsptr(CPUSPARCState* env); #define TB_FLAG_HYPER (1 << 7) #define TB_FLAG_ASI_SHIFT 24 -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags) -{ - uint32_t flags; - *pc = env->pc; - *cs_base = env->npc; - flags = cpu_mmu_index(env_cpu(env), false); -#ifndef CONFIG_USER_ONLY - if (cpu_supervisor_mode(env)) { - flags |= TB_FLAG_SUPER; - } -#endif -#ifdef TARGET_SPARC64 -#ifndef CONFIG_USER_ONLY - if (cpu_hypervisor_mode(env)) { - flags |= TB_FLAG_HYPER; - } -#endif - if (env->pstate & PS_AM) { - flags |= TB_FLAG_AM_ENABLED; - } - if ((env->pstate & PS_PEF) && (env->fprs & FPRS_FEF)) { - flags |= TB_FLAG_FPU_ENABLED; - } - flags |= env->asi << TB_FLAG_ASI_SHIFT; -#else - if (env->psref) { - flags |= TB_FLAG_FPU_ENABLED; - } -#endif - *pflags = flags; -} - static inline bool tb_fpu_enabled(int tb_flags) { #if defined(CONFIG_USER_ONLY) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index dc9ead21fc..b74a3f00b7 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -899,6 +899,7 @@ static const TCGCPUOps sparc_tcg_ops = { .initialize = sparc_tcg_init, .synchronize_from_tb = sparc_cpu_synchronize_from_tb, .restore_state_to_opc = sparc_restore_state_to_opc, + .get_cpu_state = sparc_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = sparc_cpu_tlb_fill, diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 319934d9bd..49958837b8 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5122,3 +5122,36 @@ void sparc_restore_state_to_opc(CPUState *cs, env->npc = npc; } } + +void sparc_get_cpu_state(CPUSPARCState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags) +{ + uint32_t flags; + *pc = env->pc; + *cs_base = env->npc; + flags = cpu_mmu_index(env_cpu(env), false); +#ifndef CONFIG_USER_ONLY + if (cpu_supervisor_mode(env)) { + flags |= TB_FLAG_SUPER; + } +#endif +#ifdef TARGET_SPARC64 +#ifndef CONFIG_USER_ONLY + if (cpu_hypervisor_mode(env)) { + flags |= TB_FLAG_HYPER; + } +#endif + if (env->pstate & PS_AM) { + flags |= TB_FLAG_AM_ENABLED; + } + if ((env->pstate & PS_PEF) && (env->fprs & FPRS_FEF)) { + flags |= TB_FLAG_FPU_ENABLED; + } + flags |= env->asi << TB_FLAG_ASI_SHIFT; +#else + if (env->psref) { + flags |= TB_FLAG_FPU_ENABLED; + } +#endif + *pflags = flags; +} From patchwork Tue Mar 19 15:42:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781123 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997026wrs; Tue, 19 Mar 2024 08:48:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWil5t7Bc0QxciKAB1nhutlf6wSzbbArJkB7As2XLeAJoYOZsgtHTuD0RFDkDjxcPfbWLnQgD22bCGAvbDHweXq X-Google-Smtp-Source: AGHT+IHHl2jJmYWSIwM3dACdjm2fk86tBdKaVSyWFZaR1ADBPes6EDRZoi2LH+mMt+k3RhDZGTqm X-Received: by 2002:a05:6808:2087:b0:3c3:6dc5:c1a1 with SMTP id s7-20020a056808208700b003c36dc5c1a1mr18665036oiw.41.1710863284945; Tue, 19 Mar 2024 08:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863284; cv=none; d=google.com; s=arc-20160816; b=Rra4v+LjoIQ5A39+/Zv1b8ZqNpJz+mLM2s1dMjFfIJj+vDnyKxYCbraeWaXHWUotIq mz9Niwb1NIXgrffsaedi+KpgrmfkxYEVqIiulzzKxp+9kFYRgp8LfbR31+hQplreGEgN F2g/eHjTXRERTHC3Vt/s1k/X6Cc5aJ9lrYxLGcwl+3mKEfk8gPreEr1y6hpQ4cQDgcDd I0F9K0h9vtXwOdUklH0g8CcddgcIJ1SjS5tJaPlftUSZWly/w6D45v+6kPmFnlNpJuGA W/J8d6N7VHXJU62FzHxfyICxaxFr8w5QxcOqK5FYdaZgjMP/jdIB+EiqzYplf7d+jRQx +yGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cuDVEU6xu2/Is+40NdFmTs6boTjeWsn71DRjetsl+yM=; fh=PnH/izz3MAsDSl6BnpnG4uXAuLuXCIaBKLWo6Q2UO7A=; b=GelytcqoAzWjx9s6D7HRcB3ffHNQfgdcNDz7YmPaoNEtB+jcZwsq6Q51LP+XJE1j9a LLKzhqPVuYLZYInCPtI/7Ei/QGLYQpkoVI6+Atngi+nMh5818x6v3GxGjx0k3xAWUwXs M7ACXaW2+i9iUN/RpVBOjIrRmzTYvFrKiOdaFgk6A3ShrdpVTRldQz6c4HbLTf4J5wER Fe0TFT9XhoTUGvn3ujjLEYk4PV08okR+9qy22zWLHrydfoFbcFAWv2Ltrvde3zEB/CSW DmxFzDiOBEzw9tlKeaKkfYy7k7OtRpFsk5bxe20ql/eTYC3OmyLQYyjfRsF+HLx883Qv RwvQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w4dAN8yZ; 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 fq2-20020a056214258200b0068ce5582563si11302785qvb.263.2024.03.19.08.48.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:48:04 -0700 (PDT) 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=w4dAN8yZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbf4-00030n-DD; Tue, 19 Mar 2024 11:45:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbed-0001mc-5q for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:32 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbea-0005qN-CY for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:30 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4146178270dso8472855e9.1 for ; Tue, 19 Mar 2024 08:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863124; x=1711467924; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cuDVEU6xu2/Is+40NdFmTs6boTjeWsn71DRjetsl+yM=; b=w4dAN8yZnbe9OQi8Q5jpt9VuXwPdpincDvfrUkJG2ny8jJnZ2CkyG7Mgfr0rf8rrMC ZwZlO2SIR8xwkf0EYV6k1/ZE36N4MyZiFmFeeKigce+rNyYaLok+1hReEuyukCNmTEjl YY2QYAdaRPwbQKjvnJuGm3RIQkZxkuPophsayJ787RA0HvNamuSE/piBxbSvIZ28MOaF 0sHm4mcMTYViEVWlgWjARkffUMSah01nqL9TLElfaPy1zzV+18R5WieJc18nq+ITuMuL rMVNePWAT0XUOqvhHvRH3LHnD0N5bTW6t6hKBHVNaSdz0HDZyAQ1gdG8+K2TmNLFvAsM 3ILg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863124; x=1711467924; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cuDVEU6xu2/Is+40NdFmTs6boTjeWsn71DRjetsl+yM=; b=NyTFemnQAziHwXISY31rVWaipCzTsHxNve+IVETv7LWcf/aKvdEAQhsRsN/GJAD309 He51cYxwKmcBaPDiY1Sn3LZwTc5mNX61D3y676NGgDqvXZAXRUbSH0YshZyTMrx+wXzM xM7nc3qtsv4R2GjWGLwZwnYDddefSrcD9//rl0uChhgcaqQ6kHR4LzZ4/o6THdADbvY7 o+V9titF5Qx1LdtAgBVBwWCLKSJdZbqcS8ZLVycm6Dn1EAtJSpJ4BLS2XpH1tfS+3DcW fCKJDlfz3M3LXL7QKG0mTNZHzEfvSiXVDYgus/BOqg2mTlPxLaCtCQlR6N97L1VkJxna 2ZsQ== X-Gm-Message-State: AOJu0Yzt4M81L6ze62PLYCZlkWdx/8i0wgFSsSeYP2OurO0unR8PJ3sJ k35VB+Tgcws6bjz+DERB7xxoH5mb48Mklihm51/uYWXmYXaW/6q/bO348KV6bKH2jH9Rcw+DTNJ t X-Received: by 2002:a05:600c:35ce:b0:414:5e9d:ad31 with SMTP id r14-20020a05600c35ce00b004145e9dad31mr2871529wmq.13.1710863124688; Tue, 19 Mar 2024 08:45:24 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id dw11-20020a0560000dcb00b0033b66c2d61esm12578388wrb.48.2024.03.19.08.45.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bastian Koppelmann Subject: [PATCH-for-9.1 25/27] target/tricore: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:54 +0100 Message-ID: <20240319154258.71206-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bastian Koppelmann --- target/tricore/cpu.h | 12 ------------ target/tricore/cpu.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 220af69fc2..9537fef2b9 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -253,18 +253,6 @@ FIELD(TB_FLAGS, PRIV, 0, 2) void cpu_state_reset(CPUTriCoreState *s); void tricore_tcg_init(void); -static inline void cpu_get_tb_cpu_state(CPUTriCoreState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - uint32_t new_flags = 0; - *pc = env->PC; - *cs_base = 0; - - new_flags |= FIELD_DP32(new_flags, TB_FLAGS, PRIV, - extract32(env->PSW, 10, 2)); - *flags = new_flags; -} - #define CPU_RESOLVING_TYPE TYPE_TRICORE_CPU /* helpers.c */ diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index a9af73aeb5..d6ac07a488 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -58,6 +58,18 @@ static void tricore_restore_state_to_opc(CPUState *cs, cpu_env(cs)->PC = data[0]; } +static void tricore_get_cpu_state(CPUTriCoreState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + uint32_t new_flags = 0; + *pc = env->PC; + *cs_base = 0; + + new_flags |= FIELD_DP32(new_flags, TB_FLAGS, PRIV, + extract32(env->PSW, 10, 2)); + *flags = new_flags; +} + static void tricore_cpu_reset_hold(Object *obj) { CPUState *cs = CPU(obj); @@ -168,6 +180,7 @@ static const TCGCPUOps tricore_tcg_ops = { .initialize = tricore_tcg_init, .synchronize_from_tb = tricore_cpu_synchronize_from_tb, .restore_state_to_opc = tricore_restore_state_to_opc, + .get_cpu_state = tricore_get_cpu_state, .tlb_fill = tricore_cpu_tlb_fill, }; From patchwork Tue Mar 19 15:42:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781128 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997923wrs; Tue, 19 Mar 2024 08:50:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVK24rPLjPFSiLruk76Ztct2nDT9QIwqrArv6b2SNEbzDDPipE1NcFUMGDh/b7OMDi7SZDcyx2Z0lg9GPuKEdZq X-Google-Smtp-Source: AGHT+IHalIcL4pnNtwQyRrJPTwKN6SMwNHc3We+x8el1itkuKXoJ88mU7yAYCwBIQ6Qa4bJiiNVl X-Received: by 2002:ad4:4351:0:b0:690:c337:826b with SMTP id q17-20020ad44351000000b00690c337826bmr5001535qvs.7.1710863422200; Tue, 19 Mar 2024 08:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863422; cv=none; d=google.com; s=arc-20160816; b=kNK633FUWI8oo6wYi7CtTerIkXmd8XSKpSzLRQcl9XsOawpFDf34zQV3N/P1JkT8Qp Q6Ni+folmFyKT2zY2seOHbQS/bsr1fpzpGyaMYjcRc5+8z40lEoan5UVe8sMKLMtaB+U /XhyTd9pHjAYcjYZ3Tmh3vFrPRCbWXe6BFQPoCwLIC+MA/P3A9eeZ2mtNLrxuy+n4PNM 1w9YZQBhBYD8P9Cn+X2rBJFEY919OxIfw1MFDSM9jJMMK/WE7OeVyI5r+kVcyZAZYmYi dkqAfGNnxF1ByuiNwl1kZfVGwuYu006VCEqWcwvk91/sO0T0YO4IdO1by3B0Jj8P5WaI HMHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zm2YX9dIHSMGPAJWuVZxhizkFvEayxvFDr7Y720qWo8=; fh=QISwjKDMVYNo/MBfzIqpuvRD87utE9o6m+Ee8Qs9B8A=; b=B6SA7ktNgN8Nmeq4X1dwVjMQRJ1hBmJvims7FnZ7G/HRW7D7Ru3lkigUCoBm8Q4euT MIu9z3yNiNcoVjioia0jJqmovxhJaUrzRY8kOJdM7D/CM5t9jWn8uf4VdxhkvomNB7jn D9+SzMslo4Lcz9a9TiXD0gtxL3qdIyyJKx1FBAkxPSgvpTTHM46N1rgRFETLfFL5UHCm 8Ryg8YMWcuIAJMgRksnMpxUhk6JYNNVdQ91ZZhR7TgAKyP+snWSmzFBQUbkb5ekeFRFU +h5Ki6yDc4p4WY8zRc6N45YoRIvZflKdzQ7sRuFCJCAvBKYsnZSdlDvqZEe2BqzvVSGG P48w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oCijfxYi; 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 iw7-20020a0562140f2700b006907928dc20si11374702qvb.550.2024.03.19.08.50.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:50:22 -0700 (PDT) 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=oCijfxYi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbf6-0003O5-Mp; Tue, 19 Mar 2024 11:46:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbeg-0001rh-6R for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:36 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbed-0005sd-VF for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:33 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33ff53528ceso1966974f8f.0 for ; Tue, 19 Mar 2024 08:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863130; x=1711467930; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zm2YX9dIHSMGPAJWuVZxhizkFvEayxvFDr7Y720qWo8=; b=oCijfxYib3UaiNFQgjrgmHEQNFvDPEuggVgfHkLFxvDFvBGYsojVLz0TDsqNZQHvWD iz45irMDhSuIYWcUnKAnVbpY9TXAUfBMp6n+8IiqHKkBkaShj0/TvE8oo2fGUVUb5yXa A881nAb0TbfIq9GOWcpE2QBUmobSX60X9oPnnqQbi7xUHhz6gxON1AZrCsF9JxgdFFdT EFky9fzaTR6HLyeSbaIyBOxAioFnIdp8gU8mbd1WXeB1CzxB4SAWS0md4XWpJEYA7pxo BJl9H0oroHe+6P92lwyRNcUXGLINAuZ5cXhuuAgmb2cpTrkEH3Z6G1B8Lp11phSG78Lm 1Xxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863130; x=1711467930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zm2YX9dIHSMGPAJWuVZxhizkFvEayxvFDr7Y720qWo8=; b=f6E1G0eZRp3T9GJQEzHydAc9rjUPr+sGgYmL9uWE6U423arf0yVOllFxJEHClXQGaT QMOWSqTtED4STddp6PxOp4qbju4zmRMp/zBczhKPwnzph3LPkGmX0Ln+iHtpyLqP6WBS XkuCejcBRB75SBDAk/p1DfRs+V0BUoM91Mr9G6VBGP7zBnsRVYPwUWpa5LgQhwa9MVfS 5ocPNe9bCHETeTXebBBCO1gNbdQkJKlFJqiI6x5zqRaCwNdEhzFJ5oUSlHih0K2XlK4P XAGwsuhRYp5XG6Fbuyxh7p6peNIVIzJjii1YMJkIIZjwA5DpbTTuY+5VhNgHH2C1SDSn KiOA== X-Gm-Message-State: AOJu0YxRpMSSF1cYHGcwcJ2Sf8E3W/gfNYRU24f0NLZb1PMrSB0V5el4 P62bVpGz980kwkuxiQy0X7K0VEiilug9sVyax4ixH+jCXsfzmZsdsxSf364k2tanQCpYnFewZBt h X-Received: by 2002:adf:fc8c:0:b0:33e:c7e3:b1bb with SMTP id g12-20020adffc8c000000b0033ec7e3b1bbmr9763043wrr.16.1710863130186; Tue, 19 Mar 2024 08:45:30 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id ba29-20020a0560001c1d00b0033ec8b3b3e4sm9758355wrb.79.2024.03.19.08.45.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Filippov Subject: [PATCH-for-9.1 26/27] target/xtensa: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:55 +0100 Message-ID: <20240319154258.71206-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/cpu.h | 70 --------------------------------------------- target/xtensa/cpu.c | 69 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 70 deletions(-) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 3826b779e4..2b6f2bdea7 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -734,76 +734,6 @@ static inline uint32_t xtensa_replicate_windowstart(CPUXtensaState *env) #include "exec/cpu-all.h" -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - *cs_base = 0; - *flags = 0; - *flags |= xtensa_get_ring(env); - if (env->sregs[PS] & PS_EXCM) { - *flags |= XTENSA_TBFLAG_EXCM; - } else if (xtensa_option_enabled(env->config, XTENSA_OPTION_LOOP)) { - target_ulong lend_dist = - env->sregs[LEND] - (env->pc & -(1u << TARGET_PAGE_BITS)); - - /* - * 0 in the csbase_lend field means that there may not be a loopback - * for any instruction that starts inside this page. Any other value - * means that an instruction that ends at this offset from the page - * start may loop back and will need loopback code to be generated. - * - * lend_dist is 0 when LEND points to the start of the page, but - * no instruction that starts inside this page may end at offset 0, - * so it's still correct. - * - * When an instruction ends at a page boundary it may only start in - * the previous page. lend_dist will be encoded as TARGET_PAGE_SIZE - * for the TB that contains this instruction. - */ - if (lend_dist < (1u << TARGET_PAGE_BITS) + env->config->max_insn_size) { - target_ulong lbeg_off = env->sregs[LEND] - env->sregs[LBEG]; - - *cs_base = lend_dist; - if (lbeg_off < 256) { - *cs_base |= lbeg_off << XTENSA_CSBASE_LBEG_OFF_SHIFT; - } - } - } - if (xtensa_option_enabled(env->config, XTENSA_OPTION_EXTENDED_L32R) && - (env->sregs[LITBASE] & 1)) { - *flags |= XTENSA_TBFLAG_LITBASE; - } - if (xtensa_option_enabled(env->config, XTENSA_OPTION_DEBUG)) { - if (xtensa_get_cintlevel(env) < env->config->debug_level) { - *flags |= XTENSA_TBFLAG_DEBUG; - } - if (xtensa_get_cintlevel(env) < env->sregs[ICOUNTLEVEL]) { - *flags |= XTENSA_TBFLAG_ICOUNT; - } - } - if (xtensa_option_enabled(env->config, XTENSA_OPTION_COPROCESSOR)) { - *flags |= env->sregs[CPENABLE] << XTENSA_TBFLAG_CPENABLE_SHIFT; - } - if (xtensa_option_enabled(env->config, XTENSA_OPTION_WINDOWED_REGISTER) && - (env->sregs[PS] & (PS_WOE | PS_EXCM)) == PS_WOE) { - uint32_t windowstart = xtensa_replicate_windowstart(env) >> - (env->sregs[WINDOW_BASE] + 1); - uint32_t w = ctz32(windowstart | 0x8); - - *flags |= (w << XTENSA_TBFLAG_WINDOW_SHIFT) | XTENSA_TBFLAG_CWOE; - *flags |= extract32(env->sregs[PS], PS_CALLINC_SHIFT, - PS_CALLINC_LEN) << XTENSA_TBFLAG_CALLINC_SHIFT; - } else { - *flags |= 3 << XTENSA_TBFLAG_WINDOW_SHIFT; - } - if (env->yield_needed) { - *flags |= XTENSA_TBFLAG_YIELD; - } -} - XtensaCPU *xtensa_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk); diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 875cf843c9..35c66432a1 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -63,6 +63,74 @@ static void xtensa_restore_state_to_opc(CPUState *cs, cpu->env.pc = data[0]; } +static void xtensa_get_cpu_state(CPUXtensaState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + *cs_base = 0; + *flags = 0; + *flags |= xtensa_get_ring(env); + if (env->sregs[PS] & PS_EXCM) { + *flags |= XTENSA_TBFLAG_EXCM; + } else if (xtensa_option_enabled(env->config, XTENSA_OPTION_LOOP)) { + target_ulong lend_dist = + env->sregs[LEND] - (env->pc & -(1u << TARGET_PAGE_BITS)); + + /* + * 0 in the csbase_lend field means that there may not be a loopback + * for any instruction that starts inside this page. Any other value + * means that an instruction that ends at this offset from the page + * start may loop back and will need loopback code to be generated. + * + * lend_dist is 0 when LEND points to the start of the page, but + * no instruction that starts inside this page may end at offset 0, + * so it's still correct. + * + * When an instruction ends at a page boundary it may only start in + * the previous page. lend_dist will be encoded as TARGET_PAGE_SIZE + * for the TB that contains this instruction. + */ + if (lend_dist < (1u << TARGET_PAGE_BITS) + env->config->max_insn_size) { + target_ulong lbeg_off = env->sregs[LEND] - env->sregs[LBEG]; + + *cs_base = lend_dist; + if (lbeg_off < 256) { + *cs_base |= lbeg_off << XTENSA_CSBASE_LBEG_OFF_SHIFT; + } + } + } + if (xtensa_option_enabled(env->config, XTENSA_OPTION_EXTENDED_L32R) && + (env->sregs[LITBASE] & 1)) { + *flags |= XTENSA_TBFLAG_LITBASE; + } + if (xtensa_option_enabled(env->config, XTENSA_OPTION_DEBUG)) { + if (xtensa_get_cintlevel(env) < env->config->debug_level) { + *flags |= XTENSA_TBFLAG_DEBUG; + } + if (xtensa_get_cintlevel(env) < env->sregs[ICOUNTLEVEL]) { + *flags |= XTENSA_TBFLAG_ICOUNT; + } + } + if (xtensa_option_enabled(env->config, XTENSA_OPTION_COPROCESSOR)) { + *flags |= env->sregs[CPENABLE] << XTENSA_TBFLAG_CPENABLE_SHIFT; + } + if (xtensa_option_enabled(env->config, XTENSA_OPTION_WINDOWED_REGISTER) && + (env->sregs[PS] & (PS_WOE | PS_EXCM)) == PS_WOE) { + uint32_t windowstart = xtensa_replicate_windowstart(env) >> + (env->sregs[WINDOW_BASE] + 1); + uint32_t w = ctz32(windowstart | 0x8); + + *flags |= (w << XTENSA_TBFLAG_WINDOW_SHIFT) | XTENSA_TBFLAG_CWOE; + *flags |= extract32(env->sregs[PS], PS_CALLINC_SHIFT, + PS_CALLINC_LEN) << XTENSA_TBFLAG_CALLINC_SHIFT; + } else { + *flags |= 3 << XTENSA_TBFLAG_WINDOW_SHIFT; + } + if (env->yield_needed) { + *flags |= XTENSA_TBFLAG_YIELD; + } +} + static bool xtensa_cpu_has_work(CPUState *cs) { #ifndef CONFIG_USER_ONLY @@ -230,6 +298,7 @@ static const TCGCPUOps xtensa_tcg_ops = { .initialize = xtensa_translate_init, .debug_excp_handler = xtensa_breakpoint_handler, .restore_state_to_opc = xtensa_restore_state_to_opc, + .get_cpu_state = xtensa_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = xtensa_cpu_tlb_fill, From patchwork Tue Mar 19 15:42:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781119 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996879wrs; Tue, 19 Mar 2024 08:47:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWKPqCuqZBkCUJtbomXNUs5OtZ/bJUO83CMh4vczVN9gAaXbgg6g/NgwP43JjAxGBBDNFRfOvivHW1pX7R07DeX X-Google-Smtp-Source: AGHT+IFa7tpjh/9h3jfpwYJCA+dWToynyUJiUdY9dE0cNpaSP69i31EdY71pwm0PxVo7Vhnbe4sM X-Received: by 2002:a05:6214:3012:b0:68f:62d6:70c with SMTP id ke18-20020a056214301200b0068f62d6070cmr4245644qvb.19.1710863262394; Tue, 19 Mar 2024 08:47:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863262; cv=none; d=google.com; s=arc-20160816; b=ksXpVX/RKd531zXCiD3Go0CrTUzgjimtrOXkkMXZTgGYUyLTYLoD8mSgFZyCQpXkv9 5UAJCDHVaH1f65BSMHCVmKhGlPDiIRWaz8KkITImRq9fBbmaCxrX+C+D/jPtON3YNN8p us5tzu3KRBneSH67pSKFzwn0HuGiEXAN0wxKJa0wt5/O92gfmy12lb9PGEUvqcpw9SB6 jrCk+LvdpMiugmSDZXH1fJAOH7aJSFZdMgoQWHf1R2AcssQbzHDOstPL1LWWTKEgkTJD LWdXt1uZ7flsMPuZ3vUtKN5qtPDJ9WhPWg6/A/E+TemIhTaxJL9PVGOD1V1rvgf77Dk7 5INw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KePNgRmbU+28xR9UGCx3m+xL9JDUZJvD83MlZjBrjtE=; fh=NuPLMlVFc4cfvp2Oa5z7LIdyagRbnbQ6Uh9klhOYydE=; b=Mc8zgIKu4XqBZYpW/cpWoXzJvWQkGwZnzZ/1orgEZuvOeF40xsPrunEj6x9eg2j1mv zwAH6Lsg7aLYokZeK1rlSXRiJwMl+ZMXEj3/UVYt+A8ujO9PFoy64xihIIzF4/jEe0dl qdTH/CCJhYP3MVHs493h+Mbkz/ig0LFYuFDxGHt8g6Z1A2URrxSiTpiamN05xWghSeSC i3yRDRsum8RTjTqUt4Httf4FeLmSGoTfEAgXJKgclNdTJSdfaSPgRl9thh83CmDOaCou 2oScBwZnMbBfOOi1W0gw1K/u5JDEarnZULCo7LhEWu8n+hrMMPlACblNJ3vBG41JBmRa Mnxw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PrWe3goK; 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 ke26-20020a056214301a00b0068d1501ebb9si10814075qvb.458.2024.03.19.08.47.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:47:42 -0700 (PDT) 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=PrWe3goK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbf8-0003fL-K5; Tue, 19 Mar 2024 11:46:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbeo-0001wb-2r for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:43 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbel-0005ts-J6 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:41 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4146703fd2dso4786575e9.1 for ; Tue, 19 Mar 2024 08:45:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863136; x=1711467936; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KePNgRmbU+28xR9UGCx3m+xL9JDUZJvD83MlZjBrjtE=; b=PrWe3goKr8GYfnaMoJ7LIs6DCUpeuT0k81FxkSXqMLUR8MzdMj+v1wkN+pWMm7kKkM wsckU+w+ehnecroXFmw7KzgzHNzEKh+QNPjYcc/8aONBFp+Tbx8J2IHVys814YfwReQv Qw3sBYbWMrvAWOoPnxdISp3SUCZvFWlRVJ3nIRlBC1/4SiZ4JGKAjRtnPcNiJ+esDwLj HiIqxbGJW/YLx6sA4sCN5jrFfMYKgpeFK5bHZfHh00f/U2/GfuGiLVFYlLGfkaBojIED lQxsdlko3tjajMo6db3Jzb8DxfaNa+T1p5kofw6NEzhYWUqYGKjgPKnhbg7a1B3rFbeo y+lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863136; x=1711467936; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KePNgRmbU+28xR9UGCx3m+xL9JDUZJvD83MlZjBrjtE=; b=PPLwV81XXGu9JyUq/f13/caxIiCSVpUl+a4S8NNwWAgXO6427eumxRg158G9vq7JLt 9TSNzydtU3seBu5y1MeIogjEhwiu9qwYfKJrA12ZVdGeUYzzdGl3T+EN/LIbgi57zRn1 wsGfLm/GMCFDVLjVMlTG5bSnrBFSJAQfFupfibMqvcFT7zmzPLsQg2Hi6GOGtZn02RCQ DnRkI4XZ6aNcmFe8lZzNL68V0AkWaR1M+vkBrzvtfXweJ/Qgr8D7Rr9Pg5k2099QUDWf lR4a5Uc9B4OOmLAjXcESMcWos3XwGl/ELzwa9kb81QBYW5IkN+AFVDgIKhyfFX35rFkd nwxA== X-Gm-Message-State: AOJu0YzgjhAvVCQ48EEYEpJECmua/E21W/y+J+JQyhlsNbBrbqJ8jEDo iMYzdb38t82eLCWDyLW/WDWazzdByAOC16Efzl2klYORFD3jgN5+oRoum4pqrFl5V92m/dpnfdb 3 X-Received: by 2002:a1c:4b17:0:b0:414:3c57:fae5 with SMTP id y23-20020a1c4b17000000b004143c57fae5mr2383201wma.38.1710863135815; Tue, 19 Mar 2024 08:45:35 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id n20-20020a05600c501400b00414112a6159sm6723678wmr.44.2024.03.19.08.45.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PATCH-for-9.1 27/27] accel/tcg: Remove check on TARGET_HAS_CPU_GET_TB_CPU_STATE Date: Tue, 19 Mar 2024 16:42:56 +0100 Message-ID: <20240319154258.71206-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org All targets have been converted to TCGCPUOps::get_cpu_state(), there is no more use of TARGET_HAS_CPU_GET_TB_CPU_STATE in the tree. Remove the check on TARGET_HAS_CPU_GET_TB_CPU_STATE, but add an assertion in tcg_exec_realizefn() so new target won't miss to implement this handler. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 1 + accel/tcg/translate-all.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 987e6164f7..6167bd3159 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1072,6 +1072,7 @@ bool tcg_exec_realizefn(CPUState *cpu, Error **errp) const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; assert(tcg_ops->restore_state_to_opc); + assert(tcg_ops->get_cpu_state); tcg_ops->initialize(); tcg_target_initialized = true; } diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 7b538d2b9c..3c9fafba69 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -221,7 +221,6 @@ void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, cpu->cc->tcg_ops->restore_state_to_opc(cpu, tb, data); } -#ifndef TARGET_HAS_CPU_GET_TB_CPU_STATE void cpu_get_tb_cpu_state(CPUArchState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { @@ -229,7 +228,6 @@ void cpu_get_tb_cpu_state(CPUArchState *env, vaddr *pc, cpu->cc->tcg_ops->get_cpu_state(env, pc, cs_base, flags); } -#endif bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc) {