From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 01/41] KVM: arm/arm64: Avoid vcpu_load for other vcpu ioctls than KVM_RUN Date: Mon, 5 Feb 2018 12:32:33 +0000 Message-ID: References: <20180112120747.27999-1-christoffer.dall@linaro.org> <20180112120747.27999-2-christoffer.dall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Marc Zyngier , Shih-Wei Li , kvm@vger.kernel.org To: Christoffer Dall , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Return-path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49588 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260AbeBEMch (ORCPT ); Mon, 5 Feb 2018 07:32:37 -0500 In-Reply-To: <20180112120747.27999-2-christoffer.dall@linaro.org> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: Hi Christoffer, On 12/01/18 12:07, Christoffer Dall wrote: > Calling vcpu_load() registers preempt notifiers for this vcpu and calls > kvm_arch_vcpu_load(). The latter will soon be doing a lot of heavy > lifting on arm/arm64 and will try to do things such as enabling the > virtual timer and setting us up to handle interrupts from the timer > hardware. > > Loading state onto hardware registers and enabling hardware to signal > interrupts can be problematic when we're not actually about to run the > VCPU, because it makes it difficult to establish the right context when > handling interrupts from the timer, and it makes the register access > code difficult to reason about. > > Luckily, now when we call vcpu_load in each ioctl implementation, we can > simply remove the call from the non-KVM_RUN vcpu ioctls, and our > kvm_arch_vcpu_load() is only used for loading vcpu content to the > physical CPU when we're actually going to run the vcpu. > > Signed-off-by: Christoffer Dall Reviewed-by: Julien Grall Cheers, -- Julien Grall From mboxrd@z Thu Jan 1 00:00:00 1970 From: julien.grall@arm.com (Julien Grall) Date: Mon, 5 Feb 2018 12:32:33 +0000 Subject: [PATCH v3 01/41] KVM: arm/arm64: Avoid vcpu_load for other vcpu ioctls than KVM_RUN In-Reply-To: <20180112120747.27999-2-christoffer.dall@linaro.org> References: <20180112120747.27999-1-christoffer.dall@linaro.org> <20180112120747.27999-2-christoffer.dall@linaro.org> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Christoffer, On 12/01/18 12:07, Christoffer Dall wrote: > Calling vcpu_load() registers preempt notifiers for this vcpu and calls > kvm_arch_vcpu_load(). The latter will soon be doing a lot of heavy > lifting on arm/arm64 and will try to do things such as enabling the > virtual timer and setting us up to handle interrupts from the timer > hardware. > > Loading state onto hardware registers and enabling hardware to signal > interrupts can be problematic when we're not actually about to run the > VCPU, because it makes it difficult to establish the right context when > handling interrupts from the timer, and it makes the register access > code difficult to reason about. > > Luckily, now when we call vcpu_load in each ioctl implementation, we can > simply remove the call from the non-KVM_RUN vcpu ioctls, and our > kvm_arch_vcpu_load() is only used for loading vcpu content to the > physical CPU when we're actually going to run the vcpu. > > Signed-off-by: Christoffer Dall Reviewed-by: Julien Grall Cheers, -- Julien Grall