From patchwork Fri Jun 28 17:32:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11023161 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 826631745 for ; Fri, 28 Jun 2019 18:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9570C28AF4 for ; Fri, 28 Jun 2019 17:59:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 881E928AF8; Fri, 28 Jun 2019 17:59:37 +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 3491E28AF4 for ; Fri, 28 Jun 2019 17:59:37 +0000 (UTC) Received: from localhost ([::1]:35066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgv9s-0003aS-Gz for patchwork-qemu-devel@patchwork.kernel.org; Fri, 28 Jun 2019 13:59:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54792) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hguko-0008NC-AU for qemu-devel@nongnu.org; Fri, 28 Jun 2019 13:33:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgukh-0000Rs-Hr for qemu-devel@nongnu.org; Fri, 28 Jun 2019 13:33:38 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hguke-0000OS-C7 for qemu-devel@nongnu.org; Fri, 28 Jun 2019 13:33:34 -0400 Received: by mail-pg1-f196.google.com with SMTP id n2so2876782pgp.11 for ; Fri, 28 Jun 2019 10:33:31 -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=WFOcqA5bhC2gv8hijUonjP/cUpFUXz32Bb/6MGXuT1U=; b=bP19ZOjdgjDpgX1DwcLAJqp5eJnJ5ZFkvQ4VqSI3aUJlP1JOjjfGeUrybVoqMwJAYW /LJXZIuuDPSxB951PTb+qv2MqgL85FaA7BynSJV9PRAzmo0+Qgo0sfMWkR6HTJdb9ItF yzSTI/QL66D0h9xB4q4MH7P3oRWyw5G+wGa3Ylni2fik3/rgLfqkyTXRrzJ4012L5RXs NA+Ur05ltSlFrBBPr333niefj5nCjH66fuyhzK0QjszmOsqFLbHTzBAEnCCk3k5oFigq TnUHiJl+OMDXEqZJtHocUCNa6Da8+O7+JGWORtF74KhST+1F4MT4UknNgl/ZFNvAkYHg pr/g== X-Gm-Message-State: APjAAAVxMlbXNZ3DXC16uOFR+M/AladUEyAorBS4Y7RWgpwRQuApLTkB LJd0rdl0zIn9YsSKUI1S/IeV84a+fDO4O6J1 X-Google-Smtp-Source: APXvYqxZXcgQvYEmTU1tDWqSLAtLWxpU3JuDD0WS3iMyaSz63FTWLhL2MjZCmoruXx8hy7bbNJTCZQ== X-Received: by 2002:a63:1316:: with SMTP id i22mr10815249pgl.274.1561743210410; Fri, 28 Jun 2019 10:33:30 -0700 (PDT) Received: from localhost (220-132-236-182.HINET-IP.hinet.net. [220.132.236.182]) by smtp.gmail.com with ESMTPSA id y10sm3105961pfm.66.2019.06.28.10.33.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 10:33:29 -0700 (PDT) Date: Fri, 28 Jun 2019 10:32:11 -0700 Message-Id: <20190628173227.31925-19-palmer@sifive.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190628173227.31925-1-palmer@sifive.com> References: <20190628173227.31925-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.215.196 Subject: [Qemu-devel] [PULL 18/34] target/riscv: Require either I or E base extension 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 Signed-off-by: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- target/riscv/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index ba1325f43533..1689ffecf85f 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -373,6 +373,12 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp) return; } + if (!cpu->cfg.ext_i && !cpu->cfg.ext_e) { + error_setg(errp, + "Either I or E extension must be set"); + return; + } + if (cpu->cfg.ext_g && !(cpu->cfg.ext_i & cpu->cfg.ext_m & cpu->cfg.ext_a & cpu->cfg.ext_f & cpu->cfg.ext_d)) {