[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#440068: gnumach: GPT in fp_save, fpu.c:675



Hi,

Samuel Thibault, le Wed 29 Aug 2007 16:50:20 +0200, a écrit :
> Michael Banck, le Wed 29 Aug 2007 16:13:20 +0200, a écrit :
> > eax 0x107502f8
> 
> This is the culprit: fxsave needs the buffer to be 16 bytes-aligned. It
> looks like there is a bug somewhere in the alignment support of
> zalloc().

The attached patch should help: in case the allocation makes sleep,
zalloc_next_space could be changed by another task, and hence possibly
unaligned.

Samuel
Index: kern/zalloc.c
===================================================================
RCS file: /cvsroot/hurd/gnumach/kern/zalloc.c,v
retrieving revision 1.3.2.8
diff -u -p -r1.3.2.8 zalloc.c
--- kern/zalloc.c	30 Apr 2007 20:30:11 -0000	1.3.2.8
+++ kern/zalloc.c	3 Sep 2007 23:22:13 -0000
@@ -320,6 +320,7 @@ static vm_offset_t zget_space(vm_offset_
 			zone_page_init(new_space, space_to_add,
 							ZONE_PAGE_USED);
 			simple_lock(&zget_space_lock);
+			ALIGN_SIZE_UP(zalloc_next_space, align);
 			continue;
 		}
 

Reply to: