Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3535360imu; Mon, 7 Jan 2019 05:14:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN7HV3CuHpyx4PrBJs4VZWm2GZuMqspj2jT0HPX7KDgBCpzsBOdK7gl3e8ws6HT6DyM8boQQ X-Received: by 2002:a63:e84c:: with SMTP id a12mr10804358pgk.241.1546866890344; Mon, 07 Jan 2019 05:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546866890; cv=none; d=google.com; s=arc-20160816; b=bcxQim5dFYOxzfHxP+NVw2J9k52sZmwQsvdDw7e+j14YJR6ppqe5C4kcZkBFFvSqgk 0XtQJem48/DN3c00cv6TiiYFNlPMVVHvyXIZbsfvU8AT9TlbeeV/eEZ9RTPiY3wVKqhS Siao4TPnQTI5pDVvRRSSj0XDIcPhY8njqArFHmj6+DuQ5ZW6jn5zKhPlD2KoyIDXMIiU be9AdZzQvWW+Bp24e2jRbC/YSSeJrCgItGjHGgKEzEKAoEZgOZyAAQNr0H9tUtfCWsjz 5VHl/3bBpktC+iG/RO2Ui6lNejUGAL3An4sZC87OeP+BH4QfX6uECIDWQ5Gl6m76RZnu JrUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eF4CIbMdjejC6F/3UjQlzecfDOOeSKEzKcb7bNhlVtA=; b=l4Oy8gSZuLYIz2CouanzxHVyoGznxS9EOBGvcHnmSYGgzjQQQYYkj4ahSNAwLxrdXi KKlPVB1cjJlYeIfnxDVN5aocCHCLlqlwIFDQD8ygoL53iB6E9JtIMW+IQ9tRjZzrqetu fAXgoNGQ5rPbugLaSeO0jSULvUqHhX7o+Eq4zbV63l7r85jH0HO1oYwJ55r2PtNDlGgM 5k4+gGu1VJq+NdGZUx3TQwuV2aMB0HBHN74XVkGtdMsG+Uvt7XB5gVyrCqlkk2LhhLhs z08djRtjptGNqiS/3A9S8Vjo9Zoa6TpNJX5270FBODClY/DhMA+XJCo8ti+L58WCUYs0 ashw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IGEAqGVP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z63si40416116pfz.132.2019.01.07.05.14.35; Mon, 07 Jan 2019 05:14:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IGEAqGVP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731349AbfAGNEU (ORCPT + 99 others); Mon, 7 Jan 2019 08:04:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:51736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731184AbfAGNEJ (ORCPT ); Mon, 7 Jan 2019 08:04:09 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D8D4F206BB; Mon, 7 Jan 2019 13:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866248; bh=pe4GpTP5sLXuJjlVIz5ZrazuBCmLykzGckE0cmqtLmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IGEAqGVPcnlKx/HP5kZ+r+9tCyTIUTsxOguYEyJdRsLraCF4j4Jbwt/6pcLuomSKt BCeZzTs725CSFsVJ9draKjBIWg0BbQgRHvrKVqo+6703u/0cZLaj3PUjaJR1jGmqvS EiFx49z97p7wub4eNQ3QZ11HsJr/FdMLeuXIXIZw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoffer Dall , Marc Zyngier Subject: [PATCH 4.14 097/101] arm/arm64: KVM: vgic: Force VM halt when changing the active state of GICv3 PPIs/SGIs Date: Mon, 7 Jan 2019 13:33:25 +0100 Message-Id: <20190107105338.080964363@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marc Zyngier commit 107352a24900fb458152b92a4e72fbdc83fd5510 upstream. We currently only halt the guest when a vCPU messes with the active state of an SPI. This is perfectly fine for GICv2, but isn't enough for GICv3, where all vCPUs can access the state of any other vCPU. Let's broaden the condition to include any GICv3 interrupt that has an active state (i.e. all but LPIs). Cc: stable@vger.kernel.org Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier Signed-off-by: Greg Kroah-Hartman --- virt/kvm/arm/vgic/vgic-mmio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/virt/kvm/arm/vgic/vgic-mmio.c +++ b/virt/kvm/arm/vgic/vgic-mmio.c @@ -241,14 +241,16 @@ static void vgic_mmio_change_active(stru */ static void vgic_change_active_prepare(struct kvm_vcpu *vcpu, u32 intid) { - if (intid > VGIC_NR_PRIVATE_IRQS) + if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3 || + intid > VGIC_NR_PRIVATE_IRQS) kvm_arm_halt_guest(vcpu->kvm); } /* See vgic_change_active_prepare */ static void vgic_change_active_finish(struct kvm_vcpu *vcpu, u32 intid) { - if (intid > VGIC_NR_PRIVATE_IRQS) + if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3 || + intid > VGIC_NR_PRIVATE_IRQS) kvm_arm_resume_guest(vcpu->kvm); }