From: Marcelo Tosatti Subject: Re: QEMU, MCE, unpoison memory address across reboot Date: Mon, 27 Dec 2010 19:27:54 -0200 Message-ID: <20101227212754.GB13518@amt.cnet> References: <1292986371.8743.113.camel@yhuang-dev> <20101223142803.GD17819@amt.cnet> <4D1734AE.30909@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Huang Ying , "kvm@vger.kernel.org" , Andi Kleen , Dean Nelson To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:64877 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495Ab0L0V2k (ORCPT ); Mon, 27 Dec 2010 16:28:40 -0500 Content-Disposition: inline In-Reply-To: <4D1734AE.30909@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Dec 26, 2010 at 02:27:26PM +0200, Avi Kivity wrote: > >> +static void kvm_unpoison_all(void *param) > >> +{ > >> + HWPoisonPage *page, *next_page; > >> + unsigned long address; > >> + KVMState *s = param; > >> + > >> + QLIST_FOREACH_SAFE(page,&hwpoison_page_list, list, next_page) { > >> + address = (unsigned long)page->vaddr; > >> + QLIST_REMOVE(page, list); > >> + kvm_vm_ioctl(s, KVM_UNPOISON_ADDRESS, address); > >> + qemu_free(page); > >> + } > >> +} > > > >Can't you free and reallocate all guest memory instead, on reboot, if > >there's a hwpoisoned page? Then you don't need this interface. > > > > Alternatively, MADV_DONTNEED? We already use it for ballooning. Does not work for hugetlbfs.