Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1263782ybl; Fri, 23 Aug 2019 16:29:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3TPIGjAoHnUtxHmlTn3cUbJz1RgenvD6I/KEpQzmmQpyKEw+J49jF92S+MqAscH9Gr+/f X-Received: by 2002:a65:4243:: with SMTP id d3mr6260396pgq.119.1566602947017; Fri, 23 Aug 2019 16:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566602947; cv=none; d=google.com; s=arc-20160816; b=Ik6Dy6lWl44PDEaGywI7aYY3x8BEQr918K0cOXKYLLt0Ak9TQTW310VMMEXZqyuD+9 Sg5viz38KV0o8992ZAiw9DXqCmZHQ2UaVZhthlvtEG4och+v39C1A5swkpIgJlaGUyYR 36rqYW5wRkUBx0Dzt7SR8XxI1oJwmmnNnukudt0e0zjQLD/9MqOU0REqKQvtCFb0UoOo U0c8ydSYQQizLZ8BHWQEDaA1O/bcEN9M4hZ8UDL4v+RGZVWpPZpxYIkwlZORKOvPI8Fx VzEuZpRryKBfFOTLIg0kzQ82fnaeNMx3/C7uHpyr2rBeBq1Z2cB1C52P9966uRnHKKxK R8cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=BKDQBHY9nLfWCz/8pBzkEJhAAXRLgYjY6Sa4fWiRCls=; b=HqopXJaU7dIx9DlpLLp6glmJza3OUt5tsXRe2ZKVgZH1AO1Z+MSmvsj3L2hQtYWlGT nIqnVz2r+HSVlbs4Se0Odt34ZVeZg+UFW4Bf1OE87fHshesYwQoS1fwzqE4/IVacETCZ qcSe2Z/jqCtOWfD7IS6OYvmsIBNdbFTVlkhploqfFSrnogZg8pQGT7tRFgGhOvO8qaWN NQa6SiGxOvbQQZ84IMv656h388HW7lnjTtE50jBM2e1xnHKgisw9U5eRBbDLkL6S7fr/ 1Aury6FnCgDHGnoLt5MwEDdk3u+R1TAIKi3hsQ4NW9P+PJ2OO4cIlD6EnWTbse7KueV1 rFAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si3051954pgs.126.2019.08.23.16.28.52; Fri, 23 Aug 2019 16:29:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395376AbfHWOh5 (ORCPT + 99 others); Fri, 23 Aug 2019 10:37:57 -0400 Received: from mga02.intel.com ([134.134.136.20]:62650 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393066AbfHWOh5 (ORCPT ); Fri, 23 Aug 2019 10:37:57 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2019 07:37:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,421,1559545200"; d="scan'208";a="196492866" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by fmsmga001.fm.intel.com with ESMTP; 23 Aug 2019 07:37:55 -0700 Date: Fri, 23 Aug 2019 07:37:55 -0700 From: Sean Christopherson To: Vitaly Kuznetsov Cc: Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [RESEND PATCH 01/13] KVM: x86: Relocate MMIO exit stats counting Message-ID: <20190823143755.GA6713@linux.intel.com> References: <20190823010709.24879-1-sean.j.christopherson@intel.com> <20190823010709.24879-2-sean.j.christopherson@intel.com> <87d0gwp7ix.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d0gwp7ix.fsf@vitty.brq.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 23, 2019 at 11:15:18AM +0200, Vitaly Kuznetsov wrote: > Sean Christopherson writes: > > > Move the stat.mmio_exits update into x86_emulate_instruction(). This is > > both a bug fix, e.g. the current update flows will incorrectly increment > > mmio_exits on emulation failure, and a preparatory change to set the > > stage for eliminating EMULATE_DONE and company. > > > > Signed-off-by: Sean Christopherson > > Reviewed-by: Vitaly Kuznetsov > > This, however, makes me wonder why this is handled in x86-specific code > in the first place, can we just count KVM_EXIT_MMIO exits when handling > KVM_RUN? struct kvm_vcpu_stat is arch specific. At a glance, everyone is counting similar things, but often in slightly different ways. E.g. PowerPC and ARM count MMIO exits, but PowerPC counts all exits, ARM has separate counters for in-kernel vs. userspace, and x86 counts only userspace.