From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946864AbcBRQ1J (ORCPT ); Thu, 18 Feb 2016 11:27:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42434 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946766AbcBRQ1H (ORCPT ); Thu, 18 Feb 2016 11:27:07 -0500 Date: Thu, 18 Feb 2016 17:27:01 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: Suravee Suthikulpanit , joro@8bytes.org, alex.williamson@redhat.com, gleb@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com Subject: Re: [PART1 RFC 5/9] svm: Add VMEXIT handlers for AVIC Message-ID: <20160218162701.GB6289@potion.brq.redhat.com> References: <56C2C1BF.7010700@amd.com> <56C312E1.1080902@redhat.com> <20160216141330.GG10555@potion.brq.redhat.com> <56C354A5.4040807@redhat.com> <20160216180618.GA18952@potion.brq.redhat.com> <56C52B80.5050104@amd.com> <20160218141817.GA6289@potion.brq.redhat.com> <56C5DA62.8080204@redhat.com> <20160218154343.GA18904@potion.brq.redhat.com> <56C5E8E1.9060900@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56C5E8E1.9060900@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-02-18 16:53+0100, Paolo Bonzini: > Patch 9 is okay, but it is also necessary to clear IsRunning in > kvm_arch_vcpu_blocking and set it in kvm_arch_vcpu_unblocking. In > addition, vcpu_put/vcpu_load should not modify IsRunning between > kvm_arch_vcpu_blocking and kvm_arch_vcpu_unblocking. Do you agree? Yes. I think we don't need to clear IsRunning on preemption, which would simplify the protection. (I haven't thought much about userspace exit, so maybe we could skip that one as well, but we don't need to now.) The reason for that is that KVM knows that the VCPU was scheduled out, so it couldn't do much in the AVIC VMEXIT. (KVM could force scheduler to pritioritize the VCPU, but our kick doesn't do that now and it seems like a bad idea.) Does it seem reasonable?