From patchwork Mon May 23 20:28:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 97057 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 D67E5B6FBA for ; Tue, 24 May 2011 06:38:24 +1000 (EST) Received: from localhost ([::1]:53321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObtO-0003MK-7i for incoming@patchwork.ozlabs.org; Mon, 23 May 2011 16:38:22 -0400 Received: from eggs.gnu.org ([140.186.70.92]:42912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObkn-0005YZ-Lp for qemu-devel@nongnu.org; Mon, 23 May 2011 16:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QObkm-0008P1-Ts for qemu-devel@nongnu.org; Mon, 23 May 2011 16:29:29 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:52905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObkm-0008Gw-RB for qemu-devel@nongnu.org; Mon, 23 May 2011 16:29:28 -0400 Received: by mail-gw0-f45.google.com with SMTP id 19so2711964gwb.4 for ; Mon, 23 May 2011 13:29:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=OH0rPrGCwcTUY7KtNax2iccvNYwwtKSe1LArQZtAcX0=; b=q5ykmgP7yA1rGurW/FL8vWJf50zIC3NVW8OKdotuRBCmWlQstCxVNltQDlxzCkR4CN oH9kSx/oDkjjyvL3cCBXeTZoJYWlQpWJfGUpeIHEAjJoIcTmb0geVi5sAJws189IjUPQ 844OJ5bnGGuGiqWeAHcEABpN3DbzvrRArg3bE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=u1movHruCwJr8tmsH5qPWwzq19/fqIrSpYyg1jPQvh/woUwgVA9UCgvEorqmu7XqV3 TiYeXYtoRuvyWDMa24fZXqVMID2hKTkWIO/bT/4zdc7Y8Ef2vfdhK5tM8FAWmhXQdrIk URB2tbP+DRm+LWg7lecjrIB/BuCBGCOA06YL8= Received: by 10.150.66.14 with SMTP id o14mr3097412yba.353.1306182568643; Mon, 23 May 2011 13:29:28 -0700 (PDT) Received: from localhost.localdomain (c-71-227-161-214.hsd1.wa.comcast.net [71.227.161.214]) by mx.google.com with ESMTPS id e9sm5033668ann.24.2011.05.23.13.29.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2011 13:29:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 23 May 2011 13:28:43 -0700 Message-Id: <1306182526-12081-24-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306182526-12081-1-git-send-email-rth@twiddle.net> References: <1306182526-12081-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.45 Subject: [Qemu-devel] [PATCH 23/26] target-alpha: Remap PIO space for 43-bit KSEG for EV6. 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 Signed-off-by: Richard Henderson --- target-alpha/helper.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/target-alpha/helper.c b/target-alpha/helper.c index 96b407b..bd3af38 100644 --- a/target-alpha/helper.c +++ b/target-alpha/helper.c @@ -220,14 +220,18 @@ static int get_physical_address(CPUState *env, target_ulong addr, /* Translate the superpage. */ /* ??? When we do more than emulate Unix PALcode, we'll need to - determine which superpage is actually active. */ - if (saddr < 0 && (saddr >> (TARGET_VIRT_ADDR_SPACE_BITS - 2) & 3) == 2) { - /* User-space cannot access kseg addresses. */ + determine which KSEG is actually active. */ + if (saddr < 0 && ((saddr >> 41) & 3) == 2) { + /* User-space cannot access KSEG addresses. */ if (mmu_idx != MMU_KERNEL_IDX) { goto exit; } + /* For the benefit of the Typhoon chipset, move bit 40 to bit 43. + We would not do this if the 48-bit KSEG is enabled. */ phys = saddr & ((1ull << 40) - 1); + phys |= (saddr & (1ull << 40)) << 3; + prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; ret = -1; goto exit;