From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v5 4/9] KVM: MMU: introduce gfn_to_pfn_atomic() function Date: Tue, 06 Jul 2010 19:28:50 +0800 Message-ID: <4C331372.30900@cn.fujitsu.com> References: <4C330918.6040709@cn.fujitsu.com> <4C3309D3.6010109@cn.fujitsu.com> <20100706112259.GV4689@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , LKML , KVM list To: Gleb Natapov Return-path: In-Reply-To: <20100706112259.GV4689@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Gleb Natapov wrote: >> + } >> >> if (unlikely(npages != 1)) { >> struct vm_area_struct *vma; >> >> + if (atomic) >> + goto return_bad_page; >> + > You are skipping hwpoison test and sometimes you will return bad_page > for something that returns good pfn now without caller even know. > vma->vm_flags & VM_PFNMAP comes to mind. Is this safe? No matter about it, we not hope the atomic case return good pfn all the time, if the page is swapped or it's hwpoison just return bad_page, then we can skip it in the speculative path.