From patchwork Fri Nov 4 20:50:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9413305 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 AB71A6022E for ; Fri, 4 Nov 2016 21:13:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DF912B09D for ; Fri, 4 Nov 2016 21:13:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92E1D2B0BA; Fri, 4 Nov 2016 21:13:51 +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 47CB02B09D for ; Fri, 4 Nov 2016 21:13:51 +0000 (UTC) Received: from localhost ([::1]:40816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2lo6-0002xG-EX for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 Nov 2016 17:13:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2lSv-0001Og-JQ for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2lSs-0004Wo-GN for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:57 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35300) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2lSs-0004Vy-AT for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:54 -0400 Received: by mail-wm0-x244.google.com with SMTP id 68so5629124wmz.2 for ; Fri, 04 Nov 2016 13:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=KorKtMLiQPvi4wwn+r8/hUBVEs05KL23F+cgBPR9OcM=; b=mvtRtJBWrbrw/9ScgPesRNSa7QG+eNCqLEYTdDSd52AJo+Pk30mhoCD3nOA4CyyyOj bOrZamfsAp+NmVyEu6fOH2ZZgY+dgPhCEQCME5X9vL4e1pd6UB9l2Ujg9zY+H0d39UKq LzhKEJ0/Dcy6wrBMdqeUWagF71xOk/pmxX2RrVr5ZPLyVvSrqUpuW62VvD4FcLpwOtEc PRb7LYgBIB1kHFhVCRbztQrXDg62iJTDVKJSBIAOvO/QV2ipYz/bCiIOjikXiVCI3EA5 K8HM15x8zgo6s+Vgv/C40Bvyg8m8CPV86SWGlSSb1k8H3NEeebgbqJBla6xNIgte8IeD 5uYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=KorKtMLiQPvi4wwn+r8/hUBVEs05KL23F+cgBPR9OcM=; b=j9UoIivLhX8jEoLP6PdIJGcqF2bfmz+WACxefQsEYi92vpVpwSSro3EGQjncLuHr+v Hs2xZoVGH7KFjiZbkilXufY3xWCfLOhY2N60aW1JpI22Zq4qdQMYcuklunIAIyzHzOfB je8hjSsHU5mmWjVOL4cM3ZMH3N7xdnN2FmauY9G5TgmY2DuGHdUEqwyEH6I7c0575K7B yvavsQ43BERjkT+WEbCUH4bnORQMGJCmR+RpEIfgT4UZwloC3xfw5cUYs33LmT9x+JEV XXg3euCtJ0lw+bVycVhMHp2ryKZork/Bd/+GvoiQ68lPZPtOrME39JespVG2zOTmf6JR OnbA== X-Gm-Message-State: ABUngvdPCp/hydxLUZziiFRA8+HXluQMZBI8d2eRO9SISvBYxPiiKYdt9tnF3GRgvVCZ4Q== X-Received: by 10.28.169.4 with SMTP id s4mr214866wme.65.1478292713280; Fri, 04 Nov 2016 13:51:53 -0700 (PDT) Received: from localhost (x55b4b5cf.dyn.telefonica.de. [85.180.181.207]) by smtp.gmail.com with ESMTPSA id 70sm6484396wmv.1.2016.11.04.13.51.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 13:51:52 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Fri, 4 Nov 2016 21:50:26 +0100 Message-Id: <22b09fa554e41743c8be399abe3a7b8b5ab7887a.1478291230.git.atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH v1 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 , Artyom Tarasenko , Richard Henderson 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 57b3b97..d34795a 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -1394,6 +1394,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 */ @@ -1712,6 +1724,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 */