From patchwork Mon Aug 3 06:17:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 38836 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n736HJbN021783 for ; Mon, 3 Aug 2009 06:17:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751629AbZHCGQr (ORCPT ); Mon, 3 Aug 2009 02:16:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752022AbZHCGQr (ORCPT ); Mon, 3 Aug 2009 02:16:47 -0400 Received: from mga03.intel.com ([143.182.124.21]:3833 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751980AbZHCGQr (ORCPT ); Mon, 3 Aug 2009 02:16:47 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 02 Aug 2009 23:16:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,312,1246863600"; d="scan'208";a="171585508" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.29]) by azsmga001.ch.intel.com with ESMTP; 02 Aug 2009 23:16:45 -0700 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1MXqrP-0001kx-Sw; Mon, 03 Aug 2009 14:17:27 +0800 From: Sheng Yang To: Avi Kivity Cc: Marcelo Tosatti , kvm@vger.kernel.org, Sheng Yang Subject: [PATCH] KVM: Fix EPT identity IOCTL on 32pae Date: Mon, 3 Aug 2009 14:17:27 +0800 Message-Id: <1249280247-6732-1-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.6.0.4 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Copy u64 from guest result in chaos. Also fix a mistake of still using old macro rather than new variable(). Signed-off-by: Sheng Yang --- arch/x86/kvm/vmx.c | 2 +- arch/x86/kvm/x86.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 7931c72..c5aaa1b 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2199,7 +2199,7 @@ static int alloc_identity_pagetable(struct kvm *kvm) goto out; kvm->arch.ept_identity_pagetable = gfn_to_page(kvm, - VMX_EPT_IDENTITY_PAGETABLE_ADDR >> PAGE_SHIFT); + kvm->arch.ept_identity_map_addr >> PAGE_SHIFT); out: up_write(&kvm->slots_lock); return r; diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2539e9a..977b705 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2178,7 +2178,7 @@ long kvm_arch_vm_ioctl(struct file *filp, goto out; break; case KVM_SET_IDENTITY_MAP_ADDR: { - u64 ident_addr; + unsigned long ident_addr; r = -EFAULT; if (copy_from_user(&ident_addr, argp, sizeof ident_addr))