From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8YcB-00049G-KX for qemu-devel@nongnu.org; Tue, 17 Apr 2018 17:58:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8Yc8-0007Zp-Fa for qemu-devel@nongnu.org; Tue, 17 Apr 2018 17:58:15 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:35548) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f8Yc8-0007Uu-9g for qemu-devel@nongnu.org; Tue, 17 Apr 2018 17:58:12 -0400 Received: by mail-pf0-x241.google.com with SMTP id j5so3266686pfh.2 for ; Tue, 17 Apr 2018 14:58:11 -0700 (PDT) References: From: Richard Henderson Message-ID: <2a15b7bf-1502-6f95-6b7e-12a2990f5a05@linaro.org> Date: Tue, 17 Apr 2018 11:58:06 -1000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-arm] ARM memory barrier patch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Henry Wertz Cc: qemu-arm , QEMU Developers , Richard Henderson On 04/17/2018 11:51 AM, Peter Maydell wrote: > On 17 April 2018 at 22:32, Henry Wertz wrote: >> Please find submitted a patch for ARM memory barriers. This patch is >> against qemu-2.12-rc2 but I do believe it should apply for anything from >> 2.11.x to current. (the code being patched was added in for 2.11 series.) >> >> >> 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. >> >> Signed-off-by: Henry Wertz > > Reviewed-by: Peter Maydell > > Richard, did you want to take this via the tcg tree? Yes, I can do that. r~