From: Paolo Bonzini Subject: Re: [PATCH 0/8] kvm: nVMX: Checkpoint/restore support for VMX state Date: Thu, 16 Feb 2017 00:09:05 +0100 Message-ID: <9a3b21f9-821c-2d8d-0126-60bb9989fb67@redhat.com> References: <1480536229-11754-1-git-send-email-jmattson@google.com> <203030e9-5f2e-9383-933f-6088f794ea93@redhat.com> <0b04249f-f7fc-6164-49f1-c80de0e65d5d@redhat.com> <08cfbee1-4d5b-d094-2f90-9f2b6e335f72@redhat.com> <9b20b8f3-6351-a172-c712-385e33daa3a9@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: David Hildenbrand , kvm@vger.kernel.org To: Jim Mattson Return-path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:33526 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbdBOXJK (ORCPT ); Wed, 15 Feb 2017 18:09:10 -0500 Received: by mail-wr0-f193.google.com with SMTP id i10so111023wrb.0 for ; Wed, 15 Feb 2017 15:09:10 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 15/02/2017 23:49, Jim Mattson wrote: >> I think it should, yes. There are other limitations of KVM_TRANSLATE >> (it always assumes CPL=0 for example) but the same logic would apply to >> KVM_TRANSLATE and to the in-kernel emulator. > > Since KVM_TRANSLATE doesn't supply access mode, the exit qualification would be > deficient in more than the final access/paging-structure-entry bit you > reference below. > > Is it possible to fix this ioctl without breaking backwards > compatibility? Can existing > userspace code be expected to fill the pad[] bytes of the > kvm_translate structure > with 0? (There doesn't appear to be any enforcement of this, so I'm > assuming not.) > > Between this and the CPL==0 assumption, KVM_TRANSLATE seems like a non-starter. > But perhaps a new and improved API in the same vein... Either a new ioctl, or KVM_ENABLE_CAP to enable parsing the padding bytes. The format of struct kvm_translation is a bit inflexible, so I think a new ioctl would be better. BTW, have you seen this patent: https://www.google.com/patents/US20150378633? Implemnting this for nested EPT would complicate the MMU quite a lot. Paolo