aboutsummaryrefslogtreecommitdiffstats
path: root/vm
Commit message (Collapse)AuthorAgeFilesLines
...
* vm: dedup VM count restriction in debug modeDmitry Vyukov2024-11-259-38/+12
| | | | | | | Move the VM count restriction logic info vm package. This avoids lots of duplication, makes it supported for VM types that failed to do this, and allows to unify more VM count logic in future.
* syz-manager: add pause functionDmitry Vyukov2024-11-082-4/+76
| | | | | | | | | The pause function is useful to make manager stop consuming CPU for some time, e.g. when it runs on a shared machine, and a user wants to use CPU for something else. Previously one would need to kill the manager process and restart later to achieve this, but the restart is costly, and aborts all bug reproductions.
* pkg/manager: set more http fields before calling ServeDmitry Vyukov2024-11-071-1/+3
| | | | | | | | | Pools and ReproLoop and always created on start, so there is no need to support lazy set for them. It only complicates code and makes it harder to reason about. Also introduce vm.Dispatcher as an alias to dispatcher.Pool, as it's the only specialization we use in the project.
* vm: simplify codeDmitry Vyukov2024-11-071-5/+1
|
* pkg/build: add build command for starnixLaura Peskin2024-10-301-2/+2
| | | | Co-authored-by: eep@google.com
* vm/qemu: do not pass `-accel tcg,thread=multi` on arm64Alexander Potapenko2024-10-221-1/+1
| | | | | | Even though we are yet to see arm64 hosts on which `-accel kvm` works properly, require the users to explicitly set request TCG in their manager configs.
* vm/starnix: exclude netlink logsCameron Finucane2024-10-071-1/+2
| | | | | They are very noisy and can cause important crash information to run off the end of the buffer; this is a temporary fix to avoid that.
* vm/starnix: avoid hang on vm shutdownCameron Finucane2024-10-071-35/+16
| | | | | | | | | - Extraneous references to the `ffx log` pipe are closed, allowing the EOF from the subprocess to be propagated properly. - The SSH bridge into the Starnix sshd is now properly shut down when the instance is closed, avoiding a zombie process. - Some of the starnix code has been updated to be in line with a refactor that took place in other VM types.
* vm/starnix: isolate ffx per starnix vm poolCameron Finucane2024-10-071-65/+107
| | | | | This allows for multiple starnix VM pools to exist simultaneously without conflict, and avoids any unintential global state.
* vm/qemu: increase max number of VMsDmitry Vyukov2024-09-271-2/+2
| | | | I want to create more than 128.
* vm/qemu: enable sve128 on ARM instancesAlexander Potapenko2024-09-251-1/+1
| | | | This seems to be an acceptable compromise between speed and coverage
* all: follow new linter recommendationsTaras Madan2024-09-101-1/+1
|
* all: regenerate mocksTaras Madan2024-09-102-2/+2
| | | | ./tools/syz-env make generate
* vm/qemu: extend error messagesDmitry Vyukov2024-08-161-3/+3
| | | | | Include VM output into snapshot error messages. Otherwise it's hard to understand what happened.
* vm/dispatcher: support updating the default functionAleksandr Nogikh2024-08-132-1/+60
| | | | Stop all default VMs and restart them with the new handler.
* all: pkg/gcs supports AppEngine contextTaras Madan2024-08-121-1/+2
|
* vm/dispatcher: add TestPoolStress()Aleksandr Nogikh2024-08-021-0/+34
| | | | | The test should aid the Go race detector to detect bugs in the dispatcher.Pool code.
* vm/dispatcher: fix data racesAleksandr Nogikh2024-08-021-11/+9
| | | | | | | | It was possible for poolInstance.reserve() and free() to race with instance restart in Pool.Loop(). Add more locking to poolInstance. Remove locks in one case where it was excessive.
* vm/qemu: use the maximum available CPU on ARM64Alexander Potapenko2024-07-291-4/+7
| | | | | | This is needed to have access to newer features like nested virtualization. Because those features slow down CPU emulation in QEMU, disable SVE and pointer authentication, which are of less importance for us now.
* vm/qemu: use the maximum available VGIC on arm64Alexander Potapenko2024-07-291-1/+1
| | | | | Newer virtual IRQ controllers provide more features, so this should hopefully increase the coverage.
* vm/dispatcher: move boot duration calculation to vmAleksandr Nogikh2024-07-261-0/+5
| | | | | This should be calculated in dispatcher.Pool that actually does boot VMs.
* all: add qemu snapshotting modeDmitry Vyukov2024-07-253-0/+299
|
* vm/qemu: refactor boot functionDmitry Vyukov2024-07-251-49/+56
| | | | | More qemu arguments building into separate function to prevent linter error about max function length in next commits.
* vm: add snapshot interfaceDmitry Vyukov2024-07-252-5/+47
|
* pkg/stat: rename package name to singular formDmitry Vyukov2024-07-241-4/+4
| | | | | | | | Go package names should generally be singular form: https://go.dev/blog/package-names https://rakyll.org/style-packages https://groups.google.com/g/golang-nuts/c/buBwLar1gNw
* pkg/stats: rename Create to NewDmitry Vyukov2024-07-241-1/+1
| | | | | | New is more idiomatic name and is shorter (lines where stats.Create is used are usually long, so making them a bit shorter is good).
* vm: check preemption string only for gce instancesDmitry Vyukov2024-07-234-4/+14
| | | | Fixes #5028
* vmimpl: refactor VM type registrationDmitry Vyukov2024-07-2313-21/+48
| | | | | | | | | Pass Type struct directly during registration. This allows to add additional optional parameters to VM types without changing all VM implementations. We we will need to add SupportsSnapshots flag and one flag to resolve #5028. With this change it will be possible to add "SupportsSnapshots: true" to just one VM type implemenetation.
* vm/dispatcher: make the test more deterministicAleksandr Nogikh2024-07-221-12/+12
| | | | | | | | | There was a race between starting the job and resetting the reserved VM count. Rewrite the test to let it run regardless of the thread interleaving. Closes #5090.
* vm/vmimpl: don't wait commands that have not failedDmitry Vyukov2024-07-111-8/+10
| | | | | | | | | The sleep in Multiplex is unconditional and it sleeps idle even for commands that has nothting to do with executor, and for executor in other modes that has nothing to do with fuzzing. Since the original reason for the sleep was related to failing executor, sleep only when the command fails. This allows to at least run successful commands fast.
* all: transition to instance.PoolAleksandr Nogikh2024-07-111-4/+19
| | | | | Rely on instance.Pool to perform fuzzing and do bug reproductions. Extract the reproduction queue logic to separate testable class.
* vm/dispatcher: introduce a generic instance poolAleksandr Nogikh2024-07-113-0/+446
| | | | | | | The pool operates on a low level and assumes that there's one default activity (=fuzzing) that is performed by the VMs and that there are also occasional non-default activities that must be performed by some VMs (=bug reproduction).
* vm: make Instance implement io.CloserAleksandr Nogikh2024-07-1114-19/+36
| | | | It's better to follow standard interfaces.
* vm: export Index() from InstanceAleksandr Nogikh2024-07-111-0/+4
|
* vm/qemu: don't log qmp on level 1Dmitry Vyukov2024-07-111-1/+1
| | | | | If qmp is used all the time for snapshotting, it produces tons of uniniteresting logs at level 1 (manager web UI).
* vm/qemu: better handle qmp errorsDmitry Vyukov2024-07-081-2/+14
| | | | | | Sometimes qemu just returns an "Error: ..." string in reply instead of returning an error. Handle these cases. Also log all qmp commands in debug mode.
* vm/gce: use vmimpl.Multiplex()Aleksandr Nogikh2024-07-022-44/+34
| | | | | | It will let us reduce code duplication and use the more appropriate approach to the graceful Run() shutdown - by enforcing a delay between stopping the command and stopping the collection of the console output.
* vm: refactor vm.Multiplex argumentsAleksandr Nogikh2024-07-015-33/+75
| | | | | Introduce a MultiplexConfig structure that contains optional parameters. Include a Scale parameter to control the intended slowdown.
* vmimpl: add a delay after an error from the tracked processAleksandr Nogikh2024-07-013-4/+8
| | | | | It usually means a kernel crash, in which case we want to give the kernel some more time to print the whole coverage report to the console.
* vm/qemu: use the default vmimpl.Multiplex() functionAleksandr Nogikh2024-07-012-32/+10
|
* vm/qemu: remove an unused diagnose fieldAleksandr Nogikh2024-07-011-6/+0
| | | | We never write to the channel.
* vm/gvisor: make stdin address less specialDmitry Vyukov2024-06-251-1/+1
| | | | Make it also "host:port" form ("stdin:0").
* executor: add runner modeDmitry Vyukov2024-06-246-61/+15
| | | | | | | Move all syz-fuzzer logic into syz-executor and remove syz-fuzzer. Also restore syz-runtest functionality in the manager. Update #4917 (sets most signal handlers to SIG_IGN)
* vm/starnix: `-debug` sends kernel and syzkaller logs to stdoutLaura Peskin2024-06-181-1/+5
| | | | | Now these logs go to stdout when syz-manager runs with the `-debug` flag.
* vm/starnix: run without host fuzzer modeLaura Peskin2024-06-181-32/+14
| | | | | | | Removes the SYZ_STARNIX_HACK envvar and runs syz-fuzzer on the VM. Co-authored-by: mvanotti@google.com
* vm/starnix: fuzz over ssh instead of adbLaura Peskin2024-06-181-155/+125
| | | | | | | | | | | fuchsia build instructions: fx set workbench_eng.x64 --with-base \ //src/testing/fuzzing/syzkaller/starnix:syzkaller_starnix \ && fx build Co-authored-by: eep@google.com Co-authored-by: mvanotti@google.com
* Revert "tools/mockery.sh: update to 2.43.2"Taras Madan2024-06-052-2/+2
| | | | This reverts commit 5aa1a7c940d309a8251de3a1fb423ab0cacb6317.
* tools/mockery.sh: update to 2.43.2Taras Madan2024-06-052-2/+2
|
* docs/freebsd: update with notes on slirp-based networkingMark Johnston2024-05-271-1/+1
|
* vm/bhyve: add support for the slirp network backendMark Johnston2024-05-271-30/+63
| | | | | | | bhyve recently grew support for using libslirp (from QEMU) as the networking backend, which is useful for syzkaller since it requires no configuration on the host. This patch causes syz-manager to make use of the slirp backend when no VM bridge is configured.