From patchwork Wed Mar 21 16:32:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 132229 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp2356295ljb; Wed, 21 Mar 2018 09:35:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELtpBS+g0yFpEz2zZLUbsNR3q7Nd1bhFKu7XCF9mcscXr1zhGG3ik5ALpnM1MqT8uc89FKU8 X-Received: by 2002:a24:441:: with SMTP id 62-v6mr4852906itb.57.1521650111620; Wed, 21 Mar 2018 09:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521650111; cv=none; d=google.com; s=arc-20160816; b=rjMU6YnNHbICgLV+LLkxNmokkYsmBG8VkVOANkzBpX4Fj3Wn48idALzkU6agDpN6E9 uyOYcxJdJYiFOcGaeN+Hvwbtb7xQjWayrKzdIJ38s7C1QL9H7VZCJIo8xSmLjTYcKmDC 9nYvvHTT2xkqTC4mpMElr279ZYTTGbAwMRtTxcBmyn9IvDSvgFYQmwW0B6wcCCToiAEK VdDKL6+9CHcxe9OhOaECYTHEbcv6rjL+kPMPYsNSBqyC1uEb3IrRM6OYz7jwykQAzVLN oHcMvXK//zXZ/DzVLjNV8i3+15rmvPju0apWUPDUSSeFd+htsUc77lXlMIt5CKg90ttT aVKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=NS/uRFAfMk+JwNP4lEw3+YThTEm3N5Ht2r53QEkl/Lw=; b=tQ5IH0Bo19IC6XKUz0jyCLaR3EGAMxBTxzxPEwQeRwzK3qe8FDAdVrE1mFYrX7QVmS a2KR+XtOG9RcXf3sDLGvz5hPrzN7+3J0NXgHxi6NShgcxRDeR+oWyRAwJzZz/EgLxfwb NgOnBcBnVgwtqLPU+MRCcd9RGBTsZ6Sp5HZfJfQUCPgSBtWi34YaexEccn21Gu9XSA8F xVlbE66UqBhg6f4poMy4FVHTnA2GIB3/D9KXH+i/tifrjXdl51ym/PKbQBubdwEtZuTa jZTDtHs2MCzGROYLw1nQ9Vm99R05gTQhNrsZ3mKWQBhvRy0Nbap8dNwYA92U4paDOhMa zBRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fhq2FCP2; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 17-v6si3537031itx.56.2018.03.21.09.35.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 09:35:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fhq2FCP2; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eyggG-0003WT-5b; Wed, 21 Mar 2018 16:33:40 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eygg8-0003CS-GJ for xen-devel@lists.xenproject.org; Wed, 21 Mar 2018 16:33:32 +0000 X-Inumbo-ID: 8e21f32e-2d25-11e8-9728-bc764e045a96 Received: from mail-wm0-x241.google.com (unknown [2a00:1450:400c:c09::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 8e21f32e-2d25-11e8-9728-bc764e045a96; Wed, 21 Mar 2018 17:33:16 +0100 (CET) Received: by mail-wm0-x241.google.com with SMTP id f19so10925918wmc.0 for ; Wed, 21 Mar 2018 09:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V74A939mZB0IM3mO++10txX3+q7HukRc/B9ZpsGTPAE=; b=fhq2FCP2/eZu7KjIvauiqO0BG0aOKSZq9OC2iXMXYcIid/JAaA0p8Ujp4mjsX7yjCL IDK5IpNLJRkz0e4GwNz0OnPxAOCkelq9RZSxGtx0PtxXQQrumx/z9d5t+aJVEEU/WA3n I9nYd6BD91duv9OyHp7caGzgBZomwEBp3IxOo= 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:in-reply-to :references; bh=V74A939mZB0IM3mO++10txX3+q7HukRc/B9ZpsGTPAE=; b=uJBO/peaG8pzgGa43irzJBgNZ4Pu9Km+zyyudVQoj5beKXaoji1iSYC4gu9W4nB1eW BFAfEkzxN2n97MqtBdU21lSEkb9VDipubQVoyD8QzVxeQVylgT27uGs9Gvhw8G2vu8Iy M3CVP56L+Aszh3gnPRMT7EH8GarFvuhp3nULmjACmMHu5Y2KnzNbQPoiu5q/TEcrzLqQ N4PKI/IHnBkxa0J9TOQq6F1mz0eHBIE0UAgf6LJRi+r+YHy/VcVyb6Pr2UKkLGZ3k7IT TR6FoJvrF+qj5lJBIh+AToIyXEySo8IDBsTgM4ITOEKeYH4KNsnP02lvW6XUP26Uokbq KpXQ== X-Gm-Message-State: AElRT7ELzlH7GgkGt/qIHpKzSuAWRyGkSb0p4B3D98mnORIdvyFHATHU xQl7EQd9y2U7KKl/wekPcf3R3amuvew= X-Received: by 10.28.69.133 with SMTP id l5mr2946557wmi.152.1521650009789; Wed, 21 Mar 2018 09:33:29 -0700 (PDT) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id n64sm4423724wmd.11.2018.03.21.09.33.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Mar 2018 09:33:29 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Wed, 21 Mar 2018 16:32:35 +0000 Message-Id: <20180321163235.12529-40-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180321163235.12529-1-andre.przywara@linaro.org> References: <20180321163235.12529-1-andre.przywara@linaro.org> Subject: [Xen-devel] [PATCH v3 39/39] ARM: VGIC: wire new VGIC(-v2) files into Xen build system X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Andre Przywara , Tim Deegan , Jan Beulich , xen-devel@lists.xenproject.org MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Now that we have both the old VGIC prepared to cope with a sibling and the code for the new VGIC in place, lets add a Kconfig option to enable the new code and wire it into the Xen build system. This will add a compile time option to use either the "old" or the "new" VGIC. In the moment this is restricted to a vGIC-v2. To make the build system happy, we provide a temporary dummy implementation of vgic_v3_setup_hw() to allow building for now. Signed-off-by: Andre Przywara --- Changelog v2 ... v3: - fix indentation of Kconfig entry - select NEEDS_LIST_SORT - drop unconditional list_sort.o inclusion Changelog v1 ... v2: - add Kconfig help text - use separate Makefile in vgic/ directory - protect compilation without GICV3 support - always include list_sort() in build xen/arch/arm/Kconfig | 18 +++++++++++++++++- xen/arch/arm/Makefile | 5 ++++- xen/arch/arm/vgic/Makefile | 5 +++++ xen/arch/arm/vgic/vgic.c | 10 ++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 xen/arch/arm/vgic/Makefile diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 2782ee6589..8174c0c635 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -48,7 +48,23 @@ config HAS_GICV3 config HAS_ITS bool prompt "GICv3 ITS MSI controller support" if EXPERT = "y" - depends on HAS_GICV3 + depends on HAS_GICV3 && !NEW_VGIC + +config NEW_VGIC + bool + prompt "Use new VGIC implementation" + select NEEDS_LIST_SORT + ---help--- + + This is an alternative implementation of the ARM GIC interrupt + controller emulation, based on the Linux/KVM VGIC. It has a better + design and fixes many shortcomings of the existing GIC emulation in + Xen. It will eventually replace the existing/old VGIC. + However at the moment it lacks support for Dom0 using the ITS for + using MSIs. + Say Y if you want to help testing this new code or if you experience + problems with the standard emulation. + At the moment this implementation is not security supported. config SBSA_VUART_CONSOLE bool "Emulated SBSA UART console support" diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 41d7366527..a9533b107e 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -16,7 +16,6 @@ obj-y += domain_build.o obj-y += domctl.o obj-$(EARLY_PRINTK) += early_printk.o obj-y += gic.o -obj-y += gic-vgic.o obj-y += gic-v2.o obj-$(CONFIG_HAS_GICV3) += gic-v3.o obj-$(CONFIG_HAS_ITS) += gic-v3-its.o @@ -47,10 +46,14 @@ obj-y += sysctl.o obj-y += time.o obj-y += traps.o obj-y += vcpreg.o +subdir-$(CONFIG_NEW_VGIC) += vgic +ifneq ($(CONFIG_NEW_VGIC),y) +obj-y += gic-vgic.o obj-y += vgic.o obj-y += vgic-v2.o obj-$(CONFIG_HAS_GICV3) += vgic-v3.o obj-$(CONFIG_HAS_ITS) += vgic-v3-its.o +endif obj-y += vm_event.o obj-y += vtimer.o obj-$(CONFIG_SBSA_VUART_CONSOLE) += vpl011.o diff --git a/xen/arch/arm/vgic/Makefile b/xen/arch/arm/vgic/Makefile new file mode 100644 index 0000000000..806826948e --- /dev/null +++ b/xen/arch/arm/vgic/Makefile @@ -0,0 +1,5 @@ +obj-y += vgic.o +obj-y += vgic-v2.o +obj-y += vgic-mmio.o +obj-y += vgic-mmio-v2.o +obj-y += vgic-init.o diff --git a/xen/arch/arm/vgic/vgic.c b/xen/arch/arm/vgic/vgic.c index 131358a5a1..22c70ff7cd 100644 --- a/xen/arch/arm/vgic/vgic.c +++ b/xen/arch/arm/vgic/vgic.c @@ -981,6 +981,16 @@ unsigned int vgic_max_vcpus(const struct domain *d) return min_t(unsigned int, MAX_VIRT_CPUS, vgic_vcpu_limit); } +#ifdef CONFIG_HAS_GICV3 +void vgic_v3_setup_hw(paddr_t dbase, + unsigned int nr_rdist_regions, + const struct rdist_region *regions, + unsigned int intid_bits) +{ + /* Dummy implementation to allow building without actual vGICv3 support. */ +} +#endif + /* * Local variables: * mode: C