Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751126AbdHRMfW (ORCPT ); Fri, 18 Aug 2017 08:35:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbdHRMfV (ORCPT ); Fri, 18 Aug 2017 08:35:21 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0726780467 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: [PATCH] kvm: VMX: do not use vm-exit instruction length for fast MMIO To: David Hildenbrand , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: rkrcmar@redhat.com, "Michael S. Tsirkin" , stable@vger.kernel.org References: <1502890494-35208-1-git-send-email-pbonzini@redhat.com> <901d4c2e-aa94-2002-babc-7f042946a327@redhat.com> From: Paolo Bonzini Message-ID: <3b7afdfc-d308-7645-2105-6bb339188aa6@redhat.com> Date: Fri, 18 Aug 2017 14:35:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <901d4c2e-aa94-2002-babc-7f042946a327@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 18 Aug 2017 12:35:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 578 Lines: 19 On 18/08/2017 13:57, David Hildenbrand wrote: > What about a hack: > > 1. clear instruction length when entering > 2. check if instruction length is set when trying to forward the RIP > 2a. if set, use it > 2b. if not set, compute it It's undefined, so we don't know that the instruction length remains zero (also, on older processors and possibly some nested setups the field is read-only). Testing the hypervisor bit is the first line of action. Paolo > this at least should give full speedup in existing setups. Not 99% > architecturally correct but might just work. >