From 1d75fe458f90d0a3dbb1578b88cdb64ae0a37398 Mon Sep 17 00:00:00 2001 From: Cheng-Min Chiang Date: Thu, 13 Aug 2020 19:49:39 -0700 Subject: [PATCH] sys/linux: add descriptions of vga_arbiter Add desciptions for testing /dev/vga_arbiter. Update #533 --- sys/linux/dev_vga_arbiter.txt | 45 +++++++++++++++++++++++++++++ sys/linux/dev_vga_arbiter.txt.const | 5 ++++ sys/linux/sys.txt | 1 - 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 sys/linux/dev_vga_arbiter.txt create mode 100644 sys/linux/dev_vga_arbiter.txt.const diff --git a/sys/linux/dev_vga_arbiter.txt b/sys/linux/dev_vga_arbiter.txt new file mode 100644 index 00000000..779dce5e --- /dev/null +++ b/sys/linux/dev_vga_arbiter.txt @@ -0,0 +1,45 @@ +# Copyright 2020 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include + +resource fd_vga_arbiter[fd] +openat$vga_arbiter(fd const[AT_FDCWD], file ptr[in, string["/dev/vga_arbiter"]], flags flags[open_flags], mode const[0]) fd_vga_arbiter +write$vga_arbiter(fd fd_vga_arbiter, data ptr[in, data_vga_arbiter], len bytesize[data]) + +data_vga_arbiter [ + target_default string["target default"] + unlock_all string["unlock all"] + target vga_arbiter_target_cmd + other vga_arbiter_io_state_cmd +] [varlen] + +vga_arbiter_target_cmd { + prefix stringnoz["target "] + card_id vga_arbiter_card_id + end const[0, int8] +} [packed] + +# We cannot use fmt for the numbers here or else the result string will be too long +vga_arbiter_card_id { + prefix stringnoz["PCI:"] + domain stringnoz[vga_arbiter_pci_numbers] + colon1 stringnoz[":"] + bus stringnoz[vga_arbiter_pci_numbers] + colon2 stringnoz[":"] + dev stringnoz[vga_arbiter_pci_numbers] + dot stringnoz["."] + fn stringnoz[vga_arbiter_pci_numbers] +} [packed] + +vga_arbiter_pci_numbers = "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f" + +vga_arbiter_io_state_cmd { + name stringnoz[vga_arbiter_io_state_cmd_names] + space stringnoz[" "] + io_state stringnoz[vga_arbiter_io_states] + end const[0, int8] +} [packed] + +vga_arbiter_io_state_cmd_names = "lock", "trylock", "unlock", "decodes" +vga_arbiter_io_states = "io", "mem", "io+mem", "none" diff --git a/sys/linux/dev_vga_arbiter.txt.const b/sys/linux/dev_vga_arbiter.txt.const new file mode 100644 index 00000000..30259d4b --- /dev/null +++ b/sys/linux/dev_vga_arbiter.txt.const @@ -0,0 +1,5 @@ +# Code generated by syz-sysgen. DO NOT EDIT. +arches = 386, amd64, arm, arm64, mips64le, ppc64le, riscv64, s390x +AT_FDCWD = 18446744073709551516 +__NR_openat = 56, 386:295, amd64:257, arm:322, mips64le:5247, ppc64le:286, s390x:288 +__NR_write = 4, amd64:1, arm64:riscv64:64, mips64le:5001 diff --git a/sys/linux/sys.txt b/sys/linux/sys.txt index f8ea6737..67c8bd28 100644 --- a/sys/linux/sys.txt +++ b/sys/linux/sys.txt @@ -552,7 +552,6 @@ syz_open_dev$media(dev ptr[in, string["/dev/media#"]], id intptr, flags flags[op openat$null(fd const[AT_FDCWD], file ptr[in, string["/dev/null"]], flags flags[open_flags], mode const[0]) fd openat$zero(fd const[AT_FDCWD], file ptr[in, string["/dev/zero"]], flags flags[open_flags], mode const[0]) fd openat$full(fd const[AT_FDCWD], file ptr[in, string["/dev/full"]], flags flags[open_flags], mode const[0]) fd -openat$vga_arbiter(fd const[AT_FDCWD], file ptr[in, string["/dev/vga_arbiter"]], flags flags[open_flags], mode const[0]) fd openat$qat_adf_ctl(fd const[AT_FDCWD], file ptr[in, string["/dev/qat_adf_ctl"]], flags flags[open_flags], mode const[0]) fd openat$irnet(fd const[AT_FDCWD], file ptr[in, string["/dev/irnet"]], flags flags[open_flags], mode const[0]) fd openat$hwrng(fd const[AT_FDCWD], file ptr[in, string["/dev/hwrng"]], flags flags[open_flags], mode const[0]) fd