From 58509c75a2a2d472855da0683c36d7ef2f1a6c97 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 23 Dec 2015 19:58:15 +0100 Subject: prog: remove padding checking So far it has found only false positives. Let's leave this to KMSAN. --- prog/encodingexec.go | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'prog/encodingexec.go') diff --git a/prog/encodingexec.go b/prog/encodingexec.go index 7c75eccc9..3b0d4c28c 100644 --- a/prog/encodingexec.go +++ b/prog/encodingexec.go @@ -14,8 +14,6 @@ const ( ExecInstrEOF = ^uintptr(iota) ExecInstrCopyin ExecInstrCopyout - ExecInstrSetPad - ExecInstrCheckPad ) const ( @@ -59,20 +57,16 @@ func (p *Prog) SerializeForExec() []byte { } return } + if pad, _ := arg1.IsPad(); pad { + return + } if arg1.Kind == ArgData && len(arg1.Data) == 0 { return } - pad, padSize := arg1.IsPad() - if (arg1.Dir == DirIn && !pad) || (arg1.Dir == DirOut && pad) || arg1.Dir == DirInOut { - if pad { - w.write(ExecInstrSetPad) - w.write(physicalAddr(arg) + w.args[arg1].Offset) - w.write(padSize) - } else { - w.write(ExecInstrCopyin) - w.write(physicalAddr(arg) + w.args[arg1].Offset) - w.writeArg(arg1) - } + if arg1.Dir != DirOut { + w.write(ExecInstrCopyin) + w.write(physicalAddr(arg) + w.args[arg1].Offset) + w.writeArg(arg1) instrSeq++ } } @@ -89,16 +83,7 @@ func (p *Prog) SerializeForExec() []byte { instrSeq++ // Generate copyout instructions that persist interesting return values. foreachArg(c, func(arg, base *Arg, _ *[]*Arg) { - pad, padSize := arg.IsPad() - if pad && arg.Dir != DirIn { - instrSeq++ - info := w.args[arg] - w.write(ExecInstrCheckPad) - w.write(physicalAddr(base) + info.Offset) - w.write(padSize) - return - } - if pad || len(arg.Uses) == 0 { + if len(arg.Uses) == 0 { return } switch arg.Kind { -- cgit mrf-deployment