aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ifuzz/x86
Commit message (Collapse)AuthorAgeFilesLines
* all: remove unused nolint directivesDmitry Vyukov2026-01-021-1/+1
|
* all: use any instead of interface{}Dmitry Vyukov2025-12-221-1/+1
| | | | Any is the preferred over interface{} now in Go.
* all: apply linter auto fixesTaras Madan2025-07-172-20/+28
| | | | ./tools/syz-env bin/golangci-lint run ./... --fix
* pkg/ifuzz: fix generate/buildDmitry Vyukov2025-04-032-5/+11
| | | | | | | Currently the commands we have in go:generate first create an empty file and then write final contents. This breaks any parallel builds of the source. Even running go generate ./... does not work. Write output files atomically.
* pkg/ifuzz/x86: fix code generatorDmitry Vyukov2025-04-022-10/+10
| | | | | | The generator does not run and generates broken code. It looks like the generated file was edited manully. Fix that.
* pkg/ifuzz: fix instruction decoding on x86Alexander Potapenko2024-04-301-0/+4
| | | | | | | | | | | | | | | | | | Decode() was only checking full opcode byte(s), whereas certain instructions are encoded in a way that some bits of the opcode are stored in the ModR/M byte. In particular, e.g. there is a variation of MUL encoded as: F7 /4 (which means the opcode byte is F7, and MODRM.reg is 4), and a variation of TEST encoded as: F7 /0 (opcode byte is also F7, and MODRM.reg is 0), which were previously indistinguishable (the decoder would incorrectly treat the MUL instruction as a TEST instruction if there were at least four extra bytes following it). Make sure to calculate and check the MODRM.reg value if insn.Reg is set to a non-negative value.
* all: go fix everythingDmitry Vyukov2024-04-262-2/+0
|
* all: use errors.As instead of .(type)Taras Madan2023-07-241-5/+8
|
* all: use special placeholder for errorsTaras Madan2023-07-241-4/+4
|
* pkg/ifuzz/iset: make generateInt() available for all archesAlexey Kardashevskiy2021-07-192-57/+11
| | | | | | | The helper generates random int values including addresses from interesting memory regions. This seems useful for all arches, share it. Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>
* pkg: update generated files to go 1.17Alexey Kardashevskiy2021-07-072-0/+2
| | | | | | | | | | | "make generate" produces this diff when go 1.17 (go1.17-c95464f0ea3f==upstream) is used. Seems compatible with >=1.16. https://github.com/golang/go/commit/4d2d89ff42ca documents the syntax. https://github.com/golang/go/commit/eeadce2d8713 enforces "ignore" for unsatisfiable tags hence the pkg/csource/gen.go change. Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>
* all: use tool.Failf instead of local functionsDmitry Vyukov2020-12-251-8/+4
|
* pkg/ifuzz/iset: rename ifuzzimpl to isetDmitry Vyukov2020-11-215-79/+79
| | | | | | | | | ifuzzimpl is too lenghty and too clumsy on my taste (nm/vmimpl worked better b/c it's shorter and used less). I've tried to come up with something shorter and nicer. We could use "insn" as a common name for "instruction" in ifuzz, but it's a commonly used name already so would cause lots of conflicts. "iset" is somewhat descriptive, short and nice.
* pkg/ifuzz/ifuzzimpl: move IsCompatible from x86Dmitry Vyukov2020-11-212-17/+1
| | | | We now can implement IsCompatible portably.
* pkg/ifuzz/x86: deduplicate modeInsns population logicDmitry Vyukov2020-11-211-26/+8
| | | | | It's currently duplicated in x86 and powerpc. Move to ifuzzimpl.
* pkg/ifuzz/x86: simplify pseudo-instruction intializationDmitry Vyukov2020-11-212-32/+30
|
* pkg/ifuzz/x86: don't use X86 suffix for typesDmitry Vyukov2020-11-213-6/+6
| | | | x86.InsnSetX86 is excessive. Everything in x86 package is x86-ish already.
* pkg/ifuzz/ifuzzimpl: simplify Insn interfaceDmitry Vyukov2020-11-212-16/+4
| | | | | We don't need GetMode, GetPriv, IsCompatible in Insn interface. Replace GetName and GetPseudo with single Info method.
* pkg/ifuzz: invert ifuzz and ifuzzimplDmitry Vyukov2020-11-215-103/+97
| | | | | | | | | ifuzzimpl imports the public interface package ifuzz and prog package needs to import ifuzzimpl (implementation guts that nobody outside of ifuzz should care about). This is not right. Invert everything so that prog package only needs to import ifuzz and ifuzz imports ifuzzimpl.
* pkg/ifuzz: reorganize files to allow other architecturesAlexey Kardashevskiy2020-11-209-0/+80292
At the moment ifuzz only generates x86 instructions. In order to support instruction fuzzing for others (ARM, POWERPC), some separation of the common and arch layers is needed. This adds 2 packages: 1. "x86" where x86 instruction generator goes to 2. "ifuzzimpl which contains some common code. The goal was to keep changes to the rand.go to the minimum. The next patch will use this when adding PPC64. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy <aik@linux.ibm.com>