From patchwork Thu Mar 22 11:56:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 132264 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp741056ljb; Thu, 22 Mar 2018 04:59:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELvPJw58k0vq+7FdfuV4Fm2u8FTTLElaCeRyFYScAc7RDvcjlHPlrfgiVVElwa3xw915+aL5 X-Received: by 2002:a24:5491:: with SMTP id t139-v6mr8042584ita.89.1521719947056; Thu, 22 Mar 2018 04:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521719947; cv=none; d=google.com; s=arc-20160816; b=u9AxLbHfZRqolWsOUBSFXQdigZbbH7akzi+sg8rH7c43ufbDoqX7pHuP2LNmSH2WJ6 qcxOnI8XAmTZZUSJY3wj4+F7J9YzteADI9dNL1KZCojWGquZLeDnEhfr4ZWSlygbmlSP Gnv2ET/rdR+85DoPREpmWduNWEHqgGEYi/CBn0McoVygHFp5dCsGikry6DuQUtVoiPeD qoY9HIOgQaqzqyci5gerDYUs9PszOEEnaLWidd8LIg0K53dQgy1YoSERtourJoJ/JaCf w+o8+f66hWW1UCODDxlGNCxyqeLNjqj6zvk8KwxAU6ttAR/ipl/WcT8ntvirsg2zgcbW 5Ucw== 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=EhnU9HIGEM+gB7BBIb5upiaOFgWXLHqXwoNEWlmbR3E=; b=qCwX1QOi0HGaAqVroauflG5XHCYW5tqNlaTSbh4Sgzg/GKVEnJEoP4wJ8GtMTWBl21 pftxlBGQ8OM4PipzTGG/AGrr7QBECrMkpDWhR7HhulzIKAJMUHZCr9gWw83gdMiZzqnz ceias6D3cRHTcD3Gg0Fj/UWaM04KvCIUPYVvdRJZih2q7QIvVRZ1oSQxv6lwVAqvkVsd ZIOBzFhIA/pdrIEHq/tDt8eJw+bIwU1vgEG/n9W23HpPndU5G5/1i6NuHH2FktUbCzbC EMKIt7WIeH/decaPvGQdXnRIQs529B7h1LbfshoGUpWkGJ4dhddCBi57WH7DOudgic4t KNOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RCqxOeAL; 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 t5-v6si349980itf.158.2018.03.22.04.59.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Mar 2018 04:59:07 -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=RCqxOeAL; 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 1eyyqB-0005yp-SU; Thu, 22 Mar 2018 11:57:07 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eyyqA-0005xQ-PJ for xen-devel@lists.xenproject.org; Thu, 22 Mar 2018 11:57:06 +0000 X-Inumbo-ID: 19de7547-2dc8-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 19de7547-2dc8-11e8-9728-bc764e045a96; Thu, 22 Mar 2018 12:56:49 +0100 (CET) Received: by mail-wm0-x241.google.com with SMTP id v21so4225479wmc.1 for ; Thu, 22 Mar 2018 04:57:05 -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=pMku6kU8Pd/TESz90YxBY+YuDKILn5Q0S2X0Rh0vW8A=; b=RCqxOeAL0O9diDflAW7mL57mV5PYuqOGB4r3bPke9C9TI6H+E7h6PEuT/56l06xoBD Gnet1z+/g6kf3D0JvHqjyDl4YLpw+eryuHAHdo9Qa7qkRuP3Nd+MrBd15EM5P8C4hnbc PB97jlFhz71ukyb2MipB6Oofn2Zrc302MTZLY= 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=pMku6kU8Pd/TESz90YxBY+YuDKILn5Q0S2X0Rh0vW8A=; b=HJZ+TX8rWsiMOBg1Q5KDF5bquAwaPp2BH9gDyxCcg7XXhjp6JwbxP2Swt4gr05zBtW vwLZavQBoVgGr8pr/HP/+PS9yPyggZnfG1781SVfikQny/nVgGzOTDIj1deHkO2Xx619 gFnfiQy+TbW5gOfqSuTI9zc+y+4E9d3P4a0Qiexp0G0nRmj9MtVIfh4EB6iV/3h1J88b A8wjawrNSZW212vMI1G4h2Uy/AYi8PIwOHpxwTM/2g3CTzLkg7L2u25TN5Ypockp7VW/ jVnk/xRpZAc2wwULw37rqhUzBQfJrzGbe9txeSNlUbiKFnkzyoeEJiOCEeX+i9S1uLme 587w== X-Gm-Message-State: AElRT7ETS2rRvrejwSFoVr7xTLOA3hUvzoT6fpEBFqnPsClsMbQgrnvs Jb1HYETPjGy73cJxUo451HwSxwkS9XE= X-Received: by 10.28.127.204 with SMTP id a195mr5671854wmd.58.1521719823989; Thu, 22 Mar 2018 04:57:03 -0700 (PDT) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id e67sm12207356wmf.20.2018.03.22.04.57.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Mar 2018 04:57:03 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Thu, 22 Mar 2018 11:56:49 +0000 Message-Id: <20180322115649.5283-4-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180322115649.5283-1-andre.przywara@linaro.org> References: <20180322115649.5283-1-andre.przywara@linaro.org> Subject: [Xen-devel] [PATCH v3a 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: 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 Acked-by: Julien Grall Acked-by: Stefano Stabellini --- Changelog v3 ... v3a: - print panic when trying to run on GICv3 hardware 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 | 11 +++++++++++ 4 files changed, 37 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 f9a5088285..ac18cab6f3 100644 --- a/xen/arch/arm/vgic/vgic.c +++ b/xen/arch/arm/vgic/vgic.c @@ -981,6 +981,17 @@ unsigned int vgic_max_vcpus(const struct domain *d) return min_t(unsigned int, MAX_VIRT_CPUS, vgic_vcpu_limit); } +#ifdef CONFIG_HAS_GICV3 +/* Dummy implementation to allow building without actual vGICv3 support. */ +void vgic_v3_setup_hw(paddr_t dbase, + unsigned int nr_rdist_regions, + const struct rdist_region *regions, + unsigned int intid_bits) +{ + panic("New VGIC implementation does not yet support GICv3."); +} +#endif + /* * Local variables: * mode: C