From patchwork Tue May 8 17:31:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 910364 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ku3wTrXw"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gRYV3BqJz9s0W for ; Wed, 9 May 2018 03:38:54 +1000 (AEST) Received: from localhost ([::1]:52588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG6Zf-0004bm-Sp for incoming@patchwork.ozlabs.org; Tue, 08 May 2018 13:38:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG6TB-00089f-Gh for qemu-devel@nongnu.org; Tue, 08 May 2018 13:32:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG6TA-0005Jx-Iu for qemu-devel@nongnu.org; Tue, 08 May 2018 13:32:09 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:44878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fG6TA-0005Jb-Bq for qemu-devel@nongnu.org; Tue, 08 May 2018 13:32:08 -0400 Received: by mail-lf0-x244.google.com with SMTP id h197-v6so47004804lfg.11 for ; Tue, 08 May 2018 10:32:08 -0700 (PDT) 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=3KUDo4dh/s/YhTgxTbAxINfl/AMfZjMpg+hhn9W3sRI=; b=Ku3wTrXwazGehnG7UCFIAUKanf/GQNCzb4eUvmf6Tz0nr2dVyGGil6TEOmu625ev0u hFgpxeekqsRNGR5x0TqHs87rKgm00MGzBjelUgcbgXLd/6/S0rOZwPkdeEGrkDJeJw4e EWf9NY+bQNLBxqXwuO4cq38kmmfPnZYuic6/Fjzh1KA46nZIiSjCi+ApnnmLYKu3J8KT HH1U+vZXAHz9G/VQ77u0WmIyOhali/SodTyPvpgI6hhLryZ8gXhkBiTRSYUaWRIXzLWd fAPbMCA+d6AGTFf73QPr0zq5qBzkF5pFaJojXy0CkzJODdvq12ogn8RpN0AYsdQsIlkH pgkg== 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=3KUDo4dh/s/YhTgxTbAxINfl/AMfZjMpg+hhn9W3sRI=; b=ezD7l1EFe/hSdB96VOXYDcWyqMB5C7dqwz+REDiBZs9JxOKz5uCE7S9fVyj8LGdPpE 1Ld5FGScvUvQlVmfb+DxgyLa0MJ13v1camB8rzIB/MnX5FQdm5z6lE2LujUwCuhQ5zPZ hB6z8Ws+qO+d04HAcDi5FdFgkCtAyWmvaYSQBZ1M68ciYU02fGCEEzSf7+n63/NtusP8 uT/q7V+YeGSGuWJZ5YDLWixKtDy9hJOfScheIYPCRhHihIVsnXV1Xb8/ULRcLLMt8ec/ g4YHGomeVO84E4JIskxBPgtJOneu0Oje/h48bogzaF3ONFX/lU+CNfkDUK73F6ybtkT2 uKLg== X-Gm-Message-State: ALKqPwcPTIdtCg6ey7BwDJQ2+ZOjuC0eEptrvEiB619YPziBfRrwdqV+ w0+i0xc1RheyimJQJTAVegQchw== X-Google-Smtp-Source: AB8JxZq/eiWBjz3Qc6jN7R7vEoPWziresSWRoBaK6DIVwx5OiHytD+iCIOOAfYPDcMPnwrmI/5j+Ow== X-Received: by 2002:a19:b257:: with SMTP id b84-v6mr5476145lff.84.1525800726845; Tue, 08 May 2018 10:32:06 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id c12-v6sm4865261lji.59.2018.05.08.10.32.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 May 2018 10:32:05 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 8 May 2018 19:31:24 +0200 Message-Id: <20180508173152.29327-9-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180508173152.29327-1-edgar.iglesias@gmail.com> References: <20180508173152.29327-1-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PATCH v2 08/36] target-microblaze: Remove USE_MMU PVR checks 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" We already have a CPU property to control if a core has an MMU or not. Remove USE_MMU PVR checks in favor of looking at the property. Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson --- target/microblaze/helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 387d4aca5a..a9f4ca93e3 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -54,21 +54,11 @@ int mb_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw, MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); CPUMBState *env = &cpu->env; unsigned int hit; - unsigned int mmu_available; int r = 1; int prot; - mmu_available = 0; - if (cpu->cfg.use_mmu) { - mmu_available = 1; - if ((cpu->cfg.pvr == C_PVR_FULL) && - (env->pvr.regs[11] & PVR11_USE_MMU) != PVR11_USE_MMU) { - mmu_available = 0; - } - } - /* Translate if the MMU is available and enabled. */ - if (mmu_available && (env->sregs[SR_MSR] & MSR_VM)) { + if (cpu->cfg.use_mmu && (env->sregs[SR_MSR] & MSR_VM)) { uint32_t vaddr, paddr; struct microblaze_mmu_lookup lu;