From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935363AbcLONb1 (ORCPT ); Thu, 15 Dec 2016 08:31:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2945 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757884AbcLONbZ (ORCPT ); Thu, 15 Dec 2016 08:31:25 -0500 Subject: Re: [PATCH v3] kvm: svm: Use the hardware provided GPA instead of page walk To: David Hildenbrand , Brijesh Singh , kvm@vger.kernel.org References: <148174555164.13485.11526818510637119259.stgit@brijesh-build-machine> <148174556351.13485.18084576305677228092.stgit@brijesh-build-machine> <1f538be1-b5f1-d095-01be-38a30db62045@redhat.com> <71035e94-f1c0-409c-e58d-2d4a3ea75db5@redhat.com> <5be2e278-fca0-d08a-3f2a-aa8ec70c9b9e@redhat.com> Cc: thomas.lendacky@amd.com, rkrcmar@redhat.com, joro@8bytes.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, tglx@linutronix.de, bp@suse.de From: Paolo Bonzini Message-ID: Date: Thu, 15 Dec 2016 14:31:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <5be2e278-fca0-d08a-3f2a-aa8ec70c9b9e@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 15 Dec 2016 13:31:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/12/2016 14:09, David Hildenbrand wrote: >>> >>> bool exception_gpa_valid(struct kvm_vcpu) >>> { >>> // check if svm >>> // check if exit code is NPF >>> // check ctxt >>> } >> >> No, this would be a layering violation. The emulator ops don't know >> about svm and exit codes (and in fact it's trivial to implement this >> optimization for vmx, with a slightly different logic), so we need to >> have gpa_available. > > I was rather thinking about adding an vmx/svm independent callback, > which would return false for vmx for now. I just saw the variable > and was wondering if it is really necessary. The variable would probably just move into struct {vmx,svm}_vcpu. Maybe you could access the VMX/SVM exitcode directly, but doing that worries me a bit... Paolo