Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp257451imu; Mon, 26 Nov 2018 10:28:31 -0800 (PST) X-Google-Smtp-Source: AJdET5flRSETmDpaC8IPPWSQP8h1CdeRF2fjs7sPgqVNHzGKavXgeCDES9CTEUjpCXuBvXvK4MEZ X-Received: by 2002:a63:fc49:: with SMTP id r9mr25301744pgk.209.1543256911302; Mon, 26 Nov 2018 10:28:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543256911; cv=none; d=google.com; s=arc-20160816; b=gM37DFfO+WGvw17ncHtrjjfsFUZYBfxXYOQqMt3dDseGQVfQ2ytJfkGT7+F4ugiWTs iAZ+zPXSrVIR/1FkQ5KpCLcDdXFuXLvThvCrDAsA+57s1VoKhX5b0nX7KOEKNsGBB86e NSKCw9ZjZbajyMHq83P71zPo7fTDrlt4UMDXPTEDTWULJryPW1qCJ/0b1wLkVxd8D4BZ RhV81fJVJS9idmG1xBSHyuxkxZLJmYmjtGwB1uUx8o7V6JVYrcYyBVFUm9CwwNa/U9rs 6dJ5B2poiRRFK68UaTXZrdIWSnZnQ1ulOUUnQxQD+NG36FZNmnjilH9612h/Issh+R0R Cynw== 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=KBrXuXp++Dql2/KChJev2pVnlw3HlhcW5KM7pzaLDPk=; b=Fo/SD9lZjRA7IzN+fS0htOlTfJAvBIPXwJEdys/12zoRnF59mezBHSpkMGQczVrBDU o/fk5ewOAmlwVPA0CzA5EH+fJ+s9KGiqNG7siDp/AUtJIGu1ROqsWrG0tJ1VIZ66FMia W0Jc8oPfGNost3xeWD3KYwSlnfUj4zF9mWeaZ3r2jI7nb5H/dsBYTWUz0PJEHCTfMcly Q/KA9ROqPgqdPFPOziZP5UNdSlKBBHlO/quZVrgM1eYDDFEz96LqjaJCwG/AExo6hHPp YSzu7rDbJnzJUo/xaeMZqfcBeAcu9ooFXEP+IRELPQUnK+gT3rjiZenZQ1S6UyYBNeuv GEzw== 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 b39-v6si1014009pla.22.2018.11.26.10.27.51; Mon, 26 Nov 2018 10:28:31 -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 S1726396AbeK0FVu (ORCPT + 99 others); Tue, 27 Nov 2018 00:21:50 -0500 Received: from foss.arm.com ([217.140.101.70]:44576 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725199AbeK0FVu (ORCPT ); Tue, 27 Nov 2018 00:21:50 -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 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 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 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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