You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
|
2
(6) |
3
(1) |
4
(1) |
5
(20) |
6
(3) |
|
7
(1) |
8
(3) |
9
(4) |
10
(1) |
11
(1) |
12
(3) |
13
(5) |
|
14
|
15
|
16
(2) |
17
(3) |
18
(4) |
19
(2) |
20
(1) |
|
21
(1) |
22
(2) |
23
(3) |
24
(2) |
25
(2) |
26
(7) |
27
(1) |
|
28
(28) |
29
|
30
(1) |
|
|
|
|
|
From: <sv...@va...> - 2015-06-18 21:33:12
|
Author: florian
Date: Thu Jun 18 22:33:04 2015
New Revision: 15344
Log:
In the future we may want to use a different implementation to
represent an ordered set of segments. Therefore, reduce
dependency on the nsegments array.
Add function find_segment.
Totally mechanical patch, easy to proofread. Its main purpose is
to reduce the size of future patches.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Thu Jun 18 22:33:04 2015
@@ -331,8 +331,8 @@
/* ------ end of STATE for the address-space manager ------ */
/* ------ Forwards decls ------ */
-inline
-static UInt find_nsegment_idx ( Addr a );
+
+static inline NSegment *find_segment( Addr a );
static void parse_procselfmaps (
void (*record_mapping)( Addr addr, SizeT len, UInt prot,
@@ -768,7 +768,6 @@
ULong dev, ULong ino, Off64T offset,
const HChar* filename )
{
- UInt iLo, iHi, i;
Bool sloppyXcheck, sloppyRcheck;
/* If a problem has already been detected, don't continue comparing
@@ -785,12 +784,12 @@
/* The kernel should not give us wraparounds. */
aspacem_assert(addr <= addr + len - 1);
- iLo = find_nsegment_idx( addr );
- iHi = find_nsegment_idx( addr + len - 1 );
+ const NSegment *segLo = find_segment( addr );
+ const NSegment *segHi = find_segment( addr + len - 1 );
- aspacem_assert(iLo <= iHi);
- aspacem_assert(nsegments[iLo].start <= addr );
- aspacem_assert(nsegments[iHi].end >= addr + len - 1 );
+ aspacem_assert(segLo <= segHi);
+ aspacem_assert(segLo->start <= addr );
+ aspacem_assert(segHi->end >= addr + len - 1 );
/* x86 doesn't differentiate 'x' and 'r' (at least, all except the
most recent NX-bit enabled CPUs) and so recent kernels attempt
@@ -819,30 +818,28 @@
sloppyRcheck = False;
# endif
- /* NSegments iLo .. iHi inclusive should agree with the presented
- data. */
- for (i = iLo; i <= iHi; i++) {
+ /* Segments segLo .. segHi inclusive should agree with the
+ presented data. */
+ for (const NSegment *seg = segLo; seg <= segHi; seg++) {
Bool same, cmp_offsets, cmp_devino;
UInt seg_prot;
/* compare the kernel's offering against ours. */
- same = nsegments[i].kind == SkAnonC
- || nsegments[i].kind == SkAnonV
- || nsegments[i].kind == SkFileC
- || nsegments[i].kind == SkFileV
- || nsegments[i].kind == SkShmC;
+ same = seg->kind == SkAnonC
+ || seg->kind == SkAnonV
+ || seg->kind == SkFileC
+ || seg->kind == SkFileV
+ || seg->kind == SkShmC;
seg_prot = 0;
- if (nsegments[i].hasR) seg_prot |= VKI_PROT_READ;
- if (nsegments[i].hasW) seg_prot |= VKI_PROT_WRITE;
- if (nsegments[i].hasX) seg_prot |= VKI_PROT_EXEC;
+ if (seg->hasR) seg_prot |= VKI_PROT_READ;
+ if (seg->hasW) seg_prot |= VKI_PROT_WRITE;
+ if (seg->hasX) seg_prot |= VKI_PROT_EXEC;
- cmp_offsets
- = nsegments[i].kind == SkFileC || nsegments[i].kind == SkFileV;
+ cmp_offsets = seg->kind == SkFileC || seg->kind == SkFileV;
- cmp_devino
- = nsegments[i].dev != 0 || nsegments[i].ino != 0;
+ cmp_devino = seg->dev != 0 || seg->ino != 0;
/* Consider other reasons to not compare dev/inode */
#if defined(VGO_linux)
@@ -881,10 +878,10 @@
same = same
&& seg_prot == prot
&& (cmp_devino
- ? (nsegments[i].dev == dev && nsegments[i].ino == ino)
+ ? (seg->dev == dev && seg->ino == ino)
: True)
&& (cmp_offsets
- ? nsegments[i].start-nsegments[i].offset == addr-offset
+ ? seg->start - seg->offset == addr-offset
: True);
if (!same) {
Addr start = addr;
@@ -897,7 +894,7 @@
VG_(debugLog)(
0,"aspacem",
"segment mismatch: V's seg 1st, kernel's 2nd:\n");
- show_nsegment_full( 0, i, &nsegments[i] );
+ show_nsegment_full( 0, -1, seg );
VG_(debugLog)(0,"aspacem",
"...: .... %010llx-%010llx %s %c%c%c.. ....... "
"d=0x%03llx i=%-7lld o=%-7lld (.) m=. %s\n",
@@ -917,8 +914,6 @@
static void sync_check_gap_callback ( Addr addr, SizeT len )
{
- UInt iLo, iHi, i;
-
/* If a problem has already been detected, don't continue comparing
segments, so as to avoid flooding the output with error
messages. */
@@ -933,22 +928,20 @@
/* The kernel should not give us wraparounds. */
aspacem_assert(addr <= addr + len - 1);
- iLo = find_nsegment_idx( addr );
- iHi = find_nsegment_idx( addr + len - 1 );
-
- aspacem_assert(iLo <= iHi);
- aspacem_assert(nsegments[iLo].start <= addr );
- aspacem_assert(nsegments[iHi].end >= addr + len - 1 );
-
- /* NSegments iLo .. iHi inclusive should agree with the presented
- data. */
- for (i = iLo; i <= iHi; i++) {
+ const NSegment *segLo = find_segment( addr );
+ const NSegment *segHi = find_segment( addr + len - 1 );
+ aspacem_assert(segLo <= segHi);
+ aspacem_assert(segLo->start <= addr );
+ aspacem_assert(segHi->end >= addr + len - 1 );
+
+ /* Segments segLo .. segHo inclusive should agree with the
+ presented data. */
+ for (const NSegment *seg = segLo; seg <= segHi; seg++) {
Bool same;
/* compare the kernel's offering against ours. */
- same = nsegments[i].kind == SkFree
- || nsegments[i].kind == SkResvn;
+ same = seg->kind == SkFree || seg->kind == SkResvn;
if (!same) {
Addr start = addr;
@@ -961,7 +954,7 @@
VG_(debugLog)(
0,"aspacem",
"segment mismatch: V's gap 1st, kernel's 2nd:\n");
- show_nsegment_full( 0, i, &nsegments[i] );
+ show_nsegment_full( 0, -1, seg );
VG_(debugLog)(0,"aspacem",
" : .... %010llx-%010llx %s\n",
(ULong)start, (ULong)end, len_buf);
@@ -1091,29 +1084,31 @@
&& a <= nsegments[cache_segidx[ix]].end) {
/* hit */
/* aspacem_assert( cache_segidx[ix] == find_nsegment_idx_WRK(a) ); */
+ return cache_segidx[ix];
} else {
/* miss */
n_m++;
cache_segidx[ix] = find_nsegment_idx_WRK(a);
cache_pageno[ix] = a >> 12;
+ return cache_segidx[ix];
}
- aspacem_assert(cache_segidx[ix] >= 0 && cache_segidx[ix] < nsegments_used);
- return cache_segidx[ix];
# undef N_CACHE
}
+static NSegment *find_segment( Addr a )
+{
+ return nsegments + find_nsegment_idx(a);
+}
/* Finds the segment containing 'a'. Only returns non-SkFree segments. */
NSegment const * VG_(am_find_nsegment) ( Addr a )
{
- UInt i = find_nsegment_idx(a);
+ const NSegment *seg = find_segment(a);
- aspacem_assert(nsegments[i].start <= a);
- aspacem_assert(a <= nsegments[i].end);
- if (nsegments[i].kind == SkFree)
- return NULL;
- else
- return &nsegments[i];
+ aspacem_assert(seg->start <= a);
+ aspacem_assert(a <= seg->end);
+
+ return seg->kind == SkFree ? NULL : seg;
}
@@ -1160,7 +1155,6 @@
static
Bool is_valid_for( UInt kinds, Addr start, SizeT len, UInt prot )
{
- UInt i, iLo, iHi;
Bool needR, needW, needX;
if (len == 0)
@@ -1172,25 +1166,26 @@
needW = toBool(prot & VKI_PROT_WRITE);
needX = toBool(prot & VKI_PROT_EXEC);
- iLo = find_nsegment_idx(start);
- aspacem_assert(start >= nsegments[iLo].start);
+ const NSegment *segLo = find_segment(start);
+ const NSegment *segHi;
+ aspacem_assert(start >= segLo->start);
- if (start+len-1 <= nsegments[iLo].end) {
- /* This is a speedup hack which avoids calling find_nsegment_idx
+ if (start+len-1 <= segLo->end) {
+ /* This is a speedup hack which avoids calling find_segment
a second time when possible. It is always correct to just
use the "else" clause below, but is_valid_for_client is
called a lot by the leak checker, so avoiding pointless calls
- to find_nsegment_idx, which can be expensive, is helpful. */
- iHi = iLo;
+ to find_segment, which can be expensive, is helpful. */
+ segHi = segLo;
} else {
- iHi = find_nsegment_idx(start + len - 1);
+ segHi = find_segment(start + len - 1);
}
- for (i = iLo; i <= iHi; i++) {
- if ( (nsegments[i].kind & kinds) != 0
- && (needR ? nsegments[i].hasR : True)
- && (needW ? nsegments[i].hasW : True)
- && (needX ? nsegments[i].hasX : True) ) {
+ for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ if ( (seg->kind & kinds) != 0
+ && (needR ? seg->hasR : True)
+ && (needW ? seg->hasW : True)
+ && (needX ? seg->hasX : True) ) {
/* ok */
} else {
return False;
@@ -1236,13 +1231,12 @@
static Bool any_Ts_in_range ( Addr start, SizeT len )
{
- UInt iLo, iHi, i;
aspacem_assert(len > 0);
aspacem_assert(start + len > start);
- iLo = find_nsegment_idx(start);
- iHi = find_nsegment_idx(start + len - 1);
- for (i = iLo; i <= iHi; i++) {
- if (nsegments[i].hasT)
+ const NSegment *segLo = find_segment(start);
+ const NSegment *segHi = find_segment(start + len - 1);
+ for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ if (seg->hasT)
return True;
}
return False;
@@ -1261,7 +1255,7 @@
*/
Bool VG_(am_addr_is_in_extensible_client_stack)( Addr addr, MapKind kind )
{
- const NSegment *seg = nsegments + find_nsegment_idx(addr);
+ const NSegment *seg = find_segment(addr);
switch (seg->kind) {
case SkFree:
@@ -1306,7 +1300,7 @@
False and set the limts to 0. */
Bool VG_(am_stack_limits)( Addr addr, /*OUT*/Addr *start, /*OUT*/Addr *end )
{
- const NSegment *seg = nsegments + find_nsegment_idx(addr);
+ const NSegment *seg = find_segment(addr);
switch (seg->kind) {
case SkFree:
@@ -1793,8 +1787,6 @@
valgrind's mappings.
*/
UInt i, j;
- Addr holeStart, holeEnd, holeLen;
- Bool fixed_not_required;
Addr startPoint = forClient ? aspacem_cStart : aspacem_vStart;
@@ -1802,13 +1794,6 @@
Addr reqEnd = reqStart + req->len - 1;
Addr reqLen = req->len;
- /* These hold indices for segments found during search, or -1 if not
- found. */
- Int floatIdx = -1;
- Int fixedIdx = -1;
-
- aspacem_assert(nsegments_used > 0);
-
if (0) {
VG_(am_show_nsegments)(0,"getAdvisory");
VG_(debugLog)(0,"aspacem", "getAdvisory 0x%llx %lld\n",
@@ -1831,15 +1816,15 @@
/* ------ Implement Policy Exception #1 ------ */
if (forClient && req->rkind == MFixed) {
- UInt iLo = find_nsegment_idx(reqStart);
- UInt iHi = find_nsegment_idx(reqEnd);
+ const NSegment *segLo = find_segment(reqStart);
+ const NSegment *segHi = find_segment(reqEnd);
Bool allow = True;
- for (i = iLo; i <= iHi; i++) {
- if (nsegments[i].kind == SkFree
- || nsegments[i].kind == SkFileC
- || nsegments[i].kind == SkAnonC
- || nsegments[i].kind == SkShmC
- || nsegments[i].kind == SkResvn) {
+ for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ if (seg->kind == SkFree
+ || seg->kind == SkFileC
+ || seg->kind == SkAnonC
+ || seg->kind == SkShmC
+ || seg->kind == SkResvn) {
/* ok */
} else {
allow = False;
@@ -1859,12 +1844,11 @@
/* ------ Implement Policy Exception #2 ------ */
if (forClient && req->rkind == MHint) {
- UInt iLo = find_nsegment_idx(reqStart);
- UInt iHi = find_nsegment_idx(reqEnd);
+ const NSegment *segLo = find_segment(reqStart);
+ const NSegment *segHi = find_segment(reqEnd);
Bool allow = True;
- for (i = iLo; i <= iHi; i++) {
- if (nsegments[i].kind == SkFree
- || nsegments[i].kind == SkResvn) {
+ for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ if (seg->kind == SkFree || seg->kind == SkResvn) {
/* ok */
} else {
allow = False;
@@ -1881,8 +1865,13 @@
/* ------ Implement the Default Policy ------ */
+ /* These hold indices for segments found during search, or -1 if not
+ found. */
+ Int floatIdx = -1;
+ Int fixedIdx = -1;
+
/* Don't waste time looking for a fixed match if not requested to. */
- fixed_not_required = req->rkind == MAny;
+ Bool fixed_not_required = req->rkind == MAny;
i = find_nsegment_idx(startPoint);
@@ -1897,8 +1886,8 @@
continue;
}
- holeStart = nsegments[i].start;
- holeEnd = nsegments[i].end;
+ Addr holeStart = nsegments[i].start;
+ Addr holeEnd = nsegments[i].end;
/* Stay sane .. */
aspacem_assert(holeStart <= holeEnd);
@@ -1906,7 +1895,7 @@
aspacem_assert(holeEnd <= aspacem_maxAddr);
/* See if it's any use to us. */
- holeLen = holeEnd - holeStart + 1;
+ Addr holeLen = holeEnd - holeStart + 1; // FIXME: SizeT
if (fixedIdx == -1 && holeStart <= reqStart && reqEnd <= holeEnd)
fixedIdx = i;
@@ -1989,14 +1978,12 @@
/* Similar to VG_(am_find_nsegment) but only returns free segments. */
static NSegment const * VG_(am_find_free_nsegment) ( Addr a )
{
- UInt i = find_nsegment_idx(a);
+ const NSegment *seg = find_segment(a);
- aspacem_assert(nsegments[i].start <= a);
- aspacem_assert(a <= nsegments[i].end);
- if (nsegments[i].kind == SkFree)
- return &nsegments[i];
- else
- return NULL;
+ aspacem_assert(seg->start <= a);
+ aspacem_assert(a <= seg->end);
+
+ return seg->kind == SkFree ? seg : NULL;
}
Bool VG_(am_covered_by_single_free_segment)
@@ -2621,9 +2608,9 @@
if (! sr_isError(res)) {
Addr addr = sr_Res(res);
- UInt ix = find_nsegment_idx(addr);
+ NSegment *seg = find_segment(addr);
- nsegments[ix].whatsit = WiClientHeap;
+ seg->whatsit = WiClientHeap;
}
return res;
}
@@ -2711,7 +2698,7 @@
Bool VG_(am_change_ownership_v_to_c)( Addr start, SizeT len )
{
- UInt i, iLo, iHi;
+ UInt iLo, iHi;
if (len == 0)
return True;
@@ -2720,14 +2707,14 @@
if (!VG_IS_PAGE_ALIGNED(start) || !VG_IS_PAGE_ALIGNED(len))
return False;
- i = find_nsegment_idx(start);
- if (nsegments[i].kind != SkFileV && nsegments[i].kind != SkAnonV)
+ const NSegment *seg = find_segment(start);
+ if (seg->kind != SkFileV && seg->kind != SkAnonV)
return False;
- if (start+len-1 > nsegments[i].end)
+ if (start+len-1 > seg->end)
return False;
- aspacem_assert(start >= nsegments[i].start);
- aspacem_assert(start+len-1 <= nsegments[i].end);
+ aspacem_assert(start >= seg->start);
+ aspacem_assert(start+len-1 <= seg->end);
/* This scheme is like how mprotect works: split the to-be-changed
range into its own segment(s), then mess with them (it). There
@@ -2749,10 +2736,10 @@
expected to belong to a client segment. */
void VG_(am_set_segment_hasT)( Addr addr )
{
- UInt i = find_nsegment_idx(addr);
- SegKind kind = nsegments[i].kind;
+ NSegment *seg = find_segment(addr);
+ SegKind kind = seg->kind;
aspacem_assert(kind == SkAnonC || kind == SkFileC || kind == SkShmC);
- nsegments[i].hasT = True;
+ seg->hasT = True;
}
@@ -2770,7 +2757,6 @@
static Bool create_reservation (Addr start, SizeT length, ShrinkMode smode,
SSizeT extra, WhatsIt whatsit)
{
- UInt startI, endI;
NSegment seg;
/* start and end, not taking into account the extra space. */
@@ -2789,22 +2775,22 @@
aspacem_assert(VG_IS_PAGE_ALIGNED(start2));
aspacem_assert(VG_IS_PAGE_ALIGNED(end2+1));
- startI = find_nsegment_idx( start2 );
- endI = find_nsegment_idx( end2 );
+ const NSegment *startSeg = find_segment( start2 );
+ const NSegment *endSeg = find_segment( end2 );
/* If the start and end points don't fall within the same (free)
segment, we're hosed. This does rely on the assumption that all
mergeable adjacent segments can be merged, but add_segment()
should ensure that. */
- if (startI != endI)
+ if (startSeg != endSeg)
return False;
- if (nsegments[startI].kind != SkFree)
+ if (startSeg->kind != SkFree)
return False;
/* Looks good - make the reservation. */
- aspacem_assert(nsegments[startI].start <= start2);
- aspacem_assert(end2 <= nsegments[startI].end);
+ aspacem_assert(startSeg->start <= start2);
+ aspacem_assert(end2 <= startSeg->end);
init_nsegment( &seg );
seg.kind = SkResvn;
@@ -2836,21 +2822,21 @@
extend_into_adjacent_reservation_client (Addr addr, SSizeT delta,
Bool *overflow)
{
- UInt segA, segR;
+ NSegment *segA, *segR;
UInt prot;
SysRes sres;
*overflow = False;
- segA = find_nsegment_idx(addr);
- aspacem_assert(nsegments[segA].kind == SkAnonC);
+ segA = find_segment(addr);
+ aspacem_assert(segA->kind == SkAnonC);
if (delta == 0)
- return nsegments + segA;
+ return segA;
- prot = (nsegments[segA].hasR ? VKI_PROT_READ : 0)
- | (nsegments[segA].hasW ? VKI_PROT_WRITE : 0)
- | (nsegments[segA].hasX ? VKI_PROT_EXEC : 0);
+ prot = (segA->hasR ? VKI_PROT_READ : 0)
+ | (segA->hasW ? VKI_PROT_WRITE : 0)
+ | (segA->hasX ? VKI_PROT_EXEC : 0);
aspacem_assert(VG_IS_PAGE_ALIGNED(delta<0 ? -delta : delta));
@@ -2858,13 +2844,13 @@
/* Extending the segment forwards. */
segR = segA+1;
- if (segR >= nsegments_used
- || nsegments[segR].kind != SkResvn
- || nsegments[segR].smode != SmLower)
+ if (segR >= nsegments + nsegments_used
+ || segR->kind != SkResvn
+ || segR->smode != SmLower)
return NULL;
if (delta + VKI_PAGE_SIZE
- > (nsegments[segR].end - nsegments[segR].start + 1)) {
+ > (segR->end - segR->start + 1)) {
*overflow = True;
return NULL;
}
@@ -2872,39 +2858,36 @@
/* Extend the kernel's mapping. */
// DDD: #warning GrP fixme MAP_FIXED can clobber memory!
sres = VG_(am_do_mmap_NO_NOTIFY)(
- nsegments[segR].start, delta,
+ segR->start, delta,
prot,
VKI_MAP_FIXED|VKI_MAP_PRIVATE|VKI_MAP_ANONYMOUS,
0, 0
);
if (sr_isError(sres))
return NULL; /* kernel bug if this happens? */
- if (sr_Res(sres) != nsegments[segR].start) {
+ if (sr_Res(sres) != segR->start) {
/* kernel bug if this happens? */
(void)ML_(am_do_munmap_NO_NOTIFY)( sr_Res(sres), delta );
return NULL;
}
/* Ok, success with the kernel. Update our structures. */
- nsegments[segR].start += delta;
- nsegments[segA].end += delta;
- aspacem_assert(nsegments[segR].start <= nsegments[segR].end);
+ segR->start += delta;
+ segA->end += delta;
+ aspacem_assert(segR->start <= segR->end);
} else {
/* Extending the segment backwards. */
delta = -delta;
aspacem_assert(delta > 0);
- aspacem_assert(segA >= 1);
+ aspacem_assert(segA > nsegments);
segR = segA-1;
- if (segR < 0
- || nsegments[segR].kind != SkResvn
- || nsegments[segR].smode != SmUpper)
+ if (segR->kind != SkResvn || segR->smode != SmUpper)
return NULL;
- if (delta + VKI_PAGE_SIZE
- > (nsegments[segR].end - nsegments[segR].start + 1)) {
+ if ((delta + VKI_PAGE_SIZE) > (segR->end - segR->start + 1)) {
*overflow = True;
return NULL;
}
@@ -2912,27 +2895,27 @@
/* Extend the kernel's mapping. */
// DDD: #warning GrP fixme MAP_FIXED can clobber memory!
sres = VG_(am_do_mmap_NO_NOTIFY)(
- nsegments[segA].start-delta, delta,
+ segA->start - delta, delta,
prot,
VKI_MAP_FIXED|VKI_MAP_PRIVATE|VKI_MAP_ANONYMOUS,
0, 0
);
if (sr_isError(sres))
return NULL; /* kernel bug if this happens? */
- if (sr_Res(sres) != nsegments[segA].start-delta) {
+ if (sr_Res(sres) != segA->start - delta) {
/* kernel bug if this happens? */
(void)ML_(am_do_munmap_NO_NOTIFY)( sr_Res(sres), delta );
return NULL;
}
/* Ok, success with the kernel. Update our structures. */
- nsegments[segR].end -= delta;
- nsegments[segA].start -= delta;
- aspacem_assert(nsegments[segR].start <= nsegments[segR].end);
+ segR->end -= delta;
+ segA->start -= delta;
+ aspacem_assert(segR->start <= segR->end);
}
AM_SANITY_CHECK();
- return nsegments + segA;
+ return segA;
}
@@ -2988,7 +2971,7 @@
SysRes sres = VG_(am_mmap_anon_fixed_client)( anon_start, anon_size, prot );
if (! sr_isError(sres)) {
- NSegment *seg = nsegments + find_nsegment_idx(sr_Res(sres));
+ NSegment *seg = find_segment(sr_Res(sres));
seg->whatsit = WiClientBreak;
}
return sres;
@@ -3091,7 +3074,7 @@
if (ok) {
SysRes sres = VG_(am_mmap_anon_fixed_client)(anon_start, anon_size, prot);
if (! sr_isError(sres)) {
- NSegment *seg = nsegments + find_nsegment_idx(sr_Res(sres));
+ NSegment *seg = find_segment(sr_Res(sres));
seg->whatsit = WiClientStack;
}
return sres;
@@ -3160,9 +3143,7 @@
VG_(am_show_nsegments)(0, "VG_(am_extend_map_client) BEFORE");
/* Get the client segment */
- UInt ix = find_nsegment_idx(addr);
-
- NSegment *seg = nsegments + ix;
+ NSegment *seg = find_segment(addr);
aspacem_assert(seg->kind == SkFileC || seg->kind == SkAnonC ||
seg->kind == SkShmC);
@@ -3200,7 +3181,7 @@
VG_(am_show_nsegments)(0, "VG_(am_extend_map_client) AFTER");
AM_SANITY_CHECK();
- return nsegments + find_nsegment_idx(addr);
+ return find_segment(addr);
}
@@ -3217,7 +3198,6 @@
Addr old_addr, SizeT old_len,
Addr new_addr, SizeT new_len )
{
- UInt iLo, iHi;
SysRes sres;
NSegment seg;
@@ -3240,13 +3220,13 @@
} else
return False;
- iLo = find_nsegment_idx( old_addr );
- iHi = find_nsegment_idx( old_addr + old_len - 1 );
- if (iLo != iHi)
+ const NSegment *segLo = find_segment( old_addr );
+ const NSegment *segHi = find_segment( old_addr + old_len - 1 );
+ if (segLo != segHi)
return False;
- if (nsegments[iLo].kind != SkFileC && nsegments[iLo].kind != SkAnonC &&
- nsegments[iLo].kind != SkShmC)
+ if (segLo->kind != SkFileC && segLo->kind != SkAnonC &&
+ segLo->kind != SkShmC)
return False;
sres = ML_(am_do_relocate_nooverlap_mapping_NO_NOTIFY)
@@ -3261,7 +3241,7 @@
*need_discard = any_Ts_in_range( old_addr, old_len )
|| any_Ts_in_range( new_addr, new_len );
- seg = nsegments[iLo];
+ seg = *segLo;
/* Mark the new area based on the old seg. */
if (seg.kind == SkFileC) {
@@ -3697,27 +3677,25 @@
here. If found, we just skip. Otherwise add the data presented
here into css_local[]. */
- UInt iLo, iHi, i;
-
if (len == 0) return;
/* The kernel should not give us wraparounds. */
aspacem_assert(addr <= addr + len - 1);
- iLo = find_nsegment_idx( addr );
- iHi = find_nsegment_idx( addr + len - 1 );
+ const NSegment *segLo = find_segment( addr );
+ const NSegment *segHi = find_segment( addr + len - 1 );
- /* NSegments iLo .. iHi inclusive should agree with the presented
+ /* NSegments segLo .. segHi inclusive should agree with the presented
data. */
- for (i = iLo; i <= iHi; i++) {
+ for (const NSegment *seg = segLo; seg <= segHi; seg++) {
UInt seg_prot;
- if (nsegments[i].kind == SkAnonV || nsegments[i].kind == SkFileV) {
+ if (seg->kind == SkAnonV || seg->kind == SkFileV) {
/* Ignore V regions */
continue;
}
- else if (nsegments[i].kind == SkFree || nsegments[i].kind == SkResvn) {
+ else if (seg->kind == SkFree || seg->kind == SkResvn) {
/* Add mapping for SkResvn regions */
ChangedSeg* cs = &css_local[css_used_local];
if (css_used_local < css_size_local) {
@@ -3733,28 +3711,28 @@
return;
}
- else if (nsegments[i].kind == SkAnonC ||
- nsegments[i].kind == SkFileC ||
- nsegments[i].kind == SkShmC)
+ else if (seg->kind == SkAnonC ||
+ seg->kind == SkFileC ||
+ seg->kind == SkShmC)
{
/* Check permissions on client regions */
// GrP fixme
seg_prot = 0;
- if (nsegments[i].hasR) seg_prot |= VKI_PROT_READ;
- if (nsegments[i].hasW) seg_prot |= VKI_PROT_WRITE;
+ if (seg->hasR) seg_prot |= VKI_PROT_READ;
+ if (seg->hasW) seg_prot |= VKI_PROT_WRITE;
# if defined(VGA_x86)
// GrP fixme sloppyXcheck
// darwin: kernel X ignored and spuriously changes? (vm_copy)
seg_prot |= (prot & VKI_PROT_EXEC);
# else
- if (nsegments[i].hasX) seg_prot |= VKI_PROT_EXEC;
+ if (seg->hasX) seg_prot |= VKI_PROT_EXEC;
# endif
if (seg_prot != prot) {
if (VG_(clo_trace_syscalls))
VG_(debugLog)(0,"aspacem","region %p..%p permission "
"mismatch (kernel %x, V %x)\n",
- (void*)nsegments[i].start,
- (void*)(nsegments[i].end+1), prot, seg_prot);
+ (void*)seg->start,
+ (void*)(seg->end+1), prot, seg_prot);
/* Add mapping for regions with protection changes */
ChangedSeg* cs = &css_local[css_used_local];
if (css_used_local < css_size_local) {
@@ -3781,20 +3759,19 @@
{
// derived from sync_check_gap_callback()
- UInt iLo, iHi, i;
-
if (len == 0)
return;
/* The kernel should not give us wraparounds. */
aspacem_assert(addr <= addr + len - 1);
- iLo = find_nsegment_idx( addr );
- iHi = find_nsegment_idx( addr + len - 1 );
+ const NSegment *segLo = find_segment( addr );
+ const NSegment *segHi = find_segment( addr + len - 1 );
- /* NSegments iLo .. iHi inclusive should agree with the presented data. */
- for (i = iLo; i <= iHi; i++) {
- if (nsegments[i].kind != SkFree && nsegments[i].kind != SkResvn) {
+ /* Segments segLo .. segHi inclusive should agree with the
+ presented data. */
+ for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ if (seg->kind != SkFree && seg->kind != SkResvn) {
/* V has a mapping, kernel doesn't. Add to css_local[],
directives to chop off the part of the V mapping that
falls within the gap that the kernel tells us is
@@ -3802,8 +3779,8 @@
ChangedSeg* cs = &css_local[css_used_local];
if (css_used_local < css_size_local) {
cs->is_added = False;
- cs->start = Addr__max(nsegments[i].start, addr);
- cs->end = Addr__min(nsegments[i].end, addr + len - 1);
+ cs->start = Addr__max(seg->start, addr);
+ cs->end = Addr__min(seg->end, addr + len - 1);
aspacem_assert(VG_IS_PAGE_ALIGNED(cs->start));
aspacem_assert(VG_IS_PAGE_ALIGNED(cs->end+1));
/* I don't think the following should fail. But if it
|
|
From: <sv...@va...> - 2015-06-18 21:31:58
|
Author: philippe
Date: Thu Jun 18 22:31:51 2015
New Revision: 15343
Log:
Announce change in NEWS
Modified:
trunk/NEWS
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Thu Jun 18 22:31:51 2015
@@ -7,6 +7,9 @@
* s390x: It is now required for the host to have the long displacement
facility. The oldest supported machine model is z990.
+* x86: on an SSE2 only host, Valgrind in 32 bits now claims to be a Pentium 4.
+ 3.10.1 was wrongly claiming to be a CORE 2, which is SSSE3.
+
* ==================== TOOL CHANGES ====================
* Memcheck:
|
|
From: <sv...@va...> - 2015-06-18 21:31:39
|
Author: philippe
Date: Thu Jun 18 22:31:32 2015
New Revision: 3154
Log:
* x86: on an SSE2 only host, Valgrind in 32 bits now claims to be a Pentium 4.
3.10.1 was wrongly claiming to be a CORE 2, which is SSSE3.
Modified:
trunk/priv/guest_x86_defs.h
trunk/priv/guest_x86_helpers.c
trunk/priv/guest_x86_toIR.c
Modified: trunk/priv/guest_x86_defs.h
==============================================================================
--- trunk/priv/guest_x86_defs.h (original)
+++ trunk/priv/guest_x86_defs.h Thu Jun 18 22:31:32 2015
@@ -147,6 +147,7 @@
extern void x86g_dirtyhelper_CPUID_sse0 ( VexGuestX86State* );
extern void x86g_dirtyhelper_CPUID_mmxext ( VexGuestX86State* );
extern void x86g_dirtyhelper_CPUID_sse1 ( VexGuestX86State* );
+extern void x86g_dirtyhelper_CPUID_sse2 ( VexGuestX86State* );
extern void x86g_dirtyhelper_CPUID_sse3 ( VexGuestX86State* );
extern void x86g_dirtyhelper_FINIT ( VexGuestX86State* );
Modified: trunk/priv/guest_x86_helpers.c
==============================================================================
--- trunk/priv/guest_x86_helpers.c (original)
+++ trunk/priv/guest_x86_helpers.c Thu Jun 18 22:31:32 2015
@@ -2297,6 +2297,46 @@
}
}
+/* Claim to be the following SSE2-capable CPU:
+ vendor_id : GenuineIntel
+ cpu family : 15
+ model : 2
+ model name : Intel(R) Pentium(R) 4 CPU 3.00GHz
+ stepping : 9
+ microcode : 0x17
+ cpu MHz : 2992.577
+ cache size : 512 KB
+ flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
+ pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
+ pebs bts cid xtpr
+ clflush size : 64
+ cache_alignment : 128
+ address sizes : 36 bits physical, 32 bits virtual
+*/
+void x86g_dirtyhelper_CPUID_sse2 ( VexGuestX86State* st )
+{
+ switch (st->guest_EAX) {
+ case 0:
+ st->guest_EAX = 0x00000002;
+ st->guest_EBX = 0x756e6547;
+ st->guest_ECX = 0x6c65746e;
+ st->guest_EDX = 0x49656e69;
+ break;
+ case 1:
+ st->guest_EAX = 0x00000f29;
+ st->guest_EBX = 0x01020809;
+ st->guest_ECX = 0x00004400;
+ st->guest_EDX = 0xbfebfbff;
+ break;
+ default:
+ st->guest_EAX = 0x03020101;
+ st->guest_EBX = 0x00000000;
+ st->guest_ECX = 0x00000000;
+ st->guest_EDX = 0x0c040883;
+ break;
+ }
+}
+
/* Claim to be the following SSSE3-capable CPU (2 x ...):
vendor_id : GenuineIntel
cpu family : 6
Modified: trunk/priv/guest_x86_toIR.c
==============================================================================
--- trunk/priv/guest_x86_toIR.c (original)
+++ trunk/priv/guest_x86_toIR.c Thu Jun 18 22:31:32 2015
@@ -14847,6 +14847,11 @@
fAddr = &x86g_dirtyhelper_CPUID_sse3;
}
else
+ if (archinfo->hwcaps & VEX_HWCAPS_X86_SSE2) {
+ fName = "x86g_dirtyhelper_CPUID_sse2";
+ fAddr = &x86g_dirtyhelper_CPUID_sse2;
+ }
+ else
if (archinfo->hwcaps & VEX_HWCAPS_X86_SSE1) {
fName = "x86g_dirtyhelper_CPUID_sse1";
fAddr = &x86g_dirtyhelper_CPUID_sse1;
|
|
From: <sv...@va...> - 2015-06-18 21:01:43
|
Author: florian
Date: Thu Jun 18 22:01:35 2015
New Revision: 15342
Log:
Minor tweaks:
Make AM_SANITY_CHECK function-like.
Change preen_nsegments return type to void as nobody
cares about the result.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Thu Jun 18 22:01:35 2015
@@ -321,7 +321,7 @@
static Addr aspacem_vStart = 0;
-#define AM_SANITY_CHECK \
+#define AM_SANITY_CHECK() \
do { \
if (VG_(clo_sanity_level >= 3)) \
aspacem_assert(VG_(am_do_sync_check) \
@@ -702,9 +702,9 @@
/* Sanity-check and canonicalise the segment array (merge mergable
segments). Returns True if any segments were merged. */
-static Bool preen_nsegments ( void )
+static void preen_nsegments ( void )
{
- Int i, r, w, nsegments_used_old = nsegments_used;
+ Int i, r, w;
/* Pass 1: check the segment array covers the entire address space
exactly once, and also that each segment is sane. */
@@ -733,8 +733,6 @@
w++;
aspacem_assert(w > 0 && w <= nsegments_used);
nsegments_used = w;
-
- return nsegments_used != nsegments_used_old;
}
@@ -1011,7 +1009,7 @@
/* Hook to allow sanity checks to be done from aspacemgr-common.c. */
void ML_(am_do_sanity_check)( void )
{
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
}
@@ -1459,7 +1457,7 @@
nsegments[iLo] = *seg;
- (void)preen_nsegments();
+ preen_nsegments();
if (0) VG_(am_show_nsegments)(0,"AFTER preen (add_segment)");
}
@@ -1730,7 +1728,7 @@
VG_(am_show_nsegments)(2, "With contents of /proc/self/maps");
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return suggested_clstack_end;
}
@@ -1932,7 +1930,7 @@
if (floatIdx >= 0)
aspacem_assert(nsegments[floatIdx].kind == SkFree);
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
/* Now see if we found anything which can satisfy the request. */
switch (req->rkind) {
@@ -2054,7 +2052,7 @@
}
}
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return needDiscard;
}
@@ -2085,7 +2083,7 @@
seg.hasW = toBool(prot & VKI_PROT_WRITE);
seg.hasX = toBool(prot & VKI_PROT_EXEC);
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return needDiscard;
}
@@ -2135,8 +2133,8 @@
/* Changing permissions could have made previously un-mergable
segments mergeable. Therefore have to re-preen them. */
- (void)preen_nsegments();
- AM_SANITY_CHECK;
+ preen_nsegments();
+ AM_SANITY_CHECK();
return needDiscard;
}
@@ -2173,7 +2171,7 @@
/* Unmapping could create two adjacent free segments, so a preen is
needed. add_segment() will do that, so no need to here. */
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
}
/* Notifies aspacem that an munmap completed successfully. The
@@ -2285,7 +2283,7 @@
}
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
@@ -2343,7 +2341,7 @@
seg.hasX = toBool(prot & VKI_PROT_EXEC);
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
@@ -2401,7 +2399,7 @@
seg.hasX = toBool(prot & VKI_PROT_EXEC);
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
@@ -2499,7 +2497,7 @@
seg.hasX = True;
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
@@ -2590,7 +2588,7 @@
}
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return sres;
}
/* Map privately a file at an unconstrained address for V, and update the
@@ -2818,7 +2816,7 @@
add_segment( &seg );
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return True;
}
@@ -2933,7 +2931,7 @@
aspacem_assert(nsegments[segR].start <= nsegments[segR].end);
}
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return nsegments + segA;
}
@@ -3182,12 +3180,12 @@
SizeT seg_old_len = seg->end + 1 - seg->start;
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
sres = ML_(am_do_extend_mapping_NO_NOTIFY)( seg->start,
seg_old_len,
seg_old_len + delta );
if (sr_isError(sres)) {
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return NULL;
} else {
/* the area must not have moved */
@@ -3201,7 +3199,7 @@
if (0)
VG_(am_show_nsegments)(0, "VG_(am_extend_map_client) AFTER");
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return nsegments + find_nsegment_idx(addr);
}
@@ -3254,7 +3252,7 @@
sres = ML_(am_do_relocate_nooverlap_mapping_NO_NOTIFY)
( old_addr, old_len, new_addr, new_len );
if (sr_isError(sres)) {
- AM_SANITY_CHECK;
+ AM_SANITY_CHECK();
return False;
} else {
aspacem_assert(sr_Res(sres) == new_addr);
|
|
From: <sv...@va...> - 2015-06-17 21:33:26
|
Author: philippe
Date: Wed Jun 17 22:33:19 2015
New Revision: 3153
Log:
A SSE2 only CPU was reported to the guest as a SSE3 CPU.
The guest code might then select functions calling invalid
instructions.
E.G. giving:
vex x86->IR: unhandled instruction bytes: 0x66 0xF 0x3A 0xF
==13094== valgrind: Unrecognised instruction at address 0x496d4d3.
==13094== at 0x496D4D3: __mempcpy_ssse3 (memcpy-ssse3.S:771)
==13094== by 0x125E0B: ??? (in /bin/dash)
as the host hw cap is not SSE3 enabled, while the guest believes
SSE3 can be used.
So, change CPUID so as to report an SSE3 if the hw is SSE3,
and otherwise SSE1 or lower.
(an SSE2 cpu might be added later on)
Modified:
trunk/priv/guest_x86_defs.h
trunk/priv/guest_x86_helpers.c
trunk/priv/guest_x86_toIR.c
Modified: trunk/priv/guest_x86_defs.h
==============================================================================
--- trunk/priv/guest_x86_defs.h (original)
+++ trunk/priv/guest_x86_defs.h Wed Jun 17 22:33:19 2015
@@ -147,7 +147,7 @@
extern void x86g_dirtyhelper_CPUID_sse0 ( VexGuestX86State* );
extern void x86g_dirtyhelper_CPUID_mmxext ( VexGuestX86State* );
extern void x86g_dirtyhelper_CPUID_sse1 ( VexGuestX86State* );
-extern void x86g_dirtyhelper_CPUID_sse2 ( VexGuestX86State* );
+extern void x86g_dirtyhelper_CPUID_sse3 ( VexGuestX86State* );
extern void x86g_dirtyhelper_FINIT ( VexGuestX86State* );
Modified: trunk/priv/guest_x86_helpers.c
==============================================================================
--- trunk/priv/guest_x86_helpers.c (original)
+++ trunk/priv/guest_x86_helpers.c Wed Jun 17 22:33:19 2015
@@ -2324,7 +2324,7 @@
address sizes : 36 bits physical, 48 bits virtual
power management:
*/
-void x86g_dirtyhelper_CPUID_sse2 ( VexGuestX86State* st )
+void x86g_dirtyhelper_CPUID_sse3 ( VexGuestX86State* st )
{
# define SET_ABCD(_a,_b,_c,_d) \
do { st->guest_EAX = (UInt)(_a); \
Modified: trunk/priv/guest_x86_toIR.c
==============================================================================
--- trunk/priv/guest_x86_toIR.c (original)
+++ trunk/priv/guest_x86_toIR.c Wed Jun 17 22:33:19 2015
@@ -14842,9 +14842,9 @@
IRDirty* d = NULL;
void* fAddr = NULL;
const HChar* fName = NULL;
- if (archinfo->hwcaps & VEX_HWCAPS_X86_SSE2) {
- fName = "x86g_dirtyhelper_CPUID_sse2";
- fAddr = &x86g_dirtyhelper_CPUID_sse2;
+ if (archinfo->hwcaps & VEX_HWCAPS_X86_SSE3) {
+ fName = "x86g_dirtyhelper_CPUID_sse3";
+ fAddr = &x86g_dirtyhelper_CPUID_sse3;
}
else
if (archinfo->hwcaps & VEX_HWCAPS_X86_SSE1) {
|
Author: philippe
Date: Wed Jun 17 20:57:09 2015
New Revision: 15341
Log:
324181 mmap does not handle MAP_32BIT (handle it now, rather than fail it)
324181 was previously closed with a solution to always make
MAP_32BIT fail. This is technically correct/according to the doc,
but is not very usable.
This patch ensures that MAP_32BIT mmap is succesful, as long as
aspacemgr gives a range in the first 2GB
(so, compared to a native run, MAP_32BIT will fail much more quickly
as aspacemgr does not reserve the address space below 2GB on a 64 bits).
Far to be perfect, but this is better than nothing.
Added a regression test that test succesful mmap 32 bits till
the 2GB limit is reached.
Added:
trunk/none/tests/amd64-linux/map_32bits.c
trunk/none/tests/amd64-linux/map_32bits.stderr.exp
trunk/none/tests/amd64-linux/map_32bits.vgtest
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/none/tests/amd64-linux/Makefile.am
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Wed Jun 17 20:57:09 2015
@@ -115,6 +115,7 @@
'sizeof(UWord) == sizeof(UInt)' failed in m_syscall.c
== 326797
319274 Fix unhandled syscall: unix:410 (sigsuspend_nocancel) on OS X
+324181 mmap does not handle MAP_32BIT (handle it now, rather than fail it)
333051 mmap of huge pages fails due to incorrect alignment
== 339163
334802 valgrind does not always explain why a given option is bad
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c Wed Jun 17 20:57:09 2015
@@ -2150,15 +2150,6 @@
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
-# if defined(VKI_MAP_32BIT)
- /* We can't support MAP_32BIT (at least, not without significant
- complication), and it's royally unportable, so if the client
- asks for it, just fail it. */
- if (arg4 & VKI_MAP_32BIT) {
- return VG_(mk_SysRes_Error)( VKI_ENOMEM );
- }
-# endif
-
/* Figure out what kind of allocation constraints there are
(fixed/hint/any), and ask aspacem what we should do. */
mreq.start = arg1;
@@ -2179,12 +2170,37 @@
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
+# if defined(VKI_MAP_32BIT)
+ /* MAP_32BIT is royally unportable, so if the client asks for it, try our
+ best to make it work (but without complexifying aspacemgr).
+ If the user requested MAP_32BIT, the mmap-ed space must be in the
+ first 2GB of the address space. So, return ENOMEM if aspacemgr
+ advisory is above the first 2GB. If MAP_FIXED is also requested,
+ MAP_32BIT has to be ignored.
+ Assumption about aspacemgr behaviour: aspacemgr scans the address space
+ from low addresses to find a free segment. No special effort is done
+ to keep the first 2GB 'free' for this MAP_32BIT. So, this will often
+ fail once the program has already allocated significant memory. */
+ if ((arg4 & VKI_MAP_32BIT) && !(arg4 & VKI_MAP_FIXED)) {
+ if (advised + arg2 >= 0x80000000)
+ return VG_(mk_SysRes_Error)( VKI_ENOMEM );
+ }
+# endif
+
/* Otherwise we're OK (so far). Install aspacem's choice of
address, and let the mmap go through. */
sres = VG_(am_do_mmap_NO_NOTIFY)(advised, arg2, arg3,
arg4 | VKI_MAP_FIXED,
arg5, arg6);
+# if defined(VKI_MAP_32BIT)
+ /* No recovery trial if the advisory was not accepted. */
+ if ((arg4 & VKI_MAP_32BIT) && !(arg4 & VKI_MAP_FIXED)
+ && sr_isError(sres)) {
+ return VG_(mk_SysRes_Error)( VKI_ENOMEM );
+ }
+# endif
+
/* A refinement: it may be that the kernel refused aspacem's choice
of address. If we were originally asked for a hinted mapping,
there is still a last chance: try again at any address.
Modified: trunk/none/tests/amd64-linux/Makefile.am
==============================================================================
--- trunk/none/tests/amd64-linux/Makefile.am (original)
+++ trunk/none/tests/amd64-linux/Makefile.am Wed Jun 17 20:57:09 2015
@@ -5,10 +5,11 @@
filter_stderr filter_minimal
EXTRA_DIST = \
- bug345887.stderr.exp bug345887.vgtest
+ bug345887.stderr.exp bug345887.vgtest \
+ map_32bits.stderr.exp map_32bits.vgtest
check_PROGRAMS = \
- bug345887
+ bug345887 map_32bits
AM_CFLAGS += @FLAG_M64@
AM_CXXFLAGS += @FLAG_M64@
Added: trunk/none/tests/amd64-linux/map_32bits.c
==============================================================================
--- trunk/none/tests/amd64-linux/map_32bits.c (added)
+++ trunk/none/tests/amd64-linux/map_32bits.c Wed Jun 17 20:57:09 2015
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include "tests/sys_mman.h"
+#include <stdlib.h>
+#include <unistd.h>
+
+int main()
+{
+
+ void *first = NULL;
+ void *last;
+ void *res;
+
+ while (1) {
+ res = mmap (NULL, 64 * 1024,
+ PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT,
+ -1, 0);
+ if (first == NULL) {
+ first = res;
+ if (first == (void *)-1) {
+ perror ("first mmap");
+ exit (1);
+ }
+ fprintf(stderr, "first mmap : %p\n", first);
+ }
+ if (res == (void *)-1) {
+ fprintf(stderr, "last mmap ok: %p\n", last);
+ break;
+ }
+ last = res;
+ }
+
+ /* And now, retry without MAP_32BIT */
+ res = mmap (NULL, 64 * 1024,
+ PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
+ -1, 0);
+ if (res == (void *)-1) {
+ perror ("retry mmap");
+ exit (1);
+ }
+ fprintf(stderr, "retry mmap ok: %p\n", res);
+
+ return 0;
+}
Added: trunk/none/tests/amd64-linux/map_32bits.stderr.exp
==============================================================================
--- trunk/none/tests/amd64-linux/map_32bits.stderr.exp (added)
+++ trunk/none/tests/amd64-linux/map_32bits.stderr.exp Wed Jun 17 20:57:09 2015
@@ -0,0 +1,3 @@
+first mmap : 0x........
+last mmap ok: 0x........
+retry mmap ok: 0x........
Added: trunk/none/tests/amd64-linux/map_32bits.vgtest
==============================================================================
--- trunk/none/tests/amd64-linux/map_32bits.vgtest (added)
+++ trunk/none/tests/amd64-linux/map_32bits.vgtest Wed Jun 17 20:57:09 2015
@@ -0,0 +1,5 @@
+prog: map_32bits
+# take a big aspacemgr minaddr, to quickly reach the 2GB limit
+vgopts: -q --aspace-minaddr=0x7ff60000
+stderr_filter: filter_minimal
+
|
|
From: Matthias S. <zz...@ge...> - 2015-06-17 19:43:46
|
On 05.06.2015 15:33, sv...@va... wrote: > Author: sewardj > Date: Fri Jun 5 14:33:46 2015 > New Revision: 15317 > > Log: > arm32-linux only: add handwritten assembly helpers for > MC_(helperc_LOADV32le), MC_(helperc_LOADV16le) and > MC_(helperc_LOADV8). This improves performance by around 5% to 7% in > the best case, for run-of-the-mill integer code. > > Hi! I tried this for x86. I am not yet 100% sure if the code is now the fastest possible way. * Alignment of function and of jump targets? necessary at all? * Should the byte result from the secmap be stored in %dl or extended to 32bits and be in %edx? * Should the asm functions be defined in a .s file? Then the debug info can also point to the file and line number. But the ifdef-ing will be harder. I tried to compare: 1. valgrind-trunk compiled with gcc-4.8.4 2. valgrind-trunk compiled with gcc-4.9.2 3. my modified valgrind-trunk compiled with gcc-4.9.2 The results are mixed. code from gcc-4.8.4 was faster than gcc-4.9.2. and hand-optimized code was sometimes faster than gcc-4.8.4. Maybe I should compile hand-optimized version also with gcc-4.8.4. Which test (of the perf suite or something else) should I use. I did run the perf suite hosted in callgrind. The numbers for tinycc test are attached. In this case helperc_LOADV32le seems to be more than 13% faster than the gcc-4.9.2 version. and it might be the same speed as gcc-4.8.4 version, but I don't know exactly how to understand the created numbers. Will "perf stat" applied to normal vg-in-place give better results? At least it runs a lot faster. Regards Matthias |
Author: petarj
Date: Wed Jun 17 00:49:30 2015
New Revision: 15340
Log:
mips64: modify load_indexed_instructions test
A little style improvement for load_indexed_instructions test including
addition of new instruction to be tested - lhx (supported as of VEX r3152).
Related issue - BZ #345987.
Modified:
trunk/none/tests/mips64/load_indexed_instructions.c
trunk/none/tests/mips64/load_indexed_instructions.stdout.exp-BE
trunk/none/tests/mips64/load_indexed_instructions.stdout.exp-LE
Modified: trunk/none/tests/mips64/load_indexed_instructions.c
==============================================================================
--- trunk/none/tests/mips64/load_indexed_instructions.c (original)
+++ trunk/none/tests/mips64/load_indexed_instructions.c Wed Jun 17 00:49:30 2015
@@ -67,16 +67,16 @@
};
/*
-Test 1 macro is used for ldx instructions. After executing each instructions
-the macro performs following operations:
+TEST1 macro is used for load-indexed instructions. For each instruction,
+the macro will perform the following operations:
-1: Move arguments to registers.
-2: Execute instruction.
-3: Move result from register. */
+1: Move input arguments into registers.
+2: Execute the instruction.
+3: Move the result from a register to the out variable. */
#define TEST1(instruction, offset, mem) \
{ \
- unsigned long out = 0; \
+ unsigned long out = 0; \
__asm__ volatile( \
"move $t0, %1" "\n\t" \
"move $t1, %2" "\n\t" \
@@ -84,7 +84,7 @@
"move %0, $t2" "\n\t" \
: "=&r" (out) \
: "r" (mem) , "r" (offset) \
- : "t0", "t1", "t2", "cc", "memory" \
+ : "t0", "t1", "t2", "memory" \
); \
printf("%s :: offset: 0x%x, out: 0x%lx\n", \
instruction, offset, out); \
@@ -100,6 +100,8 @@
TEST1("lbux", i, reg_val);
for(i = 8; i <= 255; i += 8)
TEST1("lwx", i, reg_val);
+ for(i = 8; i <= 255; i += 8)
+ TEST1("lhx", i, reg_val);
#endif
return 0;
}
Modified: trunk/none/tests/mips64/load_indexed_instructions.stdout.exp-BE
==============================================================================
--- trunk/none/tests/mips64/load_indexed_instructions.stdout.exp-BE (original)
+++ trunk/none/tests/mips64/load_indexed_instructions.stdout.exp-BE Wed Jun 17 00:49:30 2015
@@ -91,3 +91,34 @@
lwx :: offset: 0xe8, out: 0xfffffffffbb8bb46
lwx :: offset: 0xf0, out: 0xffffffffe13ef6f4
lwx :: offset: 0xf8, out: 0xffffffffe8bccd9a
+lhx :: offset: 0x8, out: 0x982
+lhx :: offset: 0x10, out: 0x1304
+lhx :: offset: 0x18, out: 0x1a86
+lhx :: offset: 0x20, out: 0x2608
+lhx :: offset: 0x28, out: 0x2f8a
+lhx :: offset: 0x30, out: 0x350c
+lhx :: offset: 0x38, out: 0x3c8e
+lhx :: offset: 0x40, out: 0x4c11
+lhx :: offset: 0x48, out: 0x4593
+lhx :: offset: 0x50, out: 0x5f15
+lhx :: offset: 0x58, out: 0x5697
+lhx :: offset: 0x60, out: 0x6a19
+lhx :: offset: 0x68, out: 0x639b
+lhx :: offset: 0x70, out: 0x791d
+lhx :: offset: 0x78, out: 0x709f
+lhx :: offset: 0x80, out: 0xffffffffffff9823
+lhx :: offset: 0x88, out: 0xffffffffffff91a1
+lhx :: offset: 0x90, out: 0xffffffffffff8b27
+lhx :: offset: 0x98, out: 0xffffffffffff82a5
+lhx :: offset: 0xa0, out: 0xffffffffffffbe2b
+lhx :: offset: 0xa8, out: 0xffffffffffffb7a9
+lhx :: offset: 0xb0, out: 0xffffffffffffad2f
+lhx :: offset: 0xb8, out: 0xffffffffffffa4ad
+lhx :: offset: 0xc0, out: 0xffffffffffffd432
+lhx :: offset: 0xc8, out: 0xffffffffffffddb0
+lhx :: offset: 0xd0, out: 0xffffffffffffc736
+lhx :: offset: 0xd8, out: 0xffffffffffffceb4
+lhx :: offset: 0xe0, out: 0xfffffffffffff23a
+lhx :: offset: 0xe8, out: 0xfffffffffffffbb8
+lhx :: offset: 0xf0, out: 0xffffffffffffe13e
+lhx :: offset: 0xf8, out: 0xffffffffffffe8bc
Modified: trunk/none/tests/mips64/load_indexed_instructions.stdout.exp-LE
==============================================================================
--- trunk/none/tests/mips64/load_indexed_instructions.stdout.exp-LE (original)
+++ trunk/none/tests/mips64/load_indexed_instructions.stdout.exp-LE Wed Jun 17 00:49:30 2015
@@ -91,3 +91,34 @@
lwx :: offset: 0xe8, out: 0xfffffffffbb8bb46
lwx :: offset: 0xf0, out: 0xffffffffe13ef6f4
lwx :: offset: 0xf8, out: 0xffffffffe8bccd9a
+lhx :: offset: 0x8, out: 0x3b6e
+lhx :: offset: 0x10, out: 0x76dc
+lhx :: offset: 0x18, out: 0x4db2
+lhx :: offset: 0x20, out: 0xffffffffffffedb8
+lhx :: offset: 0x28, out: 0xffffffffffffd6d6
+lhx :: offset: 0x30, out: 0xffffffffffff9b64
+lhx :: offset: 0x38, out: 0xffffffffffffa00a
+lhx :: offset: 0x40, out: 0xffffffffffffdb70
+lhx :: offset: 0x48, out: 0xffffffffffffe01e
+lhx :: offset: 0x50, out: 0xffffffffffffadac
+lhx :: offset: 0x58, out: 0xffffffffffff96c2
+lhx :: offset: 0x60, out: 0x36c8
+lhx :: offset: 0x68, out: 0xda6
+lhx :: offset: 0x70, out: 0x4014
+lhx :: offset: 0x78, out: 0x7b7a
+lhx :: offset: 0x80, out: 0xffffffffffffb6e0
+lhx :: offset: 0x88, out: 0xffffffffffff8d8e
+lhx :: offset: 0x90, out: 0xffffffffffffc03c
+lhx :: offset: 0x98, out: 0xfffffffffffffb52
+lhx :: offset: 0xa0, out: 0x5b58
+lhx :: offset: 0xa8, out: 0x6036
+lhx :: offset: 0xb0, out: 0x2d84
+lhx :: offset: 0xb8, out: 0x16ea
+lhx :: offset: 0xc0, out: 0x6d90
+lhx :: offset: 0xc8, out: 0x56fe
+lhx :: offset: 0xd0, out: 0x1b4c
+lhx :: offset: 0xd8, out: 0x2022
+lhx :: offset: 0xe0, out: 0xffffffffffff8028
+lhx :: offset: 0xe8, out: 0xffffffffffffbb46
+lhx :: offset: 0xf0, out: 0xfffffffffffff6f4
+lhx :: offset: 0xf8, out: 0xffffffffffffcd9a
|
|
From: <sv...@va...> - 2015-06-16 23:40:29
|
Author: petarj
Date: Wed Jun 17 00:40:21 2015
New Revision: 3152
Log:
mips64: add support for Cavium LHX
This patch adds support for LHX (Load Halfword Indexed) instruction.
It is available on CVMv2/MIPS DSP.
Issue reported in BZ #345987.
Patch by Crestez Dan Leonard.
Modified:
trunk/priv/guest_mips_toIR.c
Modified: trunk/priv/guest_mips_toIR.c
==============================================================================
--- trunk/priv/guest_mips_toIR.c (original)
+++ trunk/priv/guest_mips_toIR.c Wed Jun 17 00:40:21 2015
@@ -2638,6 +2638,16 @@
True));
break;
}
+ case 0x04: // LHX rd, index(base)
+ DIP("lhx r%d, r%d(r%d)", regRd, regRt, regRs);
+ LOADX_STORE_PATTERN;
+ if (mode64)
+ putIReg(regRd, unop(Iop_16Sto64, load(Ity_I16,
+ mkexpr(t1))));
+ else
+ putIReg(regRd, unop(Iop_16Sto32, load(Ity_I16,
+ mkexpr(t1))));
+ break;
case 0x08: { // LDX rd, index(base)
DIP("ldx r%d, r%d(r%d)", regRd, regRt, regRs);
vassert(mode64); /* Currently Implemented only for n64 */
|
|
From: <sv...@va...> - 2015-06-13 22:59:55
|
Author: rhyskidd
Date: Sat Jun 13 23:59:47 2015
New Revision: 15339
Log:
Fix UNKNOWN task message [id 3410, to mach_task_self(), reply 0x........] (task_set_special_port)
bz#349087
On OS X 10.10
Before:
== 592 tests, 222 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
After:
== 592 tests, 222 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
trunk/coregrind/m_syswrap/syswrap-darwin.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Jun 13 23:59:47 2015
@@ -239,6 +239,8 @@
348949 Bogus "ERROR: --ignore-ranges: suspiciously large range"
349086 Fix UNKNOWN task message [id 3406, to mach_task_self(),
reply 0x........] (task_set_info)
+349087 Fix UNKNOWN task message [id 3410, to mach_task_self(),
+ reply 0x........] (task_set_special_port)
n-i-bz Provide implementations of certain compiler builtins to support
compilers who may not provide those
n-i-bz Old STABS code is still being compiled, but never used. Remove it.
Modified: trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
==============================================================================
--- trunk/coregrind/m_syswrap/priv_syswrap-darwin.h (original)
+++ trunk/coregrind/m_syswrap/priv_syswrap-darwin.h Sat Jun 13 23:59:47 2015
@@ -591,6 +591,7 @@
DECL_TEMPLATE(darwin, mach_port_set_attributes);
DECL_TEMPLATE(darwin, mach_port_insert_member);
DECL_TEMPLATE(darwin, task_get_special_port);
+DECL_TEMPLATE(darwin, task_set_special_port);
DECL_TEMPLATE(darwin, task_get_exception_ports);
DECL_TEMPLATE(darwin, semaphore_create);
DECL_TEMPLATE(darwin, semaphore_destroy);
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Sat Jun 13 23:59:47 2015
@@ -5851,6 +5851,48 @@
}
+PRE(task_set_special_port)
+{
+#pragma pack(4)
+ typedef struct {
+ mach_msg_header_t Head;
+ /* start of the kernel processed data */
+ mach_msg_body_t msgh_body;
+ mach_msg_port_descriptor_t special_port;
+ /* end of the kernel processed data */
+ NDR_record_t NDR;
+ int which_port;
+ } Request;
+#pragma pack()
+
+ Request *req = (Request *)ARG1;
+
+ PRINT("got port %#x ", req->special_port.name);
+
+ // MACH_ARG(task_set_special_port.which_port) = req->which_port;
+ PRINT("%s", name_for_port(req->special_port.name));
+
+ AFTER = POST_FN(task_set_special_port);
+}
+
+POST(task_set_special_port)
+{
+#pragma pack(4)
+ typedef struct {
+ mach_msg_header_t Head;
+ NDR_record_t NDR;
+ kern_return_t RetCode;
+ } Reply;
+#pragma pack()
+
+ Reply *reply = (Reply *)ARG1;
+ if (!reply->RetCode) {
+ } else {
+ PRINT("mig return %d", reply->RetCode);
+ }
+}
+
+
PRE(semaphore_create)
{
#pragma pack(4)
@@ -8032,10 +8074,12 @@
case 3408:
CALL_PRE(task_resume);
return;
-
case 3409:
CALL_PRE(task_get_special_port);
return;
+ case 3410:
+ CALL_PRE(task_set_special_port);
+ return;
case 3411:
CALL_PRE(thread_create);
return;
|
|
From: <sv...@va...> - 2015-06-13 15:54:30
|
Author: philippe
Date: Sat Jun 13 16:54:22 2015
New Revision: 15338
Log:
Waiting for the release, the doc should better indicate it is a SVN version
Modified:
trunk/docs/xml/vg-entities.xml
Modified: trunk/docs/xml/vg-entities.xml
==============================================================================
--- trunk/docs/xml/vg-entities.xml (original)
+++ trunk/docs/xml/vg-entities.xml Sat Jun 13 16:54:22 2015
@@ -6,8 +6,8 @@
<!-- valgrind release + version stuff -->
<!ENTITY rel-type "Release">
-<!ENTITY rel-version "3.10.0">
-<!ENTITY rel-date "10 September 2014">
+<!ENTITY rel-version "3.11.0.SVN">
+<!ENTITY rel-date "?? ??????? 2015">
<!-- where the docs are installed -->
<!ENTITY vg-docs-path "$INSTALL/share/doc/valgrind/html/index.html">
|
|
From: <sv...@va...> - 2015-06-13 10:06:12
|
Author: florian
Date: Sat Jun 13 11:06:05 2015
New Revision: 15337
Log:
Remove VG_(am_next_nsegment) from external interface.
The internal organisation of the address space manager segments is now
completely hidden in the address space manager itself and it is invalid
for any AM users to assume a particular arrangement (e.g. array).
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Sat Jun 13 11:06:05 2015
@@ -1120,7 +1120,7 @@
/* Find the next segment along from 'here', if it is a non-SkFree segment. */
-NSegment const * VG_(am_next_nsegment) ( const NSegment* here, Bool fwds )
+static const NSegment *next_nsegment ( const NSegment* here, Bool fwds )
{
const NSegment *next;
@@ -1278,7 +1278,7 @@
if (seg->smode != SmUpper) return False;
/* If the the abutting segment towards higher addresses is an SkAnonC
segment, then ADDR is a future stack pointer. */
- const NSegment *next = VG_(am_next_nsegment)(seg, /*forward*/ True);
+ const NSegment *next = next_nsegment(seg, /*forward*/ True);
if (next == NULL || next->kind != SkAnonC) return False;
/* OK; looks like a stack segment */
@@ -1289,7 +1289,7 @@
/* If the abutting segment towards lower addresses is an SkResvn
segment, then ADDR is a stack pointer into mapped memory. */
if (kind == MkUnmapped) return False;
- const NSegment *next = VG_(am_next_nsegment)(seg, /*forward*/ False);
+ const NSegment *next = next_nsegment(seg, /*forward*/ False);
if (next == NULL || next->kind != SkResvn || next->smode != SmUpper)
return False;
@@ -1329,7 +1329,7 @@
then this is OK. */
if (seg->smode != SmUpper) goto bad;
*start = seg->start;
- seg = VG_(am_next_nsegment)(seg, /*forward*/ True);
+ seg = next_nsegment(seg, /*forward*/ True);
if (!seg || seg->kind != SkAnonC || !seg->hasR || !seg->hasW) goto bad;
*end = seg->end;
return True;
@@ -3125,7 +3125,7 @@
return sres;
}
- const NSegment *anon_seg = VG_(am_next_nsegment)(seg, True/*fwds*/);
+ const NSegment *anon_seg = next_nsegment(seg, True/*fwds*/);
vg_assert(anon_seg != NULL);
udelta = VG_PGROUNDUP(anon_seg->start - addr);
Modified: branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h (original)
+++ branches/ASPACEM_TWEAKS/coregrind/pub_core_aspacemgr.h Sat Jun 13 11:06:05 2015
@@ -77,10 +77,6 @@
// Querying current status
-/* Find the next non-free segment along from 'here'. */
-extern NSegment const* VG_(am_next_nsegment) ( const NSegment* here,
- Bool fwds );
-
/* Is the area [start .. start+len-1] validly accessible by
valgrind with at least the permissions 'prot' ? To find out
simply if said area merely belongs to valgrind, pass
|
|
From: <sv...@va...> - 2015-06-13 06:16:17
|
Author: rhyskidd
Date: Sat Jun 13 07:16:10 2015
New Revision: 15336
Log:
Fix UNKNOWN task message [id 3406, to mach_task_self(), reply 0x........] (task_set_info)
bz#349086
On OS X 10.10
Before:
== 592 tests, 222 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
After:
== 592 tests, 222 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
trunk/coregrind/m_syswrap/syswrap-darwin.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Jun 13 07:16:10 2015
@@ -237,6 +237,8 @@
348748 Fix redundant condition
348890 Fix clang warning about unsupported --param inline-unit-growth=900
348949 Bogus "ERROR: --ignore-ranges: suspiciously large range"
+349086 Fix UNKNOWN task message [id 3406, to mach_task_self(),
+ reply 0x........] (task_set_info)
n-i-bz Provide implementations of certain compiler builtins to support
compilers who may not provide those
n-i-bz Old STABS code is still being compiled, but never used. Remove it.
Modified: trunk/coregrind/m_syswrap/priv_syswrap-darwin.h
==============================================================================
--- trunk/coregrind/m_syswrap/priv_syswrap-darwin.h (original)
+++ trunk/coregrind/m_syswrap/priv_syswrap-darwin.h Sat Jun 13 07:16:10 2015
@@ -598,6 +598,7 @@
DECL_TEMPLATE(darwin, mach_ports_register);
DECL_TEMPLATE(darwin, mach_ports_lookup);
DECL_TEMPLATE(darwin, task_info);
+DECL_TEMPLATE(darwin, task_set_info);
DECL_TEMPLATE(darwin, task_threads);
DECL_TEMPLATE(darwin, task_suspend);
DECL_TEMPLATE(darwin, task_resume);
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Sat Jun 13 07:16:10 2015
@@ -6078,6 +6078,42 @@
}
+PRE(task_set_info)
+{
+#pragma pack(4)
+ typedef struct {
+ mach_msg_header_t Head;
+ NDR_record_t NDR;
+ task_flavor_t flavor;
+ mach_msg_type_number_t task_info_inCnt;
+ integer_t task_info_in[52];
+ } Request;
+#pragma pack()
+
+ Request *req = (Request *)ARG1;
+
+ PRINT("task_set_info(%s) flavor:%d", name_for_port(MACH_REMOTE), req->flavor);
+
+ AFTER = POST_FN(task_set_info);
+}
+
+POST(task_set_info)
+{
+#pragma pack(4)
+ typedef struct {
+ mach_msg_header_t Head;
+ NDR_record_t NDR;
+ kern_return_t RetCode;
+ } Reply;
+#pragma pack()
+
+ Reply *reply = (Reply *)ARG1;
+ if (!reply->RetCode) {
+ } else {
+ PRINT("mig return %d", reply->RetCode);
+ }
+}
+
PRE(task_threads)
{
#pragma pack(4)
@@ -7984,11 +8020,12 @@
case 3404:
CALL_PRE(mach_ports_lookup);
return;
-
case 3405:
CALL_PRE(task_info);
return;
-
+ case 3406:
+ CALL_PRE(task_set_info);
+ return;
case 3407:
CALL_PRE(task_suspend);
return;
|
|
From: <sv...@va...> - 2015-06-13 02:49:52
|
Author: rhyskidd
Date: Sat Jun 13 03:49:44 2015
New Revision: 15335
Log:
Update svn ignore propset on the folder none/tests/scripts. n-i-bz.
Modified:
trunk/none/tests/scripts/ (props changed)
|
|
From: Victor R. <vm....@gm...> - 2015-06-12 23:25:56
|
From: Victor Rodriguez <vic...@in...>
This patch makes glibc-2.21 be taken as valid by valgrind configure
Signed-off-by: Victor Rodriguez <vic...@in...>
---
configure.ac | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/configure.ac b/configure.ac
index bac11ef..bd203e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -973,6 +973,13 @@ case "${GLIBC_VERSION}" in
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
+ 2.21)
+ AC_MSG_RESULT(2.21 family)
+ AC_DEFINE([GLIBC_2_21], 1, [Define to 1 if you're using glibc 2.21.x])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
darwin)
AC_MSG_RESULT(Darwin)
AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
--
2.4.3
|
|
From: Florian K. <fl...@ei...> - 2015-06-12 11:20:27
|
On 12.06.2015 12:54, sv...@va... wrote: > Author: cborntra > Date: Fri Jun 12 11:54:12 2015 > New Revision: 15334 > > Log: > add KVM_S390_MEMOP ioctl handling > > Modified: > trunk/coregrind/m_syswrap/syswrap-linux.c > trunk/include/vki/vki-linux.h I'd say s390 specific stuff should go to syswrap-s390-linux.c and vki-s390-linux.h, respectively. Florian |
|
From: <sv...@va...> - 2015-06-12 10:54:21
|
Author: cborntra
Date: Fri Jun 12 11:54:12 2015
New Revision: 15334
Log:
add KVM_S390_MEMOP ioctl handling
Modified:
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/include/vki/vki-linux.h
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c Fri Jun 12 11:54:12 2015
@@ -7220,6 +7220,21 @@
case VKI_KVM_RUN:
break;
+ case VKI_KVM_S390_MEM_OP: {
+ struct vki_kvm_s390_mem_op *args =
+ (struct vki_kvm_s390_mem_op *)(ARG3);
+ PRE_MEM_READ("ioctl(KVM_S390_MEM_OP)", ARG3,
+ sizeof(struct vki_kvm_s390_mem_op));
+ if (args->flags & VKI_KVM_S390_MEMOP_F_CHECK_ONLY)
+ break;
+ if (args->op == VKI_KVM_S390_MEMOP_LOGICAL_READ)
+ PRE_MEM_WRITE("ioctl(KVM_S390_MEM_OP).buf", (Addr)args->buf, args->size);
+ if (args->op == VKI_KVM_S390_MEMOP_LOGICAL_WRITE)
+ PRE_MEM_READ("ioctl(KVM_S390_MEM_OP).buf", (Addr)args->buf, args->size);
+ }
+ break;
+
+
#ifdef ENABLE_XEN
case VKI_XEN_IOCTL_PRIVCMD_HYPERCALL: {
SyscallArgs harrghs;
@@ -9614,6 +9629,16 @@
case VKI_KVM_KVMCLOCK_CTRL:
break;
+ case VKI_KVM_S390_MEM_OP: {
+ struct vki_kvm_s390_mem_op *args =
+ (struct vki_kvm_s390_mem_op *)(ARG3);
+ if (args->flags & VKI_KVM_S390_MEMOP_F_CHECK_ONLY)
+ break;
+ if (args->op == VKI_KVM_S390_MEMOP_LOGICAL_READ)
+ POST_MEM_WRITE((Addr)args->buf, args->size);
+ }
+ break;
+
#ifdef ENABLE_XEN
case VKI_XEN_IOCTL_PRIVCMD_HYPERCALL: {
SyscallArgs harrghs;
Modified: trunk/include/vki/vki-linux.h
==============================================================================
--- trunk/include/vki/vki-linux.h (original)
+++ trunk/include/vki/vki-linux.h Fri Jun 12 11:54:12 2015
@@ -3167,6 +3167,24 @@
#define VKI_KVM_NMI _VKI_IO(KVMIO, 0x9a)
#define VKI_KVM_KVMCLOCK_CTRL _VKI_IO(KVMIO, 0xad)
+struct vki_kvm_s390_mem_op {
+ /* in */
+ __vki_u64 gaddr; /* the guest address */
+ __vki_u64 flags; /* flags */
+ __vki_u32 size; /* amount of bytes */
+ __vki_u32 op; /* type of operation */
+ __vki_u64 buf; /* buffer in userspace */
+ __vki_u8 ar; /* the access register number */
+ __vki_u8 reserved[31]; /* should be set to 0 */
+};
+
+#define VKI_KVM_S390_MEMOP_LOGICAL_READ 0
+#define VKI_KVM_S390_MEMOP_LOGICAL_WRITE 1
+#define VKI_KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
+#define VKI_KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
+
+#define VKI_KVM_S390_MEM_OP _VKI_IOW(KVMIO, 0xb1, struct vki_kvm_s390_mem_op)
+
//----------------------------------------------------------------------
// From linux-2.6/include/linux/net_stamp.h
//----------------------------------------------------------------------
|
|
From: <sv...@va...> - 2015-06-11 19:57:50
|
Author: philippe
Date: Thu Jun 11 20:57:42 2015
New Revision: 15333
Log:
Fix 348949 Bogus "ERROR: --ignore-ranges: suspiciously large range"
Patch from Mark Harris
Modified:
trunk/NEWS
trunk/memcheck/mc_main.c
trunk/memcheck/tests/err_disable_arange1.stderr.exp
trunk/memcheck/tests/err_disable_arange1.vgtest
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Thu Jun 11 20:57:42 2015
@@ -236,6 +236,7 @@
348728 Fix broken check for VIDIOC_G_ENC_INDEX
348748 Fix redundant condition
348890 Fix clang warning about unsupported --param inline-unit-growth=900
+348949 Bogus "ERROR: --ignore-ranges: suspiciously large range"
n-i-bz Provide implementations of certain compiler builtins to support
compilers who may not provide those
n-i-bz Old STABS code is still being compiled, but never used. Remove it.
Modified: trunk/memcheck/mc_main.c
==============================================================================
--- trunk/memcheck/mc_main.c (original)
+++ trunk/memcheck/mc_main.c Thu Jun 11 20:57:42 2015
@@ -5496,11 +5496,11 @@
gIgnoredAddressRanges, i );
tl_assert(key_min <= key_max);
UWord limit = 0x4000000; /* 64M - entirely arbitrary limit */
- if (key_max - key_min > limit) {
+ if (key_max - key_min > limit && val == IAR_CommandLine) {
VG_(message)(Vg_DebugMsg,
"ERROR: --ignore-ranges: suspiciously large range:\n");
VG_(message)(Vg_DebugMsg,
- " 0x%lx-0x%lx (size %ld)\n", key_min, key_max,
+ " 0x%lx-0x%lx (size %lu)\n", key_min, key_max,
key_max - key_min + 1);
return False;
}
Modified: trunk/memcheck/tests/err_disable_arange1.stderr.exp
==============================================================================
--- trunk/memcheck/tests/err_disable_arange1.stderr.exp (original)
+++ trunk/memcheck/tests/err_disable_arange1.stderr.exp Thu Jun 11 20:57:42 2015
@@ -32,5 +32,5 @@
WARNING: address error disablement range(s) still in force,
WARNING: possibly as a result of some mistake in the use of the
WARNING: VALGRIND_{DISABLE,ENABLE}_ERROR_REPORTING_IN_RANGE macros.
- [1] 0x........-0x........ ClientReq
- [3] 0x........-0x........ ClientReq
+ [4] 0x........-0x........ ClientReq
+ [6] 0x........-0x........ ClientReq
Modified: trunk/memcheck/tests/err_disable_arange1.vgtest
==============================================================================
--- trunk/memcheck/tests/err_disable_arange1.vgtest (original)
+++ trunk/memcheck/tests/err_disable_arange1.vgtest Thu Jun 11 20:57:42 2015
@@ -1,2 +1,2 @@
prog: err_disable_arange1
-vgopts: -q
+vgopts: -q --ignore-ranges=0x1000-0x1fff,0x0000-0x00ff
|
|
From: Ivo R. <iv...@iv...> - 2015-06-10 09:11:34
|
Valgrind developers, Port of Valgrind to x86/Solaris, amd64/Solaris, x86/illumos and amd64/illumos is waiting for integration. More details at [1]. We have addressed all review comments so far from Julian, Philippe, Florian and Rhys - please see the comments there. Hopefully all your review comments have been addressed to your satisfaction and the port is now ready to be integrated. Kind regards, I. [1] https://bugs.kde.org/show_bug.cgi?id=345248 |
|
From: Florian K. <fl...@ei...> - 2015-06-09 22:06:04
|
On 09.06.2015 07:27, Rhys Kidd wrote: > Valgrind developers, > > You will have seen the OS X-related commits over the last six months, and I > wanted to provide an update on current status and where to next. > What you're doing is great stuff. It's good to see that port moving along again. > > Now that I have development environments for OS X 10.7 through OS X 10.10, > I'll look to setup frequent buildbots to post nightly regressions to the > mailing list. +1 for that. Since you have those environments up and running it makes you the perfect candidate to pull this off. Setting up a nightly build is mostly straight forward with the possible exception of sending the results to the mailing list. mjw knows more about that topic and may have a few tricks up his sleeve. Cheers, Florian |
|
From: <sv...@va...> - 2015-06-09 21:53:55
|
Author: florian
Date: Tue Jun 9 22:53:48 2015
New Revision: 15332
Log:
Stick in -Werror when attempting to detect whether a compiler
option is available. This is needed for clang. See also r15323.
Fixes BZ #348890
Modified:
trunk/NEWS
trunk/configure.ac
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Jun 9 22:53:48 2015
@@ -235,6 +235,7 @@
348565 Fix detection of command line option availability for clang
348728 Fix broken check for VIDIOC_G_ENC_INDEX
348748 Fix redundant condition
+348890 Fix clang warning about unsupported --param inline-unit-growth=900
n-i-bz Provide implementations of certain compiler builtins to support
compilers who may not provide those
n-i-bz Old STABS code is still being compiled, but never used. Remove it.
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Jun 9 22:53:48 2015
@@ -1264,7 +1264,7 @@
AC_MSG_CHECKING([for Altivec])
safe_CFLAGS=$CFLAGS
-CFLAGS="-maltivec"
+CFLAGS="-maltivec -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <altivec.h>
@@ -1295,7 +1295,7 @@
AC_MSG_CHECKING([for VSX])
safe_CFLAGS=$CFLAGS
-CFLAGS="-mvsx"
+CFLAGS="-mvsx -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <altivec.h>
@@ -1331,7 +1331,7 @@
AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
safe_CFLAGS=$CFLAGS
-CFLAGS="-mhard-dfp"
+CFLAGS="-mhard-dfp -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
]], [[
__asm__ __volatile__("dadd 1, 2, 3");
@@ -1383,7 +1383,7 @@
AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
safe_CFLAGS=$CFLAGS
-CFLAGS="-lpthread"
+CFLAGS="-lpthread -Werror"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
extern int pthread_create_glibc_2_0(void*, const void*,
void *(*)(void*), void*);
@@ -1515,7 +1515,7 @@
AC_MSG_CHECKING([if gcc accepts -m32])
safe_CFLAGS=$CFLAGS
-CFLAGS="-m32"
+CFLAGS="-m32 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1535,7 +1535,7 @@
AC_MSG_CHECKING([if gcc accepts -m64])
safe_CFLAGS=$CFLAGS
-CFLAGS="-m64"
+CFLAGS="-m64 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1555,7 +1555,7 @@
AC_MSG_CHECKING([if gcc accepts -march=mips32])
safe_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -march=mips32"
+CFLAGS="$CFLAGS -march=mips32 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1575,7 +1575,7 @@
AC_MSG_CHECKING([if gcc accepts -march=mips64])
safe_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -march=mips64"
+CFLAGS="$CFLAGS -march=mips64 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1595,7 +1595,7 @@
AC_MSG_CHECKING([if gcc accepts -march=octeon])
safe_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -march=octeon"
+CFLAGS="$CFLAGS -march=octeon -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1615,7 +1615,7 @@
AC_MSG_CHECKING([if gcc accepts -march=octeon2])
safe_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -march=octeon2"
+CFLAGS="$CFLAGS -march=octeon2 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1635,7 +1635,7 @@
AC_MSG_CHECKING([if gcc accepts -mmmx])
safe_CFLAGS=$CFLAGS
-CFLAGS="-mmmx"
+CFLAGS="-mmmx -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1655,7 +1655,7 @@
AC_MSG_CHECKING([if gcc accepts -msse])
safe_CFLAGS=$CFLAGS
-CFLAGS="-msse"
+CFLAGS="-msse -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1680,7 +1680,7 @@
AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary=2 -m32])
safe_CFLAGS=$CFLAGS
-CFLAGS="-mpreferred-stack-boundary=2 -m32"
+CFLAGS="-mpreferred-stack-boundary=2 -m32 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1764,7 +1764,7 @@
AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
safe_CFLAGS=$CFLAGS
-CFLAGS="-Wextra"
+CFLAGS="-Wextra -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
return 0;
@@ -1772,7 +1772,7 @@
AC_SUBST([FLAG_W_EXTRA], [-Wextra])
AC_MSG_RESULT([-Wextra])
], [
- CFLAGS="-W"
+ CFLAGS="-W -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
return 0;
]])], [
@@ -1789,7 +1789,7 @@
AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
safe_CFLAGS=$CFLAGS
-CFLAGS="-fno-stack-protector"
+CFLAGS="-fno-stack-protector -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1816,7 +1816,7 @@
AC_MSG_CHECKING([if gcc accepts -fno-ipa-icf])
safe_CFLAGS=$CFLAGS
-CFLAGS="-fno-ipa-icf"
+CFLAGS="-fno-ipa-icf -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
@@ -1839,7 +1839,7 @@
if test "x${vg_cv_ubsan}" = "xyes"; then
AC_MSG_CHECKING([if gcc accepts -fsanitize=undefined])
safe_CFLAGS=$CFLAGS
-CFLAGS="-fsanitize=undefined"
+CFLAGS="-fsanitize=undefined -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
return 0;
]])], [
@@ -1860,7 +1860,7 @@
AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
safe_CFLAGS=$CFLAGS
-CFLAGS="--param inline-unit-growth=900"
+CFLAGS="--param inline-unit-growth=900 -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
return 0;
@@ -1880,7 +1880,7 @@
AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
safe_CFLAGS=$CFLAGS
-CFLAGS="-gdwarf-4 -fdebug-types-section"
+CFLAGS="-gdwarf-4 -fdebug-types-section -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
return 0;
@@ -1946,7 +1946,7 @@
AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
safe_CFLAGS=$CFLAGS
-CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml"
+CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml -Werror"
AC_LINK_IFELSE(
[AC_LANG_SOURCE([int _start () { return 0; }])],
@@ -1975,7 +1975,7 @@
# directly.
AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
safe_CFLAGS=$CFLAGS
-CFLAGS="-Wl,--build-id=none"
+CFLAGS="-Wl,--build-id=none -Werror"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([ ], [return 0;])],
@@ -2059,7 +2059,7 @@
AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -msse"
+CFLAGS="$CFLAGS -msse -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
do { long long int x;
__asm__ __volatile__(
@@ -2735,7 +2735,7 @@
AC_MSG_CHECKING([for OpenMP])
safe_CFLAGS=$CFLAGS
-CFLAGS="-fopenmp $mflag_primary"
+CFLAGS="-fopenmp $mflag_primary -Werror"
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <omp.h>
|
|
From: <sv...@va...> - 2015-06-09 21:45:06
|
Author: florian
Date: Tue Jun 9 22:44:58 2015
New Revision: 15331
Log:
Followup to r15323. Cannot use AC_GCC_WARNING_SUBST to detect
whether -Wformat-security is supported. Special handling is needed.
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 accepts -Wformat-security
without -Wformat being present on the command line. Other GCC
versions will issue a warning if -Wformat is missing. r15323
adds -Werror to AC_GCC_WARNING_SUBST and therefore turns that
warning into an error. With the consequence that
-Wformat-security appears to be unsupported -- a false conclusion.
Modified:
trunk/configure.ac
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Jun 9 22:44:58 2015
@@ -1738,12 +1738,27 @@
AC_GCC_WARNING_SUBST([write-strings], [FLAG_W_WRITE_STRINGS])
AC_GCC_WARNING_SUBST([empty-body], [FLAG_W_EMPTY_BODY])
AC_GCC_WARNING_SUBST([format], [FLAG_W_FORMAT])
-AC_GCC_WARNING_SUBST([format-security], [FLAG_W_FORMAT_SECURITY])
AC_GCC_WARNING_SUBST([cast-qual], [FLAG_W_CAST_QUAL])
AC_GCC_WARNING_SUBST([old-style-declaration], [FLAG_W_OLD_STYLE_DECLARATION])
AC_GCC_WARNING_SUBST([ignored-qualifiers], [FLAG_W_IGNORED_QUALIFIERS])
AC_GCC_WARNING_SUBST([missing-parameter-type], [FLAG_W_MISSING_PARAMETER_TYPE])
+# Does this compiler support -Wformat-security ?
+# Special handling is needed, because certain GCC versions require -Wformat
+# being present if -Wformat-security is given. Otherwise a warning is issued.
+# However, AC_GCC_WARNING_SUBST will stick in -Werror (see r15323 for rationale).
+# And with that the warning will be turned into an error with the result
+# that -Wformat-security is believed to be unsupported when in fact it is.
+AC_MSG_CHECKING([if gcc accepts -Wformat-security])
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wformat -Wformat-security -Werror"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[;]])], [
+AC_SUBST([FLAG_W_FORMAT_SECURITY], [-Wformat-security])
+AC_MSG_RESULT([yes])], [
+AC_SUBST([FLAG_W_FORMAT_SECURITY], [])
+AC_MSG_RESULT([no])])
+CFLAGS=$safe_CFLAGS
+
# does this compiler support -Wextra or the older -W ?
AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
|
|
From: Rhys K. <rhy...@gm...> - 2015-06-09 05:27:42
|
Valgrind developers, You will have seen the OS X-related commits over the last six months, and I wanted to provide an update on current status and where to next. Valgrind had putative support for OS X as a platform since the initial work of Greg Parker (since at least December 2004), Nicholas Nethercote, Julian Seward and others hit trunk in 2009. First release with highlighted support was 3.5.0, if I recall correctly. Since that time there have been five OS X releases (Mac OS X 10.6 Snow Leopard - OS X 10.10 Yosemite) and the platform saw the transition from gcc to a clang-based compiler chain. Valgrind support didn't quite keep up, and despite the efforts of many the Valgrind user experience often fell below expectations. Over the last six months I've been working to improve Valgrind's support for the OS X platform. Pleasingly, progress has been made and already the regression test failures are down ~20%. The improvement is actually better within the core memcheck toolset, as the % failure rate remains much higher in helgrind and drd. Based on my commit logs (performance slightly different between OS X releases, not the full time horizon): 1 March: == 585 tests, 257 stderr failures, 23 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures == 8 June: == 598 tests, 200 stderr failures, 12 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == Now that I have development environments for OS X 10.7 through OS X 10.10, I'll look to setup frequent buildbots to post nightly regressions to the mailing list. Others are of course free to do so if you have the infrastructure, please consult the docs or ask on the mailing list/IRC! Based on the rate of bugfixes during 2015 YTD, we are on track to clear all core memcheck and 'none' regression test failures this year. This week's announcement of OS X 10.11 (El Capitan) is a good juncture to set an audacious goal of no new regressions in Valgrind on El Capitan when it is available for general release later this year. Stretch targets are day 1 support for Firefox and the Swift runtime. Progress is being tracked in the meta bug here: https://bugs.kde.org/show_bug.cgi?id=348909 Importantly, this OS X-related activity has also led to new users reporting bugs, providing patches and suggesting new tests. This is a positive for the sustained viability of the port. We would value your comments, thoughts and contributions to achieve our goal for Valgrind support on OS X 10.11. Regards, Rhys Kidd |
|
From: <sv...@va...> - 2015-06-08 11:20:29
|
Author: sewardj
Date: Mon Jun 8 12:20:22 2015
New Revision: 15330
Log:
Fix up a few not-in-alphabetical-order file names in file lists.
No functional change.
Modified:
trunk/coregrind/Makefile.am
Modified: trunk/coregrind/Makefile.am
==============================================================================
--- trunk/coregrind/Makefile.am (original)
+++ trunk/coregrind/Makefile.am Mon Jun 8 12:20:22 2015
@@ -186,9 +186,9 @@
pub_core_mallocfree.h \
pub_core_options.h \
pub_core_oset.h \
+ pub_core_poolalloc.h \
pub_core_rangemap.h \
pub_core_redir.h \
- pub_core_poolalloc.h \
pub_core_replacemalloc.h\
pub_core_sbprofile.h \
pub_core_scheduler.h \
@@ -278,7 +278,6 @@
m_debuglog.c \
m_errormgr.c \
m_execontext.c \
- m_poolalloc.c \
m_hashtable.c \
m_libcbase.c \
m_libcassert.c \
@@ -292,6 +291,7 @@
m_mallocfree.c \
m_options.c \
m_oset.c \
+ m_poolalloc.c \
m_rangemap.c \
m_redir.c \
m_sbprofile.c \
@@ -319,6 +319,8 @@
m_debuginfo/misc.c \
m_debuginfo/d3basics.c \
m_debuginfo/debuginfo.c \
+ m_debuginfo/image.c \
+ m_debuginfo/minilzo-inl.c \
m_debuginfo/readdwarf.c \
m_debuginfo/readdwarf3.c \
m_debuginfo/readelf.c \
@@ -327,8 +329,6 @@
m_debuginfo/readpdb.c \
m_debuginfo/storage.c \
m_debuginfo/tytypes.c \
- m_debuginfo/image.c \
- m_debuginfo/minilzo-inl.c \
m_demangle/cp-demangle.c \
m_demangle/cplus-dem.c \
m_demangle/demangle.c \
@@ -374,10 +374,10 @@
m_mach/mach_traps-x86-darwin.S \
m_mach/mach_traps-amd64-darwin.S \
m_replacemalloc/replacemalloc_core.c \
- m_scheduler/scheduler.c \
- m_scheduler/sema.c \
m_scheduler/sched-lock.c \
m_scheduler/sched-lock-generic.c \
+ m_scheduler/scheduler.c \
+ m_scheduler/sema.c \
m_sigframe/sigframe-common.c \
m_sigframe/sigframe-x86-linux.c \
m_sigframe/sigframe-amd64-linux.c \
|
|
From: <sv...@va...> - 2015-06-08 11:07:55
|
Author: rhyskidd
Date: Mon Jun 8 12:07:48 2015
New Revision: 15329
Log:
Memcheck on multithreaded program fails with Assertion 'sizeof(UWord) == sizeof(UInt)' failed in m_syscall.c
bz#302630
== bz#326797
On OS X 10.7 and OS X 10.8
Before:
== 598 tests, 201 stderr failures, 12 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
After:
== 598 tests, 200 stderr failures, 12 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
Modified:
trunk/NEWS
trunk/coregrind/m_syswrap/syswrap-darwin.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Mon Jun 8 12:07:48 2015
@@ -111,6 +111,9 @@
254164 OS X task_info: UNKNOWN task message [id 3405, to mach_task_self(),
reply 0x........]
269360 s390x: Fix addressing mode selection for compare-and-swap
+302630 Memcheck on multithreaded program fails with Assertion
+ 'sizeof(UWord) == sizeof(UInt)' failed in m_syscall.c
+ == 326797
319274 Fix unhandled syscall: unix:410 (sigsuspend_nocancel) on OS X
333051 mmap of huge pages fails due to incorrect alignment
== 339163
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Mon Jun 8 12:07:48 2015
@@ -7375,12 +7375,23 @@
// and SET_STATUS_Success creates a UNIX-class syscall result.
// Hence we have to laboriously construct the full SysRes "by hand"
// and use that to set the syscall return status.
+#if defined(VGA_x86)
SET_STATUS_from_SysRes(
VG_(mk_SysRes_x86_darwin)(
VG_DARWIN_SYSCALL_CLASS_MACH,
False/*success*/, 0, 0
)
);
+#elif defined(VGA_amd64)
+ SET_STATUS_from_SysRes(
+ VG_(mk_SysRes_amd64_darwin)(
+ VG_DARWIN_SYSCALL_CLASS_MACH,
+ False/*success*/, 0, 0
+ )
+ );
+#else
+#error unknown architecture
+#endif
*flags &= ~SfMayBlock; // clear flag set by PRE(mach_msg)
} else {
// Terminating some other thread.
|