From patchwork Fri Feb 9 14:39: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: 127856 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp680137ljc; Fri, 9 Feb 2018 06:42:34 -0800 (PST) X-Google-Smtp-Source: AH8x2277jLnQylKcsFY1bidX8n27VuqUDQzwcddeAm/BW/7Jeq79dxVKC8r8EuJIcsX0cnxsImHX X-Received: by 10.36.239.130 with SMTP id i124mr3755677ith.27.1518187354611; Fri, 09 Feb 2018 06:42:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518187354; cv=none; d=google.com; s=arc-20160816; b=D7nyxGhVOaCVnneM7EGxzJ1uu3Bwi57cNxtkDyR/2aMY3mh7oeC9xP3do2TDKvUV7j manip/w39fNVt36Ot9QmEO9UMjsWba83l/FbFsAS/x9udqjP0T4OjQwmUjHfr+G2Lpm/ 9qqu8vgsfVDCvkla5sZhW8sqxmiBahHWuLM8MCq+sMnZJnpMDIPdssApKUDexG1z7NIw YJbq/5MugFXMQ0aaoZgniptufrfRLUfqeOZek06i45va+dlmYP88Gym8g44gP1QHDBbT 7FQMr9fhNe/WmR2AgdXME+L79hSqZbypOtddNnYygVy9IJ6Wmd3rsCdidu/HiSsmeNcz 0qPg== 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:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=M1sEy5GP2+knfPN0e74FZYLnKUFpk7jEFI6K4xl9/gA=; b=0UZ4uF3oaP8vimeQjrUQLC2XGmNSkAvBJ35N62abBghfYJOOJyMiw4xV6HBuigH0rA BMGJzu8MHzN8H0rQ9nau5ePKLnpy0kyVs2m0FYDd/vZjKbxgvUtii/4nfBBG20q7XKZj pQYJE3heVJowkn+r1jonrkHz39xNGdrDnGXdllMfi7GejnTf/rnbVzqvL/kFsFAHxLxK OSeSRlp3J9zsFRrNLvSUBfArl2j63krvLoNsU0Ea92UslqxeGWXYGtRReNg9sJeHxEtJ CmO17jNMVB6oo6BJD/G8MCcb2aNtkQJOCdOsWOIw41rd4XrzQx+J/0NI/eWOTvKO49hj SEZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EbNTa69P; 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 x8si1682838itf.15.2018.02.09.06.42.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 06:42:34 -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=EbNTa69P; 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 1ek9qw-00029z-A7; Fri, 09 Feb 2018 14:40:38 +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 1ek9qv-00025i-8H for xen-devel@lists.xenproject.org; Fri, 09 Feb 2018 14:40:37 +0000 X-Inumbo-ID: 1f5e3e08-0da7-11e8-ba59-bc764e045a96 Received: from mail-wr0-x241.google.com (unknown [2a00:1450:400c:c0c::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 1f5e3e08-0da7-11e8-ba59-bc764e045a96; Fri, 09 Feb 2018 15:40:08 +0100 (CET) Received: by mail-wr0-x241.google.com with SMTP id h9so8473217wre.12 for ; Fri, 09 Feb 2018 06:40:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=l8ZqNCm6S+KWI+CvOLepdHuSuNv/kpXZnRSNAdEeiWM=; b=EbNTa69P9AvGCpp36g7Wr2NGjQ5NlpeVvKLgb1299RRi5OBznNr3m8u4fzGiYJ6rb6 +G/MZkYxzkuUGeWtqOLqoYaollF1hrupFMLeQaeAy8u18yVsDbIResYfa1WeW0bcIBkN HPH9RDi01vrwZJ6CDd8H9fmTaiEaMk2jZezkY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=l8ZqNCm6S+KWI+CvOLepdHuSuNv/kpXZnRSNAdEeiWM=; b=tbMsb4KhbPgTpf10l33BhpPSpmlNGZxtgoeUa/DXNX7z1DDGNIQp/2i+z0YAfmxZWk kjzgtDJ7MpteQmAR/fj5p9w1ET/EYs2sh62EObJvVfm/x5jdZrBEyEVsh4WzsajpVdMr 2Mat6ROhzh8uhv/C7pGr01+2GbUYwIrGjHcobDHHi3dg5Oqb0fWkXQtJrpK4rWZjiRNW ijRy5T0Q6/83Dsd0tsBYkWBFttWEttQ3uj1xSnf1wZbma1lCBk0a1Lu0BrMxRc/A/qJu P37h/a2lS68+FMxcZPhMZ62uquSUkMXxJHCX9cxMhItItDLHkA5v5L+I0G2/BvxcSpf6 /Pbg== X-Gm-Message-State: APf1xPAFYtO6Pg9Kj5bRp+oC4Ho+QsNr8ifB9ahzOIC/LLkD1kSUmc+j o1GL4zXbhjlIo7z4i3F5HGYk+Q== X-Received: by 10.223.161.15 with SMTP id o15mr2462908wro.274.1518187234976; Fri, 09 Feb 2018 06:40:34 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id b35sm2552229wra.13.2018.02.09.06.40.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Feb 2018 06:40:34 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall , xen-devel@lists.xenproject.org Date: Fri, 9 Feb 2018 14:39:35 +0000 Message-Id: <20180209143937.28866-48-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180209143937.28866-1-andre.przywara@linaro.org> References: <20180209143937.28866-1-andre.przywara@linaro.org> Subject: [Xen-devel] [RFC PATCH 47/49] 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 --- xen/arch/arm/vgic/vgic-v2.c | 13 +++++++++++++ xen/arch/arm/vgic/vgic.h | 1 + 2 files changed, 14 insertions(+) diff --git a/xen/arch/arm/vgic/vgic-v2.c b/xen/arch/arm/vgic/vgic-v2.c index b5026bb050..16e9c8dbf0 100644 --- a/xen/arch/arm/vgic/vgic-v2.c +++ b/xen/arch/arm/vgic/vgic-v2.c @@ -202,6 +202,19 @@ void vgic_v2_clear_lr(struct vcpu *vcpu, int lr) vcpu->arch.vgic_cpu.vgic_v2.vgic_lr[lr] = 0; } +void vgic_v2_enable(struct vcpu *vcpu) +{ + /* + * By forcing VMCR to zero, the GIC will restore the binary + * points to their reset values. Anything else resets to zero + * anyway. + */ + vcpu->arch.vgic_cpu.vgic_v2.vgic_vmcr = 0; + + /* Get the show on the road... */ + vcpu->arch.vgic_cpu.vgic_v2.vgic_hcr = GICH_HCR_EN; +} + 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 adb04f2f52..e28c002a9e 100644 --- a/xen/arch/arm/vgic/vgic.h +++ b/xen/arch/arm/vgic/vgic.h @@ -58,6 +58,7 @@ 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_clear_lr(struct vcpu *vcpu, 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, paddr_t dist_base_address, enum vgic_type);