From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valentine Sinitsyn Subject: Re: Nested paging in nested SVM setup Date: Wed, 18 Jun 2014 22:59:25 +0600 Message-ID: <53A1C56D.4060703@gmail.com> References: <53A179C4.9060203@gmail.com> <53A18A6D.2050407@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit To: Jan Kiszka , kvm@vger.kernel.org Return-path: Received: from mail-lb0-f178.google.com ([209.85.217.178]:60522 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977AbaFRQ7a (ORCPT ); Wed, 18 Jun 2014 12:59:30 -0400 Received: by mail-lb0-f178.google.com with SMTP id 10so711482lbg.37 for ; Wed, 18 Jun 2014 09:59:29 -0700 (PDT) In-Reply-To: <53A18A6D.2050407@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi Jan, > If we want to provide useful nested SVM support, this must be feasible. > If there is a bug, it has to be fixed. I was more concerned about if it is supported (and it means I do something wrong), or if it is not supported (at least, now). > Maybe you can describe how you configured the involved units (NPT > structures, guest / host PAR, MTRR etc.). I've tried different combinations, but to be specific: - NPT: four-level long-mode page tables; all PTEs except terminal have U,R,P bits set (0x07), as per APMv2 15.25.5 - APIC page pte; physical address 0xfee00000, flags: PAT, PWT, PCD, U, P (0x9D) - guest PAT and host PAT are the same, 0x7010600070106 (as set by the Linux kernel). Guest PAT is stored in VMCB; host PAT is restored at each #VMEXIT. - MTRRs. No changes to what Linux use prior to VM entry here; #0 (base 0x80000000, mask 0xFF80000000) uncacheable, others are disabled. I also noticed that setting PAT MSR from the nested hypervisor leaves high word unassigned, i.e. the code like this: mov $0x70106, %rax mov %rax, %rdx mov $0x0277, %rcx wrmsr rdmsr yields %rax = 0, %rdx = 0x70106. > Even better would be a test case based on kvm-unit-tests (see [1], Will have a look at it, thanks. -- Best regards, Valentine Sinitsyn