From patchwork Fri Aug 2 10:37:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11073123 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 7B4221399 for ; Fri, 2 Aug 2019 10:37:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61B96287E9 for ; Fri, 2 Aug 2019 10:37:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 559022881B; Fri, 2 Aug 2019 10:37:47 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F30242881C for ; Fri, 2 Aug 2019 10:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbfHBKhp (ORCPT ); Fri, 2 Aug 2019 06:37:45 -0400 Received: from foss.arm.com ([217.140.110.172]:49370 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbfHBKhp (ORCPT ); Fri, 2 Aug 2019 06:37:45 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 087D2344; Fri, 2 Aug 2019 03:37:45 -0700 (PDT) Received: from filthy-habits.cambridge.arm.com (filthy-habits.cambridge.arm.com [10.1.197.61]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A60B53F71F; Fri, 2 Aug 2019 03:37:43 -0700 (PDT) From: Marc Zyngier To: Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Julien Thierry , Suzuki K Poulose , James Morse , Joerg Roedel , Suravee Suthikulpanit , Tangnianyao Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH 0/2] KVM: arm/arm64: Fix guest's PMR synchronization when blocking on WFI Date: Fri, 2 Aug 2019 11:37:07 +0100 Message-Id: <20190802103709.70148-1-maz@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It recently came to light that if we run a guest that actively uses interrupt priorities to block interrupts, vcpus can end-up being blocked while they shouldn't, leading to an unresponsive guest (a slightly less than desirable outcome). Patch #1 fixes the issue (which has been with us since 4.12), which I plan to take in for 5.3 with immediate backport to stable. Patch #2 is more of an RFC, as it also impacts the SVN AVIC support. It moves the kvm_arch_vcpu_blocking callback to happen earlier, leading to much better performances on ARM, and leading to the above fix to be applied at the best possible spot. I'd welcome any comment/testing on this, specially on non-ARM systems. Marc Zyngier (2): KVM: arm/arm64: Sync ICH_VMCR_EL2 back when about to block KVM: Call kvm_arch_vcpu_blocking early into the blocking sequence include/kvm/arm_vgic.h | 1 + virt/kvm/arm/arm.c | 11 +++++++++++ virt/kvm/arm/vgic/vgic-v2.c | 9 ++++++++- virt/kvm/arm/vgic/vgic-v3.c | 7 ++++++- virt/kvm/arm/vgic/vgic.c | 11 +++++++++++ virt/kvm/arm/vgic/vgic.h | 2 ++ virt/kvm/kvm_main.c | 7 +++---- 7 files changed, 42 insertions(+), 6 deletions(-)