From patchwork Thu Oct 15 15:21:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Baturo X-Patchwork-Id: 1382739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; 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.a=rsa-sha256 header.s=20161025 header.b=OXVszxVL; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBtNV5tSMz9sV0 for ; Fri, 16 Oct 2020 02:23:54 +1100 (AEDT) Received: from localhost ([::1]:43006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT56e-0000tr-NL for incoming@patchwork.ozlabs.org; Thu, 15 Oct 2020 11:23:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT54h-0007Gr-D7; Thu, 15 Oct 2020 11:21:51 -0400 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:35983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kT54f-00060E-J5; Thu, 15 Oct 2020 11:21:50 -0400 Received: by mail-ed1-x543.google.com with SMTP id l16so3519930eds.3; Thu, 15 Oct 2020 08:21:48 -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:mime-version :content-transfer-encoding; bh=aJ0KQb6Ozzm+TKAEStsx77t+LpGGqIZVP5UuxdMy3MY=; b=OXVszxVLFimgwpIqc1n0s1xqtuShZsq5Xrpbqa/ixMYQ/4Ow2UfcRIVTYuTWNZ7D7H g937XVt7oSZHMfzBC84e6Uy4m8iIb+m0b6Z+OB+tSacT5ZAe562W6qF0wBaDli22rVkM 0fIplViQQ0L2yy7U4MsCu04UZ8bY9cS9VjDvYlc3/SuN3C8GRP8R13sWAuhdyxJI6Bxx uc9VQQfWzKC9CHOiw5fKW64PyQ2qcZQ6pOaYIf0hSvPMlYrNfzZoMOOnk4HCBcTljtP+ mcLYlGzSDI5rueElXo/JvE7n9QUK0Ijp7orF4WsicfeMcpA8BNaqUHlTb+Q/JniSjx3r iL3g== 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:mime-version :content-transfer-encoding; bh=aJ0KQb6Ozzm+TKAEStsx77t+LpGGqIZVP5UuxdMy3MY=; b=r8QZlKDrgVE3zqOPSGbgR4xFStv43RsQe82ozMVwfk7T5Eu8z7n3f0o9yOJsTZOyLb Z1V+/fHsj9vD7XMWVFA47yC+SaAeZi004mjSzU/EAD8ZCe4v0uLfgM/9vaFtn7vZJ+31 Z3HNrL+Ok9IvxK1W4SU3UeB8UBlX993TbVTxec3IZs2xhbuSNSIPlNUrTGVJt3QBoYKj jAPZG2DR7Gea/ZAWbTtnmOmEJtBELc6VD/LWBFY/RJqcZsL+q+iu59TDNOSlNTnxkVA3 +wp4I7aT38dNluF3TwIF2i7jOUxYCUPL/X4PMeu/eRQLTkDv/1uDqRTEZXYqU6WzHM0Q iI7g== X-Gm-Message-State: AOAM5331+WaosFqm8pG6GEgVGmSpUs/57fHf20ipv7PFHejB2kRZYo/w tCD1ylneW3DBb1RBIOZSnds= X-Google-Smtp-Source: ABdhPJwjOE6fLykMsgqYNOifFoQZHHMaKuXVXgVVJtsxkKgnimUPMRtS4MdkOFb6f7NtaJrY19SP6g== X-Received: by 2002:aa7:c948:: with SMTP id h8mr4691523edt.171.1602775307533; Thu, 15 Oct 2020 08:21:47 -0700 (PDT) Received: from neptune.lab ([46.39.229.194]) by smtp.googlemail.com with ESMTPSA id i5sm1819539ejv.54.2020.10.15.08.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 08:21:46 -0700 (PDT) From: Alexey Baturo X-Google-Original-From: Alexey Baturo To: Subject: [PATCH v2 1/5] [RISCV_PM] Add J-extension into RISC-V Date: Thu, 15 Oct 2020 18:21:35 +0300 Message-Id: <20201015152139.28903-1-space.monkey.delivers@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::543; envelope-from=baturo.alexey@gmail.com; helo=mail-ed1-x543.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: baturo.alexey@gmail.com, qemu-riscv@nongnu.org, sagark@eecs.berkeley.edu, kbastian@mail.uni-paderborn.de, richard.henderson@linaro.org, qemu-devel@nongnu.org, space.monkey.delivers@gmail.com, Alistair.Francis@wdc.com, kupokupokupopo@gmail.com, palmer@dabbelt.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alexey Baturo --- target/riscv/cpu.c | 4 ++++ target/riscv/cpu.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 0bbfd7f457..fe6bab4a52 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -438,6 +438,9 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp) if (cpu->cfg.ext_h) { target_misa |= RVH; } + if (cpu->cfg.ext_j) { + target_misa |= RVJ; + } if (cpu->cfg.ext_v) { target_misa |= RVV; if (!is_power_of_2(cpu->cfg.vlen)) { @@ -516,6 +519,7 @@ static Property riscv_cpu_properties[] = { DEFINE_PROP_BOOL("u", RISCVCPU, cfg.ext_u, true), /* This is experimental so mark with 'x-' */ DEFINE_PROP_BOOL("x-h", RISCVCPU, cfg.ext_h, false), + DEFINE_PROP_BOOL("x-j", RISCVCPU, cfg.ext_j, false), DEFINE_PROP_BOOL("x-v", RISCVCPU, cfg.ext_v, false), DEFINE_PROP_BOOL("Counters", RISCVCPU, cfg.ext_counters, true), DEFINE_PROP_BOOL("Zifencei", RISCVCPU, cfg.ext_ifencei, true), diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index de275782e6..eca611a367 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -66,6 +66,7 @@ #define RVS RV('S') #define RVU RV('U') #define RVH RV('H') +#define RVJ RV('J') /* S extension denotes that Supervisor mode exists, however it is possible to have a core that support S mode but does not have an MMU and there @@ -277,6 +278,7 @@ struct RISCVCPU { bool ext_s; bool ext_u; bool ext_h; + bool ext_j; bool ext_v; bool ext_counters; bool ext_ifencei;