From patchwork Mon Nov 26 18:26:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Thierry X-Patchwork-Id: 10698905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD7B513AD for ; Mon, 26 Nov 2018 18:27:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF37229238 for ; Mon, 26 Nov 2018 18:27:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A203529574; Mon, 26 Nov 2018 18:27:11 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 252992A31E for ; Mon, 26 Nov 2018 18:27:11 +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: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:In-Reply-To: References:List-Owner; bh=qrL8SO/3BetH46ApjczK1oC+k3dluYw6qmAZeml+1Vo=; b=VVC oPz6Yl/eZWJ5L46K8Evw+4qcQiI0wgh3NvWy2F3vnDl5rqiCsWKasSXhHak/vypaWmuy90W3Er0fV CvVCdFIX9v831YYoJsUGjjcU5IMPMQvtvhQWTqijbxeuwhXNGSCfgAqnJCdLTOkjR6vAlDbjtn/Yq uHR+uzQ6QE/IyNB6mWVQy7iCljUNvOC4S2Xk8v3HX2MVnfS5lhcJfiWB3P07z3Mb8842L4GD4L6F4 oua3SimDv2tldGMFJ/ORFf/x9+K6/Z8fIdL/i9j5z1ld3ZWKVOwFYiDUibOzkjHjLlP7YdODkOwSo YDHszbF90nui4SAWUs+0e4OOv+rS0gA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRLbB-0000sA-3Y; Mon, 26 Nov 2018 18:27:09 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRLb7-0000oC-Rm for linux-arm-kernel@lists.infradead.org; Mon, 26 Nov 2018 18:27:07 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DDDAA1A25; Mon, 26 Nov 2018 10:26:53 -0800 (PST) Received: from e112298-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 135FF3F5AF; Mon, 26 Nov 2018 10:26:51 -0800 (PST) From: Julien Thierry To: linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH v2 0/4] KVM: arm/arm64: vgic: Use raw_spinlock for locks taken in IRQ context Date: Mon, 26 Nov 2018 18:26:43 +0000 Message-Id: <1543256807-9768-1-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181126_102705_897545_28F55EF8 X-CRM114-Status: UNSURE ( 9.14 ) X-CRM114-Notice: Please train this message. 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: linux-rt-users@vger.kernel.org, Julien Thierry , marc.zyngier@arm.com, bigeasy@linutronix.de, Christoffer.Dall@arm.com, rostedt@goodmis.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.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 Hi, While testing KVM running on PREEMPT_RT, starting guest could simply freeze the machine. This is because we are using spinlocks for VGIC locks, which is invalid in the VGIC case since the locks must be take with interrupts disabled. The solution is to use raw_spinlock instead of spinlocks. Replacing those locks also highlighted an issue where we attempt to cond_resched with interrupts disabled. Patch 1 fixes the cond_resched issue. Patch 2-4 replace the VGIC spinlocks with raw_spinlocks Changes since v1[1]: - Rebase on v4.20-rc4 - Add Christoffer's Acked-by - Fix potential lock up when waiting for vcpus to halt [1] https://lkml.org/lkml/2018/11/19/776 Cheers, Julien --> Julien Thierry (4): KVM: arm/arm64: vgic: Do not cond_resched_lock() with IRQs disabled KVM: arm/arm64: vgic: Make vgic_irq->irq_lock a raw_spinlock KVM: arm/arm64: vgic: Make vgic_dist->lpi_list_lock a raw_spinlock KVM: arm/arm64: vgic: Make vgic_cpu->ap_list_lock a raw_spinlock include/kvm/arm_vgic.h | 6 +- virt/kvm/arm/vgic/vgic-debug.c | 4 +- virt/kvm/arm/vgic/vgic-init.c | 8 +-- virt/kvm/arm/vgic/vgic-its.c | 22 +++---- virt/kvm/arm/vgic/vgic-mmio-v2.c | 14 ++--- virt/kvm/arm/vgic/vgic-mmio-v3.c | 12 ++-- virt/kvm/arm/vgic/vgic-mmio.c | 70 ++++++++++----------- virt/kvm/arm/vgic/vgic-v2.c | 4 +- virt/kvm/arm/vgic/vgic-v3.c | 8 +-- virt/kvm/arm/vgic/vgic.c | 130 +++++++++++++++++++-------------------- 10 files changed, 135 insertions(+), 143 deletions(-) --- 1.9.1