From nobody Mon Feb 9 02:28:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1621530424; cv=none; d=zohomail.com; s=zohoarc; b=bBJpD5c5rgsTu0PChB0DEZ65iajZfzu7g4Su88J63sVEj2E4niwpdYzbajr9/IBo8EFROKl378Irlo2XBOOi6PZMkdkzdDeOFeYHfmb762pOcnX8ScmWMWiLNKyl8Iip+6gCZBL+ThKnzJSJYIJ7f2dUL6epIqb+blWSpo3LxbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621530424; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e0SNQoAqdb4bl76wcRMsvUXYfkexwm35ttQDzweDdUk=; b=kE6dk3pMinL3l0vCznhSXgYTvhuUWVWDlLlVR4xn7bV3JyY2uq+cfsWvZSohGF16Rz822VdkeazHrdCJO7/Yi1IBw/9iIaq6nISyk46CarBiUeAK/e1RkdBvqjSUDobFjUUqAAWFJkR/Y+HZ/olUSHkIYRcpf+YD92dPPADn3Dk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621530424792384.5427581823425; Thu, 20 May 2021 10:07:04 -0700 (PDT) Received: from localhost ([::1]:54490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljm8V-0004S6-LT for importer@patchew.org; Thu, 20 May 2021 13:07:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljm7M-0001cN-AV for qemu-devel@nongnu.org; Thu, 20 May 2021 13:05:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljm7B-0005cL-0Q for qemu-devel@nongnu.org; Thu, 20 May 2021 13:05:51 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-599-tbQBEVasNjuWj4k9eSfn9g-1; Thu, 20 May 2021 13:05:38 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C7411020C38; Thu, 20 May 2021 17:05:36 +0000 (UTC) Received: from gondolin.fritz.box (ovpn-113-166.ams2.redhat.com [10.36.113.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2E4F5D6D5; Thu, 20 May 2021 17:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621530340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e0SNQoAqdb4bl76wcRMsvUXYfkexwm35ttQDzweDdUk=; b=WzEItpa/LNikurzXjuRQOinUTa7oXqOJ0oEGoBXCsBe6SE7UusSp3FHBtKz6LXcq5/NjBI mdCMv7sTgntk4uykpjhZG9fyV3ykvt/cx2KhsuVJxlrDHihypDmSwGhGq+7oBcfFKN5vvO Y2zxjOP7EL3TgS3F3+50XpwUd6Jwujw= X-MC-Unique: tbQBEVasNjuWj4k9eSfn9g-1 From: Cornelia Huck To: Peter Maydell Subject: [PULL v2 4/9] accel/tcg: Assert that tb->size != 0 after translation Date: Thu, 20 May 2021 19:05:14 +0200 Message-Id: <20210520170519.300951-5-cohuck@redhat.com> In-Reply-To: <20210520170519.300951-1-cohuck@redhat.com> References: <20210520170519.300951-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cornelia Huck , qemu-s390x@nongnu.org, David Hildenbrand , qemu-devel@nongnu.org, Ilya Leoshkevich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Ilya Leoshkevich If arch-specific code generates a translation block of size 0, tb_gen_code() may generate a spurious exception. Add an assertion in order to catch such situations early. Signed-off-by: Ilya Leoshkevich Reviewed-by: David Hildenbrand Message-Id: <20210416154939.32404-5-iii@linux.ibm.com> Signed-off-by: Cornelia Huck --- accel/tcg/translate-all.c | 1 + 1 file changed, 1 insertion(+) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index fbf8fc630b27..640ff6e3e706 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1912,6 +1912,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, =20 tcg_ctx->cpu =3D env_cpu(env); gen_intermediate_code(cpu, tb, max_insns); + assert(tb->size !=3D 0); tcg_ctx->cpu =3D NULL; max_insns =3D tb->icount; =20 --=20 2.31.1