From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: 2 CPU Conformance Issue in KVM/x86 Date: Mon, 09 Mar 2015 19:08:44 +0200 Message-ID: <54FDD39C.9060908@gmail.com> References: <54F58471.7020906@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= To: Paolo Bonzini , Nadav Amit , kvm list Return-path: Received: from mail-wi0-f171.google.com ([209.85.212.171]:34721 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751743AbbCIRIs (ORCPT ); Mon, 9 Mar 2015 13:08:48 -0400 Received: by wiwl15 with SMTP id l15so21720834wiw.1 for ; Mon, 09 Mar 2015 10:08:47 -0700 (PDT) In-Reply-To: <54F58471.7020906@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/03/2015 11:52 AM, Paolo Bonzini wrote: >> In this >> case, the VM might expect exceptions when PTE bits which are higher than the >> maximum (reported) address width are set, and it would not get such >> exceptions. This problem can easily be experienced by small change to the >> existing KVM unit-tests. >> >> There are many variants to this problem, and the only solution which I >> consider complete is to report to the VM the maximum (52) physical address >> width to the VM, configure the VM to exit on #PF with reserved-bit >> error-codes, and then emulate these faulting instructions. > Not even that would be a definitive solution. If the guest tries to map > RAM (e.g. a PCI BAR that is backed by RAM) above the host MAXPHYADDR, > you would get EPT misconfiguration vmexits. > > I think there is no way to emulate physical address width correctly, > except by disabling EPT. > Is the issue emulating a higher MAXPHYADDR on the guest than is available on the host? I don't think there's any need to support that. Emulating a lower setting on the guest than is available on the host is, I think, desirable. Whether it would work depends on the relative priority of EPT misconfiguration exits vs. page table permission faults.