From patchwork Mon May 9 21:34:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 94876 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 BE8ACB6F1B for ; Tue, 10 May 2011 07:42:52 +1000 (EST) Received: from localhost ([::1]:40049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJYE5-00087G-PP for incoming@patchwork.ozlabs.org; Mon, 09 May 2011 17:42:49 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJY6o-0003n9-LY for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJY6n-0006Mt-To for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:18 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:38418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJY6n-0006Af-LK for qemu-devel@nongnu.org; Mon, 09 May 2011 17:35:17 -0400 Received: by mail-iw0-f173.google.com with SMTP id 42so5560360iwl.4 for ; Mon, 09 May 2011 14:35:17 -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=xMik/Bjvq4CAYzbsOOVW+67kpackzvaulWMASGU9sS/wGSn/Wyc4B8qIgV4T1zbmOx aDdywhtFW6hQUGfbT4DMIQoE9fZm9ONAbD0TZq4X/h5r16smjbcYMXwiI3+1WdAZX+/P 1qzk6QkAkAHY3NQn3VerMJF3sdaQIl9B6fuEg= 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=xAhb2VLNZMaeNg/0pEpqfjQ/v1A93mNOryHszJcvN6Ps/J6n35ayXsa8fJIzwITwHx UAe8++4Y0ZpWkbsjPbpsfJEUYwHhebbTuYUZj8Njbe8mqNFYkYEliCPjwkzI1yo8MtTc lbiklOMoPpVcHcDG/mCcJTMU03Opo8FqGe+sE= Received: by 10.42.152.195 with SMTP id j3mr3263043icw.514.1304976917447; Mon, 09 May 2011 14:35:17 -0700 (PDT) Received: from localhost.localdomain (are.twiddle.net [75.101.38.216]) by mx.google.com with ESMTPS id ui7sm2549819icb.14.2011.05.09.14.35.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2011 14:35:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 9 May 2011 14:34:37 -0700 Message-Id: <1304976889-29675-24-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304976889-29675-1-git-send-email-rth@twiddle.net> References: <1304976889-29675-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.173 Subject: [Qemu-devel] [PATCH 23/35] 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;