Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751644AbdHRMkx (ORCPT ); Fri, 18 Aug 2017 08:40:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60972 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbdHRMkw (ORCPT ); Fri, 18 Aug 2017 08:40:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 854224ACA5 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=rkrcmar@redhat.com Date: Fri, 18 Aug 2017 14:40:47 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: David Hildenbrand , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, wanpeng.li@hotmail.com, Brijesh Singh Subject: Re: [PATCH 2/3] KVM: x86: Avoid guest page table walk when gpa_available is set Message-ID: <20170818124047.GC20100@flask> References: <1502987818-24065-1-git-send-email-pbonzini@redhat.com> <1502987818-24065-3-git-send-email-pbonzini@redhat.com> <97f78603-3007-2418-653a-58a0d33a0523@redhat.com> <20170818123649.GB20100@flask> <661ca6b5-bfb4-5377-d537-fb058d86ca0c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <661ca6b5-bfb4-5377-d537-fb058d86ca0c@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 18 Aug 2017 12:40:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 737 Lines: 20 2017-08-18 14:37+0200, Paolo Bonzini: > On 18/08/2017 14:36, Radim Krčmář wrote: > >>> + gpa = vcpu->arch.gpa_val; > >>> + ret = vcpu_is_mmio_gpa(vcpu, addr, gpa, write); > >>> + } else { > >>> + ret = vcpu_mmio_gva_to_gpa(vcpu, addr, &gpa, exception, write); > >>> } > >>> > >>> - ret = vcpu_mmio_gva_to_gpa(vcpu, addr, &gpa, exception, write); > >>> - > >>> if (ret < 0) > >>> return X86EMUL_PROPAGATE_FAULT; > >> just wondering if it makes sense to move this into the else branch (as > >> it logically only belongs to vcpu_mmio_gva_to_gpa) > > > > It does, I took the liberty to change that. > > It was on purpose, but it's okay either way. :) Oh, sorry, I was thinking that vcpu_is_mmio_gpa() should return bool. :)