From patchwork Tue Jul 11 12:14:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 701513 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5682338wrs; Tue, 11 Jul 2023 05:21:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlEDT3E5TIK0oIJPpcBh46KYBdRdhmbvGTuvs3CHWRc2t/4Y0T92yorU6aqe8KFS6Q6dEnrj X-Received: by 2002:a05:620a:25ce:b0:767:154b:2f91 with SMTP id y14-20020a05620a25ce00b00767154b2f91mr16051462qko.24.1689078097679; Tue, 11 Jul 2023 05:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689078097; cv=none; d=google.com; s=arc-20160816; b=fPSHpqH2S9UxPFoPo0X99TVd3T+eJlHQi5ivOwLgIDX6hzQx/UTJaSW2KgQj/9EW3j 2sS3nr/M8PvZXOsoEmNEEZUNj7GW9JIeceG5IzHgFbv91EezFcikZyQWB2SQ5iLAhJos yyRg0a0+/Weu3hucUqrSK3lmmerZf642dhRn6w4bCt4ARVMNLuiIVomdG84wLCor5X62 zKy2gWj38d+TJVC2dqxE85/kihlzTDWpEGhB+U6guV6R3glGksu1Vu0/pG2EkCSoxwYX QhetA6ggx5BBfBvt4Pgud8T3g04ksI7SVBX6JshxeLBt/6jdRUG3zKbTmCwNwiub8+SK gGkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/eou1bffGOF2PwMTgUZZvH0l+QYZMD9+i7me4gyg/s4=; fh=nMhgh7dohLgvOYDjFYWSpLzFIRgf0EXY4ZiytwmpnqU=; b=mBPegBZRG8R/Iutab8suJ1p1B2Flqwwe07rg2czW4H6T+zAHzl6srdZoJAHPfM7dQr 98iLTtnrhrX3Y31IuW7e+hJuc8aW4DqqmZLRkss5lAVMoD0p6Uw9EZ4PqJA5O3iUXg8S QFAmyfTlDDmyzZpWIMS4/7sSjIjNxZ1/UaVGFlfH9tpA1CDz9ngO8ZKELVRVTp9bnd7V TLnrk7GnHb9MbK8OG1l6xn6ZMeGxFTHnp+iqbeepodN7+qrG2CucZrt6NMXeY2afxfzQ PMLI5qfMlaWYItuu0i/sA0iwElOcLdxzDclWMJco48uQ9AO3Dd7xnM8pTJv3qzijRwpS IE6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bfVZ9K5L; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f10-20020a05620a280a00b007672b4ff13fsi741287qkp.604.2023.07.11.05.21.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2023 05:21:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bfVZ9K5L; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJCHR-0001Vd-UQ; Tue, 11 Jul 2023 08:15:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJCHD-0001Ra-SD for qemu-devel@nongnu.org; Tue, 11 Jul 2023 08:15:41 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJCH8-0005MD-83 for qemu-devel@nongnu.org; Tue, 11 Jul 2023 08:15:31 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fbc59de0e2so58159335e9.3 for ; Tue, 11 Jul 2023 05:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689077724; x=1691669724; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/eou1bffGOF2PwMTgUZZvH0l+QYZMD9+i7me4gyg/s4=; b=bfVZ9K5Lk2ksq+KNxlEjRbG3wZ4tprBeW1wc0bJ4ZCAGJl+qUcl7sRFFnwS9eidDN8 9FUp3XTfu5XGubNZ47KGSGWd/ZXKqqQH1HawxH4vXnrVyLfjlV9xuH+0Ddconv68sW/f kNOY01YNcH1wDotKObHCrPmhr7Z8uQUEXSwDg0woaqL7jS7P9uujNze4rHy1Z3kuX+Q4 O9CVHP1xEEmwHFMcSBVTZvL3xEdmnOnDkoFHsOiu2Zl7XEfO76cnyL0D1Mn5yN01/FNm 3KeRRN9+jT5gKDuUPk6AAWSZ8+EHNlOfbNtZKyEhWu6dFlsMCY5i1f1M9UL2CgrL7vN8 M5hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689077724; x=1691669724; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/eou1bffGOF2PwMTgUZZvH0l+QYZMD9+i7me4gyg/s4=; b=Bz9NeUo4Y3mUq4Ud16dqDqr77mEAc1FRXeBKqTgxcYAOx5YfDIRD75rijTpQTaOuiM BvUrG9zuGE/khbte6n6h9OnxszaQCH2BId0g45IkeQQ8OlID/ratFnawQ1o2XdwCRjKP fBxtL6zpblEE1Q81Ak4e2KHUyx7g0D/aj0bT2cek6QldZtxgFofJhwDjs2HoqmGXQSmx T+3CaZjrwoPFuqDBDFg6DwF7vqqMBLbzZsHNtVT/rqSNQhKBvDvuRUtLsAq2XLpmJImV VhzqYNBPyz8HBSpveznIO+Yn5F08BM8kX+UAc+9G+rKpOwRK7iWZ18+mTtgKH/siyiS/ Le2g== X-Gm-Message-State: ABy/qLYVWo27QmBXVzkmHxHCNp3A1eb6R5hO9UecIAcwwRXOd0JwpVg6 yCIyMpqO4KuiUB6HvYeIEWiSgKfPtWLyjTyixL4= X-Received: by 2002:a05:600c:220a:b0:3fa:7bf9:706c with SMTP id z10-20020a05600c220a00b003fa7bf9706cmr12616529wml.36.1689077723983; Tue, 11 Jul 2023 05:15:23 -0700 (PDT) Received: from m1x-phil.lan ([176.187.194.156]) by smtp.gmail.com with ESMTPSA id q21-20020a7bce95000000b003fc06169abdsm2436083wmj.2.2023.07.11.05.15.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Jul 2023 05:15:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, Daniel Henrique Barboza , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Alistair Francis Subject: [PATCH v3 05/16] target/riscv: Move sysemu-specific files to target/riscv/sysemu/ Date: Tue, 11 Jul 2023 14:14:42 +0200 Message-Id: <20230711121453.59138-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230711121453.59138-1-philmd@linaro.org> References: <20230711121453.59138-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move sysemu-specific files to the a new 'sysemu' sub-directory, adapt meson rules. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis --- target/riscv/cpu.h | 2 +- target/riscv/{ => sysemu}/instmap.h | 0 target/riscv/{ => sysemu}/kvm_riscv.h | 0 target/riscv/{ => sysemu}/pmp.h | 0 target/riscv/{ => sysemu}/pmu.h | 0 target/riscv/{ => sysemu}/time_helper.h | 0 hw/riscv/virt.c | 2 +- target/riscv/cpu.c | 6 ++--- target/riscv/cpu_helper.c | 4 +-- target/riscv/csr.c | 4 +-- target/riscv/{ => sysemu}/arch_dump.c | 0 target/riscv/sysemu/kvm-stub.c | 30 ++++++++++++++++++++++ target/riscv/{ => sysemu}/kvm.c | 0 target/riscv/{ => sysemu}/machine.c | 0 target/riscv/{ => sysemu}/monitor.c | 0 target/riscv/{ => sysemu}/pmp.c | 0 target/riscv/{ => sysemu}/pmu.c | 0 target/riscv/{ => sysemu}/riscv-qmp-cmds.c | 0 target/riscv/{ => sysemu}/time_helper.c | 0 target/riscv/meson.build | 13 +++------- target/riscv/sysemu/meson.build | 11 ++++++++ 21 files changed, 54 insertions(+), 18 deletions(-) rename target/riscv/{ => sysemu}/instmap.h (100%) rename target/riscv/{ => sysemu}/kvm_riscv.h (100%) rename target/riscv/{ => sysemu}/pmp.h (100%) rename target/riscv/{ => sysemu}/pmu.h (100%) rename target/riscv/{ => sysemu}/time_helper.h (100%) rename target/riscv/{ => sysemu}/arch_dump.c (100%) create mode 100644 target/riscv/sysemu/kvm-stub.c rename target/riscv/{ => sysemu}/kvm.c (100%) rename target/riscv/{ => sysemu}/machine.c (100%) rename target/riscv/{ => sysemu}/monitor.c (100%) rename target/riscv/{ => sysemu}/pmp.c (100%) rename target/riscv/{ => sysemu}/pmu.c (100%) rename target/riscv/{ => sysemu}/riscv-qmp-cmds.c (100%) rename target/riscv/{ => sysemu}/time_helper.c (100%) create mode 100644 target/riscv/sysemu/meson.build diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 6ea22e0eea..dba78db644 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -93,7 +93,7 @@ typedef enum { #define MAX_RISCV_PMPS (16) #if !defined(CONFIG_USER_ONLY) -#include "pmp.h" +#include "sysemu/pmp.h" #include "debug.h" #endif diff --git a/target/riscv/instmap.h b/target/riscv/sysemu/instmap.h similarity index 100% rename from target/riscv/instmap.h rename to target/riscv/sysemu/instmap.h diff --git a/target/riscv/kvm_riscv.h b/target/riscv/sysemu/kvm_riscv.h similarity index 100% rename from target/riscv/kvm_riscv.h rename to target/riscv/sysemu/kvm_riscv.h diff --git a/target/riscv/pmp.h b/target/riscv/sysemu/pmp.h similarity index 100% rename from target/riscv/pmp.h rename to target/riscv/sysemu/pmp.h diff --git a/target/riscv/pmu.h b/target/riscv/sysemu/pmu.h similarity index 100% rename from target/riscv/pmu.h rename to target/riscv/sysemu/pmu.h diff --git a/target/riscv/time_helper.h b/target/riscv/sysemu/time_helper.h similarity index 100% rename from target/riscv/time_helper.h rename to target/riscv/sysemu/time_helper.h diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index d90286dc46..74f789a85b 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -30,7 +30,7 @@ #include "hw/char/serial.h" #include "target/riscv/cpu.h" #include "hw/core/sysbus-fdt.h" -#include "target/riscv/pmu.h" +#include "target/riscv/sysemu/pmu.h" #include "hw/riscv/riscv_hart.h" #include "hw/riscv/virt.h" #include "hw/riscv/boot.h" diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index faf703afcb..91433f3041 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -24,11 +24,11 @@ #include "cpu.h" #include "cpu_vendorid.h" #ifndef CONFIG_USER_ONLY -#include "pmu.h" -#include "time_helper.h" +#include "sysemu/pmu.h" +#include "sysemu/time_helper.h" #include "sysemu/tcg.h" #include "sysemu/kvm.h" -#include "kvm_riscv.h" +#include "sysemu/kvm_riscv.h" #endif #include "internals.h" #include "exec/exec-all.h" diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index e8b7f70be3..0adde26321 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -22,9 +22,9 @@ #include "qemu/main-loop.h" #include "cpu.h" #include "internals.h" -#include "pmu.h" +#include "sysemu/pmu.h" #include "exec/exec-all.h" -#include "instmap.h" +#include "sysemu/instmap.h" #include "tcg/tcg-op.h" #include "trace.h" #include "semihosting/common-semi.h" diff --git a/target/riscv/csr.c b/target/riscv/csr.c index e5737dcf58..29151429ee 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -22,8 +22,8 @@ #include "qemu/timer.h" #include "cpu.h" #ifndef CONFIG_USER_ONLY -#include "pmu.h" -#include "time_helper.h" +#include "sysemu/pmu.h" +#include "sysemu/time_helper.h" #endif #include "qemu/main-loop.h" #include "exec/exec-all.h" diff --git a/target/riscv/arch_dump.c b/target/riscv/sysemu/arch_dump.c similarity index 100% rename from target/riscv/arch_dump.c rename to target/riscv/sysemu/arch_dump.c diff --git a/target/riscv/sysemu/kvm-stub.c b/target/riscv/sysemu/kvm-stub.c new file mode 100644 index 0000000000..4e8fc31a21 --- /dev/null +++ b/target/riscv/sysemu/kvm-stub.c @@ -0,0 +1,30 @@ +/* + * QEMU KVM RISC-V specific function stubs + * + * Copyright (c) 2020 Huawei Technologies Co., Ltd + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +#include "qemu/osdep.h" +#include "cpu.h" +#include "kvm_riscv.h" + +void kvm_riscv_reset_vcpu(RISCVCPU *cpu) +{ + abort(); +} + +void kvm_riscv_set_irq(RISCVCPU *cpu, int irq, int level) +{ + abort(); +} diff --git a/target/riscv/kvm.c b/target/riscv/sysemu/kvm.c similarity index 100% rename from target/riscv/kvm.c rename to target/riscv/sysemu/kvm.c diff --git a/target/riscv/machine.c b/target/riscv/sysemu/machine.c similarity index 100% rename from target/riscv/machine.c rename to target/riscv/sysemu/machine.c diff --git a/target/riscv/monitor.c b/target/riscv/sysemu/monitor.c similarity index 100% rename from target/riscv/monitor.c rename to target/riscv/sysemu/monitor.c diff --git a/target/riscv/pmp.c b/target/riscv/sysemu/pmp.c similarity index 100% rename from target/riscv/pmp.c rename to target/riscv/sysemu/pmp.c diff --git a/target/riscv/pmu.c b/target/riscv/sysemu/pmu.c similarity index 100% rename from target/riscv/pmu.c rename to target/riscv/sysemu/pmu.c diff --git a/target/riscv/riscv-qmp-cmds.c b/target/riscv/sysemu/riscv-qmp-cmds.c similarity index 100% rename from target/riscv/riscv-qmp-cmds.c rename to target/riscv/sysemu/riscv-qmp-cmds.c diff --git a/target/riscv/time_helper.c b/target/riscv/sysemu/time_helper.c similarity index 100% rename from target/riscv/time_helper.c rename to target/riscv/sysemu/time_helper.c diff --git a/target/riscv/meson.build b/target/riscv/meson.build index e3ab3df4e5..8967dfaded 100644 --- a/target/riscv/meson.build +++ b/target/riscv/meson.build @@ -7,6 +7,8 @@ gen = [ ] riscv_ss = ss.source_set() +riscv_system_ss = ss.source_set() + riscv_ss.add(gen) riscv_ss.add(files( 'cpu.c', @@ -22,19 +24,12 @@ riscv_ss.add(files( 'crypto_helper.c', 'zce_helper.c' )) -riscv_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c')) -riscv_system_ss = ss.source_set() riscv_system_ss.add(files( - 'arch_dump.c', - 'pmp.c', 'debug.c', - 'monitor.c', - 'machine.c', - 'pmu.c', - 'time_helper.c', - 'riscv-qmp-cmds.c', )) +subdir('sysemu') + target_arch += {'riscv': riscv_ss} target_softmmu_arch += {'riscv': riscv_system_ss} diff --git a/target/riscv/sysemu/meson.build b/target/riscv/sysemu/meson.build new file mode 100644 index 0000000000..64de0256a5 --- /dev/null +++ b/target/riscv/sysemu/meson.build @@ -0,0 +1,11 @@ +riscv_system_ss.add(files( + 'arch_dump.c', + 'machine.c', + 'monitor.c', + 'pmp.c', + 'pmu.c', + 'riscv-qmp-cmds.c', + 'time_helper.c', +)) + +riscv_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'))