From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: Nested paging in nested SVM setup Date: Thu, 19 Jun 2014 11:32:35 +0200 Message-ID: <53A2AE33.4060505@redhat.com> References: <53A179C4.9060203@gmail.com> <53A18A6D.2050407@siemens.com> <53A1C56D.4060703@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit To: Valentine Sinitsyn , Jan Kiszka , kvm@vger.kernel.org Return-path: Received: from mail-wi0-f175.google.com ([209.85.212.175]:35338 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757557AbaFSJcj (ORCPT ); Thu, 19 Jun 2014 05:32:39 -0400 Received: by mail-wi0-f175.google.com with SMTP id r20so9027338wiv.8 for ; Thu, 19 Jun 2014 02:32:38 -0700 (PDT) In-Reply-To: <53A1C56D.4060703@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 18/06/2014 18:59, Valentine Sinitsyn ha scritto: > > 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. This should be the trivial fix: diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 0b140dc65bee..8a1cdc0f8fe7 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -461,7 +461,7 @@ struct kvm_vcpu_arch { bool nmi_injected; /* Trying to inject an NMI this entry */ struct mtrr_state_type mtrr_state; - u32 pat; + u64 pat; unsigned switch_db_regs; unsigned long db[KVM_NR_DB_REGS]; Paolo