From patchwork Tue Apr 9 05:48:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 10890539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 469D4139A for ; Tue, 9 Apr 2019 05:59:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 310C92880A for ; Tue, 9 Apr 2019 05:59:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2255228846; Tue, 9 Apr 2019 05:59:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C72022880A for ; Tue, 9 Apr 2019 05:59:29 +0000 (UTC) Received: from localhost ([127.0.0.1]:35747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDjn7-0003Md-5G for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Apr 2019 01:59:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDjlo-0002Yr-S9 for qemu-devel@nongnu.org; Tue, 09 Apr 2019 01:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDjlm-0003tG-S3 for qemu-devel@nongnu.org; Tue, 09 Apr 2019 01:58:08 -0400 Received: from mail.weilnetz.de ([37.120.169.71]:43272 helo=v2201612906741603.powersrv.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDjlk-0003sR-45; Tue, 09 Apr 2019 01:58:04 -0400 Received: from localhost (localhost [127.0.0.1]) by v2201612906741603.powersrv.de (Postfix) with ESMTP id 8D2F1DB6049; Tue, 9 Apr 2019 07:49:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at v2201612906741603.powersrv.de Received: from v2201612906741603.powersrv.de ([127.0.0.1]) by localhost (v2201612906741603.powersrv.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9HxXChr5P8uJ; Tue, 9 Apr 2019 07:49:04 +0200 (CEST) Received: from qemu.weilnetz.de (qemu.weilnetz.de [188.68.58.204]) by v2201612906741603.powersrv.de (Postfix) with ESMTP id B169DDB6046; Tue, 9 Apr 2019 07:49:04 +0200 (CEST) Received: by qemu.weilnetz.de (Postfix, from userid 1000) id A90C946000F; Tue, 9 Apr 2019 07:49:04 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, Peter Maydell Date: Tue, 9 Apr 2019 07:48:52 +0200 Message-Id: <20190409054852.22547-1-sw@weilnetz.de> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 37.120.169.71 Subject: [Qemu-devel] [PATCH v2] Fix type of cluster_index 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: Stefan Weil Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The type should be the same as the type of cluster_id. This fixed a runtime error reported by sanitizers: /qemu/include/exec/tb-lookup.h:33:35: runtime error: left shift of negative value -1 /qemu/accel/tcg/translate-all.c:1692:34: runtime error: left shift of negative value -1 Signed-off-by: Stefan Weil --- v2: Fixed my e-mail address. include/qom/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 1d6099e5d4..6a753caed7 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -422,7 +422,7 @@ struct CPUState { /* TODO Move common fields from CPUArchState here. */ int cpu_index; - int cluster_index; + uint32_t cluster_index; uint32_t halted; uint32_t can_do_io; int32_t exception_index; @@ -1129,6 +1129,6 @@ extern const struct VMStateDescription vmstate_cpu_common; #endif /* NEED_CPU_H */ #define UNASSIGNED_CPU_INDEX -1 -#define UNASSIGNED_CLUSTER_INDEX -1 +#define UNASSIGNED_CLUSTER_INDEX UINT32_MAX #endif