From patchwork Tue Apr 14 10:35:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11487239 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 05EFF913 for ; Tue, 14 Apr 2020 10:54:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E21EE2072D for ; Tue, 14 Apr 2020 10:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586861664; bh=HTu//z0XJEwQHak8IhhTICmq+Sn+E6x+AwgA/JSk24U=; h=From:To:Cc:Subject:Date:List-ID:From; b=zYZzeqJ1e0bN/k+2WM+y3zuqqHAQoUGGoZ/KRMdw79Sun1eWN9tbbU5xtLRcxCS+z cx5woHQfMDmhxZyx8rmnwE2OZ9gMgDQZ8rrpZe4A5vYUujsrrT5wz/6Im3E/t2h6sX 2RKh6rzSZked7psodD2V412FT32WfBf7PMZ8gi08= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438672AbgDNKxu (ORCPT ); Tue, 14 Apr 2020 06:53:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:39498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438454AbgDNKfo (ORCPT ); Tue, 14 Apr 2020 06:35:44 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CB11320644; Tue, 14 Apr 2020 10:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586860543; bh=HTu//z0XJEwQHak8IhhTICmq+Sn+E6x+AwgA/JSk24U=; h=From:To:Cc:Subject:Date:From; b=GdDDuxOITRb32SG16cxJkfmqBTuSmracfzbNyUVwKew4s1O3QM+NM/R98myCM3cPx XTaXr0KwHIvinwf+MvYrsrRu/IweRRydVlcpKzNHYCuUZRrCw65GWADQUEzGaUhFUy n4Jq5dPPrVyFsFsg0UbzF/nKfLscOIXq69XcLrI4= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jOIus-0036te-6Q; Tue, 14 Apr 2020 11:35:42 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: Zenghui Yu , Eric Auger , Andre Przywara , Julien Grall , James Morse , Julien Thierry , Suzuki K Poulose Subject: [PATCH 0/3] KVM: arm: vgic fixes for 5.7 Date: Tue, 14 Apr 2020 11:35:14 +0100 Message-Id: <20200414103517.2824071-1-maz@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, yuzenghui@huawei.com, eric.auger@redhat.com, Andre.Przywara@arm.com, julien@xen.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Here's a few fixes I've been piling on during the merge window. The first patch improves the handling of the ACTIVE registers, which we never synchronise on the read side (the distributor state can only be updated when the vcpu exits). Let's fix it the same way we do it on the write side (stop-the-world, read, restart). Yes, this is expensive. The last two patches deal with an issue where we consider the HW state of an interrupt when responding to a userspace access. We should never do this, as the guest shouldn't be running at this stage and if it is, it is absolutely fine to return random bits to userspace. It could also be that there is no active guest context at this stage, and you end up with an Oops, which nobody really enjoys. Marc Zyngier (3): KVM: arm: vgic: Synchronize the whole guest on GIC{D,R}_I{S,C}ACTIVER read KVM: arm: vgic: Only use the virtual state when userspace accesses enable bits KVM: arm: vgic-v2: Only use the virtual state when userspace accesses pending bits virt/kvm/arm/vgic/vgic-mmio-v2.c | 16 ++- virt/kvm/arm/vgic/vgic-mmio-v3.c | 20 ++-- virt/kvm/arm/vgic/vgic-mmio.c | 183 +++++++++++++++++++++++++------ virt/kvm/arm/vgic/vgic-mmio.h | 19 ++++ 4 files changed, 188 insertions(+), 50 deletions(-)