Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751734AbdHQJAL (ORCPT ); Thu, 17 Aug 2017 05:00:11 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34282 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107AbdHQJAI (ORCPT ); Thu, 17 Aug 2017 05:00:08 -0400 Subject: Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS To: "Michael S. Tsirkin" Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org References: <20170816112249.28939-1-pbonzini@redhat.com> <20170816155132-mutt-send-email-mst@kernel.org> <9de5ebf5-457d-2a34-0314-c6c612ddb2e9@redhat.com> <20170816161301-mutt-send-email-mst@kernel.org> <20170816194342-mutt-send-email-mst@kernel.org> <81dabc78-edfd-32fc-024c-c57330386a51@redhat.com> <20170816190316.GA2566@flask> <20170816224815-mutt-send-email-mst@kernel.org> <20170817011815-mutt-send-email-mst@kernel.org> From: Paolo Bonzini Message-ID: <2e42e64c-f31d-5ccd-2357-1a859cec5b5b@redhat.com> Date: Thu, 17 Aug 2017 11:00:01 +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: <20170817011815-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1461 Lines: 34 On 17/08/2017 00:31, Michael S. Tsirkin wrote: > On Wed, Aug 16, 2017 at 11:25:35PM +0200, Paolo Bonzini wrote: >> Yes, I agree. EMULTYPE_SKIP is fine because failed decoding still >> causes an exception to be injected. Maybe it's better to gate the >> EMULTYPE_SKIP emulation on the exit qualification saying this is a write > > I thought it's already limited to writes. I agree that's a reasonable > limitation in any case. > >> and also not a page table walk---just in case. > > I still don't get it, sorry. Let's assume for the sake of argument > that it's a PT walk causing the MMIO access. Just why do you think > that it makes sense to skip the instruction that caused the walk? I think it doesn't. I think in that case it's better to skip the fast write and proceed with full emulation. >>> It's just that this has been there for 3 years and people have built a >>> product around this. >> >> Around 700 clock cycles? > > About 30% the cost of exit, isn't it? There are definitely workloads > where cost of exit gates performance. We didn't work on fast mmio based > on theoretical assumptions. But maybe I am wrong. We'll see. Jason here > volunteered to test your patch and we'll see what comes out of it. If > I'm wrong and it's about 1%, I won't split hairs. Note that we still get the latency benefit from fast MMIO, and maybe we can cut a couple hundred clock cycles more---which would benefit all emulation, not just fast MMIO. Paolo