From patchwork Wed Dec 15 10:40:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 524255 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp235108imb; Wed, 15 Dec 2021 03:18:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJz61urIBtvof2QxT85PvWbfVrznns0ZuKGpjYAlB0KLx1jQz/KYwjqBXNnKDDbKtuNob80f X-Received: by 2002:a25:ccd0:: with SMTP id l199mr5939273ybf.39.1639567092944; Wed, 15 Dec 2021 03:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639567092; cv=none; d=google.com; s=arc-20160816; b=TxUMysSslqmdjRusIhIHnX17Hd4dfZPR5gDP+hcaX2jxXtDqnw0ttTV4OwY96BS7fc kH7UJDpcwgdf6e2dYLeYAqQzGGrpDNMlmw24Nb4idIgOMKe01ErauVIrCOvSqka0hoF3 4zRHiN68oc5ZV0k9HGIt+VoHSueY2cQzva2XkTyvYNuzfHS00CMzKG0u2+o6Tn+QI5O3 a64Gviq1k0Q2OpFaexmcpWSv8bcetirdTLv72ykJcHZJyKl3iTty3uW8BKxkahdpulxl v+1pzT2rf8Q2QcM1CYMuIAeRa1wZMG78AGR+Wx7a1w5GRFh/NLFwdKBM+10+uVYDnwTB GQIQ== 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:to:from :dkim-signature; bh=fqhgJq2CB3BEUpVjd/zJhy6cguqz09ikl8mo+0Dzrp4=; b=ck0Hb9rwaLSnYq8ZECfVMsSSWgLpONeMBjM0td2vzQ/dQcq3npW7aDv8rNVTqNo0PW yZrTq5k/HlblBEBxedIa8YIfNprgJOQ0jOKRTIfPF7bmv3jSYdkyRBnYhipV+xqyatSq 7L+AsW1B9oKNmI3bKp3FIcONpR+v3V8HLFYDxUVsRHyWX8Q5gGm4lh6ng2m6Fj929dkS IPGmzcz9ROjJDWSkTZTgSLLhygLJigshRWAJGQJc+uY8LMzr/kEzdDIgppqfR05njJVi PUu5Dh6212jV3WfQpP131b52b37LLNd9dgxqQUaL2NIPbW62B9FO/dfUe0ngPn4VpeG8 ns7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Fgtm/atD"; 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 134si1641541ybn.212.2021.12.15.03.18.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Dec 2021 03:18:12 -0800 (PST) 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="Fgtm/atD"; 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]:58528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxSIW-0004Bf-CI for patch@linaro.org; Wed, 15 Dec 2021 06:18:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxRiY-0006k6-5d for qemu-devel@nongnu.org; Wed, 15 Dec 2021 05:41:02 -0500 Received: from [2a00:1450:4864:20::42a] (port=43843 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxRiS-0008Q1-6y for qemu-devel@nongnu.org; Wed, 15 Dec 2021 05:41:01 -0500 Received: by mail-wr1-x42a.google.com with SMTP id v11so37332326wrw.10 for ; Wed, 15 Dec 2021 02:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=fqhgJq2CB3BEUpVjd/zJhy6cguqz09ikl8mo+0Dzrp4=; b=Fgtm/atD6qWBuwLPO9HOW6ZV+SugxwkDRv3s+AEj3RPo3jZ6SUTPr92CVuP5hacDlJ 1N1PCu+/5+BQ/rI6V2LpwQj6KMG4cF6KNcOc0qTHs5QTiskw9IhZvNvc8VtW9AZvWS97 PPQ25hpk4PM42inmFKhWPVrdoeYGhDxgxlYd8Q5ydDnK397LaPQQctU9uZQlB6PLtcAS 3Bc6xwGtaYE9r9zkrnB3nsizzidJ4gGCAn6JaSXQpgffMA9xnL8Pg6l0N0HM6b2VVpkW 9fl+Wg2NoEKnGXigMCO0zDkWB8zD41oA+aZWNJrHKI2Dk8Dch8yQNYESF+JkkEQqK77x clIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fqhgJq2CB3BEUpVjd/zJhy6cguqz09ikl8mo+0Dzrp4=; b=mx17ElXoWfRH28uH2Jaz5JR89k9KEGmLzptts5628y2WLiP6JFileRFkMjpRSUmrAv 0lJYa75nUbfqYKvAxsdmTG9G0brnSSBgJqYz2CN9x7kggu04gw0J+Kuoo9ysmb3ThaDr uGYlhDyAfZACMmQ4WhUBBYHcVaibXphBBLyNe0RvgW5WNc6oxTgIuFxF5cKFseXYv2TZ 4QAaFTm+wV93Slq5ME1NjKdfwX2aflbhQ5WQV3us4gJ+T6YZBy1IQw7yNIx0OIRXMDZF rFCLSMb8NpN88xvA4U9FGCXQORd8CiQDjbW5l3m07jPblDqyp5qA3q2aIwUAc55sxxRf IPSA== X-Gm-Message-State: AOAM531RRfHoQukoigHZTMwrXbV+EcEyQQ87F/QsbwJ7g2Mp+V0SK52C MvqI5KVUhBXdYgD47NQyXnSMd3JoSRibcw== X-Received: by 2002:a5d:52c3:: with SMTP id r3mr3898222wrv.115.1639564854908; Wed, 15 Dec 2021 02:40:54 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e18sm1600815wrs.48.2021.12.15.02.40.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 02:40:54 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/33] hw/intc/arm_gicv3: Extract gicv3_set_gicv3state from arm_gicv3_cpuif.c Date: Wed, 15 Dec 2021 10:40:23 +0000 Message-Id: <20211215104049.2030475-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211215104049.2030475-1-peter.maydell@linaro.org> References: <20211215104049.2030475-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" From: Philippe Mathieu-Daudé gicv3_set_gicv3state() is used by arm_gicv3_common.c in arm_gicv3_common_realize(). Since we want to restrict arm_gicv3_cpuif.c to TCG, extract gicv3_set_gicv3state() to a new file. Add this file to the meson 'specific' source set, since it needs access to "cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Message-id: 20211115223619.2599282-2-philmd@redhat.com Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_cpuif.c | 10 +--------- hw/intc/arm_gicv3_cpuif_common.c | 22 ++++++++++++++++++++++ hw/intc/meson.build | 1 + 3 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 hw/intc/arm_gicv3_cpuif_common.c diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index 85fc369e550..d7e03d0cab8 100644 --- a/hw/intc/arm_gicv3_cpuif.c +++ b/hw/intc/arm_gicv3_cpuif.c @@ -1,5 +1,5 @@ /* - * ARM Generic Interrupt Controller v3 + * ARM Generic Interrupt Controller v3 (emulation) * * Copyright (c) 2016 Linaro Limited * Written by Peter Maydell @@ -21,14 +21,6 @@ #include "hw/irq.h" #include "cpu.h" -void gicv3_set_gicv3state(CPUState *cpu, GICv3CPUState *s) -{ - ARMCPU *arm_cpu = ARM_CPU(cpu); - CPUARMState *env = &arm_cpu->env; - - env->gicv3state = (void *)s; -}; - static GICv3CPUState *icc_cs_from_env(CPUARMState *env) { return env->gicv3state; diff --git a/hw/intc/arm_gicv3_cpuif_common.c b/hw/intc/arm_gicv3_cpuif_common.c new file mode 100644 index 00000000000..ff1239f65db --- /dev/null +++ b/hw/intc/arm_gicv3_cpuif_common.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * ARM Generic Interrupt Controller v3 + * + * Copyright (c) 2016 Linaro Limited + * Written by Peter Maydell + * + * This code is licensed under the GPL, version 2 or (at your option) + * any later version. + */ + +#include "qemu/osdep.h" +#include "gicv3_internal.h" +#include "cpu.h" + +void gicv3_set_gicv3state(CPUState *cpu, GICv3CPUState *s) +{ + ARMCPU *arm_cpu = ARM_CPU(cpu); + CPUARMState *env = &arm_cpu->env; + + env->gicv3state = (void *)s; +}; diff --git a/hw/intc/meson.build b/hw/intc/meson.build index c89d2ca180e..11352806db2 100644 --- a/hw/intc/meson.build +++ b/hw/intc/meson.build @@ -25,6 +25,7 @@ softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP_PMU', if_true: files('xlnx-pmu-iomod-in specific_ss.add(when: 'CONFIG_ALLWINNER_A10_PIC', if_true: files('allwinner-a10-pic.c')) specific_ss.add(when: 'CONFIG_APIC', if_true: files('apic.c', 'apic_common.c')) +specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gicv3_cpuif_common.c')) specific_ss.add(when: 'CONFIG_ARM_GIC', if_true: files('arm_gicv3_cpuif.c')) specific_ss.add(when: 'CONFIG_ARM_GIC_KVM', if_true: files('arm_gic_kvm.c')) specific_ss.add(when: ['CONFIG_ARM_GIC_KVM', 'TARGET_AARCH64'], if_true: files('arm_gicv3_kvm.c', 'arm_gicv3_its_kvm.c'))