From patchwork Mon Jun 18 18:40:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 139056 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4287739lji; Mon, 18 Jun 2018 11:51:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLem8qp5ZAFX4mZLfVJ2qTXE4TxFBsmtxVwMcWC+bkns3MPtdNtgF4qBAKDAct2x8YBcCn/ X-Received: by 2002:a37:3ca:: with SMTP id 193-v6mr10979181qkd.432.1529347871280; Mon, 18 Jun 2018 11:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529347871; cv=none; d=google.com; s=arc-20160816; b=a0txIK6jDzk6ZnlkqQ2Cf5EmbrrtB/Ew3keBGfH74p7NnHZHSIB0zuHrCnAo9VsPWH yXxTO9lSvKDo/fsQm/NW21t6rZdRY74AjvJIU1oFx5Kloy06M0zq4dgBtFSBE9S/CLnS pjywJZ5YmrGuYZCADbynee/CJ5HaedioxhoS4GoYP3xL9pO2GrvkUBnQ4j2wcO7Zhja4 iGI7CZOx1/IBIbwViX58x3SJR1UgAZJ10xNGw5E/MvJAH2lqZDzxsF85R0TjQ4yDiiVH OWnWudkdAXi2QaV5UahQe8VDBxHaZM4y8Tq9RITeUq6jRqvak4vxWB65VfpUuUoBhyxH /vYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=V/jeWmFGQVVeKWPcvaBSAlQuL/FGCb4V1yNp9F8huX4=; b=lCBi67UmiAPXwyDJ9IZZx/E7A2IExTyiElHuhbiBPAyOzUrZN+yg5OVRMOSBvlh2rL 8uLOivPCY5Hx/0gF9w0OYZLEq8lnZYEzXhfOqr9pN9OiHMY6fj4wW+Zg/vnYuK2IkcgN ndBS+elLpxUZnJ+eSEslpBo1WEGIfpLP+T+r+KKdQPy5YtfSosTxvamhlFiTn0up+kRT Vgbm22bE2NR/OuYWI27xQF0uB6iN4ItEehcQdFGWqeqrGpECX3XNuPOKHALLhJDlBWRe cvuW90JnFg3l/V+v+TocpGeS9J20hoEuacMQ+6jxd5i1s+eQnV44DDnhf22d06E0AdsW M/Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jf5r+Wej; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p17-v6si1987219qvf.115.2018.06.18.11.51.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Jun 2018 11:51:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jf5r+Wej; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUzF8-0002tT-O6 for patch@linaro.org; Mon, 18 Jun 2018 14:51:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUz5f-0003ZG-Bx for qemu-devel@nongnu.org; Mon, 18 Jun 2018 14:41:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUz5d-0004yO-VI for qemu-devel@nongnu.org; Mon, 18 Jun 2018 14:41:23 -0400 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]:34540) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUz5d-0004xK-Pj for qemu-devel@nongnu.org; Mon, 18 Jun 2018 14:41:21 -0400 Received: by mail-pf0-x231.google.com with SMTP id a63-v6so8613279pfl.1 for ; Mon, 18 Jun 2018 11:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V/jeWmFGQVVeKWPcvaBSAlQuL/FGCb4V1yNp9F8huX4=; b=jf5r+Wejt3mGA9xulBqhI0KH04CstPoTbBHq72G2R/EjBTx2Keg7JBfjQV/1pBcPVa fq3Ce9jLVb81bY2/nRyIpBjJTCvOw1XioqmeRlAvm7SKIQevh59XudMJIGFbvjyfN5/O J2yfGuV4byHOZ2hQixMMFrHcFQ0tqzA9L6LI8= 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=V/jeWmFGQVVeKWPcvaBSAlQuL/FGCb4V1yNp9F8huX4=; b=etpoHGEgGorwLue1PxPF4ByJ8WtppHCLvvqasZdvJbXcrv21h4tYNvsJD4Tiz/F2Zj RDiX1TxF6v9Rj/QzQea6yqJqb7WIArTxtRX8p6fj4aNO1xr07M2NuNFbHfY216yQWC2Y 0GCtmk2JDVcVgKYFSeWqOUB526dZlfbvUm00LxvH88601aflFs4HIubDaSNgOFl7EmAj sw2AXBbxqf0WKyuKLi7O2J+lZI+ma9w/TAcUGBmeJhVDkjvDKXtdMIwS027+rTx5XeqJ Ah3/TiZFMovCft3JlGoTL4y/pGNdvgV3WsOwcmvFUzru6qa5mnnBNGMbqOZebz8bb0DT DIAQ== X-Gm-Message-State: APt69E2hEu079c9wIF1S4I44gHjLnyDrTQMmJnUN3Nxt5JrVnAUHc8pc Ai77d3/vse8kXIDVtr7wFRJRPptqHQQ= X-Received: by 2002:a65:660a:: with SMTP id w10-v6mr11765294pgv.366.1529347280560; Mon, 18 Jun 2018 11:41:20 -0700 (PDT) Received: from cloudburst.twiddle.net (mta-98-147-121-51.hawaii.rr.com. [98.147.121.51]) by smtp.gmail.com with ESMTPSA id i65-v6sm49457254pfd.17.2018.06.18.11.41.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 11:41:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 18 Jun 2018 08:40:41 -1000 Message-Id: <20180618184046.6270-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618184046.6270-1-richard.henderson@linaro.org> References: <20180618184046.6270-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::231 Subject: [Qemu-devel] [PATCH v2 17/22] target/openrisc: Increase the TLB size 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: shorne@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The architecture supports 128 TLB entries. There is no reason not to provide all of them. In the process we need to fix a bug that failed to parameterize the configuration register that tells the operating system the number of entries. Signed-off-by: Richard Henderson --- v2: - Change VMState version. --- target/openrisc/cpu.h | 2 +- target/openrisc/cpu.c | 6 ++++-- target/openrisc/machine.c | 5 ++--- 3 files changed, 7 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index 53abe965e8..8035654087 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -222,7 +222,7 @@ enum { /* TLB size */ enum { - TLB_SIZE = 64, + TLB_SIZE = 128, TLB_MASK = TLB_SIZE - 1, }; diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 4c166c6329..677f02efa4 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -52,8 +52,10 @@ static void openrisc_cpu_reset(CPUState *s) cpu->env.upr = UPR_UP | UPR_DMP | UPR_IMP | UPR_PICP | UPR_TTP | UPR_PMP; - cpu->env.dmmucfgr = (DMMUCFGR_NTW & (0 << 2)) | (DMMUCFGR_NTS & (6 << 2)); - cpu->env.immucfgr = (IMMUCFGR_NTW & (0 << 2)) | (IMMUCFGR_NTS & (6 << 2)); + cpu->env.dmmucfgr = (DMMUCFGR_NTW & (0 << 2)) + | (DMMUCFGR_NTS & (ctz32(TLB_SIZE) << 2)); + cpu->env.immucfgr = (IMMUCFGR_NTW & (0 << 2)) + | (IMMUCFGR_NTS & (ctz32(TLB_SIZE) << 2)); #ifndef CONFIG_USER_ONLY cpu->env.picmr = 0x00000000; diff --git a/target/openrisc/machine.c b/target/openrisc/machine.c index 3fc837b925..1eedbf3dbe 100644 --- a/target/openrisc/machine.c +++ b/target/openrisc/machine.c @@ -38,9 +38,8 @@ static const VMStateDescription vmstate_tlb_entry = { static const VMStateDescription vmstate_cpu_tlb = { .name = "cpu_tlb", - .version_id = 1, - .minimum_version_id = 1, - .minimum_version_id_old = 1, + .version_id = 2, + .minimum_version_id = 2, .fields = (VMStateField[]) { VMSTATE_STRUCT_ARRAY(itlb, CPUOpenRISCTLBContext, TLB_SIZE, 0, vmstate_tlb_entry, OpenRISCTLBEntry),