Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Aug 2017 15:08:27 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322924 - head/contrib/cortex-strings/src/aarch64
Message-ID:  <201708261508.v7QF8RaQ017660@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Sat Aug 26 15:08:27 2017
New Revision: 322924
URL: https://svnweb.freebsd.org/changeset/base/322924

Log:
  Work around a bug in QEMU when loading data with a load pair instruction
  where the source register is also the first destination register.
  
  If this is the case, and we raise an exception in the middle of the
  instruction, for example the load is across two pages and the second page
  isn't mapped, QEMU will have overwritten the address with invalid data.
  
  This is a valid behaviour in most cases, with the exception of when a
  destination register is also use in address generation. As such switch
  the order of the registers to ensure the address register is second so it
  will be written to second, after any exceptions have happened.
  
  This has been acknowledged in upstream QEMU, however as the workaround is
  simple also handle it here.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/contrib/cortex-strings/src/aarch64/memcpy.S

Modified: head/contrib/cortex-strings/src/aarch64/memcpy.S
==============================================================================
--- head/contrib/cortex-strings/src/aarch64/memcpy.S	Sat Aug 26 14:07:24 2017	(r322923)
+++ head/contrib/cortex-strings/src/aarch64/memcpy.S	Sat Aug 26 15:08:27 2017	(r322924)
@@ -77,8 +77,8 @@
 #define D_h	x13
 #define E_l	src
 #define E_h	count
-#define F_l	srcend
-#define F_h	dst
+#define F_l	dst
+#define F_h	srcend
 #define tmp1	x9
 
 #define L(l) .L ## l



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708261508.v7QF8RaQ017660>