From patchwork Thu Feb 12 17:09:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Freimann X-Patchwork-Id: 439277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3DE6A140146 for ; Fri, 13 Feb 2015 04:19:40 +1100 (AEDT) Received: from localhost ([::1]:51381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLxQQ-0001gL-0m for incoming@patchwork.ozlabs.org; Thu, 12 Feb 2015 12:19:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLxHn-0003pG-9X for qemu-devel@nongnu.org; Thu, 12 Feb 2015 12:10:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLxHf-0008Ge-1f for qemu-devel@nongnu.org; Thu, 12 Feb 2015 12:10:43 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:50792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLxHe-0008GC-NO for qemu-devel@nongnu.org; Thu, 12 Feb 2015 12:10:34 -0500 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Feb 2015 17:10:34 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 12 Feb 2015 17:10:32 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 239B917D8042 for ; Thu, 12 Feb 2015 17:10:43 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1CH9l4F9306572 for ; Thu, 12 Feb 2015 17:09:47 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1CH9kX6025352 for ; Thu, 12 Feb 2015 10:09:46 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t1CH9jsq025343; Thu, 12 Feb 2015 10:09:45 -0700 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 1122) id 8F3491224459; Thu, 12 Feb 2015 18:09:45 +0100 (CET) From: Jens Freimann To: Christian Borntraeger , Alexander Graf , Cornelia Huck Date: Thu, 12 Feb 2015 18:09:19 +0100 Message-Id: <1423760982-8474-3-git-send-email-jfrei@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1423760982-8474-1-git-send-email-jfrei@linux.vnet.ibm.com> References: <1423760982-8474-1-git-send-email-jfrei@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15021217-0029-0000-0000-00000357EBC8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.113 Cc: Jens Freimann , qemu-devel@nongnu.org, Thomas Huth Subject: [Qemu-devel] [PATCH 02/25] s390x/mmu: Fix the check for the real-space designation bit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth The real-space designation bits live in the ASCEs, not in the table entries, so the check must be done before we start walking the MMU table. Signed-off-by: Thomas Huth Signed-off-by: Jens Freimann Reviewed-by: David Hildenbrand --- target-s390x/mmu_helper.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/target-s390x/mmu_helper.c b/target-s390x/mmu_helper.c index fc4f7c5..c845cd4 100644 --- a/target-s390x/mmu_helper.c +++ b/target-s390x/mmu_helper.c @@ -180,13 +180,6 @@ static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr, return -1; } - if (asce & _ASCE_REAL_SPACE) { - /* direct mapping */ - - *raddr = vaddr; - return 0; - } - origin = asce & _ASCE_ORIGIN; switch (level) { @@ -252,6 +245,12 @@ static int mmu_translate_asc(CPUS390XState *env, target_ulong vaddr, break; } + if (asce & _ASCE_REAL_SPACE) { + /* direct mapping */ + *raddr = vaddr; + return 0; + } + switch (asce & _ASCE_TYPE_MASK) { case _ASCE_TYPE_REGION1: break;