From patchwork Mon Jul 2 13:58:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 10501525 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 C6E9A60545 for ; Mon, 2 Jul 2018 14:19:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5EA52899F for ; Mon, 2 Jul 2018 14:19:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A903728B8E; Mon, 2 Jul 2018 14:19:55 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 5102E2899F for ; Mon, 2 Jul 2018 14:19:55 +0000 (UTC) Received: from localhost ([::1]:33069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzgI-0000n8-Jk for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 Jul 2018 10:19:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzM6-0002lL-QI for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:59:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZzM4-0008N0-WD for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:59:02 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:36617) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZzM4-0008Me-Pq for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:59:00 -0400 Received: by mail-pg0-x242.google.com with SMTP id m19-v6so3662939pgv.3 for ; Mon, 02 Jul 2018 06:59:00 -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=pNLpyMH2MtrDqswU9mlulZblcEuP061D6R6k4Avg5bA=; b=d2PMppn0DeQ5yLZHtGkEZu40eRNQ1+657tKukHaQv2f5cWcG+0twGUUuSN0q4WHgxX Qrj74Q0Tth0UtP0+y7q+z1q74KPlX3+P11muHO63T2PDK35mWSnBUjkspbUJE6xvtujy dhWQElJCvlmnU4BJUQ6toQ/2Ed7Jy6JeUKZC816Q9nXiqDAHczOMhQlp+eo7V4WsUtoM 8H2O/+8XbZaEr97GJj+Fj4FHFvom9Ft8mAs70d+RDf8hy/kIG7xaizrhyfP4Fe8YpvGG /4nXe1aCJqg76RhnOTDIoRdp+67Ffk22UK6KYEhXXDYwInmkUTVP7k6EHf/AIB+4Mmvc RjwA== 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=pNLpyMH2MtrDqswU9mlulZblcEuP061D6R6k4Avg5bA=; b=EI9cZqqYOW30F1RLEUB4VlQ2GjcX3wD2aWMRzFR1SsXiH7DWPEojodbejPTJZVW80C xp7ZJirB64k9pEdMU1FdCakaWYBNA+DnOU/XErjdV7agJn9M8rEKYE40ngq7rdELCFF9 iSHOXj1Gk/BeFvtJ+MHjB6LEOZZvUbLZd1N0JNgVdybB66ZPV+QY7lfWDuVUXJGBwcqQ wvZ/UPvlyr/9oiHbn29dpvct0amt4PO4p1m5jWz2O307ZkZFePwq8hMpFFsgaJTM3Fyf cL1NGSL6gjmNkEFXod36rB1OPK+Fmh22YtV0ZWu+dAF09Y9JNk/cXWtydk5Qee2aFLy6 L+vg== X-Gm-Message-State: APt69E3U9MIdOVOJqtSwLQ3u7AbxZ39lIxZnt88kWxBzVDlhJxAYa6Wd MU0lHXQ4JjgD3he9niuVBmQ= X-Google-Smtp-Source: ADUXVKK0Okzv/H90sVcmbeVZnlwK7lOFaZot6d/e3pvugEYTlXQA26NarYPTBPuHfvlhEgAZcNaOQw== X-Received: by 2002:a63:6741:: with SMTP id b62-v6mr22043323pgc.5.1530539939848; Mon, 02 Jul 2018 06:58:59 -0700 (PDT) Received: from localhost (g90.124-44-6.ppp.wakwak.ne.jp. [124.44.6.90]) by smtp.gmail.com with ESMTPSA id m10-v6sm25009762pgq.89.2018.07.02.06.58.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 06:58:59 -0700 (PDT) From: Stafford Horne To: Peter Maydell Date: Mon, 2 Jul 2018 22:58:00 +0900 Message-Id: <20180702135806.7087-20-shorne@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180702135806.7087-1-shorne@gmail.com> References: <20180702135806.7087-1-shorne@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PULL 19/25] 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: Stafford Horne , Richard Henderson , QEMU Development Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Richard Henderson 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 Signed-off-by: Stafford Horne --- v2: - Change VMState version. --- target/openrisc/cpu.c | 6 ++++-- target/openrisc/cpu.h | 2 +- target/openrisc/machine.c | 5 ++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index b92de51ecf..e01ce9ed1c 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -57,8 +57,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/cpu.h b/target/openrisc/cpu.h index 47e94659e1..b180e30e9e 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/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),