From patchwork Mon Feb 11 17:01:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158016 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2859113jaa; Mon, 11 Feb 2019 09:26:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IbUNQcBkdEoLe0UzMHPezWHYf9KVXuCbvGmP+ywrBYucLO1ysqnNaWFyju0xErRXVa+tWpF X-Received: by 2002:a25:b78d:: with SMTP id n13mr28147783ybh.423.1549905998383; Mon, 11 Feb 2019 09:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549905998; cv=none; d=google.com; s=arc-20160816; b=d/EoypmzAXa72tefI0HOafCNVfptiemUy0lXRyXBEPeVHIYohY74tJRn7JtGyS2XOt UVkHiCIe4v1HjXwXW+mxCuMPT4R/Z2bq4/KXbeT//tQUUE5FOMoF1bWMY7zC/LMiZDxW ffY8yvvowJhy01Lc5r/GOvJ1uTza0D3BtYogKbILjKXrmYo1Q5u2cEvOSgnF/xjiSyMa QA8dWl0tYqzODkeOwyV78IRwkk5IRmeXYG5toKzomK3vnMZ3Zvxb7yJiNjc30GPTzWR8 o4HFpD8UXZV3/RwdxFN36Rb3hBg/sCFIsZkGtg0+5e46XHhXJ1oxS+p2IVm8+8H5URpm 4Xmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=zs4D8H0jbWCZWQGKUauE35wZw5DaF/qNy92CTv/x36A=; b=ulmiqdoePOxJpQ3dTkulpHSwa7BSGssmF9CEczdR9vDAOQ6scuOjow+MEmSEZK/AQ+ AnsFSNgmZhe9+9tB1oksKST+eJmR9tUoKUYZmyrVXqyOZwrVpP8ETBx72U0YOUjzKp9e 0c8f6Yo04AmuMUel76A8iFWorFaJP4SVdaF00GnH2X9uQraud9MAVwqWiSuA4tBMhF6E 0fC9p+S4Q5hs/75/o2IOB0ORNpvF30bojX8SW5kwmntDhfeFh0ZoOzxQ52meram3kK7j 9U6T3gektPAZAHCXqTuxauufgK601WsL+6Cv60gRw7pCocLm8ydb0x68ln+uchRRGLjS bFgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E1jTql9S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c184si6570529ywe.156.2019.02.11.09.26.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 09:26:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E1jTql9S; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:53536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtFLp-0003Zf-Rg for patch@linaro.org; Mon, 11 Feb 2019 12:26:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtF9E-00020I-Rx for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:13:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtExk-0000tk-8o for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:01:47 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:43702) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtExi-0000s1-AA for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:01:42 -0500 Received: by mail-pl1-x62d.google.com with SMTP id f90so5336280plb.10 for ; Mon, 11 Feb 2019 09:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zs4D8H0jbWCZWQGKUauE35wZw5DaF/qNy92CTv/x36A=; b=E1jTql9S7GPIKpZgiAzjVtETqgGYiHsRCStKUTe2PojTYLztJHxTdlw6qMa+HnWIby Bb30Qxd5nZTAYIv2YT5P+8qEMdVMO3ZhEkprquFERkGYZDLnIdhQ3sD4O1/ZGvtxsnX5 +DkTHONqVdocfRrkE+RpVXr6AjqluDXx60yYh93HcEMhPBKVx9RhuCRxHB7OTh39A54a GZLCNszgXC7fF9m5YSrUhbSIjcd2ZeArRCrbH5Es/OrLCnxqOkulYLs6GvBpxzyUgjlZ zHWZQ8Az8nr9oI34BWTj4M9WpcM8eahNnSJXSOCPZgFj4YcKja0ykh10xr9+XN5S3tRG 75Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zs4D8H0jbWCZWQGKUauE35wZw5DaF/qNy92CTv/x36A=; b=skgNllvebl74QbPBdYrmk44C8zwqI6huimXd+ANd4mw717P+wURQ+Ys3jDsevgERfA oyn0BI1ABx4OG++DEYD0R2Irhb4bXSmPB/903jZgyFfPx1mIslFzIO8tHs5nhLXZ+7wQ 300q0e6v6YCVVeI36E8TbZTA/PQcGTlFjsgwnBSeHe/QCL3qErwwslf6/Vv3WQLn4kwN Onrf7DM9Sn2j0Pl0vdQ2vyVI+u/25MIVikVuaLsAysVW8zMZAk+6Dc8TCWcM31+HfDMz 0m35enjdIsx91OsKTdYMS5y+bbba1C+aHB3nKlEYSyrxFu6fOOBvwGD4brQ7ANsHKB+H 1hjA== X-Gm-Message-State: AHQUAua6ABAHnAxaa65b4WH0WCWgAYHpPvbfjqFP5EybC0Vy5nVzym7U KS4+ZwTdh/cqC5HCD5/5GwT6+Dm2VIY= X-Received: by 2002:a17:902:8d8e:: with SMTP id v14mr38197755plo.133.1549904500542; Mon, 11 Feb 2019 09:01:40 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id b24sm15712567pfe.136.2019.02.11.09.01.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 09:01:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 09:01:33 -0800 Message-Id: <20190211170136.18680-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211170136.18680-1-richard.henderson@linaro.org> References: <20190211170136.18680-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62d Subject: [Qemu-devel] [PULL 1/4] tcg: Diagnose referenced labels that have not been emitted X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently, a jump to a label that is not defined anywhere will be emitted not be relocated. This results in a jump to a random jump target. With tcg debugging, print a diagnostic to the -d op file and abort. This could help debug or detect errors like c2d9644e6d ("target/arm: Fix crash on conditional instruction in an IT block") Reported-by: Roman Kapl Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg-op.h | 1 + tcg/tcg.h | 12 +++++++++--- tcg/tcg.c | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) -- 2.17.2 diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index 2d98868d8f..d3e51b15af 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -255,6 +255,7 @@ static inline void tcg_gen_op6ii_i64(TCGOpcode opc, TCGv_i64 a1, TCGv_i64 a2, static inline void gen_set_label(TCGLabel *l) { + l->present = 1; tcg_gen_op1(INDEX_op_set_label, label_arg(l)); } diff --git a/tcg/tcg.h b/tcg/tcg.h index 045c24a357..32b7cf3489 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -244,16 +244,21 @@ typedef struct TCGRelocation { intptr_t addend; } TCGRelocation; -typedef struct TCGLabel { +typedef struct TCGLabel TCGLabel; +struct TCGLabel { + unsigned present : 1; unsigned has_value : 1; - unsigned id : 15; + unsigned id : 14; unsigned refs : 16; union { uintptr_t value; tcg_insn_unit *value_ptr; TCGRelocation *first_reloc; } u; -} TCGLabel; +#ifdef CONFIG_DEBUG_TCG + QSIMPLEQ_ENTRY(TCGLabel) next; +#endif +}; typedef struct TCGPool { struct TCGPool *next; @@ -685,6 +690,7 @@ struct TCGContext { #endif #ifdef CONFIG_DEBUG_TCG + QSIMPLEQ_HEAD(, TCGLabel) labels; int temps_in_use; int goto_tb_issue_mask; #endif diff --git a/tcg/tcg.c b/tcg/tcg.c index 20a5d8f315..9b2bf7f439 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -305,6 +305,9 @@ TCGLabel *gen_new_label(void) *l = (TCGLabel){ .id = s->nb_labels++ }; +#ifdef CONFIG_DEBUG_TCG + QSIMPLEQ_INSERT_TAIL(&s->labels, l, next); +#endif return l; } @@ -1092,6 +1095,9 @@ void tcg_func_start(TCGContext *s) QTAILQ_INIT(&s->ops); QTAILQ_INIT(&s->free_ops); +#ifdef CONFIG_DEBUG_TCG + QSIMPLEQ_INIT(&s->labels); +#endif } static inline TCGTemp *tcg_temp_alloc(TCGContext *s) @@ -3841,6 +3847,23 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) } #endif +#ifdef CONFIG_DEBUG_TCG + /* Ensure all labels referenced have been emitted. */ + { + TCGLabel *l; + bool error = false; + + QSIMPLEQ_FOREACH(l, &s->labels, next) { + if (unlikely(!l->present) && l->refs) { + qemu_log_mask(CPU_LOG_TB_OP, + "$L%d referenced but not present.\n", l->id); + error = true; + } + } + assert(!error); + } +#endif + #ifdef CONFIG_PROFILER atomic_set(&prof->opt_time, prof->opt_time - profile_getclock()); #endif From patchwork Mon Feb 11 17:01:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158012 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2849180jaa; Mon, 11 Feb 2019 09:16:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZrzDMCyDD4O1WU1If7m4lQRTW2fiUP8DQRTCNyERhTAzBxCYzSBrxKD0Rz64aPzETUg3pG X-Received: by 2002:a81:3d08:: with SMTP id k8mr29713787ywa.239.1549905397896; Mon, 11 Feb 2019 09:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549905397; cv=none; d=google.com; s=arc-20160816; b=KmFl7Ehp9H/lrU8/5Sh9/utV88OZmj8W6uQSHoqwGxHOdQqGL2N1/YA1mmB/1RVz7M rE4pbsAeJtOvenpIeJZOA8Hub0pDm36dGiQQmdqy9WG7OQwhgN+vnm3wmqCKT0ICy2Rx D3+2KSxV5dTz8bLhQSdv8SB518LgCUr0yFcoez++1XYzE75Eci71oVtkjzJxg3VXKiOc EdI3mt4Y6a4pwyrtJC/xWk6opoCt4wiaJXkEUivrMaurcl00MtG0zW6tE8lFOacOuuT5 wIVgUHV88X7K6f61XeuR9E435MoT4CTftWM8DmWTdamzHY3sumZbodoPP3LOlDUd3wni TuCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=UhwCvkt8Bl/HDe7Eys1vVLVXwpHbZDN/ciN+pZN8GKE=; b=fQrZm8btfmRXsYGyiWiBbRyVtXYfVlg74zFTJz6I6/0LFMWr/V/AIXUkl/uuPYxPlo 3oto1rsV/Zc8dXMC4hdB3vIcggfCGL+Em7A0cUQFC/131prGBKVey6VVY+c8AkUy2Zhm FW5E4hJvYoYwhcrY5otz83ijKcCWdWRn8DRkS331wPMudcDli2/CvFHSK5PVVh0ZDDP+ MTVdPvWwwfVVz9NO9tbdRacPj2yt/fqCmO9HCl2kAiNkqpJ8pZxsyPMV0A7hsK2lA9YQ kNABLYRDbOLGn2DaAGjDZYtKpv17Kva7P8q15jVfuhdsZVLFetckA/QnTBuNnKlpW9V6 w7mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KnAWXrrj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f76si2565999ywb.305.2019.02.11.09.16.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 09:16:37 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KnAWXrrj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:53385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtFC9-00041e-9q for patch@linaro.org; Mon, 11 Feb 2019 12:16:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtF9A-00024i-QM for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:13:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtExm-0000v3-1l for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:01:47 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:41656) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtExl-0000tC-JA for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:01:45 -0500 Received: by mail-pl1-x644.google.com with SMTP id k15so5567335pls.8 for ; Mon, 11 Feb 2019 09:01:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UhwCvkt8Bl/HDe7Eys1vVLVXwpHbZDN/ciN+pZN8GKE=; b=KnAWXrrjuZJZYqqFMupgZuMgjgKy1HYMUfWmraYVkvlW4GoGkNjIBk+dsMNNrCaFFS oLTcpqs2XSTk8O4DWu5lprlX8yxyIC29bnDb4oy3Cpbh87ghIy4QSSLDZBT30zPecQv2 2IuBVEgacQmOlMpUKELexqilwhGhEINfshSzJRkX/tOJvRgNQVdGmR5DcbJhWWZmzBx2 PXFM8X+raHh8DROHhtyJvxkEamOcPoRmUP1bAP7q7qSKO2lVb7hj65PXarnyc8eSWCaP g4T9jEk1E8kHcfx3PHKLILjopBCXoCGlQ9+mIZb3Wzm02Y3YElJOOozgBUhVhjo6MJGV nG+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UhwCvkt8Bl/HDe7Eys1vVLVXwpHbZDN/ciN+pZN8GKE=; b=sBhe8OcJdXAYrjeAdsw7sXyBRt3LbFmcOQl+bBn+M1lrKUTHJlbTtmWIfE+MJyNUFm gTera2HNF1Qlk98eG4DgmhhocH3zU3tevg0YW4TGEKpkYMixQN8IzoD160TcWjc8WZhz d6StMTZpYLYbmq7PrRehWEKtKZmeKg0TAvl7Zy4IpgZOZ1Y7NcWrAMSfOya3quo3NcPE 0bv5Bwl6uPapVFfRZ5+y92N9C/5Vh0c4zOVKjdLoKQ/DeRTEDs65HNVip32jWUc1GfTG jvB9UJ3mjsCXcY936rg6Rl8Vi/ZzrDT+yOAZMCYEY/H2WR+nOHtX/vkPWjeVY25Kov7p NQGA== X-Gm-Message-State: AHQUAua3rkgA5/YjtCrjd/3mDUPLOBlsZvBUktYh3gvlzXmzmnP4elE6 89I/CqNOw1IifiB8sJnxbbuzHyg2eG0= X-Received: by 2002:a17:902:b701:: with SMTP id d1mr36560024pls.124.1549904501835; Mon, 11 Feb 2019 09:01:41 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id b24sm15712567pfe.136.2019.02.11.09.01.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 09:01:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 09:01:34 -0800 Message-Id: <20190211170136.18680-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211170136.18680-1-richard.henderson@linaro.org> References: <20190211170136.18680-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 Subject: [Qemu-devel] [PULL 2/4] tcg/i386: fix unsigned vector saturating arithmetic X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Mark Cave-Ayland Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Due to a cut/paste error in the original implementation, the unsigned vector saturating arithmetic was erroneously being calculated as signed vector saturating arithmetic. Fixes: 8ffafbcec2 ("tcg/i386: Implement vector saturating arithmetic") Signed-off-by: Mark Cave-Ayland Message-Id: <20190207224258.426-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.2 diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 4d84aea3a9..e0670e5098 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -2615,7 +2615,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, OPC_PADDSB, OPC_PADDSW, OPC_UD2, OPC_UD2 }; static int const usadd_insn[4] = { - OPC_PADDSB, OPC_PADDSW, OPC_UD2, OPC_UD2 + OPC_PADDUB, OPC_PADDUW, OPC_UD2, OPC_UD2 }; static int const sub_insn[4] = { OPC_PSUBB, OPC_PSUBW, OPC_PSUBD, OPC_PSUBQ @@ -2624,7 +2624,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, OPC_PSUBSB, OPC_PSUBSW, OPC_UD2, OPC_UD2 }; static int const ussub_insn[4] = { - OPC_PSUBSB, OPC_PSUBSW, OPC_UD2, OPC_UD2 + OPC_PSUBUB, OPC_PSUBUW, OPC_UD2, OPC_UD2 }; static int const mul_insn[4] = { OPC_UD2, OPC_PMULLW, OPC_PMULLD, OPC_UD2 From patchwork Mon Feb 11 17:01:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158014 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2852799jaa; Mon, 11 Feb 2019 09:20:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IZUgDL8YdSJOS2dupPU+Qp7lfhVgurcchYk85w0IWJtDqiheFTR3+p6vX0+Ib6m4Sp+Zxz4 X-Received: by 2002:a81:1c12:: with SMTP id c18mr9811631ywc.487.1549905602537; Mon, 11 Feb 2019 09:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549905602; cv=none; d=google.com; s=arc-20160816; b=wznZ9V4kT6bMZ5nCZojdItkB1yhZb8lnlef7HKf4y3OUzGR0M2ox1JJT/q3J9xj6iw +Aj5uwzdQEQOgBjV49FwHBQmAr9smrC3sQuRdRzgq0qkBb6pUeR3opGgAydBiGBDUPWG x1bRnOSm/fhJdRUjsdhl5zAUjRruAuo3s3tr6jrDbLRzJAHeDJfRSo3TW4qJtbxQNW0v weZso679qyvDmSPKig0xvJDUEqa2Fko2bsPsoLTp0MuZKMdi2g5YH6em2EQcPB0D90zY dYm7Xo87/B1pvl++1HSPrdlyAsY7kvQNVulJu1ypMyFJmhAtzMxE+6kgJCsq7gQHkV5v jmEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=5WjeItA4Q5CFSTB/3Eosqvlagn8qIkKnjwru+1x0GAg=; b=CY6dt4Cj192DSqD/bf3qVzXpeoxfr7MMGBXWcvFdnJZCb05W/qxfBQnZMEFIeojiFE OoDSAqtD/TSPwHGgidLuUk3RMWLbXKG1tS4oVwckr0eB3l4zFaPCdAfd41S1NMHTrTY2 ACWkmg6ARCXR0jY2tV0eG6vmhRlutDCb0OsY9yVZhfCDRULmGUbjASiqFiTJoXW0gYqV a0IJM4T0pwGfrNCkb8Z5mB3NzceOHarVHCCFbng3Ss5jxwxClopw8g0CV/5L3VcZSWcP BVIX8P+WVbvj2sqn/kzWrRDiVAANSUe2RgnwcMAMv1Cz7kBGmHj+jOe5w0OM0wzCZama wlsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u+3fZCTn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u29si2683055ywh.263.2019.02.11.09.20.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 09:20:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=u+3fZCTn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:53427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtFFS-0006MP-02 for patch@linaro.org; Mon, 11 Feb 2019 12:20:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtF9A-0001yY-Pf for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:13:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtExm-0000v2-1j for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:01:52 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:36454) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtExl-0000tq-J8 for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:01:45 -0500 Received: by mail-pf1-x42d.google.com with SMTP id n22so2789818pfa.3 for ; Mon, 11 Feb 2019 09:01:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5WjeItA4Q5CFSTB/3Eosqvlagn8qIkKnjwru+1x0GAg=; b=u+3fZCTnC07A8i1GeVmNXjOaUtineLJGfrPyHtt2vIvOU69k4LES79nBuXF2/fFVQV EM809a2aT91sLRkQ43xNgrvM/cRJdfNDS9bZRR4YHNrNnjxabN1MMe1Dc8frQYgl/aLZ 0WuTjREpnEWOd71slNBaTfh9jZZCI+hXmgtdRUo2ciqpA4erf7fZqyrjuPdDzBcupZLU 0n2q6zIjlix5TAw2zL80tayKQ/sybrlNd4N8Ez4ohUYj0mk/pgIwSfyG+dWgZmAIdHH1 B71AD6b3JbEt4eyXdsbdSNrVr8PDzPVRT73BrtSdC4D3OHwyiVXVMQ6bNj/0VO6s1K6R nd6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5WjeItA4Q5CFSTB/3Eosqvlagn8qIkKnjwru+1x0GAg=; b=CTKbasr3PjlL41Qsv5CiFqv/uHhSs6FSK7jX61sGIUpMSNBhs0ORSRYdQSZwleZ+9S n5bbZfUfx12PM8ZdQo/SMPgKv9T2whsau+7iD7Kk8DSXGcLe6gRrVrTvyJeyEfmZUYsk oGpeIWMgNmrgYJfz6dOYS+gkTTw0Hp4RglpgV6B7BGXdYtO+Dj10pGx990NnC1+gJb95 63JrRuOxd3TlqS7Y7T6uTI5ShN0HcSEfW6j7EzSh27+BTzppA4yxkeymqZIm5QSqlYBn 3jbo/QtML0hEMen8ccyMQtgSL/nMAvxGjnBqZqEVU4Tn5cbI7JxtvXVPkhDdIBIB3lY/ pccQ== X-Gm-Message-State: AHQUAualWmZ2mrriQLq4PCcOr/hS37rDRguw4i+GsuRsQFT1WR6LPcv0 6Bepkh3KdeSQPT7d1NY23NJyOgpaeGM= X-Received: by 2002:a65:4507:: with SMTP id n7mr29107194pgq.34.1549904503470; Mon, 11 Feb 2019 09:01:43 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id b24sm15712567pfe.136.2019.02.11.09.01.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 09:01:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 09:01:35 -0800 Message-Id: <20190211170136.18680-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211170136.18680-1-richard.henderson@linaro.org> References: <20190211170136.18680-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42d Subject: [Qemu-devel] [PULL 3/4] exec-all: document that tlb_fill can trigger a TLB resize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Message-Id: <20190209162745.12668-2-cota@braap.org> Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.2 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index aa7b81aaf0..97b90cb0db 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -475,6 +475,11 @@ static inline void assert_no_pages_locked(void) struct MemoryRegionSection *iotlb_to_section(CPUState *cpu, hwaddr index, MemTxAttrs attrs); +/* + * Note: tlb_fill() can trigger a resize of the TLB. This means that all of the + * caller's prior references to the TLB table (e.g. CPUTLBEntry pointers) must + * be discarded and looked up again (e.g. via tlb_entry()). + */ void tlb_fill(CPUState *cpu, target_ulong addr, int size, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); From patchwork Mon Feb 11 17:01:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 158015 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2853388jaa; Mon, 11 Feb 2019 09:20:38 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib9EZysk+XoxDmojHKM5xTbWkndvTeg9FoCtfqifthqTXAS1qCmEPoQd7HIZANGFgergZzF X-Received: by 2002:a25:6d06:: with SMTP id i6mr28383458ybc.333.1549905638773; Mon, 11 Feb 2019 09:20:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549905638; cv=none; d=google.com; s=arc-20160816; b=D9WYLV2ZN5NEcx8ERwaeI5u3jJtHSxLtfbL2tftyNUcagHZJXRv3iMpsjWv2U6kFjC /HWXXCUlMopPr7zbJ9Z2hoTE+N2xLMd09ia0tEAx7hXJrxMdb2cbPHegk4ldxaFY/Qpt TtodYQ77JsgslPTVgX4cc6OmAP1CaDMxx1RcNK1IzIkGQ1We6BsEj9/t2zFEOQZWaLSU mCDieKa7D66HNtLIw7h5leLeTbANDdz/oyIX2Nf+oYcMrqDU9Z3jRjjmlNpiWBCySzIq fsAj15PyOYVE7gsPUp/cAozl83G1lyS5cExneRBDFws9aTc0BiBs6MUaE9mkagddbdN0 7TGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=ErMfI2JS9j1itVD/Qxguq0BTJBeC6WWZEVbtfCqUo1k=; b=x9Tzmiv08aNsoHIqIME2Nhj/zyWlC/1jppZI6UyzPVYch1UjsjnzVhIaFaFvIHpZar zT6Yis8DAJ+dNydcpYeA59DO3RQrtIKgIpCPFAbWJXFE2IOnpP7MF54K7PrfsOv3CA18 L1n3bsBfHzjRpWIPB7mtDOU2RmvrzwGBZWRrjFUMibGcp5j7/v7gWz1BSYL1647dSJyG 2y4XivT3Jq/Iwo694ImQ8IcEsyW8BrfqPwxMYxTBpzmOBpnKcG5W6wope/ycc187XFns m700kJUXMbkyHDB5XVqNHbdGEbKpxXxboYTMThUt1LXq01cZPSNC+34ik/qQmo+bvjNY 1uEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Cr/2t0XT"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e131si6238576ywc.136.2019.02.11.09.20.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Feb 2019 09:20:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Cr/2t0XT"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:53464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtFG2-0007th-3r for patch@linaro.org; Mon, 11 Feb 2019 12:20:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtF9A-00020I-Pl for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:13:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtExo-0000w8-2I for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:01:49 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:34181) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtExn-0000uQ-QC for qemu-devel@nongnu.org; Mon, 11 Feb 2019 12:01:47 -0500 Received: by mail-pg1-x533.google.com with SMTP id d9so5227624pgl.1 for ; Mon, 11 Feb 2019 09:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ErMfI2JS9j1itVD/Qxguq0BTJBeC6WWZEVbtfCqUo1k=; b=Cr/2t0XT3FfqcrGBdNXlTS2NAaKEFdzHh321xZtuP+jdDCkDzgHIWhRB8lt33UMRE0 JkFh8QW4HB8wvDKOWhZgqCfCfiLifQ/GMhRCvjXSoWH4Mai1Sg+VeLVIKFo7iqf+y7RF X6TThTKR3dMzmTx2ec5dLYsJ7UEuZOg282M1nrvcziWoHMk2NUyuqFDNsRDUmENLBgxI +NwS0xXFzZyY7806uhbWu4d5dr/mljIedY1Z8YwaGBPGU0RtO9IAxyvfJOGF02M7Wleg WOhLSnmNMcFfah1ebGQ/pKgnBcvEYXztzfijUJa8Tq6cH3R3QF2gy0UsSTcaQ4+8bi0R 8+kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ErMfI2JS9j1itVD/Qxguq0BTJBeC6WWZEVbtfCqUo1k=; b=k/LMk51jekXHi3dxflfqqO2T4t70YOxg2/xjFysIK869rcDbAaEsiK6/vhacNc1fFR ZMAvQfVymziRYTn/sWkXcD0rhQYNJhMNi/yQuSgRYojogjc8iEvjAXPXZ80xRzzvXm5L znz3T/e9e13GjlijgufU4sUW7PqtgXUcgzNbTejDvexovLaHQ2aaGa08XTFby3wuEFdu BFVOHdMY7oeaU2oy35UM0y4QDkHpe5kITR5fT+S+6INFFNItKzWMfovyUtiFBSwYw6aG maqcD+NtKCN32MmbqqqbUyws1cAKfdMYUfqCV8Lwt/nVM97Vl1iNMaj5e8dflYaUr375 eT6w== X-Gm-Message-State: AHQUAuafsjtDpFO0UX+A1LiSJdu+plYDFYZ61lcEvqrmA2gn+46i1g0S lWFr4iQQ3LkrfeWHDOMGVTZ+DXz38oE= X-Received: by 2002:a62:2284:: with SMTP id p4mr11146979pfj.115.1549904504807; Mon, 11 Feb 2019 09:01:44 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id b24sm15712567pfe.136.2019.02.11.09.01.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 09:01:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2019 09:01:36 -0800 Message-Id: <20190211170136.18680-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211170136.18680-1-richard.henderson@linaro.org> References: <20190211170136.18680-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::533 Subject: [Qemu-devel] [PULL 4/4] cputlb: update TLB entry/index after tlb_fill X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" We are failing to take into account that tlb_fill() can cause a TLB resize, which renders prior TLB entry pointers/indices stale. Fix it by re-doing the TLB entry lookups immediately after tlb_fill. Fixes: 86e1eff8bc ("tcg: introduce dynamic TLB sizing", 2019-01-28) Reported-by: Max Filippov Tested-by: Max Filippov Signed-off-by: Emilio G. Cota Message-Id: <20190209162745.12668-3-cota@braap.org> Signed-off-by: Richard Henderson --- accel/tcg/softmmu_template.h | 8 ++++++++ accel/tcg/cputlb.c | 4 ++++ 2 files changed, 12 insertions(+) -- 2.17.2 diff --git a/accel/tcg/softmmu_template.h b/accel/tcg/softmmu_template.h index 1fdd262ea4..e970a8b378 100644 --- a/accel/tcg/softmmu_template.h +++ b/accel/tcg/softmmu_template.h @@ -129,6 +129,8 @@ WORD_TYPE helper_le_ld_name(CPUArchState *env, target_ulong addr, if (!VICTIM_TLB_HIT(ADDR_READ, addr)) { tlb_fill(ENV_GET_CPU(env), addr, DATA_SIZE, READ_ACCESS_TYPE, mmu_idx, retaddr); + index = tlb_index(env, mmu_idx, addr); + entry = tlb_entry(env, mmu_idx, addr); } tlb_addr = entry->ADDR_READ; } @@ -198,6 +200,8 @@ WORD_TYPE helper_be_ld_name(CPUArchState *env, target_ulong addr, if (!VICTIM_TLB_HIT(ADDR_READ, addr)) { tlb_fill(ENV_GET_CPU(env), addr, DATA_SIZE, READ_ACCESS_TYPE, mmu_idx, retaddr); + index = tlb_index(env, mmu_idx, addr); + entry = tlb_entry(env, mmu_idx, addr); } tlb_addr = entry->ADDR_READ; } @@ -294,6 +298,8 @@ void helper_le_st_name(CPUArchState *env, target_ulong addr, DATA_TYPE val, if (!VICTIM_TLB_HIT(addr_write, addr)) { tlb_fill(ENV_GET_CPU(env), addr, DATA_SIZE, MMU_DATA_STORE, mmu_idx, retaddr); + index = tlb_index(env, mmu_idx, addr); + entry = tlb_entry(env, mmu_idx, addr); } tlb_addr = tlb_addr_write(entry) & ~TLB_INVALID_MASK; } @@ -372,6 +378,8 @@ void helper_be_st_name(CPUArchState *env, target_ulong addr, DATA_TYPE val, if (!VICTIM_TLB_HIT(addr_write, addr)) { tlb_fill(ENV_GET_CPU(env), addr, DATA_SIZE, MMU_DATA_STORE, mmu_idx, retaddr); + index = tlb_index(env, mmu_idx, addr); + entry = tlb_entry(env, mmu_idx, addr); } tlb_addr = tlb_addr_write(entry) & ~TLB_INVALID_MASK; } diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index f580e4dd7e..88cc8389e9 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1045,6 +1045,8 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr) if (unlikely(!tlb_hit(entry->addr_code, addr))) { if (!VICTIM_TLB_HIT(addr_code, addr)) { tlb_fill(ENV_GET_CPU(env), addr, 0, MMU_INST_FETCH, mmu_idx, 0); + index = tlb_index(env, mmu_idx, addr); + entry = tlb_entry(env, mmu_idx, addr); } assert(tlb_hit(entry->addr_code, addr)); } @@ -1125,6 +1127,8 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, if (!VICTIM_TLB_HIT(addr_write, addr)) { tlb_fill(ENV_GET_CPU(env), addr, 1 << s_bits, MMU_DATA_STORE, mmu_idx, retaddr); + index = tlb_index(env, mmu_idx, addr); + tlbe = tlb_entry(env, mmu_idx, addr); } tlb_addr = tlb_addr_write(tlbe) & ~TLB_INVALID_MASK; }