aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-10-27 12:09:04 +0200
committerAleksandr Nogikh <wp32pw@gmail.com>2021-10-27 14:42:09 +0200
commitbe531bb42381b245eed805e49fd889d1c2118c76 (patch)
tree3a43d9c2cc0de7ce706d53993f7a1bc564f968a9 /sys
parent1da74a1ab16f37080246570b21fe152719bcfdd4 (diff)
sys/syz-sysgen: restore detection of unsupported kvm syscalls
The workaround for broken kvm kernel headers broke detection of unsupported syscalls. The diagnostic check checks that a syscall is unsupported on all arches, but arm/riscv kvm syscalls were not noted as unsupported (we dropped them before giving them to the compiler). As the result it looked like kvm syscalls are not unsupported on arm/riscv, and we did not produce the diagnostic.
Diffstat (limited to 'sys')
-rw-r--r--sys/syz-sysgen/sysgen.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/syz-sysgen/sysgen.go b/sys/syz-sysgen/sysgen.go
index e4791b3eb..4099bfb51 100644
--- a/sys/syz-sysgen/sysgen.go
+++ b/sys/syz-sysgen/sysgen.go
@@ -176,8 +176,19 @@ func processJob(job *Job, descriptions *ast.Description, constFile *compiler.Con
// is not supported yet but might be in the future.
// Note: syz-extract also ignores this file for arm and riscv64.
top = descriptions.Filter(func(n ast.Node) bool {
- pos, _, _ := n.Info()
- return !strings.HasSuffix(pos.File, "_kvm.txt")
+ pos, typ, name := n.Info()
+ if !strings.HasSuffix(pos.File, "_kvm.txt") {
+ return true
+ }
+ switch n.(type) {
+ case *ast.Resource, *ast.Struct, *ast.Call, *ast.TypeDef:
+ // Mimic what pkg/compiler would do with unsupported entries.
+ // This is required to keep the unsupported diagnostic below working
+ // for kvm entries, otherwise it will not think that kvm entries
+ // are not supported on all architectures.
+ job.Unsupported[typ+" "+name] = true
+ }
+ return false
})
}
if job.Target.OS == targets.TestOS {