From: Marc Zyngier Subject: Re: [PATCH v2 01/10] KVM: arm/arm64: vgic: Defer touching GICH_VMCR to vcpu_load/put Date: Mon, 27 Mar 2017 11:49:39 +0100 Message-ID: <5cdcadc0-c6c4-bb11-5a70-83f3a00a6532@arm.com> References: <20170321211059.8719-1-cdall@linaro.org> <20170321211059.8719-2-cdall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9363140AF5 for ; Mon, 27 Mar 2017 06:47:46 -0400 (EDT) Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N+evBnwoQ0fk for ; Mon, 27 Mar 2017 06:47:45 -0400 (EDT) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6EB7640A66 for ; Mon, 27 Mar 2017 06:47:45 -0400 (EDT) In-Reply-To: <20170321211059.8719-2-cdall@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: Christoffer Dall , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: Andre Przywara , Christoffer Dall , kvm@vger.kernel.org List-Id: kvmarm@lists.cs.columbia.edu On 21/03/17 21:10, Christoffer Dall wrote: > From: Christoffer Dall > > We don't have to save/restore the VMCR on every entry to/from the guest, > since on GICv2 we can access the control interface from EL1 and on VHE > systems with GICv3 we can access the control interface from KVM running > in EL2. > > GICv3 systems without VHE become the rare case, which have to > save/restore the register in the put/load functions by doing an extra > jump to EL2 to access the EL2-only register state. > > Note that userspace accesses may see out-of-date values if the VCPU is > running while accessing the VGIC state via the KVM device API, but this > is already the case and it is up to userspace to quiesce the CPUs before > reading the CPU registers from the GIC for an up-to-date view. > > Signed-off-by: Christoffer Dall > Signed-off-by: Christoffer Dall Reviewed-by: Marc Zyngier M. -- Jazz is not dead. It just smells funny...