From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751405AbdE3JGE (ORCPT ); Tue, 30 May 2017 05:06:04 -0400 Received: from 8bytes.org ([81.169.241.247]:57908 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbdE3JFv (ORCPT ); Tue, 30 May 2017 05:05:51 -0400 Date: Tue, 30 May 2017 11:05:48 +0200 From: Joerg Roedel To: Brijesh Singh Cc: pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, Thomas.Lendacky@amd.com Subject: Re: [PATCH v2] KVM: x86: Avoid guest page table walk when gpa_available is set Message-ID: <20170530090548.GA2764@8bytes.org> References: <1495206749-25393-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1495206749-25393-1-git-send-email-brijesh.singh@amd.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 19, 2017 at 11:12:29AM -0400, Brijesh Singh wrote: > From: Brijesh Singh > > On AMD hardware when a guest causes a NPF which requires emulation, > the vcpu->arch.gpa_available flag is set to indicate that cr2 contains > a valid GPA. > > Currently, emulator_read_write_onepage() makes use of gpa_available flag > to avoid a guest page walk for a known MMIO regions. Lets not limit > the gpa_available optimization to just MMIO region. The patch extends > the check to avoid page walk whenever gpa_available flag is set. > > Signed-off-by: Brijesh Singh > --- > v1: http://marc.info/?l=kvm&m=149304930814202&w=2 > > Changes in v2: > - move gpa_val setting in pf_interception > > arch/x86/include/asm/kvm_host.h | 1 + > arch/x86/kvm/svm.c | 4 ++++ > arch/x86/kvm/x86.c | 14 +++++++------- > 3 files changed, 12 insertions(+), 7 deletions(-) I havn't checked in detail, but maybe you have: Does that take nesting into account, where we might run on a shadow nested page-table and we actually get a nested gpa (which still needs translation) instead of a normal gpa? Joerg