From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtGET-0005l1-JA for qemu-devel@nongnu.org; Fri, 15 May 2015 10:04:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtGEN-0003Vk-3T for qemu-devel@nongnu.org; Fri, 15 May 2015 10:04:57 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:2316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtGEM-0003Vg-Ug for qemu-devel@nongnu.org; Fri, 15 May 2015 10:04:51 -0400 Message-ID: <5555FCF8.7030903@imgtec.com> Date: Fri, 15 May 2015 15:04:40 +0100 From: Leon Alrae MIME-Version: 1.0 References: <1431531457-17127-1-git-send-email-yongbok.kim@imgtec.com> <1431531457-17127-3-git-send-email-yongbok.kim@imgtec.com> <5553A5C4.6030902@twiddle.net> <55546FF2.1030405@imgtec.com> <5554BED5.3070802@twiddle.net> <5554F38E.3070503@twiddle.net> <5555E1DE.1010506@imgtec.com> <5555F7F7.3020401@twiddle.net> In-Reply-To: <5555F7F7.3020401@twiddle.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 2/2] target-mips: Misaligned memory accesses for MSA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , Yongbok Kim , qemu-devel@nongnu.org Cc: Peter Maydell , afaerber@suse.de, Paolo Bonzini On 15/05/2015 14:43, Richard Henderson wrote: > On 05/15/2015 05:09 AM, Leon Alrae wrote: >> On 14/05/2015 20:12, Richard Henderson wrote: >>> /* We know both pages are present and writable. */ >>> if (eaddr == baddr + 15) { >>> /* Consecutive pages in RAM. */ >>> memcpy(baddr, register, 16); >>> } else { >>> /* Someone's doing an MSA store to device memory. */ >>> for (i = 0; i < 2; ++i) { >>> helper_ret_stq_mmu(env, vaddr + i*8, register.d[0], >>> make_memop_idx(MO_UNALN | MO_TEQ, mmu_idx), >>> GETRA()); >>> } >>> } >> >> We would additionally need to take care of vector elements' endianness >> before using this code. Therefore always using helper_ret_st[bwlq]_mmu >> (depending on data format) in a loop probably is simpler. > > I suppose. I'd thought one of the patches defined functions to do the > swapping, so I assumed that would still be used. IIUC they were required because of the byte access workaround, but now with the MO_UNALN support in TCG (thanks for this!) neither the workaround nor the swapping is needed for MSA I think. Leon