From patchwork Mon Oct 28 14:59: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: 177941 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp3183782ocf; Mon, 28 Oct 2019 08:11:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz21igeeb6Ag3RxoscLWiXAINSM0cOwdhJDgoE8VXgoQm25+RVHXoGPwugA+3a8dV861SK0 X-Received: by 2002:aed:34c2:: with SMTP id x60mr7101495qtd.381.1572275488237; Mon, 28 Oct 2019 08:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572275488; cv=none; d=google.com; s=arc-20160816; b=LsoFIh1zLJDCUyXRPf2KtXPalMuv5+jFKCpLjvWSjsWEswpcey9+m4iA1IChvTW6MJ 5VUsT1n6kH3ZGb6afWyeDb/+NGoxTdiIidfhWWlVQRr3IqrH5kHdFveCJGppceS8nSA6 iNV9irVOIfd6efcsoNs0eHjvLx0aDP6Qu0tYOxuXypmTK8/prJ4unH0z+GCCnSsFgm8r jwvuUVdRLcgV8t5lcHNQOjv9gNMJO2Z5oVCQ+ZKmUuLmPtL7Sme7MGuAEcrXEkLr0eog m+IJfJYtwpoBqIPw/bIxhb0l+0VmVcXqwwTO2z4Eq7qrv4EAluh5HhrDJ6GdSbxzTBr0 w7pQ== 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:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=jWCHT8imM+uT8t8z8pCnUo/8+221GMTt3GzK0VnZBfQ=; b=M4lCJNPnddLMloq2miXH7bo0HuSBKM/MMKJHH9NuM/fH7PlK9pHH7PYyCPYRUWnO40 YxHEh31/MokzQakOAoEeIWiqA45Ssme5MbFE88CISS9TEEojZozgd28OPTHcF1luV5fi 5SzAMDFKMuhe7dwuWiTB2QSgdQWkQWZ8PIWvl6oTg0JD0IELMocExO8bigvLtFT3xI00 TY3ZviBOmloVvCzysAgSzqtGfaoZftNrf8XPzAPgc4vNU4W5upc0UcNcw+y4esg+X3un J5i1ULJ0ZLxi1vQ88kU4P2C2mYzro/oZzcx1pAuwAe2pusZA15PhZews4KtDA3Rm/Qu9 JE2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d26sLpzv; 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 ba20si9475324qvb.23.2019.10.28.08.11.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Oct 2019 08:11: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=d26sLpzv; 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]:44980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP6g3-0004nB-6n for patch@linaro.org; Mon, 28 Oct 2019 11:11:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44654) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP6Us-0007Zc-4l for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iP6Uq-00046R-SQ for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:54 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39761) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iP6Uq-00045p-MU for qemu-devel@nongnu.org; Mon, 28 Oct 2019 10:59:52 -0400 Received: by mail-wr1-x431.google.com with SMTP id a11so10230997wra.6 for ; Mon, 28 Oct 2019 07:59:51 -0700 (PDT) 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=jWCHT8imM+uT8t8z8pCnUo/8+221GMTt3GzK0VnZBfQ=; b=d26sLpzvhO1E0TrFTuZ2mirSgGGVKv7FsN+fUq7Nuv0yhm3H66dT9psyNGbt6GMWuK V4fNkiNB1af8og4AcJ6kK57qpfXE95EFQRVRd0iHdeqSpmBUsmFnoQ4pYs5vard1I/AX 2mYk0yQapIsCZv7UPguJS3RoNq8rs5YjgCEEm2EY1pQ6SEEMwPiww+bcoG65R/CJCBSM NDDNP+Qo95IqEVE33peYRyeinKgs+kFdAq+wN5E+26uk5CFMWRFd1tla5kchCbAMHewg sIgHKKEwV0mNOnOvlxDf4VvNgQnDrQEWx8RzgmOe8LuF7uydkX6tXZ9XZaLHsF8u1ENd KVLw== 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=jWCHT8imM+uT8t8z8pCnUo/8+221GMTt3GzK0VnZBfQ=; b=N3hMSe0EU+ZkTZEHtzlEWgR5TxC9vrOo2XMD2dwtiVvr1Q8TRMgiXVDD5P3jQl/UMc Ov3OEA1ZdIiSactNlfBqyJR7sWrXjvfH/abVRAR+KVPTIPh17B7R2w8TPzEC6ohKLdbj XLw+xhsLaKKHhyoaG4IwGrrw58sosbbQG7j9bs+DllGszZhkbckPCXJbM5NtrSU6+vWj F2M9LK/Q36b3hOjYNiaHgWHdU0EtLLN9ba8OkTNBRB5T97yJhXZKicdpS+2fewA2Co5o wbqqRALkq5iT1Z/YXgtusl8iZna3tKbUj6Gf69RMf0KwJNU9vJBo26rYjpc602Ep2TOj KZ/g== X-Gm-Message-State: APjAAAXTx0HlLoGI+ohHok5d6eN7aCEfMGW0FOOVI2pip6cP9bKDbVA/ q+fajXMwbWsM1se7O92xPayfp3wYg8kWug== X-Received: by 2002:a5d:6747:: with SMTP id l7mr14797530wrw.328.1572274790726; Mon, 28 Oct 2019 07:59:50 -0700 (PDT) Received: from localhost.localdomain (230.106.138.88.rev.sfr.net. [88.138.106.230]) by smtp.gmail.com with ESMTPSA id 143sm14842876wmb.33.2019.10.28.07.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 07:59:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 11/12] translate-all: fix uninitialized tb->orig_tb Date: Mon, 28 Oct 2019 15:59:36 +0100 Message-Id: <20191028145937.10914-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028145937.10914-1-richard.henderson@linaro.org> References: <20191028145937.10914-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Clement Deschamps Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Clement Deschamps This fixes a segmentation fault in icount mode when executing from an IO region. TB is marked as CF_NOCACHE but tb->orig_tb is not initialized (equals previous value in code_gen_buffer). The issue happens in cpu_io_recompile() when it tries to invalidate orig_tb. Reviewed-by: Richard Henderson Signed-off-by: Clement Deschamps Message-Id: <20191022140016.918371-1-clement.deschamps@greensocs.com> Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 66d4bc4341..f9b7ba159d 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1722,6 +1722,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb->cs_base = cs_base; tb->flags = flags; tb->cflags = cflags; + tb->orig_tb = NULL; tb->trace_vcpu_dstate = *cpu->trace_dstate; tcg_ctx->tb_cflags = cflags; tb_overflow: