From patchwork Wed Jan 18 22:38:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9524929 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A36466043A for ; Wed, 18 Jan 2017 23:08:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7689C2863F for ; Wed, 18 Jan 2017 23:08:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65DAC2862E; Wed, 18 Jan 2017 23:08:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17EDF28647 for ; Wed, 18 Jan 2017 23:08:01 +0000 (UTC) Received: from localhost ([::1]:44947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTzKi-0005DI-7L for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Jan 2017 18:08:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTytW-0006uZ-4m for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTytU-00030c-U0 for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:54 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTytU-000309-OV for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:52 -0500 Received: by mail-wm0-x241.google.com with SMTP id r126so7541123wmr.3 for ; Wed, 18 Jan 2017 14:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SAJi7FfrlSnnKjmLke2hU7o+uWkJ/aBXymXa7SlM8ew=; b=MSYsbV3kPBLyc0Yi94/Np9H6F8KP5KwQC1LNJ4f82HMmkJEy7ol6yQO9X0R8smJT8S BfUyF0sJtEECAtCeVl1/nXG5QDtAKJmkay/dzxB9Gbu/+/d0hFQxsPpbOFI1XUa1b5PI pY3XHEt06dSd31YKmyzS5+Ny60f8szbHySmy7F/ZG+6CiDeyBd1dPuB55xnQYYqW0AP5 T4jNDuqUIahsifL7adi/BNad63rzba9JipkIJB9FBL0GbuONn3LnsnMVvseE7MXAP6To 4VQHgkBw1KqhpEoMYCV9kwukTIWq2qhHZ6Sld/yd7pGNrOXHOE2mFp33YPjMjz/CEoiH b2Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SAJi7FfrlSnnKjmLke2hU7o+uWkJ/aBXymXa7SlM8ew=; b=mbuL6Evew9pLXEHbKwPI2XnqFsY54gy185KvCxsUMvZf550md6KXTllIf4NhBu1BK+ u91WDgRZ1rEEefNBtOXLwJm/1mOhwent/u+QyKDPZuj/SIXQ0X9QWrsnoRV/GjHUR0NL uhKclFXus/KEfkhtrj1MGBsVsl249dMl+ocUgXDJl/9ENfgMhuyE4xoCDd0FzarlZBdV zWj5T6G0DP93K83nHABDmddUwsORri9gMVvsD1yKqOSM4OAdku3xsNpkeuxJGcu6Ok27 VlqjEKsxA4VEw2JCMGk4nWpmO9cfI3JUFXxVFJjiMCgjXcljuIxGc4P/S64UUXojIB3p 3VwA== X-Gm-Message-State: AIkVDXJpDKWQafp8mqx8LT5+A54ADLlxHMMOoMzE4sxanSNARiys0HaADP5xpC0p9DkbTA== X-Received: by 10.28.127.73 with SMTP id a70mr23378994wmd.76.1484779191733; Wed, 18 Jan 2017 14:39:51 -0800 (PST) Received: from localhost (x4e33e2b8.dyn.telefonica.de. [78.51.226.184]) by smtp.gmail.com with ESMTPSA id t194sm576749wmd.1.2017.01.18.14.39.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 14:39:51 -0800 (PST) From: Artyom Tarasenko To: peter.maydell@linaro.org Date: Wed, 18 Jan 2017 23:38:38 +0100 Message-Id: <1484779123-18968-26-git-send-email-atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1484779123-18968-1-git-send-email-atar4qemu@gmail.com> References: <1484779123-18968-1-git-send-email-atar4qemu@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 25/30] target-sparc: implement UA2005 ASI_MMU (0x21) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, Artyom Tarasenko , rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Artyom Tarasenko --- target/sparc/ldst_helper.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c index 4f55388..c69167e 100644 --- a/target/sparc/ldst_helper.c +++ b/target/sparc/ldst_helper.c @@ -1396,6 +1396,18 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr, ret = env->scratch[i]; break; } + case ASI_MMU: /* UA2005 Context ID registers */ + switch ((addr >> 3) & 0x3) { + case 1: + ret = env->dmmu.mmu_primary_context; + break; + case 2: + ret = env->dmmu.mmu_secondary_context; + break; + default: + cpu_unassigned_access(cs, addr, true, false, 1, size); + } + break; case ASI_DCACHE_DATA: /* D-cache data */ case ASI_DCACHE_TAG: /* D-cache tag access */ case ASI_ESTATE_ERROR_EN: /* E-cache error enable */ @@ -1714,6 +1726,25 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, target_ulong val, env->scratch[i] = val; return; } + case ASI_MMU: /* UA2005 Context ID registers */ + { + switch ((addr >> 3) & 0x3) { + case 1: + env->dmmu.mmu_primary_context = val; + env->immu.mmu_primary_context = val; + tlb_flush_by_mmuidx(CPU(cpu), MMU_USER_IDX, MMU_KERNEL_IDX, -1); + break; + case 2: + env->dmmu.mmu_secondary_context = val; + env->immu.mmu_secondary_context = val; + tlb_flush_by_mmuidx(CPU(cpu), MMU_USER_SECONDARY_IDX, + MMU_KERNEL_SECONDARY_IDX, -1); + break; + default: + cpu_unassigned_access(cs, addr, true, false, 1, size); + } + } + return; case ASI_QUEUE: /* UA2005 CPU mondo queue */ case ASI_DCACHE_DATA: /* D-cache data */ case ASI_DCACHE_TAG: /* D-cache tag access */