From patchwork Fri Jan 25 09:46:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10780847 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 C6B7413BF for ; Fri, 25 Jan 2019 09:47:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B339B2F818 for ; Fri, 25 Jan 2019 09:47:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6DD22F8A3; Fri, 25 Jan 2019 09:47:02 +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 3008F2F818 for ; Fri, 25 Jan 2019 09:47:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbfAYJrA (ORCPT ); Fri, 25 Jan 2019 04:47:00 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:43806 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727689AbfAYJrA (ORCPT ); Fri, 25 Jan 2019 04:47:00 -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 47294EBD; Fri, 25 Jan 2019 01:47:00 -0800 (PST) Received: from localhost (e113682-lin.copenhagen.arm.com [10.32.144.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CAEA33F589; Fri, 25 Jan 2019 01:46:59 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, Christoffer Dall Subject: [PATCH 0/5] KVM: arm/arm64: Fix VCPU power management problems Date: Fri, 25 Jan 2019 10:46:51 +0100 Message-Id: <20190125094656.5026-1-christoffer.dall@arm.com> X-Mailer: git-send-email 2.18.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series fixes a number of issues: - When powering on and resetting VCPUs, we can be preempted in the middle which can lead to guest system register corruption. - We were missing support for PSCI ON_PENDING when multiple VCPUs try to turn on a target VCPU at the same time. - Powering off a VCPU could race with powering on the same VCPU. - We unnecesarily panic'ed if we found a non-initialized guest system register. The main approach to fixing all these problems is by using VCPU requests. See the individual patches for more details. Christoffer Dall (3): KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded KVM: arm/arm64: Require VCPU threads to turn them self off KVM: arm/arm64: Implement PSCI ON_PENDING when turning on VCPUs Marc Zyngier (2): arm/arm64: KVM: Allow a VCPU to fully reset itself arm/arm64: KVM: Don't panic on failure to properly reset system registers arch/arm/include/asm/kvm_host.h | 22 ++++++++++- arch/arm/kvm/coproc.c | 4 +- arch/arm/kvm/reset.c | 24 ++++++++++++ arch/arm64/include/asm/kvm_host.h | 23 ++++++++++- arch/arm64/kvm/reset.c | 50 +++++++++++++++++++++++- arch/arm64/kvm/sys_regs.c | 4 +- virt/kvm/arm/arm.c | 40 ++++++++++++++----- virt/kvm/arm/psci.c | 64 +++++++++++++++---------------- 8 files changed, 177 insertions(+), 54 deletions(-)