From patchwork Wed Mar 21 16:32:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 132237 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp2356159ljb; Wed, 21 Mar 2018 09:35:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELsNxRgzb7BZ3HC84WCCES12Y7pJlDa7tCWyWZiKGs7AkLbUkvcRAbamWYzpKI/6EjPYT+hA X-Received: by 10.107.131.207 with SMTP id n76mr19191288ioi.158.1521650105340; Wed, 21 Mar 2018 09:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521650105; cv=none; d=google.com; s=arc-20160816; b=jHQHRBEinGoPJObIt2Uaz7AhTnzX5aBc7nUavRKmqToNKXvIjiGixH8qsWSubSqYAx kn5/kKuixjQtcn3dlb0lYILgBvOFcth6inGIPNDUoEy8zEbBg4fc6Ftro9vGKbFsy3GH yfGkWKTRZIoG3CEhEYtutNkXdHWtBoiz2MFI+5lbwHSJfazr65Nh5BbSx6qHPmhStlmh VFQKbti6U/nYV5DNuQwZJraT4JWWSP6mTti/RSd5JIpg/KFkRRGYQhP3lxsdlEyWN+TQ 6C3f9Mtej/pmNi05s1kxCQFh3E6JWQfCRp4ntwdt/yZnT/4MadTfJvYCywNrvkG68g// jTcg== 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=SCbVCH2vy6ViLDJwNoC9jFLKDVBusaefQ6KHvS5Xo7U=; b=cMG6GpTY+HBPFC5qcFNCfjCCDBmSkZe70eDRdGfwwJQFhB4pAxR7of4/hNIAu7C/ln OKN3/c0BwYwq843tAAdk1oUhrJ3cF3tk+ZIWmXIN8DJt1QKM3AaoUnsP38gU2psU0pj7 H3ebKEMJgkSVI3pl/adw6GdUu7TYJAUpdNIbbaF19TLeIPeXii8qDDPwkpie59CJbqxd ihLLDE453mUgRXJB2Hs9EYgOa6S4EGNxlHz1lVpzguDvST3FlaZBHh9PzMNdk0TnWjbW 6uNyEb7m7TGVDTXzm1S84s15nss+O2Hc6p0KgNVAUhfsa/b9icWddtIjk43vIvR6cXeW fihQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SSMkeC1o; 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 x139-v6si3505178itb.131.2018.03.21.09.35.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 09:35:05 -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=SSMkeC1o; 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 1eyggA-0003Hc-JZ; Wed, 21 Mar 2018 16:33:34 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eygg4-00031d-4h for xen-devel@lists.xenproject.org; Wed, 21 Mar 2018 16:33:28 +0000 X-Inumbo-ID: 8b818fc5-2d25-11e8-9728-bc764e045a96 Received: from mail-wr0-x244.google.com (unknown [2a00:1450:400c:c0c::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 8b818fc5-2d25-11e8-9728-bc764e045a96; Wed, 21 Mar 2018 17:33:12 +0100 (CET) Received: by mail-wr0-x244.google.com with SMTP id o1so5821595wro.10 for ; Wed, 21 Mar 2018 09:33:26 -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=MNnn4cSmPbBbvnphuJHoqYLezCWQsUWgZcOXTFG53ow=; b=SSMkeC1o23EKvvmOwclE55eopmTy/7QpW87oI0zL/mjZNkWTFVKAJjPC0fFkT4Vsd8 6GmkSHVinv/PJYM1DRDetaARpGOOAg15ogFX2QLWpMxl4PUc6gyjw8QYmckvQcNMboBg 526Yau6nmN1FU0XHf6om7kAHTRUEt9aunjhd0= 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=MNnn4cSmPbBbvnphuJHoqYLezCWQsUWgZcOXTFG53ow=; b=qVK7OpiAi5cAHr7lD1+kkf4F6QRMSJcIOuLIqdonvyIdBg6iGge/ndp12HuMf5qpXq dmG56ekYjJ/yC6xM/GbzZejY1M7A26DGy4ve2WTbTu9MFobgWI55zvDrb68545Zl70Ca Sl2q73fsQxlmEcRUdOyFf6kXQ13BV5yOi39blIa6tr1PmhwWawmbNF/TdjkroxozEV97 vMNEiRjAfB3O23z4+lOc9WBocYRlPdCPwvY+/ecZw3ygEzvFQ2HQfR5uxmbayjZVaYT1 WVe1m2zWEnj6kZqqpok2YEQEXoXHzn4sQdhOphxm5z2WyfZhGhvnfZ32T33oSSGBN1gX lPsQ== X-Gm-Message-State: AElRT7GynOtjoKgtCPW7jfNjLzm4XffV3h98Fh/Pflv815KlqCowyuPt da9Cs1v7rUsKSkhAMrgSiGsgCyH8FH4= X-Received: by 10.223.150.161 with SMTP id u30mr16427249wrb.151.1521650005497; Wed, 21 Mar 2018 09:33:25 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Mar 2018 09:33:25 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Wed, 21 Mar 2018 16:32:31 +0000 Message-Id: <20180321163235.12529-36-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 35/39] ARM: new VGIC: Add vgic_v2_enable 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, Andre Przywara MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Enable the VGIC operation by properly initialising the registers in the hypervisor GIC interface. This is based on Linux commit f7b6985cc3d0, written by Eric Auger. Signed-off-by: Andre Przywara Acked-by: Julien Grall Acked-by: Stefano Stabellini --- Changelog v2 ... v3: - replace "1" with "true" in boolean parameter Changelog v1 ... v2: - move patch from later part in the series xen/arch/arm/vgic/vgic-v2.c | 6 ++++++ xen/arch/arm/vgic/vgic.h | 1 + 2 files changed, 7 insertions(+) diff --git a/xen/arch/arm/vgic/vgic-v2.c b/xen/arch/arm/vgic/vgic-v2.c index 8ab0cfe81d..ce77e58857 100644 --- a/xen/arch/arm/vgic/vgic-v2.c +++ b/xen/arch/arm/vgic/vgic-v2.c @@ -229,6 +229,12 @@ void vgic_v2_populate_lr(struct vcpu *vcpu, struct vgic_irq *irq, int lr) gic_hw_ops->write_lr(lr, &lr_val); } +void vgic_v2_enable(struct vcpu *vcpu) +{ + /* Get the show on the road... */ + gic_hw_ops->update_hcr_status(GICH_HCR_EN, true); +} + /* * Local variables: * mode: C diff --git a/xen/arch/arm/vgic/vgic.h b/xen/arch/arm/vgic/vgic.h index a3fcd4d965..112952fbf9 100644 --- a/xen/arch/arm/vgic/vgic.h +++ b/xen/arch/arm/vgic/vgic.h @@ -66,6 +66,7 @@ void vgic_sync_hardware_irq(struct domain *d, void vgic_v2_fold_lr_state(struct vcpu *vcpu); void vgic_v2_populate_lr(struct vcpu *vcpu, struct vgic_irq *irq, int lr); void vgic_v2_set_underflow(struct vcpu *vcpu); +void vgic_v2_enable(struct vcpu *vcpu); int vgic_register_dist_iodev(struct domain *d, gfn_t dist_base_fn, enum vgic_type);