diff --git a/valgrind-3.5.0-amd64-adcsbb.patch b/valgrind-3.5.0-amd64-adcsbb.patch new file mode 100644 index 0000000..c59b83b --- /dev/null +++ b/valgrind-3.5.0-amd64-adcsbb.patch @@ -0,0 +1,486 @@ +--- valgrind/VEX/priv/guest_amd64_toIR.c.jj 2009-10-21 22:46:40.000000000 +0200 ++++ valgrind/VEX/priv/guest_amd64_toIR.c 2009-10-27 20:33:43.000000000 +0100 +@@ -14278,18 +14278,20 @@ DisResult disInstr_AMD64_WRK ( + if (haveF2orF3(pfx)) goto decode_failure; + delta = dis_op_imm_A( 1, True, Iop_Add8, True, delta, "adc" ); + break; +-//.. //-- case 0x15: /* ADC Iv, eAX */ +-//.. //-- delta = dis_op_imm_A( sz, ADC, True, delta, "adc" ); +-//.. //-- break; ++ case 0x15: /* ADC Iv, eAX */ ++ if (haveF2orF3(pfx)) goto decode_failure; ++ delta = dis_op_imm_A( sz, True, Iop_Add8, True, delta, "adc" ); ++ break; + + case 0x1C: /* SBB Ib, AL */ + if (haveF2orF3(pfx)) goto decode_failure; + delta = dis_op_imm_A( 1, True, Iop_Sub8, True, delta, "sbb" ); + break; +-//.. //-- case 0x1D: /* SBB Iv, eAX */ +-//.. //-- delta = dis_op_imm_A( sz, SBB, True, delta, "sbb" ); +-//.. //-- break; +-//.. //-- ++ case 0x1D: /* SBB Iv, eAX */ ++ if (haveF2orF3(pfx)) goto decode_failure; ++ delta = dis_op_imm_A( sz, True, Iop_Sub8, True, delta, "sbb" ); ++ break; ++ + case 0x24: /* AND Ib, AL */ + if (haveF2orF3(pfx)) goto decode_failure; + delta = dis_op_imm_A( 1, False, Iop_And8, True, delta, "and" ); +@@ -14364,9 +14366,10 @@ DisResult disInstr_AMD64_WRK ( + delta = dis_op2_E_G ( vbi, pfx, True, Iop_Add8, True, sz, delta, "adc" ); + break; + +-//.. //-- case 0x1A: /* SBB Eb,Gb */ +-//.. //-- delta = dis_op2_E_G ( sorb, True, SBB, True, 1, delta, "sbb" ); +-//.. //-- break; ++ case 0x1A: /* SBB Eb,Gb */ ++ if (haveF2orF3(pfx)) goto decode_failure; ++ delta = dis_op2_E_G ( vbi, pfx, True, Iop_Sub8, True, 1, delta, "sbb" ); ++ break; + case 0x1B: /* SBB Ev,Gv */ + if (haveF2orF3(pfx)) goto decode_failure; + delta = dis_op2_E_G ( vbi, pfx, True, Iop_Sub8, True, sz, delta, "sbb" ); +--- valgrind/none/tests/x86/sbbmisc.stdout.exp.jj 2009-10-09 12:52:02.000000000 +0200 ++++ valgrind/none/tests/x86/sbbmisc.stdout.exp 2009-10-27 20:50:15.000000000 +0100 +@@ -5,3 +5,6 @@ r4 = 11 10 + r5 = -11 -12 + r6 = -69 -68 + r7 = -113 -112 ++r8 = 104 105 ++r9 = -14982 -14981 ++r10 = -267879790 -267879789 +--- valgrind/none/tests/x86/sbbmisc.c.jj 2009-10-09 12:52:02.000000000 +0200 ++++ valgrind/none/tests/x86/sbbmisc.c 2009-10-27 20:48:00.000000000 +0100 +@@ -140,7 +140,58 @@ VG_SYM(adc_eb_gb_2) ":\n" + "\tret\n" + ); + ++extern void adc_ib_al ( void ); ++asm("\n" ++VG_SYM(adc_ib_al) ":\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tclc\n" ++"\tadcb $5, %al\n" ++"\tmovb %al, " VG_SYM(out_b1) "\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tstc\n" ++"\tadcb $5, %al\n" ++"\tmovb %al, " VG_SYM(out_b2) "\n" + ++"\tret\n" ++); ++ ++ ++extern void adc_iw_ax ( void ); ++asm("\n" ++VG_SYM(adc_iw_ax) ":\n" ++ ++"\tmovw " VG_SYM(in_w) ", %ax\n" ++"\tclc\n" ++"\tadcw $555, %ax\n" ++"\tmovw %ax, " VG_SYM(out_w1) "\n" ++ ++"\tmovw " VG_SYM(in_w) ", %ax\n" ++"\tstc\n" ++"\tadcw $555, %ax\n" ++"\tmovw %ax, " VG_SYM(out_w2) "\n" ++ ++"\tret\n" ++); ++ ++ ++extern void adc_il_eax ( void ); ++asm("\n" ++VG_SYM(adc_il_eax) ":\n" ++ ++"\tmovl " VG_SYM(in_l) ", %eax\n" ++"\tclc\n" ++"\tadcl $555666, %eax\n" ++"\tmovl %eax, " VG_SYM(out_l1) "\n" ++ ++"\tmovl " VG_SYM(in_l) ", %eax\n" ++"\tstc\n" ++"\tadcl $555666, %eax\n" ++"\tmovl %eax, " VG_SYM(out_l2) "\n" ++ ++"\tret\n" ++); + + + int main ( void ) +@@ -177,5 +228,17 @@ int main ( void ) + adc_eb_gb_2(); + printf("r7 = %d %d\n", (int)out_b1, (int)out_b2); + ++ in_b = 99; ++ adc_ib_al(); ++ printf("r8 = %d %d\n", (int)out_b1, (int)out_b2); ++ ++ in_w = 49999; ++ adc_iw_ax(); ++ printf("r9 = %d %d\n", (int)out_w1, (int)out_w2); ++ ++ in_l = 0xF0000000; ++ adc_il_eax(); ++ printf("r10 = %d %d\n", (int)out_l1, (int)out_l2); ++ + return 0; + } +--- valgrind/none/tests/amd64/sbbmisc.vgtest.jj 2009-10-27 20:50:44.000000000 +0100 ++++ valgrind/none/tests/amd64/sbbmisc.vgtest 2009-10-09 12:52:02.000000000 +0200 +@@ -0,0 +1 @@ ++prog: sbbmisc +--- valgrind/none/tests/amd64/sbbmisc.stdout.exp.jj 2009-10-27 20:50:41.000000000 +0100 ++++ valgrind/none/tests/amd64/sbbmisc.stdout.exp 2009-10-27 20:50:15.000000000 +0100 +@@ -0,0 +1,10 @@ ++r1 = 94 93 ++r2 = -16092 -16093 ++r3 = -268991122 -268991123 ++r4 = 11 10 ++r5 = -11 -12 ++r6 = -69 -68 ++r7 = -113 -112 ++r8 = 104 105 ++r9 = -14982 -14981 ++r10 = -267879790 -267879789 +--- valgrind/none/tests/amd64/Makefile.am.jj 2009-10-09 12:52:01.000000000 +0200 ++++ valgrind/none/tests/amd64/Makefile.am 2009-10-27 20:55:27.000000000 +0100 +@@ -43,6 +43,7 @@ EXTRA_DIST = \ + redundantRexW.vgtest redundantRexW.stdout.exp \ + redundantRexW.stderr.exp \ + smc1.stderr.exp smc1.stdout.exp smc1.vgtest \ ++ sbbmisc.stderr.exp sbbmisc.stdout.exp sbbmisc.vgtest \ + shrld.stderr.exp shrld.stdout.exp shrld.vgtest \ + ssse3_misaligned.stderr.exp ssse3_misaligned.stdout.exp \ + ssse3_misaligned.vgtest \ +@@ -58,6 +59,7 @@ check_PROGRAMS = \ + rcl-amd64 \ + redundantRexW \ + smc1 \ ++ sbbmisc \ + nibz_bennee_mmap + if BUILD_SSSE3_TESTS + check_PROGRAMS += ssse3_misaligned +--- valgrind/none/tests/amd64/Makefile.in.jj 2009-10-09 12:52:33.000000000 +0200 ++++ valgrind/none/tests/amd64/Makefile.in 2009-10-27 20:56:47.000000000 +0100 +@@ -53,8 +53,8 @@ DIST_COMMON = $(dist_noinst_SCRIPTS) $(s + check_PROGRAMS = amd64locked$(EXEEXT) bug127521-64$(EXEEXT) \ + bug132813-amd64$(EXEEXT) bug132918$(EXEEXT) clc$(EXEEXT) \ + $(am__EXEEXT_3) rcl-amd64$(EXEEXT) redundantRexW$(EXEEXT) \ +- smc1$(EXEEXT) nibz_bennee_mmap$(EXEEXT) $(am__EXEEXT_4) \ +- $(am__EXEEXT_5) ++ smc1$(EXEEXT) sbbmisc$(EXEEXT) nibz_bennee_mmap$(EXEEXT) \ ++ $(am__EXEEXT_4) $(am__EXEEXT_5) + @BUILD_SSSE3_TESTS_TRUE@am__append_3 = ssse3_misaligned + + # DDD: these need to be made to work on Darwin like the x86/ ones were. +@@ -169,6 +169,9 @@ slahf_amd64_LDADD = $(LDADD) + smc1_SOURCES = smc1.c + smc1_OBJECTS = smc1.$(OBJEXT) + smc1_LDADD = $(LDADD) ++sbbmisc_SOURCES = sbbmisc.c ++sbbmisc_OBJECTS = sbbmisc.$(OBJEXT) ++sbbmisc_LDADD = $(LDADD) + ssse3_misaligned_SOURCES = ssse3_misaligned.c + ssse3_misaligned_OBJECTS = ssse3_misaligned.$(OBJEXT) + ssse3_misaligned_LDADD = $(LDADD) +@@ -186,7 +189,7 @@ SOURCES = amd64locked.c bug127521-64.c b + $(insn_mmx_SOURCES) $(insn_sse_SOURCES) $(insn_sse2_SOURCES) \ + $(insn_sse3_SOURCES) $(insn_ssse3_SOURCES) jrcxz.c looper.c \ + loopnel.c nibz_bennee_mmap.c rcl-amd64.c redundantRexW.c \ +- shrld.c slahf-amd64.c smc1.c ssse3_misaligned.c ++ shrld.c slahf-amd64.c smc1.c sbbmisc.c ssse3_misaligned.c + DIST_SOURCES = amd64locked.c bug127521-64.c bug132813-amd64.c \ + bug132918.c bug137714-amd64.c bug156404-amd64.c clc.c \ + faultstatus.c fcmovnu.c fxtract.c $(insn_basic_SOURCES) \ +@@ -194,7 +197,7 @@ DIST_SOURCES = amd64locked.c bug127521-6 + $(insn_sse2_SOURCES) $(insn_sse3_SOURCES) \ + $(insn_ssse3_SOURCES) jrcxz.c looper.c loopnel.c \ + nibz_bennee_mmap.c rcl-amd64.c redundantRexW.c shrld.c \ +- slahf-amd64.c smc1.c ssse3_misaligned.c ++ slahf-amd64.c smc1.c sbbmisc.c ssse3_misaligned.c + ETAGS = etags + CTAGS = ctags + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +@@ -548,6 +551,7 @@ EXTRA_DIST = \ + redundantRexW.vgtest redundantRexW.stdout.exp \ + redundantRexW.stderr.exp \ + smc1.stderr.exp smc1.stdout.exp smc1.vgtest \ ++ sbbmisc.stderr.exp sbbmisc.stdout.exp sbbmisc.vgtest \ + shrld.stderr.exp shrld.stdout.exp shrld.vgtest \ + ssse3_misaligned.stderr.exp ssse3_misaligned.stdout.exp \ + ssse3_misaligned.vgtest \ +@@ -688,6 +692,9 @@ slahf-amd64$(EXEEXT): $(slahf_amd64_OBJE + smc1$(EXEEXT): $(smc1_OBJECTS) $(smc1_DEPENDENCIES) + @rm -f smc1$(EXEEXT) + $(LINK) $(smc1_LDFLAGS) $(smc1_OBJECTS) $(smc1_LDADD) $(LIBS) ++sbbmisc$(EXEEXT): $(sbbmisc_OBJECTS) $(sbbmisc_DEPENDENCIES) ++ @rm -f sbbmisc$(EXEEXT) ++ $(LINK) $(sbbmisc_LDFLAGS) $(sbbmisc_OBJECTS) $(sbbmisc_LDADD) $(LIBS) + ssse3_misaligned$(EXEEXT): $(ssse3_misaligned_OBJECTS) $(ssse3_misaligned_DEPENDENCIES) + @rm -f ssse3_misaligned$(EXEEXT) + $(LINK) $(ssse3_misaligned_LDFLAGS) $(ssse3_misaligned_OBJECTS) $(ssse3_misaligned_LDADD) $(LIBS) +@@ -724,6 +731,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shrld.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slahf-amd64.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smc1.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sbbmisc.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssse3_misaligned.Po@am__quote@ + + .c.o: +--- valgrind/none/tests/amd64/sbbmisc.c.jj 2009-10-27 20:50:36.000000000 +0100 ++++ valgrind/none/tests/amd64/sbbmisc.c 2009-10-27 20:51:57.000000000 +0100 +@@ -0,0 +1,244 @@ ++#include "tests/asm.h" ++#include ++ ++char in_b, out_b1, out_b2, in_b2; ++ ++short in_w, out_w1, out_w2; ++ ++int in_l, out_l1, out_l2; ++ ++extern void sbb_ib_al ( void ); ++asm("\n" ++VG_SYM(sbb_ib_al) ":\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tclc\n" ++"\tsbbb $5, %al\n" ++"\tmovb %al, " VG_SYM(out_b1) "\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tstc\n" ++"\tsbbb $5, %al\n" ++"\tmovb %al, " VG_SYM(out_b2) "\n" ++ ++"\tretq\n" ++); ++ ++ ++extern void sbb_iw_ax ( void ); ++asm("\n" ++VG_SYM(sbb_iw_ax) ":\n" ++ ++"\tmovw " VG_SYM(in_w) ", %ax\n" ++"\tclc\n" ++"\tsbbw $555, %ax\n" ++"\tmovw %ax, " VG_SYM(out_w1) "\n" ++ ++"\tmovw " VG_SYM(in_w) ", %ax\n" ++"\tstc\n" ++"\tsbbw $555, %ax\n" ++"\tmovw %ax, " VG_SYM(out_w2) "\n" ++ ++"\tretq\n" ++); ++ ++ ++extern void sbb_il_eax ( void ); ++asm("\n" ++VG_SYM(sbb_il_eax) ":\n" ++ ++"\tmovl " VG_SYM(in_l) ", %eax\n" ++"\tclc\n" ++"\tsbbl $555666, %eax\n" ++"\tmovl %eax, " VG_SYM(out_l1) "\n" ++ ++"\tmovl " VG_SYM(in_l) ", %eax\n" ++"\tstc\n" ++"\tsbbl $555666, %eax\n" ++"\tmovl %eax, " VG_SYM(out_l2) "\n" ++ ++"\tretq\n" ++); ++ ++ ++extern void sbb_eb_gb ( void ); ++asm("\n" ++VG_SYM(sbb_eb_gb) ":\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tclc\n" ++"\tsbbb " VG_SYM(in_b2) ", %al\n" ++"\tmovb %al, " VG_SYM(out_b1) "\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tstc\n" ++"\tsbbb " VG_SYM(in_b2) ", %al\n" ++"\tmovb %al, " VG_SYM(out_b2) "\n" ++ ++"\tretq\n" ++); ++ ++ ++extern void sbb_eb_gb_2 ( void ); ++asm("\n" ++VG_SYM(sbb_eb_gb_2) ":\n" ++"\tpushq %rcx\n" ++ ++"\tmovb " VG_SYM(in_b) ", %cl\n" ++"\tmovb " VG_SYM(in_b2) ", %dh\n" ++"\tclc\n" ++"\tsbbb %dh,%cl\n" ++"\tmovb %cl, " VG_SYM(out_b1) "\n" ++ ++"\tmovb " VG_SYM(in_b) ", %cl\n" ++"\tmovb " VG_SYM(in_b2) ", %dh\n" ++"\tstc\n" ++"\tsbbb %dh,%cl\n" ++"\tmovb %cl, " VG_SYM(out_b2) "\n" ++ ++"\tpopq %rcx\n" ++"\tretq\n" ++); ++ ++ ++extern void adc_eb_gb ( void ); ++asm("\n" ++VG_SYM(adc_eb_gb) ":\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tclc\n" ++"\tadcb " VG_SYM(in_b2) ", %al\n" ++"\tmovb %al, " VG_SYM(out_b1) "\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tstc\n" ++"\tadcb " VG_SYM(in_b2) ", %al\n" ++"\tmovb %al, " VG_SYM(out_b2) "\n" ++ ++"\tretq\n" ++); ++ ++ ++extern void adc_eb_gb_2 ( void ); ++asm("\n" ++VG_SYM(adc_eb_gb_2) ":\n" ++"\tpushq %rcx\n" ++ ++"\tmovb " VG_SYM(in_b) ", %cl\n" ++"\tmovb " VG_SYM(in_b2) ", %dh\n" ++"\tclc\n" ++"\tadcb %dh,%cl\n" ++"\tmovb %cl, " VG_SYM(out_b1) "\n" ++ ++"\tmovb " VG_SYM(in_b) ", %cl\n" ++"\tmovb " VG_SYM(in_b2) ", %dh\n" ++"\tstc\n" ++"\tadcb %dh,%cl\n" ++"\tmovb %cl, " VG_SYM(out_b2) "\n" ++ ++"\tpopq %rcx\n" ++"\tretq\n" ++); ++ ++extern void adc_ib_al ( void ); ++asm("\n" ++VG_SYM(adc_ib_al) ":\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tclc\n" ++"\tadcb $5, %al\n" ++"\tmovb %al, " VG_SYM(out_b1) "\n" ++ ++"\tmovb " VG_SYM(in_b) ", %al\n" ++"\tstc\n" ++"\tadcb $5, %al\n" ++"\tmovb %al, " VG_SYM(out_b2) "\n" ++ ++"\tretq\n" ++); ++ ++ ++extern void adc_iw_ax ( void ); ++asm("\n" ++VG_SYM(adc_iw_ax) ":\n" ++ ++"\tmovw " VG_SYM(in_w) ", %ax\n" ++"\tclc\n" ++"\tadcw $555, %ax\n" ++"\tmovw %ax, " VG_SYM(out_w1) "\n" ++ ++"\tmovw " VG_SYM(in_w) ", %ax\n" ++"\tstc\n" ++"\tadcw $555, %ax\n" ++"\tmovw %ax, " VG_SYM(out_w2) "\n" ++ ++"\tretq\n" ++); ++ ++ ++extern void adc_il_eax ( void ); ++asm("\n" ++VG_SYM(adc_il_eax) ":\n" ++ ++"\tmovl " VG_SYM(in_l) ", %eax\n" ++"\tclc\n" ++"\tadcl $555666, %eax\n" ++"\tmovl %eax, " VG_SYM(out_l1) "\n" ++ ++"\tmovl " VG_SYM(in_l) ", %eax\n" ++"\tstc\n" ++"\tadcl $555666, %eax\n" ++"\tmovl %eax, " VG_SYM(out_l2) "\n" ++ ++"\tretq\n" ++); ++ ++ ++int main ( void ) ++{ ++ in_b = 99; ++ sbb_ib_al(); ++ printf("r1 = %d %d\n", (int)out_b1, (int)out_b2); ++ ++ in_w = 49999; ++ sbb_iw_ax(); ++ printf("r2 = %d %d\n", (int)out_w1, (int)out_w2); ++ ++ in_l = 0xF0000000; ++ sbb_il_eax(); ++ printf("r3 = %d %d\n", (int)out_l1, (int)out_l2); ++ ++ in_b = 99; ++ in_b2 = 88; ++ sbb_eb_gb(); ++ printf("r4 = %d %d\n", (int)out_b1, (int)out_b2); ++ ++ in_b = 66; ++ in_b2 = 77; ++ sbb_eb_gb_2(); ++ printf("r5 = %d %d\n", (int)out_b1, (int)out_b2); ++ ++ in_b = 99; ++ in_b2 = 88; ++ adc_eb_gb(); ++ printf("r6 = %d %d\n", (int)out_b1, (int)out_b2); ++ ++ in_b = 66; ++ in_b2 = 77; ++ adc_eb_gb_2(); ++ printf("r7 = %d %d\n", (int)out_b1, (int)out_b2); ++ ++ in_b = 99; ++ adc_ib_al(); ++ printf("r8 = %d %d\n", (int)out_b1, (int)out_b2); ++ ++ in_w = 49999; ++ adc_iw_ax(); ++ printf("r9 = %d %d\n", (int)out_w1, (int)out_w2); ++ ++ in_l = 0xF0000000; ++ adc_il_eax(); ++ printf("r10 = %d %d\n", (int)out_l1, (int)out_l2); ++ ++ return 0; ++} +--- valgrind/none/tests/amd64/sbbmisc.stderr.exp.jj 2009-10-27 20:50:39.000000000 +0100 ++++ valgrind/none/tests/amd64/sbbmisc.stderr.exp 2009-10-09 12:52:02.000000000 +0200 +@@ -0,0 +1,2 @@ ++ ++ diff --git a/valgrind-3.5.0-syscalls.patch b/valgrind-3.5.0-syscalls.patch new file mode 100644 index 0000000..1bdb06f --- /dev/null +++ b/valgrind-3.5.0-syscalls.patch @@ -0,0 +1,240 @@ +--- valgrind/coregrind/m_syswrap/priv_syswrap-linux.h 2009-10-27 21:31:49.852433085 +0100 ++++ valgrind/coregrind/m_syswrap/priv_syswrap-linux.h 2009-10-27 21:25:05.000000000 +0100 +@@ -47,6 +47,7 @@ extern SysRes ML_(do_fork_clone) ( Threa + DECL_TEMPLATE(linux, sys_mount); + DECL_TEMPLATE(linux, sys_oldumount); + DECL_TEMPLATE(linux, sys_umount); ++DECL_TEMPLATE(linux, sys_perf_counter_open); + + // POSIX, but various sub-cases differ between Linux and Darwin. + DECL_TEMPLATE(linux, sys_fcntl); +--- valgrind/coregrind/m_syswrap/syswrap-amd64-linux.c 2009-10-27 21:31:49.852433085 +0100 ++++ valgrind/coregrind/m_syswrap/syswrap-amd64-linux.c 2009-10-27 21:25:05.000000000 +0100 +@@ -1375,7 +1375,12 @@ const SyscallTableEntry ML_(syscall_tabl + LINXY(__NR_epoll_create1, sys_epoll_create1), // 291 + // (__NR_dup3, sys_ni_syscall) // 292 + LINXY(__NR_pipe2, sys_pipe2), // 293 +- LINXY(__NR_inotify_init1, sys_inotify_init1), // 294 ++ LINXY(__NR_inotify_init1, sys_inotify_init1), // 294 ++ ++ // (__NR_preadv, sys_ni_syscall) // 295 ++ // (__NR_pwritev, sys_ni_syscall) // 296 ++ // (__NR_rt_tgsigqueueinfo, sys_ni_syscall) // 297 ++ LINXY(__NR_perf_counter_open, sys_perf_counter_open) // 298 + }; + + const UInt ML_(syscall_table_size) = +--- valgrind/coregrind/m_syswrap/syswrap-linux.c 2009-10-27 21:31:49.853433112 +0100 ++++ valgrind/coregrind/m_syswrap/syswrap-linux.c 2009-10-27 21:25:05.000000000 +0100 +@@ -2410,6 +2410,30 @@ PRE(sys_stime) + PRE_MEM_READ( "stime(t)", ARG1, sizeof(vki_time_t) ); + } + ++PRE(sys_perf_counter_open) ++{ ++ PRINT("sys_perf_counter_open ( %#lx, %ld, %ld, %ld, %ld )", ++ ARG1,ARG2,ARG3,ARG4,ARG5); ++ PRE_REG_READ5(long, "perf_counter_open", ++ struct vki_perf_counter_attr *, attr, ++ vki_pid_t, pid, int, cpu, int, group_fd, ++ unsigned long, flags); ++ PRE_MEM_READ( "perf_counter_open(attr)", ++ ARG1, sizeof(struct vki_perf_counter_attr) ); ++} ++ ++POST(sys_perf_counter_open) ++{ ++ vg_assert(SUCCESS); ++ if (!ML_(fd_allowed)(RES, "perf_counter_open", tid, True)) { ++ VG_(close)(RES); ++ SET_STATUS_Failure( VKI_EMFILE ); ++ } else { ++ if (VG_(clo_track_fds)) ++ ML_(record_fd_open_nameless)(tid, RES); ++ } ++} ++ + /* --------------------------------------------------------------------- + utime wrapper + ------------------------------------------------------------------ */ +--- valgrind/coregrind/m_syswrap/syswrap-ppc32-linux.c 2009-10-27 21:31:49.855432715 +0100 ++++ valgrind/coregrind/m_syswrap/syswrap-ppc32-linux.c 2009-10-27 21:25:05.000000000 +0100 +@@ -1867,7 +1867,11 @@ const SyscallTableEntry ML_(syscall_tabl + LINXY(__NR_epoll_create1, sys_epoll_create1), // 315 + // (__NR_dup3, sys_ni_syscall) // 316 + LINXY(__NR_pipe2, sys_pipe2), // 317 +- LINX_(__NR_inotify_init1, sys_inotify_init1) // 318 ++ LINXY(__NR_inotify_init1, sys_inotify_init1), // 318 ++ LINXY(__NR_perf_counter_open, sys_perf_counter_open) // 319 ++ // (__NR_preadv, sys_ni_syscall) // 320 ++ // (__NR_pwritev, sys_ni_syscall) // 321 ++ // (__NR_rt_tgsigqueueinfo, sys_ni_syscall) // 322 + }; + + const UInt ML_(syscall_table_size) = +--- valgrind/coregrind/m_syswrap/syswrap-ppc64-linux.c 2009-10-27 21:31:49.855432715 +0100 ++++ valgrind/coregrind/m_syswrap/syswrap-ppc64-linux.c 2009-10-27 21:25:05.000000000 +0100 +@@ -1191,10 +1191,10 @@ const SyscallTableEntry ML_(syscall_tabl + GENX_(__NR_rename, sys_rename), // 38 + GENX_(__NR_mkdir, sys_mkdir), // 39 + +-// _____(__NR_rmdir, sys_rmdir), // 40 ++ GENX_(__NR_rmdir, sys_rmdir), // 40 + GENXY(__NR_dup, sys_dup), // 41 + LINXY(__NR_pipe, sys_pipe), // 42 +- GENXY(__NR_times, sys_times), // 43 ++ GENXY(__NR_times, sys_times), // 43 + // _____(__NR_prof, sys_prof), // 44 + + GENX_(__NR_brk, sys_brk), // 45 +@@ -1355,7 +1355,7 @@ const SyscallTableEntry ML_(syscall_tabl + + // _____(__NR_rt_sigpending, sys_rt_sigpending), // 175 + LINXY(__NR_rt_sigtimedwait, sys_rt_sigtimedwait), // 176 +-// _____(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo), // 177 ++ LINXY(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo), // 177 + // _____(__NR_rt_sigsuspend, sys_rt_sigsuspend), // 178 + GENXY(__NR_pread64, sys_pread64), // 179 + +@@ -1507,7 +1507,11 @@ const SyscallTableEntry ML_(syscall_tabl + LINXY(__NR_epoll_create1, sys_epoll_create1), // 315 + // (__NR_dup3, sys_ni_syscall) // 316 + LINXY(__NR_pipe2, sys_pipe2), // 317 +- LINX_(__NR_inotify_init1, sys_inotify_init1) // 318 ++ LINXY(__NR_inotify_init1, sys_inotify_init1), // 318 ++ LINXY(__NR_perf_counter_open, sys_perf_counter_open) // 319 ++ // (__NR_preadv, sys_ni_syscall) // 320 ++ // (__NR_pwritev, sys_ni_syscall) // 321 ++ // (__NR_rt_tgsigqueueinfo, sys_ni_syscall) // 322 + }; + + const UInt ML_(syscall_table_size) = +--- valgrind/coregrind/m_syswrap/syswrap-x86-linux.c 2009-10-27 21:31:49.854432906 +0100 ++++ valgrind/coregrind/m_syswrap/syswrap-x86-linux.c 2009-10-27 21:25:05.000000000 +0100 +@@ -2254,7 +2254,12 @@ const SyscallTableEntry ML_(syscall_tabl + + // (__NR_dup3, sys_ni_syscall) // 330 + LINXY(__NR_pipe2, sys_pipe2), // 331 +- LINX_(__NR_inotify_init1, sys_inotify_init1) // 332 ++ LINXY(__NR_inotify_init1, sys_inotify_init1), // 332 ++ // (__NR_preadv, sys_ni_syscall) // 333 ++ // (__NR_pwritev, sys_ni_syscall) // 334 ++ ++ // (__NR_rt_tgsigqueueinfo, sys_ni_syscall) // 335 ++ LINXY(__NR_perf_counter_open, sys_perf_counter_open) // 336 + }; + + const UInt ML_(syscall_table_size) = +--- valgrind/include/vki/vki-linux.h 2009-08-19 15:37:07.000000000 +0200 ++++ valgrind/include/vki/vki-linux.h 2009-10-27 21:50:13.000000000 +0100 +@@ -2570,6 +2570,57 @@ struct vki_iwreq + union vki_iwreq_data u; + }; + ++/*--------------------------------------------------------------------*/ ++// From linux-2.6.31.5/include/linux/perf_counter.h ++/*--------------------------------------------------------------------*/ ++ ++struct vki_perf_counter_attr { ++ ++ /* ++ * Major type: hardware/software/tracepoint/etc. ++ */ ++ __vki_u32 type; ++ ++ /* ++ * Size of the attr structure, for fwd/bwd compat. ++ */ ++ __vki_u32 size; ++ ++ /* ++ * Type specific configuration information. ++ */ ++ __vki_u64 config; ++ ++ union { ++ __vki_u64 sample_period; ++ __vki_u64 sample_freq; ++ }; ++ ++ __vki_u64 sample_type; ++ __vki_u64 read_format; ++ ++ __vki_u64 disabled : 1, /* off by default */ ++ inherit : 1, /* children inherit it */ ++ pinned : 1, /* must always be on PMU */ ++ exclusive : 1, /* only group on PMU */ ++ exclude_user : 1, /* don't count user */ ++ exclude_kernel : 1, /* ditto kernel */ ++ exclude_hv : 1, /* ditto hypervisor */ ++ exclude_idle : 1, /* don't count when idle */ ++ mmap : 1, /* include mmap data */ ++ comm : 1, /* include comm data */ ++ freq : 1, /* use freq, not period */ ++ inherit_stat : 1, /* per task counts */ ++ enable_on_exec : 1, /* next exec enables */ ++ task : 1, /* trace fork/exit */ ++ ++ __reserved_1 : 50; ++ ++ __vki_u32 wakeup_events; /* wakeup every n events */ ++ __vki_u32 __reserved_2; ++ ++ __vki_u64 __reserved_3; ++}; + + #endif // __VKI_LINUX_H + +--- valgrind/include/vki/vki-scnums-amd64-linux.h 2009-08-19 15:37:07.000000000 +0200 ++++ valgrind/include/vki/vki-scnums-amd64-linux.h 2009-10-27 21:50:13.000000000 +0100 +@@ -376,6 +376,10 @@ + #define __NR_dup3 292 + #define __NR_pipe2 293 + #define __NR_inotify_init1 294 ++#define __NR_preadv 295 ++#define __NR_pwritev 296 ++#define __NR_rt_tgsigqueueinfo 297 ++#define __NR_perf_counter_open 298 + + #endif /* __VKI_SCNUMS_AMD64_LINUX_H */ + +--- valgrind/include/vki/vki-scnums-ppc32-linux.h 2009-08-19 15:37:07.000000000 +0200 ++++ valgrind/include/vki/vki-scnums-ppc32-linux.h 2009-10-27 21:50:13.000000000 +0100 +@@ -361,6 +361,10 @@ + #define __NR_dup3 316 + #define __NR_pipe2 317 + #define __NR_inotify_init1 318 ++#define __NR_perf_counter_open 319 ++#define __NR_preadv 320 ++#define __NR_pwritev 321 ++#define __NR_rt_tgsigqueueinfo 322 + + #endif /* __VKI_SCNUMS_PPC32_LINUX_H */ + +--- valgrind/include/vki/vki-scnums-ppc64-linux.h 2009-08-19 15:37:07.000000000 +0200 ++++ valgrind/include/vki/vki-scnums-ppc64-linux.h 2009-10-27 21:50:13.000000000 +0100 +@@ -353,6 +353,10 @@ + #define __NR_dup3 316 + #define __NR_pipe2 317 + #define __NR_inotify_init1 318 ++#define __NR_perf_counter_open 319 ++#define __NR_preadv 320 ++#define __NR_pwritev 321 ++#define __NR_rt_tgsigqueueinfo 322 + + #endif /* __VKI_SCNUMS_PPC64_LINUX_H */ + +diff -upr valgrind/include/vki/vki-scnums-x86-linux.h valgrind/include/vki/vki-scnums-x86-linux.h +--- valgrind/include/vki/vki-scnums-x86-linux.h 2009-08-19 15:37:07.000000000 +0200 ++++ valgrind/include/vki/vki-scnums-x86-linux.h 2009-10-27 21:50:13.000000000 +0100 +@@ -367,6 +367,10 @@ + #define __NR_dup3 330 + #define __NR_pipe2 331 + #define __NR_inotify_init1 332 ++#define __NR_preadv 333 ++#define __NR_pwritev 334 ++#define __NR_rt_tgsigqueueinfo 335 ++#define __NR_perf_counter_open 336 + + #endif /* __VKI_SCNUMS_X86_LINUX_H */ + diff --git a/valgrind.spec b/valgrind.spec index f44051d..e63a8c3 100644 --- a/valgrind.spec +++ b/valgrind.spec @@ -1,7 +1,7 @@ Summary: Tool for finding memory management bugs in programs Name: valgrind Version: 3.5.0 -Release: 6 +Release: 7 Epoch: 1 Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2 Patch1: valgrind-3.5.0-cachegrind-improvements.patch @@ -16,6 +16,8 @@ Patch9: valgrind-3.5.0-helgrind-race-supp.patch Patch10: valgrind-3.5.0-ppc-tests.patch Patch11: valgrind-3.5.0-amd64-loopnel.patch Patch12: valgrind-3.5.0-ppc-dwarf3.patch +Patch13: valgrind-3.5.0-amd64-adcsbb.patch +Patch14: valgrind-3.5.0-syscalls.patch License: GPLv2 URL: http://www.valgrind.org/ Group: Development/Debuggers @@ -81,6 +83,8 @@ or valgrind plugins. %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 +%patch14 -p1 %build %ifarch x86_64 ppc64 @@ -166,6 +170,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/* %changelog +* Tue Oct 27 2009 Jakub Jelinek 3.5.0-7 +- add perf_counter_open syscall support (#531271) +- add handling of some sbb/adc insn forms on x86_64 (KDE#211410) + * Fri Oct 23 2009 Jakub Jelinek 3.5.0-6 - ppc and ppc64 fixes