From nobody Sun Feb 8 12:58:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532380485139488.54341098634893; Mon, 23 Jul 2018 14:14:45 -0700 (PDT) Received: from localhost ([::1]:36681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhiAG-0001Ii-1p for importer@patchew.org; Mon, 23 Jul 2018 17:14:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhKO-0003ck-Rq for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:21:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhKN-0005Ea-T2 for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:21:08 -0400 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]:36735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhKN-0005EQ-O2; Mon, 23 Jul 2018 16:21:07 -0400 Received: by mail-oi0-x244.google.com with SMTP id n21-v6so3498460oig.3; Mon, 23 Jul 2018 13:21:07 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id e205-v6sm9811592oia.9.2018.07.23.13.21.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=F1nV6cjMRE+5DYKc2RECY4sNdc0eWRoMhLaDTtyuzus=; b=kuoJ/fdHZL2SxXWH+NWRejDTLmhxfLVQOZ7TKfr/RrfnllhcVHMtT3OlcBRtAjGfWS +GmE9Y3kPfYTQk1mJJLs5ijJh3Dfr5vsTbYGaw6W7X46gsVMOtKh4Pupr9PEnRviczIg De+n/qbkENIFD6l+eh3HAxuJdnM6UlO12Qi2Y7eRLhhDX+qm2gR1TDXjypEpcggu935+ 8rAg+32eVDRCqyEZ6sv0qcK+NM4m8XCNwmohy4h8hehxVGDCiVweM+q/TgFOY/iJmN1w AB/PX+pesD/R61GAZMVtIoejdo+9nQkNOCLAZzt02hopDRfmGMCAmlNI+TRHbs3Yjbj+ s+3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=F1nV6cjMRE+5DYKc2RECY4sNdc0eWRoMhLaDTtyuzus=; b=XJpoCfjuMSnLKcooUkRTrUvkKTKtf2x6KznPZZm0CkAOaq+H1BenwC05QBw1SuHpl4 OdQn7TPCJXRGtaYMa8lT9G0FyM8HLbOZUtqNSwvPygh4mX/Twi1HcjXK2Y6HMRYTEKuC iPY8iYUc5S/cUt5U7URiuFU1VEbtZEz7J1Ctsa8O2OeRFoCGN1HA5WN3kLnmWJlwLisy SWwij8BFwJ/pFKE4hK/vi2y2WpegIekqz/JzRrbI+ezpSQdvKMSc3+XHt8yJ9bO4cVUe C1XrBF451bu+/L+IatwjfToDHQO0GiQM2XlpF+fYXYBNECXbD2Sr8cRiQjl6XH+N5CQe VVJA== X-Gm-Message-State: AOUpUlExQrb7V2Tgh8HES25jHveSymPC1+2sUdmg26rnJpyzBUFhqDvL QlhZ6jxaKAJdqAbVApCw4ZwlLfWfqwplMw== X-Google-Smtp-Source: AAOMgpfb4rddck93v5sjNU5ToIERL5tnEm8//2b3fa4UOIG/NrRdjKzTtv8dUuOwQfaLDzw8huZLpQ== X-Received: by 2002:aca:4dca:: with SMTP id a193-v6mr252801oib.343.1532377266618; Mon, 23 Jul 2018 13:21:06 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:16:15 -0500 Message-Id: <20180723201748.25573-7-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::244 Subject: [Qemu-devel] [PATCH 06/99] tcg/arm: Fix memory barrier encoding 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: Henry Wertz , Richard Henderson , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Henry Wertz I found with qemu 2.11.x or newer that I would get an illegal instruction error running some Intel binaries on my ARM chromebook. On investigation, I found it was quitting on memory barriers. qemu instruction: mb $0x31 was translating as: 0x604050cc: 5bf07ff5 blpl #0x600250a8 After patch it gives: 0x604050cc: f57ff05b dmb ish In short, I found INSN_DMB_ISH (memory barrier for ARMv7) appeared to be correct based on online docs, but due to some endian-related shenanigans it had to be byte-swapped to suit qemu; it appears INSN_DMB_MCR (memory barrier for ARMv6) also should be byte swapped (and this patch does so). I have not checked for correctness of aarch64's barrier instruction. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Henry Wertz Signed-off-by: Richard Henderson (cherry picked from commit 3f814b803797c007abfe5c4041de754e01723031) Signed-off-by: Michael Roth --- tcg/arm/tcg-target.inc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index dc83f3e5be..56a32a470f 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -159,8 +159,8 @@ typedef enum { INSN_STRD_IMM =3D 0x004000f0, INSN_STRD_REG =3D 0x000000f0, =20 - INSN_DMB_ISH =3D 0x5bf07ff5, - INSN_DMB_MCR =3D 0xba0f07ee, + INSN_DMB_ISH =3D 0xf57ff05b, + INSN_DMB_MCR =3D 0xee070fba, =20 /* Architected nop introduced in v6k. */ /* ??? This is an MSR (imm) 0,0,0 insn. Anyone know if this --=20 2.17.1