From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxHVj-0003uZ-Rj for qemu-devel@nongnu.org; Tue, 26 May 2015 12:15:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxHVg-0004jk-Mk for qemu-devel@nongnu.org; Tue, 26 May 2015 12:15:23 -0400 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:36338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxHVg-0004je-Ib for qemu-devel@nongnu.org; Tue, 26 May 2015 12:15:20 -0400 Received: by qkx62 with SMTP id 62so93129944qkx.3 for ; Tue, 26 May 2015 09:15:20 -0700 (PDT) Sender: Richard Henderson Message-ID: <55649C14.1050207@twiddle.net> Date: Tue, 26 May 2015 09:15:16 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1432631384-470-1-git-send-email-aurelien@aurel32.net> In-Reply-To: <1432631384-470-1-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] target-s390x: fix LOAD MULTIPLE instruction on page boundary List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-devel@nongnu.org Cc: Alexander Graf On 05/26/2015 02:09 AM, Aurelien Jarno wrote: > This is an important detail in case the base register is in the list > of registers to be loaded. If a page fault occurs this register might be > overwritten and when the instruction is later restarted the wrong > base register value is useD. > > Fix this by first loading the first and last value from memory, hence > triggering all possible page faults, and then the remaining registers. > > This fixes random segmentation faults seen in the guest. > > Cc: Alexander Graf > Cc: Richard Henderson > Signed-off-by: Aurelien Jarno > --- > target-s390x/translate.c | 128 ++++++++++++++++++++++++++++++++++++----------- > 1 file changed, 99 insertions(+), 29 deletions(-) > > Changes v1->v2: > - Do the load in two steps: first and last registers, and then the remaining ones Reviewed-by: Richard Henderson r~