Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3000668imu; Mon, 19 Nov 2018 09:11:30 -0800 (PST) X-Google-Smtp-Source: AJdET5ct+TRLw38WMtaDaSSDMuzBtC2utICblZbJJ9l1NdlNDyPLAZWXm3hCMIGWJcxdoCqDQfsp X-Received: by 2002:a63:7cf:: with SMTP id 198mr21163814pgh.129.1542647490088; Mon, 19 Nov 2018 09:11:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542647490; cv=none; d=google.com; s=arc-20160816; b=Ug/Zu3ej7pp/LITSq94W/VOzsMknVFTeQ0VxkmrTOjjbnJmQPDkEC/wudc7vOwojSI IgvdpIWZ73VVseKaB/Y5MW3cuPOgShoBizMNSLjblFgT8C4e46fPABdjFv9DAHDQJeak D8mNPsCMKK1WBwzlDkjs8AqbDXwJb2Yt0Yzbph3ukaWGjCcLmPUYNuWN4RWJAEexFWqy y39qGR3tGNLUsUx4gBhfjQCJdplx1xZq/0Q2Y6UOtif8/dG6IlAVOyiY/WLq7ZPNEsLg e2Z6e2PFSqO12+A9fjK5O7Dc/tXNP/GIYVVqwvsEGBb0s7eym3XnMRDVNLcdG7VXlUC/ gKjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=7AWok06wFo8aNx0SkWkWnLldZOjnmYLB+QjUhkISjJE=; b=jVsTOgSewUnWvdSoR9n/0kxayDRwnfbXqInH/A88JzsP96DVdsvizf8BrzYfH+iKgm akHedNWNugW7cc1w2KFP40R/HvtQa4MuPbUYN3o6PnVl16+F1TMYUokNrFnLEUi8CyVx iPC8f9wAg/OPgFcn5RJ7QdxELEKjlH1DQ9dFFqnVbHrR0w2NuHWEyPbRLg2YMfBZlwBp JBqk2bypTBoNw00l+ymNqaJpxcMDURSNMu3/63szQ9wpcMa7C40TgnjnIbTgkie4vBt2 BMY9fQ5Uo0rNuh1vArgFYnJNxn27QEVWsBqmBhX5usXMIE8i3UtTBkGlT3/ojPOuxFHD 4NCg== ARC-Authentication-Results: i=1; mx.google.com; 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 d187-v6si44810754pfa.68.2018.11.19.09.11.12; Mon, 19 Nov 2018 09:11:30 -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; 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 S2406874AbeKTDc2 (ORCPT + 99 others); Mon, 19 Nov 2018 22:32:28 -0500 Received: from foss.arm.com ([217.140.101.70]:33298 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406330AbeKTDc1 (ORCPT ); Mon, 19 Nov 2018 22:32:27 -0500 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 6A6BE80D; Mon, 19 Nov 2018 09:08:09 -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 9E20F3F5B7; Mon, 19 Nov 2018 09:08:07 -0800 (PST) From: Julien Thierry To: linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: marc.zyngier@arm.com, Christoffer.Dall@arm.com, linux-arm-kernel@lists.infradead.org, linux-rt-users@vger.kernel.org, tglx@linutronix.de, rostedt@goodmis.org, bigeasy@linutronix.de, Julien Thierry Subject: [PATCH 0/4] KVM: arm/arm64: vgic: Use raw_spinlock for locks taken in IRQ context Date: Mon, 19 Nov 2018 17:07:55 +0000 Message-Id: <1542647279-46609-1-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 | 67 +++++++++----------- 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, 132 insertions(+), 143 deletions(-) -- 1.9.1