From patchwork Tue Sep 11 01:32:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10595007 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 266F513B8 for ; Tue, 11 Sep 2018 01:33:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 090262912E for ; Tue, 11 Sep 2018 01:33:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EED5F29130; Tue, 11 Sep 2018 01:33:16 +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=-7.3 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 969062912E for ; Tue, 11 Sep 2018 01:33:16 +0000 (UTC) Received: from localhost ([::1]:54868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzXYJ-0002QU-CM for patchwork-qemu-devel@patchwork.kernel.org; Mon, 10 Sep 2018 21:33:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzXXY-0000bC-HN for qemu-devel@nongnu.org; Mon, 10 Sep 2018 21:32:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzXXX-00087e-IQ for qemu-devel@nongnu.org; Mon, 10 Sep 2018 21:32:28 -0400 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:34322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fzXXX-00086J-9y; Mon, 10 Sep 2018 21:32:27 -0400 Received: by mail-lf1-x142.google.com with SMTP id c29-v6so19053720lfj.1; Mon, 10 Sep 2018 18:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=SmTH0IhtZH4ku7oSgcHQcfDWILw8y/E/1zJUqyWdqG0=; b=XmLyJx5gbPT1UlbU1y4B/3MIgbQOxzgWWGJd3I/iLBQRxb2NANTtxrAlNt2RClGUy2 pfcfPbYkx5SMd5vG0XZcv5VdRR4zzhUs8NJG+rX2hNT4TtX/pHBkVmRWKaluNO3EcyKT hRbdX8aap3YHgFJbdxWE+lkbZxBGAMgCUsw2cxjhGDpe6e4gHZONhKQ5bbMamJx9ekZJ pT0oHT/JgvSq4DdJcSIdERbQjJ8e4xdQxRRoJFAaRzJHKJncABNozq7/r70JqrIOPq+q Vfbh1DhyAhKD0ZD6UKman6IZP0jUdPCjn0iuuw8KpOEZpxEzEnDEMnBuiZWKEGEqfmiY Euvw== 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; bh=SmTH0IhtZH4ku7oSgcHQcfDWILw8y/E/1zJUqyWdqG0=; b=ePxe2U1xlJNhaob7XpaPeiJ8Q8EMB5lxCrOoLpuxDmziRrXZlc0ZACK47fZ8lyUgrM EnUPE2khxHAVdG3/lFEor8dZwr6GwxUq1qrB/wBwUph77OyrVY375RUm2XqIqRmEY1Iz xF2EVOls5vzG6uV6R0E8Odmdd6h1FaYnb6yo0uBAeMZRMqV73FjoSBp7zziDsZfLztm1 PxhZm/VCeZkC0mHuTUa7So4Yffald1aFG82q6hYlE45NAQsFBhoVmQGvNYrKJ+jW5Au9 zGyEJkJu55BXaTSkFYHwpFvEswxAniIszsUyMbrF4g5sd+MOvuSdGZFadrqD4TvNRBkl eAXw== X-Gm-Message-State: APzg51AU6KxtEAChpJJSYRHcRWgIsQHsVKVhFblrY79MXTaKOYpUM33a bLvgIVxuLLJirKNrfjKzTeGNp+uBd8w= X-Google-Smtp-Source: ANB0VdYpqpZ7+mq223Ont7Zz1++q7b1r9fC9Z4dC5Km+i15+ezVJvEJiXQXHRHdLSCv6QkM+5wHrHg== X-Received: by 2002:a19:7d84:: with SMTP id y126-v6mr14375749lfc.94.1536629545566; Mon, 10 Sep 2018 18:32:25 -0700 (PDT) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id g16-v6sm3054570lje.1.2018.09.10.18.32.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Sep 2018 18:32:24 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 18:32:11 -0700 Message-Id: <20180911013211.27340-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::142 Subject: [Qemu-devel] [PATCH] target/xtensa: fix s32c1i TCGMemOp flags 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: Max Filippov , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP s32c1i must load and store value with target endianness, not host. This results in an infinite loop in atomic cmpxchg sequences when target endianness doesn't match host endianness. Fixes: 9fb40342d4b3 ("target/xtensa: support MTTCG") Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov Reviewed-by: Richard Henderson --- target/xtensa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 25399058a0db..c626583cd952 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -2288,7 +2288,7 @@ static void translate_s32c1i(DisasContext *dc, const uint32_t arg[], gen_load_store_alignment(dc, 2, addr, true); gen_check_atomctl(dc, addr); tcg_gen_atomic_cmpxchg_i32(cpu_R[arg[0]], addr, cpu_SR[SCOMPARE1], - tmp, dc->cring, MO_32); + tmp, dc->cring, MO_TEUL); tcg_temp_free(addr); tcg_temp_free(tmp); }