From patchwork Sun Nov 13 15:33:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125435 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6D204B71F5 for ; Mon, 14 Nov 2011 03:29:09 +1100 (EST) Received: from localhost ([::1]:59238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPc4L-0004jB-6L for incoming@patchwork.ozlabs.org; Sun, 13 Nov 2011 10:34:05 -0500 Received: from eggs.gnu.org ([140.186.70.92]:54197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPc3Q-0002Ty-Dc for qemu-devel@nongnu.org; Sun, 13 Nov 2011 10:33:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPc3H-0006id-09 for qemu-devel@nongnu.org; Sun, 13 Nov 2011 10:33:07 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55861 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPc3G-0006iD-RQ for qemu-devel@nongnu.org; Sun, 13 Nov 2011 10:32:58 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id D92DB8C5DF; Sun, 13 Nov 2011 16:32:56 +0100 (CET) From: Alexander Graf To: qemu-devel Developers Date: Sun, 13 Nov 2011 16:33:44 +0100 Message-Id: <1321198434-2347-4-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1321198434-2347-1-git-send-email-agraf@suse.de> References: <1321198434-2347-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Blue Swirl Subject: [Qemu-devel] [PATCH 03/13] s390x: make ipte 31-bit aware 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 When running 31-bit code we can potentially map the same virtual address twice - once as 0x0yyyyyyy and once as 0x8yyyyyyy, because the upper bit gets ignored. This also should be reflected in the tlb invalidation path, so we really invalidate also the transparently created tlb entries. Signed-off-by: Alexander Graf --- target-s390x/op_helper.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c index e594118..2f46bdd 100644 --- a/target-s390x/op_helper.c +++ b/target-s390x/op_helper.c @@ -2950,6 +2950,13 @@ void HELPER(ipte)(uint64_t pte_addr, uint64_t vaddr) /* XXX we exploit the fact that Linux passes the exact virtual address here - it's not obliged to! */ tlb_flush_page(env, page); + + /* XXX 31-bit hack */ + if (page & 0x80000000) { + tlb_flush_page(env, page & ~0x80000000); + } else { + tlb_flush_page(env, page | 0x80000000); + } } /* flush local tlb */