From patchwork Mon Nov 13 09:17:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10055417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B059B6029B for ; Mon, 13 Nov 2017 09:34:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B36E28E6B for ; Mon, 13 Nov 2017 09:34:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 800462931B; Mon, 13 Nov 2017 09:34:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2F84928E6B for ; Mon, 13 Nov 2017 09:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=BFu7dj1Odp6VRomgfroL6MF+T7IV2sTFVJE7zSWUB44=; b=ebPqv4Ru6os8p3kyBcP/nWnm8Z XQBuJp1R6kyWyaznHudqWhPH8mKddwhhBszDR6yQya8zHSCyONmyzdDFXEOxygFUmckZXciXUoTQG U1hPEr+xwKq0z4kOVgkAY/jN+fR598W4JoZuZqswbL6pf9Ut8ZDyX1pkX20SeiAny0s0hUVySvu9b P8IApLCByt3gFOchxLWtkqtYazJqaX3zCGn1IPSAH0qKkmgLKFZ1puk4NBRIFmX1necSaJ/EfOuGH 9LYKPHLUIZZnvV2FPjBMNJ4vTSnaym5+03CnOCsHlXqjN7URwGntnTMY2xhfTriiYoPpQixFuQwWE XH3uyPdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eEB8O-0002X0-9t; Mon, 13 Nov 2017 09:34:28 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eEB8M-0002W7-7d for linux-arm-kernel@bombadil.infradead.org; Mon, 13 Nov 2017 09:34:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oimrQgsqAdpVxmuOZsGIcRoU+m6L08kR++e6VTYwv7g=; b=XZZ+7eO9WPdqp/gvsTbfPGHLh 84UIbifZHER/W6ZjYHtM07VZL+kF+Fx+VLE6LpHCEB+TFWnv9EkLdEcbCWXexVNnx0XKy1RX63i2m mptJ/MfaOB9WCntzAm0/hwtEhORLGOdrpd9CRF6l7LHuE0HqGIKs57+MUd8ypjILbtgA4Yv25BsOv W+QMN9nTBAqkoMulKMAdsearYvZ5Aq3YZ1N8/oF7vYtDwlBKW7ourwb5cXhVPRveM/j1Lup+LIG28 M/d+SKRhdSaBt4OMn9mZU96z2pE14vadEQnOGURdRM1LW/zkV0txld9E74ZnxwhR77E5dmEQ63pP8 iQQBZ2dIA==; Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eEAtH-0005WN-GP for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2017 09:18:53 +0000 Received: by mail-wm0-x243.google.com with SMTP id l8so7822225wmg.4 for ; Mon, 13 Nov 2017 01:18:33 -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=oimrQgsqAdpVxmuOZsGIcRoU+m6L08kR++e6VTYwv7g=; b=dAYUe6eqewlFRRWI8fGhEYzclFwf6xemAQL8ow7ib3poxl2aJc3+nTSsvVAnaQUbR1 28xE89sF4xxc8cmxHGn0RQtrLenxYlsGCsnqS0VHH6pJVrVbrWRPWCiq/Gjnex8e7lTC TexkcqFy54Ah1NXjGa3FQkijOhFNRCq9Sr4rU= 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=oimrQgsqAdpVxmuOZsGIcRoU+m6L08kR++e6VTYwv7g=; b=uYz+4YpwUgA4/UKzVVYrl8lugxmjUjz/+QzLNbUlvRiIEve1H7IpUi4xkXgjjMzvfj M5AyeYlexl4TnP+J6cjg+M4LtoU+F1ezBNzsGfS6+fatizF9Wi9rIMGomZeHIalldRb3 HQ4L9Sz0pLZRwb9HIjTE1VnTHP5dhrw0iVMiVQ99/cA2jn765cmMg1Q72rFUAvF40cG0 u61WsUvODqnwc0bcIhJm7VJTg4AbUX6mPmhtUZmVptbXosE+mH6HCxKQ+LWW9wPN0ElT uLlZkCRvKwb0WxrLey+LH8z/ZCKCgIEZvpxsb+IicEZwSdCgSGnPZgJFgNcwJ159IdNt z6fA== X-Gm-Message-State: AJaThX5ayGu51lDrEA0Ozx3eGdtMt3AkDunXGPC0VPqgpMF3msstFLJ0 vF3h1okYAIzXSbVgI3z0SyiZxQ== X-Google-Smtp-Source: AGs4zMaDAQ5lNK+b6E9a70Psc8KRb/TXjyAXOmrRLucKItpOFvtCDzeN5pYtCnbAHknA+z193n4SsQ== X-Received: by 10.28.71.90 with SMTP id u87mr5564407wma.91.1510564712090; Mon, 13 Nov 2017 01:18:32 -0800 (PST) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id x63sm9651399wma.39.2017.11.13.01.18.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Nov 2017 01:18:31 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 24/27] KVM: arm/arm64: GICv4: Enable VLPI support Date: Mon, 13 Nov 2017 10:17:49 +0100 Message-Id: <20171113091752.10663-25-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171113091752.10663-1-christoffer.dall@linaro.org> References: <20171113091752.10663-1-christoffer.dall@linaro.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Christoffer Dall , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier All it takes is the has_v4 flag to be set in gic_kvm_info as well as "kvm-arm.vgic_v4_enable=1" being passed on the command line for GICv4 to be enabled in KVM. Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- Documentation/admin-guide/kernel-parameters.txt | 4 ++++ virt/kvm/arm/vgic/vgic-v3.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 3daa0a590236..6f897a4c8281 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1881,6 +1881,10 @@ [KVM,ARM] Trap guest accesses to GICv3 common system registers + kvm-arm.vgic_v4_enable= + [KVM,ARM] Allow use of GICv4 for direct injection of + LPIs. + kvm-intel.ept= [KVM,Intel] Disable extended page tables (virtualized MMU) support on capable Intel chips. Default is 1 (enabled) diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c index 863351c090d8..2f05f732d3fd 100644 --- a/virt/kvm/arm/vgic/vgic-v3.c +++ b/virt/kvm/arm/vgic/vgic-v3.c @@ -24,6 +24,7 @@ static bool group0_trap; static bool group1_trap; static bool common_trap; +static bool gicv4_enable; void vgic_v3_set_underflow(struct kvm_vcpu *vcpu) { @@ -461,6 +462,12 @@ static int __init early_common_trap_cfg(char *buf) } early_param("kvm-arm.vgic_v3_common_trap", early_common_trap_cfg); +static int __init early_gicv4_enable(char *buf) +{ + return strtobool(buf, &gicv4_enable); +} +early_param("kvm-arm.vgic_v4_enable", early_gicv4_enable); + /** * vgic_v3_probe - probe for a GICv3 compatible interrupt controller in DT * @node: pointer to the DT node @@ -480,6 +487,13 @@ int vgic_v3_probe(const struct gic_kvm_info *info) kvm_vgic_global_state.can_emulate_gicv2 = false; kvm_vgic_global_state.ich_vtr_el2 = ich_vtr_el2; + /* GICv4 support? */ + if (info->has_v4) { + kvm_vgic_global_state.has_gicv4 = gicv4_enable; + kvm_info("GICv4 support %sabled\n", + gicv4_enable ? "en" : "dis"); + } + if (!info->vcpu.start) { kvm_info("GICv3: no GICV resource entry\n"); kvm_vgic_global_state.vcpu_base = 0;