From patchwork Wed Jul 3 08:40:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 11029139 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 6D70F14F6 for ; Wed, 3 Jul 2019 08:54:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F2F72858E for ; Wed, 3 Jul 2019 08:54:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53EBF2898C; Wed, 3 Jul 2019 08:54: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 F249B2894D for ; Wed, 3 Jul 2019 08:54:36 +0000 (UTC) Received: from localhost ([::1]:33796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hib2C-0003Ql-8j for patchwork-qemu-devel@patchwork.kernel.org; Wed, 03 Jul 2019 04:54:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51538) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiapy-0006Dd-TE for qemu-devel@nongnu.org; Wed, 03 Jul 2019 04:42:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiapn-0007U6-D1 for qemu-devel@nongnu.org; Wed, 03 Jul 2019 04:41:52 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:34267) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hiapk-0007H2-Ms for qemu-devel@nongnu.org; Wed, 03 Jul 2019 04:41:44 -0400 Received: by mail-lf1-f65.google.com with SMTP id b29so1182261lfq.1 for ; Wed, 03 Jul 2019 01:41:43 -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=fW/EufJdnfLa6Nh4EurJ/4h3mnBbelDrXXcksx/gG2FfE/S1JcZH45ETutiWq9FspQ FvFyLPV2pUqkmhNfk/Xw9sUOTeh0PAtES0gxnSWoFuHqLnWnfUKH93LlZusVm68Tu5+y Xyuu4+OUsvfwZHzzjl7PfIxSv41cLn8vJ8Ljjv4aKnFCDtyh1+t1kfYQyisz62IVFcRT FZmvyNwIAdEgzzgYQJZ+fZCDlljUkddwjEE9cTLDBtB+i93xF6FuUIQqpPiWpkguHw8h 0tsRdibAdNNl+c+IREu2gdFgVnx0dfBeF3/ExWPvTya9Yp8c3yDLJjw1s++JojYSQm3t o7DQ== X-Gm-Message-State: APjAAAXy7NVFB+rlMu8IeCSp3CUfEnGr4FtNqiMWm9vn89w2r5AJzwPY /93r4uggLTwpW3dorKtLEvjHlni8mGxGpQ== X-Google-Smtp-Source: APXvYqztazGDlaFYC+WJx4zsTQ8xcsRfbQ7lRYHwt0fqFmw+IWx7nTbOV89DEcb6FFLFA9jmTHgeFg== X-Received: by 2002:a19:ed0c:: with SMTP id y12mr16804747lfy.191.1562143301493; Wed, 03 Jul 2019 01:41:41 -0700 (PDT) Received: from localhost ([134.17.27.127]) by smtp.gmail.com with ESMTPSA id w1sm292624lfe.50.2019.07.03.01.41.40 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 03 Jul 2019 01:41:40 -0700 (PDT) Date: Wed, 3 Jul 2019 01:40:34 -0700 Message-Id: <20190703084048.6980-19-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.167.65 Subject: [Qemu-devel] [PULL 18/32] 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)) {