From patchwork Fri Mar 12 03:43:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 85189 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2C3fKoC011191 for ; Fri, 12 Mar 2010 03:41:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751424Ab0CLDlS (ORCPT ); Thu, 11 Mar 2010 22:41:18 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:64047 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751290Ab0CLDlR (ORCPT ); Thu, 11 Mar 2010 22:41:17 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id CF3C117010C; Fri, 12 Mar 2010 11:41:16 +0800 (CST) Received: from fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id o2C3e7j0027636; Fri, 12 Mar 2010 11:40:07 +0800 Received: from [10.167.141.76] (unknown [10.167.141.76]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 111A9D48A5; Fri, 12 Mar 2010 11:43:26 +0800 (CST) Message-ID: <4B99B848.6000006@cn.fujitsu.com> Date: Fri, 12 Mar 2010 11:43:04 +0800 From: Wei Yongjun User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Takuya Yoshikawa CC: avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org Subject: [PATCH] KVM: fix to not use NULL kvm->coalesced_mmio_ring in kvm_vcpu_fault() References: <20100312120523.1b147c58.yoshikawa.takuya@oss.ntt.co.jp> In-Reply-To: <20100312120523.1b147c58.yoshikawa.takuya@oss.ntt.co.jp> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 12 Mar 2010 03:42:23 +0000 (UTC) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index e758ef7..0e06a6d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1253,7 +1253,8 @@ static int kvm_vcpu_fault(struct vm_area_struct *vma, struct vm_fault *vmf) page = virt_to_page(vcpu->arch.pio_data); #endif #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET - else if (vmf->pgoff == KVM_COALESCED_MMIO_PAGE_OFFSET) + else if (vmf->pgoff == KVM_COALESCED_MMIO_PAGE_OFFSET && + vcpu->kvm->coalesced_mmio_ring) page = virt_to_page(vcpu->kvm->coalesced_mmio_ring); #endif else