From: "Nadav Har'El" Subject: Re: [PATCH 9/24] Implement VMCLEAR Date: Thu, 5 Aug 2010 14:50:25 +0300 Message-ID: <20100805115025.GC16722@fermat.math.technion.ac.il> References: <1276431753-nyh@il.ibm.com> <201006131227.o5DCRAB0012968@rice.haifa.ibm.com> <20100615134753.GX21797@redhat.com> <4C17852B.5080703@redhat.com> <20100615135405.GY21797@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:47829 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758893Ab0HELuq (ORCPT ); Thu, 5 Aug 2010 07:50:46 -0400 Content-Disposition: inline In-Reply-To: <20100615135405.GY21797@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jun 15, 2010, Gleb Natapov wrote about "Re: [PATCH 9/24] Implement VMCLEAR": > On Tue, Jun 15, 2010 at 04:50:35PM +0300, Avi Kivity wrote: > > On 06/15/2010 04:47 PM, Gleb Natapov wrote: > > Architectural errors (bad alignment) should update flags. Internal > > errors (ENOMEM, vpmtr pointing outside of RAM) should not. > > > vpmtr pointing outside of RAM is architectural error (or not?). SDM > says "The operand of this instruction is always 64 bits and is always in > memory", but may be they mean "not in register". Anyway internal errors > should generate error exit to userspace which this patch is also > missing. I'm a bit puzzled what I am supposed to do when the guest-physical address I get as a parameter to VMCLEAR (after I read this address from guest virtual memory) is beyond the guest's actual memory, i.e., gfn_to_page fails on this address. Is this a normal "architectural error" and I should VMfail(VMCLEAR with invalid physical address)? #GP? Or something else? The SMD says "ensure that data for VMCS referenced by the operand is in memory" but it doesn't appear to say what to do if that is not the case. When the address itself is faulty (e.g., more than 32 bits in 32 bit mode) the SDM says VMfail(VMCLEAR with invalid physical address) - but it doesn't say to do that when the physical address is "simply" beyond the amount of available memory. In any case, I don't think this should be considered an internal error, or that we have a reason to exit to user space in this case. Thanks, Nadav. -- Nadav Har'El | Thursday, Aug 5 2010, 25 Av 5770 nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Thousands of years ago, cats were http://nadav.harel.org.il |worshipped as gods. They never forgot.