From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754847AbcFPRWF (ORCPT ); Thu, 16 Jun 2016 13:22:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34430 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754651AbcFPRWD (ORCPT ); Thu, 16 Jun 2016 13:22:03 -0400 Subject: Re: [RFC PATCH 2/2] KVM: x86: use __kvm_guest_exit To: David Matlack References: <1466065297-4644-1-git-send-email-pbonzini@redhat.com> <1466065297-4644-3-git-send-email-pbonzini@redhat.com> <9747be28-e078-675f-0910-01716e7ff68f@redhat.com> Cc: "linux-kernel@vger.kernel.org" , kvm list , bsd@redhat.com, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= From: Paolo Bonzini Message-ID: Date: Thu, 16 Jun 2016 19:21:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 16 Jun 2016 17:22:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/06/2016 19:03, David Matlack wrote: > > > If you make the else case the same as svm_handle_external_intr, can we > > > avoid requiring ack-intr-on-exit? > > > > Yes, but the sti/nop/cli would be useless if ack-intr-on-exit is > > available. It's a bit ugly, so I RFCed the bold thing instead. > > Ahh, and handle_external_intr is called on every VM-exit, not just > VM-exits caused by external interrupts. So we'd be doing the > sti/nop/cli quite often. I was thinking we never hit the else case > when the CPU supports ack-intr-on-exit. Actually it's really just aesthetics, because the sti and cli are pretty cheap. It's the pushf/popf that kills performance for kvm_guest_exit. I also thought of just doing a cli/sti around __kvm_guest_exit and calling it a day. Ubuntu 14.04 had kernel 3.13, but the latest hardware enablement kernels are as recent as 4.4. And the most recent released RHEL (7.2) has all the fixes too. Debian Jessie has 3.16.7-ckt25, and all three patches for APICv support have been backported to 3.16.7-ckt11. So they should be there (but I can only check tomorrow). Paolo >> > >> > Are you thinking of some distros in particular that lack nested >> > ack-intr-on-exit? All processors have it as far as I know. > Nope, I just thought it was possible to avoid the requirement. >