From: Samuel Thibault Subject: [PATCH] minios: fix case when _text is not 0 Date: Tue, 22 Jan 2008 11:27:33 +0000 Message-ID: <20080122112733.GB5592@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org fix case when _text is not 0 Signed-off-by: Samuel Thibault diff -r b7ba0be77a47 extras/mini-os/arch/x86/mm.c --- a/extras/mini-os/arch/x86/mm.c Tue Jan 22 10:56:36 2008 +0000 +++ b/extras/mini-os/arch/x86/mm.c Tue Jan 22 11:22:55 2008 +0000 @@ -564,11 +564,11 @@ static void clear_bootstrap(void) int n = sizeof(mfns)/sizeof(*mfns); pte_t nullpte = { }; - /* Use page 0 as the CoW zero page */ - memset(NULL, 0, PAGE_SIZE); - mfn_zero = pfn_to_mfn(0); - if (HYPERVISOR_update_va_mapping(0, nullpte, UVMF_INVLPG)) - printk("Unable to unmap page 0\n"); + /* Use first page as the CoW zero page */ + memset(&_text, 0, PAGE_SIZE); + mfn_zero = pfn_to_mfn((unsigned long) &_text); + if (HYPERVISOR_update_va_mapping((unsigned long) &_text, nullpte, UVMF_INVLPG)) + printk("Unable to unmap first page\n"); set_xen_guest_handle(reservation.extent_start, mfns); reservation.nr_extents = n;