From patchwork Wed Jul 3 08:40:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11029169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 941E71398 for ; Wed, 3 Jul 2019 09:07:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81E3627F7F for ; Wed, 3 Jul 2019 09:07:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7368628968; Wed, 3 Jul 2019 09:07:49 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1943227F7F for ; Wed, 3 Jul 2019 09:07:49 +0000 (UTC) Received: from localhost ([::1]:33913 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hibEy-0006ma-Db for patchwork-qemu-devel@patchwork.kernel.org; Wed, 03 Jul 2019 05:07:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51494) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiapn-0006CX-E9 for qemu-devel@nongnu.org; Wed, 03 Jul 2019 04:41:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiapi-0007IC-RV for qemu-devel@nongnu.org; Wed, 03 Jul 2019 04:41:47 -0400 Received: from mail-lj1-f176.google.com ([209.85.208.176]:44249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hiaph-00079x-Rt for qemu-devel@nongnu.org; Wed, 03 Jul 2019 04:41:42 -0400 Received: by mail-lj1-f176.google.com with SMTP id k18so1450895ljc.11 for ; Wed, 03 Jul 2019 01:41:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=CCTUA83WsmaGam2XV7hw8vEWvHgX2YXg8c48BvbdAho=; b=GJKs9P738fHDrI+6IJCKcAw4k4bC1v8JtMQz4bYmr2OxafwI9Q7LtCBw2/i1rMZqsS aLEOl7HvDxBqLMf8wMnzJ8+H9oT7wZhpbNtuPqYFaepzJk82sXVnqYdiM7tCQurJYkRk KPwbJf6IeIGRjFKNdlbyGRzveem2sKmFPd6YSDZG6OLFptCb7FEQqub8zc38QxkeqCND P63oGw3/KLo1bSR3Rp480wS1SQyClnAUVpEpq8jNRmDGleZ681MfSHJStjKDF7fiCS54 fcLEFqcmFSOLMTyo+n2ZDeQc1AuBN+d/moLwR7wr9RhjvAhLSRwIt4FxJkjoNQiZR7p6 LVVA== X-Gm-Message-State: APjAAAV8dgW0QmyaH93p4mydmzMJllk01BT5nwdb1fOTDxG3vggYmj9G RhKLYZ+W1HTlTXNULUdfAtOIt4Zae7rlPg== X-Google-Smtp-Source: APXvYqxGJt5wVKU0cwAAl9cE8Cx+R3FTZ4xPgJuQDOa8Oo554v/Gj4878RpUVq7nN1j5ceZqq0jHLg== X-Received: by 2002:a2e:870f:: with SMTP id m15mr20205143lji.223.1562143298179; Wed, 03 Jul 2019 01:41:38 -0700 (PDT) Received: from localhost ([134.17.27.127]) by smtp.gmail.com with ESMTPSA id v21sm347593lje.10.2019.07.03.01.41.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 03 Jul 2019 01:41:37 -0700 (PDT) Date: Wed, 3 Jul 2019 01:40:32 -0700 Message-Id: <20190703084048.6980-17-palmer@sifive.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190703084048.6980-1-palmer@sifive.com> References: <20190703084048.6980-1-palmer@sifive.com> MIME-Version: 1.0 From: Palmer Dabbelt To: Peter Maydell X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.208.176 Subject: [Qemu-devel] [PULL 16/32] target/riscv: Set privledge spec 1.11.0 as default X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , Palmer Dabbelt , qemu-riscv@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Alistair Francis Set the priv spec version 1.11.0 as the default and allow selecting it via the command line. Signed-off-by: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- target/riscv/cpu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 17467c3d8705..ba1325f43533 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -111,7 +111,7 @@ static void riscv_any_cpu_init(Object *obj) { CPURISCVState *env = &RISCV_CPU(obj)->env; set_misa(env, RVXLEN | RVI | RVM | RVA | RVF | RVD | RVC | RVU); - set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_10_0); + set_versions(env, USER_VERSION_2_02_0, PRIV_VERSION_1_11_0); set_resetvec(env, DEFAULT_RSTVEC); } @@ -316,7 +316,7 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp) RISCVCPU *cpu = RISCV_CPU(dev); CPURISCVState *env = &cpu->env; RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(dev); - int priv_version = PRIV_VERSION_1_10_0; + int priv_version = PRIV_VERSION_1_11_0; int user_version = USER_VERSION_2_02_0; target_ulong target_misa = 0; Error *local_err = NULL; @@ -328,7 +328,9 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp) } if (cpu->cfg.priv_spec) { - if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) { + if (!g_strcmp0(cpu->cfg.priv_spec, "v1.11.0")) { + priv_version = PRIV_VERSION_1_11_0; + } else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.10.0")) { priv_version = PRIV_VERSION_1_10_0; } else if (!g_strcmp0(cpu->cfg.priv_spec, "v1.9.1")) { priv_version = PRIV_VERSION_1_09_1;