From patchwork Mon Nov 14 17:06:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 125581 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 DD8F6B721C for ; Tue, 15 Nov 2011 04:49:05 +1100 (EST) Received: from localhost ([::1]:50812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPzzQ-0003Xk-Ot for incoming@patchwork.ozlabs.org; Mon, 14 Nov 2011 12:06:36 -0500 Received: from eggs.gnu.org ([140.186.70.92]:56160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPzyP-0000Jr-Qh for qemu-devel@nongnu.org; Mon, 14 Nov 2011 12:05:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPzyJ-0003nI-UU for qemu-devel@nongnu.org; Mon, 14 Nov 2011 12:05:33 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49724 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPzyJ-0003l3-Nd for qemu-devel@nongnu.org; Mon, 14 Nov 2011 12:05:27 -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 D37E28FB3C; Mon, 14 Nov 2011 18:05:21 +0100 (CET) From: Alexander Graf To: qemu-devel Developers Date: Mon, 14 Nov 2011 18:06:30 +0100 Message-Id: <1321290400-32717-3-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1321290400-32717-1-git-send-email-agraf@suse.de> References: <1321290400-32717-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: blauwirbel@gmail.com Subject: [Qemu-devel] [PATCH 02/12] 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 */