From patchwork Thu Mar 15 20:30:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 131872 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp1579666ljb; Thu, 15 Mar 2018 13:33:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELvInzyKs+G71UgtKet7D98VZvGwTFBdNutfEgWyNUiXnq8VPynPjsrLyjqREtV4YSa+6o2I X-Received: by 10.36.61.85 with SMTP id n82mr8509462itn.31.1521146025292; Thu, 15 Mar 2018 13:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521146025; cv=none; d=google.com; s=arc-20160816; b=cLoZm+81xRJJd0pN713iROpAmYW7l3DakK9JZ6cdpboGGrkPGMQFBFw9iy4eQpRDg/ Ytz/wz7eVHUAG/Gl98yfnZbdlKpuJG5sV0eegVOZTmgyKnuRUQAX3kRKcYujlK+NFcbF hzoqSUEKfM81gpZ1XuAikIsL6IrRXPIC1/ERmSYysUiMVuEHtp0hQNMW4W856C7t9jSe 9Zqw+zV/UKEELusLYe0+xqyEBNAl7APqamDfES5LDylO+pAQN9Ca2gIHeC7A4MvjQCp8 pwdeK6p1DVSaXxI6KQ3v73M/yvGMVfVNnwY3rluwKMAyQ5sBfGqW+z93NXRGaf+EADEL vo6Q== 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 :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=nlGwUIgE/0FG1k6Id7fpPjiQ2Pyo1SzXEORr5S0Gd0k=; b=SjwM9W8C3tAG/GUeuf3j3qGm6mDbRneSS8OQo4ErAGoIorfCTqBGalhXIPrwVhjMgq biRMzku19BSF5HkzZWY8TyClGxtUfj+F6BO/zGsoA8/zQnnSet+fuXuq9MbSbFPq06I2 XXG+sPON1GaZAfqVdmqcnNhCvlkpNcv0BLr3Av/DC3eGVQl8VkXIYYmCUjZphqKzNYUt nm4Uxfgoxc3oecyv/YGQ6lIIjkqOVRkNjC47PFAqYGd+sHm0oTuoegYmYUe/QzVhUc6c B42EhhnHU/Ga2b6a5hQK6DWkiVFGNytUAjtIDkqScLL7KM8y/IrsWlIM5MNa9yl/iSC9 njiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=A+8Bvaoa; 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 c18-v6si2955371itd.48.2018.03.15.13.33.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 13:33:45 -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=A+8Bvaoa; 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.84_2) (envelope-from ) id 1ewZXb-0004sx-1Q; Thu, 15 Mar 2018 20:31:59 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewZXa-0004pO-8d for xen-devel@lists.xenproject.org; Thu, 15 Mar 2018 20:31:58 +0000 X-Inumbo-ID: e456d41b-288f-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 e456d41b-288f-11e8-9728-bc764e045a96; Thu, 15 Mar 2018 21:31:51 +0100 (CET) Received: by mail-wm0-x241.google.com with SMTP id u10so12787989wmu.4 for ; Thu, 15 Mar 2018 13:31:57 -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=5t7MC9SMKWatR0iLPiVYl8pDgixS10uMnPQXU3D66XA=; b=A+8Bvaoapn1GKIg0OoB/lFZBriBBnByqOvzakzO7BO3PDHT4+voHX0gNBEntU3xnEP 3osSYmz734G6536wGTluHWhi7jHXGFrM0JB7Iv9eqhpcBw1BQKz6+t7CZjhs2cJqB63C NUuJeqOXL3VVtCLfPWZ2o/nuxzWEls/PoBGak= 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=5t7MC9SMKWatR0iLPiVYl8pDgixS10uMnPQXU3D66XA=; b=EKRWMWQ0s4FGzu76OJ/V+FhCPkWENJJeTw6d8nnhAGMZlKPI536lvYakIgVi7ATY6F g4VRCGsfjvfzf5hnT0dtDIN+ZYAWG1ivoXMrdnH4ytOPXmAWQ8zfgbTlfx/6jufkZURs QagToDUNj+qmCn0YleHdpFASyuQ0utK9ax29PfZG61JlP5fJB4JmmOm0U8JGLSmsCTTI y2TYnrQxhbdoSSG9AN3idw3yn0wjp18aBUPaS0pvfYg8gIL+H+LjTkSdeFT/ucCJ3/FZ ouh3G6ygPkGtbUXUV21pKGRCLZfZSZaegN44tcR9Qc47PLWsMkbsyqYyZ2q7XD3WzSDX krBA== X-Gm-Message-State: AElRT7FxV67zvouzCuvy19dxoSrFqWpqleC+2VDhDjlUY7n6AzxXLP9m /OglO1x20P/rqurbPWxEP2mg+Q== X-Received: by 10.28.210.81 with SMTP id j78mr5711942wmg.55.1521145916064; Thu, 15 Mar 2018 13:31:56 -0700 (PDT) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id w125sm3217102wmw.20.2018.03.15.13.31.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Mar 2018 13:31:55 -0700 (PDT) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Thu, 15 Mar 2018 20:30:50 +0000 Message-Id: <20180315203050.19791-46-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180315203050.19791-1-andre.przywara@linaro.org> References: <20180315203050.19791-1-andre.przywara@linaro.org> Cc: Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Jan Beulich , xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH v2 45/45] ARM: VGIC: wire new VGIC(-v2) files into Xen build system X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , 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 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 | 17 ++++++++++++++++- xen/arch/arm/Makefile | 5 ++++- xen/arch/arm/vgic/Makefile | 5 +++++ xen/arch/arm/vgic/vgic.c | 10 ++++++++++ xen/common/Makefile | 1 + 5 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..310f909768 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -48,7 +48,22 @@ 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" + ---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 4b9664f313..342b95be31 100644 --- a/xen/arch/arm/vgic/vgic.c +++ b/xen/arch/arm/vgic/vgic.c @@ -968,6 +968,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 diff --git a/xen/common/Makefile b/xen/common/Makefile index 3a349f478b..1668e14c4b 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -19,6 +19,7 @@ obj-y += keyhandler.o obj-$(CONFIG_KEXEC) += kexec.o obj-$(CONFIG_KEXEC) += kimage.o obj-y += lib.o +obj-y += list_sort.o obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o obj-y += lzo.o obj-$(CONFIG_HAS_MEM_ACCESS) += mem_access.o