From patchwork Wed May 16 18:51:17 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: 10404685 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 ADC4C601F7 for ; Wed, 16 May 2018 18:57:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B55528653 for ; Wed, 16 May 2018 18:57:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D8AF2866B; Wed, 16 May 2018 18:57:30 +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=-4.0 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FSL_HELO_FAKE, MAILING_LIST_MULTI, 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 1F58B28653 for ; Wed, 16 May 2018 18:57:30 +0000 (UTC) Received: from localhost ([::1]:34189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ1c9-0007eQ-Bf for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 May 2018 14:57:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ1Wu-000337-Ub for qemu-devel@nongnu.org; Wed, 16 May 2018 14:52:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJ1Wu-0000jl-8r for qemu-devel@nongnu.org; Wed, 16 May 2018 14:52:05 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:35827) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJ1Wu-0000ja-1F for qemu-devel@nongnu.org; Wed, 16 May 2018 14:52:04 -0400 Received: by mail-wm0-x230.google.com with SMTP id o78-v6so4302670wmg.0 for ; Wed, 16 May 2018 11:52:03 -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=F8YuqPcoMlrPY8X1uzL8nO/RxQ4DLnZlQjO6I/YPEDc=; b=F481dIL8VpLwnrS+PFnDewehYEkEXI1Xdmhmr2qekzz+oUyzKCJEDWwoWsQAUGWoR+ yAWFZ3HCf2ACWTyoO6M3bug9o5pe8T1GG6o1PKAlPV8aRwJEfv7d1aGwvG2tZnFlP6iY DfDtg05Bbzrpqr81kRhBE2njf3LRrsZyGjIbmvDUJZA7Vl/DHYhCW/I2I5ucMiMzogcF gCuOtCTHbypmHvUI29Gh5EzmDyALoukp4KukE3FMSRfc+hDoWKvzdvje2fogmOHocNpm wZOABlFe1YMNck1ebqAqASp/jlCVQHh/C5S0ZjZ54i2ejNw2dPVNgeDOc9CsrEJ3oSnG 081Q== 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=F8YuqPcoMlrPY8X1uzL8nO/RxQ4DLnZlQjO6I/YPEDc=; b=um50jhwKXPjKmoWkJV9qnTEwbShAeGulG6qff6Qyv2iZAACjmVNiOAu9eRhmpRA1qh 3Mt9Kq0VauNrkT2qHFMPcQ8nuSNm0o0/lzp0scmDde/j5893X17JXvq64AC2DZDtV8+m DfDbrHgbgSWQePgcs/3ouhALPTxj5pJ6sURqlF3UZTwywCCHhZfocW/SiDrrvVx+gDCf t1Wq/nPxA32aLSm3OSL94iRVJDZN2dPnGB8zpmsIF3iDNvnfkk6bksfrodfrGSN5ewQo jk/NInI/MNRpo1xbAY6GzEOBlsoOKCxnCdmBiqljmveQ4UsPMaAchr/ttfvJoRQRG5/d gP2w== X-Gm-Message-State: ALKqPwf4i3v60iBVnvV17fxWnptORwvMZOLpnrcPUFtBk+HkGMhpdLBq jqcuLyEUJiPR4T1dspqcjAYcPw== X-Google-Smtp-Source: AB8JxZoHMiN9hdH2A34okjMQBO8y396Vm9XTJZn8VvL8Azt14dDvOSfHAuPRR7LJY7rXxF/I2zxB4Q== X-Received: by 2002:a2e:740b:: with SMTP id p11-v6mr1221395ljc.59.1526496722639; Wed, 16 May 2018 11:52:02 -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 m202-v6sm779410lfg.36.2018.05.16.11.52.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 11:52:01 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Wed, 16 May 2018 20:51:17 +0200 Message-Id: <20180516185146.30708-10-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180516185146.30708-1-edgar.iglesias@gmail.com> References: <20180516185146.30708-1-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::230 Subject: [Qemu-devel] [PATCH v3 09/38] target-microblaze: Conditionalize setting of PVR11_USE_MMU 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, sstabellini@kernel.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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Conditionalize setting of PVR11_USE_MMU on the use_mmu CPU property, otherwise we may incorrectly advertise an MMU via PVR when the core in fact has none. Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 06476f6efc..6fdf0fd223 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -201,7 +201,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) PVR5_DCACHE_WRITEBACK_MASK : 0; env->pvr.regs[10] = 0x0c000000; /* Default to spartan 3a dsp family. */ - env->pvr.regs[11] = PVR11_USE_MMU | (16 << 17); + env->pvr.regs[11] = cpu->cfg.use_mmu ? PVR11_USE_MMU : 0 | + 16 << 17; mcc->parent_realize(dev, errp); }