From patchwork Mon Mar 5 16:04:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 130692 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2854378lja; Mon, 5 Mar 2018 08:07:35 -0800 (PST) X-Google-Smtp-Source: AG47ELtVZ9v/qWyJg7lFkq0/4HVaBq6Z0QmInXCkcQp03yN0SfjFUedOsm98l29tYqdxD5Z+zCMq X-Received: by 10.107.46.37 with SMTP id i37mr10477309ioo.161.1520266055528; Mon, 05 Mar 2018 08:07:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520266055; cv=none; d=google.com; s=arc-20160816; b=xEREMQMsy6LM8K0aWohTX97vbO3KVyCKqvyI8LDDCu2fSYiGSoQBJGMxdbYXrm/5mD Io2x7gLGmHDeIr5p/MABZ5IATgT1a5h1WbopvhkcFa/wthfxR0r0ODmChoaX/vrcGp+4 P+/A+VcNNvCpkg0oUbYr8ggaG33mUz91A/urph3Jv2q0P+kn7UtbULR7/eoMUnfxYbox +nOmMV92w52QuW74I4QRq7Z6XR9J1txn8xlXtGfGC+5l1dWHDUl6LdblLhve/6/AYJc4 vmivy5ePgdNehZGWv7EqakqMv3mLvZratETO+IcNh8PZpzWNGabuDSb0PzcYDZ2VXqba zxYA== 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=N+vXPsrSNCXgdR2myT1vXw4uuM877zqkya9Rzk+dMTs=; b=Yesk10A39arDaNZ6ATVSt/YowX+k5SEw2KDXDxfoVIP3C8uLiYQQI1F+EeVOTJPq0F Q8LJ0jmf5eymQVAan4K8U4sJzyYl68HR0ZT2IPFZkWadTKMaI3fwt3DbyAGzBGwcbT1T lJcfLaqQepiFpujjarFUYYrE7riOduyKHrVkkBPDr0TpTjFFq4krd+qgTS94B1DGgC6g 9hBQQ1swr93pGPD+nohGDpqP9egCA5jnxNzjbYVgUu+gQ6IMmVvErt4cGTOyGSqGnWdj p9vfLFuGh3gBKEIAzWDRN5Bb+fFhYli23ZJAtfPVj9H/E65dY369wLlDDiWWXZ9TGoEV 10dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NhF8bmgx; 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 4si6052700ity.18.2018.03.05.08.07.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:07:35 -0800 (PST) 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=NhF8bmgx; 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 1essc5-0000w5-Q6; Mon, 05 Mar 2018 16:05:21 +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 1essc5-0000sV-3y for xen-devel@lists.xenproject.org; Mon, 05 Mar 2018 16:05:21 +0000 X-Inumbo-ID: d8f033d7-208e-11e8-ba59-bc764e045a96 Received: from mail-wm0-x243.google.com (unknown [2a00:1450:400c:c09::243]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d8f033d7-208e-11e8-ba59-bc764e045a96; Mon, 05 Mar 2018 17:04:13 +0100 (CET) Received: by mail-wm0-x243.google.com with SMTP id x7so16539843wmc.0 for ; Mon, 05 Mar 2018 08:05:19 -0800 (PST) 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=CZpWy3QETsxiLdz/ZFDxuJaByIZiJKUeNNEAmoHc/Ns=; b=NhF8bmgxHyWySSJBX7wznKUsdi7p3y6A+0plx9yMHLprbBDzIutXtuScrDbEX6ZmS2 OB9X/5e6fSXwi2PiNyE8mqevaJZZLtN2Jkrj7bQGh9p788qQ/MW0+C5bnR814GnJUpMq Ln1hBJSxOgv1UUZHvP4pXeqNNnT9R8JI3mV/o= 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=CZpWy3QETsxiLdz/ZFDxuJaByIZiJKUeNNEAmoHc/Ns=; b=de9szQJj/xEmmGGsgb2kafMRMKMrG2VCclpP6HZyzIq3l6hcT+3tIwhjQ2HaE146c3 WMCoNhYgp4FPWjpYR7jQ9EZznvurBpy6ycIRP+xU3puy3XcyxQIk+eQZboz/qRa9I5M7 ug3hOZObttsKVUFgh/G/FhBpz1QaD4Er+al+9bq/x9nVlkQS1GqN8IWOAvwBQF1pFHeU uVpHTyQ5EExhMMrdQMrxx+c5TVHE+mlQerhqJzJbQ/hBg1PfXGLQ3SIQR8gy/Y9Pt0nn r46CBF8iKfSjqrj+s99r0prj9O9h1KhtjpEKf6zjjRs3dBXZYMOmlN74m3l7wnwu0m0E 0fsA== X-Gm-Message-State: AElRT7Gsg+vMlngO9wqLGnbW4Tidk9x5Yoxw69v5AK4Q+sTS3aAu/ps+ 6MB4AgBnGG30/m265PTxiVl3KQ== X-Received: by 10.28.65.84 with SMTP id o81mr8533915wma.19.1520265918444; Mon, 05 Mar 2018 08:05:18 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id y6sm6574381wmy.14.2018.03.05.08.05.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Mar 2018 08:05:17 -0800 (PST) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Mon, 5 Mar 2018 16:04:13 +0000 Message-Id: <20180305160415.16760-56-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180305160415.16760-1-andre.przywara@linaro.org> References: <20180305160415.16760-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 55/57] ARM: new VGIC: Add vgic_v2_enable 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" 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 --- Changelog RFC ... v1: - drop unneeded vgic_vmcr initialization - use update_hcr_status wrapper 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 da64b4758c..b7d6493e5a 100644 --- a/xen/arch/arm/vgic/vgic-v2.c +++ b/xen/arch/arm/vgic/vgic-v2.c @@ -221,6 +221,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, 1); +} + int vgic_v2_map_resources(struct domain *d) { struct vgic_dist *dist = &d->arch.vgic; diff --git a/xen/arch/arm/vgic/vgic.h b/xen/arch/arm/vgic/vgic.h index 6fab994b9c..bd0c3fe5ab 100644 --- a/xen/arch/arm/vgic/vgic.h +++ b/xen/arch/arm/vgic/vgic.h @@ -61,6 +61,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_v2_map_resources(struct domain *d); int vgic_register_dist_iodev(struct domain *d, gfn_t dist_base_fn, enum vgic_type);