From patchwork Thu Oct 22 10:40:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 55297 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 n9MAfH6j018438 for ; Thu, 22 Oct 2009 10:41:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753287AbZJVKlK (ORCPT ); Thu, 22 Oct 2009 06:41:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753203AbZJVKlJ (ORCPT ); Thu, 22 Oct 2009 06:41:09 -0400 Received: from thoth.sbs.de ([192.35.17.2]:18430 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753116AbZJVKlI (ORCPT ); Thu, 22 Oct 2009 06:41:08 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n9MAew2e021982; Thu, 22 Oct 2009 12:40:58 +0200 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail1.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n9MAeveL007924; Thu, 22 Oct 2009 12:40:58 +0200 Message-ID: <4AE036B9.7080302@siemens.com> Date: Thu, 22 Oct 2009 12:40:57 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Marcelo Tosatti CC: Avi Kivity , kvm-devel , Ed Swierk Subject: Re: [PATCH, -next] KVM: x86: Fix 32-bit host build warning References: <4ADDA9CE.30408@siemens.com> <20091020170157.GA14309@amt.cnet> In-Reply-To: <20091020170157.GA14309@amt.cnet> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3270b3b..5ad65b4 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -841,11 +841,12 @@ static int set_msr_mce(struct kvm_vcpu *vcpu, u32 msr, u64 data) static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data) { + struct kvm *kvm = vcpu->kvm; int lm = is_long_mode(vcpu); - u8 *blob_addr = lm ? (u8 *)vcpu->kvm->arch.xen_hvm_config.blob_addr_64 - : (u8 *)vcpu->kvm->arch.xen_hvm_config.blob_addr_32; - u8 blob_size = lm ? vcpu->kvm->arch.xen_hvm_config.blob_size_64 - : vcpu->kvm->arch.xen_hvm_config.blob_size_32; + u8 *blob_addr = lm ? (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_64 + : (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_32; + u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64 + : kvm->arch.xen_hvm_config.blob_size_32; u32 page_num = data & ~PAGE_MASK; u64 page_addr = data & PAGE_MASK; u8 *page; @@ -861,7 +862,7 @@ static int xen_hvm_config(struct kvm_vcpu *vcpu, u64 data) r = -EFAULT; if (copy_from_user(page, blob_addr + (page_num * PAGE_SIZE), PAGE_SIZE)) goto out_free; - if (kvm_write_guest(vcpu->kvm, page_addr, page, PAGE_SIZE)) + if (kvm_write_guest(kvm, page_addr, page, PAGE_SIZE)) goto out_free; r = 0; out_free: