• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1dnl Run "m4 genfs_contexts" to test
2dnl # $1 = pci prefix
3dnl # $2 = pci ID start (hex)
4dnl # $3 = virtio ID start (decimal)
5pushdef(`cf_pci_block_device', `dnl
6genfscon sysfs $1/0000:00:eval($2 + 0, 16, 2).0/virtio`'eval($3 + 0)`'/block u:object_r:sysfs_devices_block:s0 # vda
7genfscon sysfs $1/0000:00:eval($2 + 1, 16, 2).0/virtio`'eval($3 + 1)`'/block u:object_r:sysfs_devices_block:s0 # vdb
8genfscon sysfs $1/0000:00:eval($2 + 2, 16, 2).0/virtio`'eval($3 + 2)`'/block u:object_r:sysfs_devices_block:s0 # vdc
9genfscon sysfs $1/0000:00:eval($2 + 3, 16, 2).0/virtio`'eval($3 + 3)`'/ndbus0 u:object_r:sysfs_devices_block:s0 # pmem0
10genfscon sysfs $1/0000:00:eval($2 + 4, 16, 2).0/virtio`'eval($3 + 4)`'/ndbus0 u:object_r:sysfs_devices_block:s0 # pmem1
11dnl')dnl
12dnl
13dnl # $1 = pci prefix
14dnl # $2 = pci ID start (hex)
15pushdef(`cf_pci_gpu_device', `dnl
16genfscon sysfs $1/0000:00:eval($2, 16, 2).0/device u:object_r:sysfs_gpu:s0
17genfscon sysfs $1/0000:00:eval($2, 16, 2).0/subsystem_device u:object_r:sysfs_gpu:s0
18genfscon sysfs $1/0000:00:eval($2, 16, 2).0/subsystem_vendor u:object_r:sysfs_gpu:s0
19genfscon sysfs $1/0000:00:eval($2, 16, 2).0/uevent u:object_r:sysfs_gpu:s0
20genfscon sysfs $1/0000:00:eval($2, 16, 2).0/vendor u:object_r:sysfs_gpu:s0
21dnl')dnl
22dnl
23dnl # $1 = rtc prefix
24dnl # $2 = rtc number (decimal)
25dnl # $3 = rtc wakeup offset (decimal)
26pushdef(`cf_rtc_wakeup_alarmtimer', `dnl
27genfscon sysfs $1/wakeup u:object_r:sysfs_wakeup:s0
28genfscon sysfs $1/rtc/rtc$2/wakeup`'eval($3 + 1)`' u:object_r:sysfs_wakeup:s0 # <= 5.5
29genfscon sysfs $1/rtc/rtc$2/alarmtimer.0.auto/wakeup u:object_r:sysfs_wakeup:s0 # >5.5
30dnl')dnl
31dnl
32# crosvm (x86)
33cf_pci_block_device(/devices/pci0000:00, 0xe, 13)
34cf_pci_gpu_device(/devices/pci0000:00, 0x2)
35## find /sys/devices/platform/* -type d -name 'rtc[0-9]' | sed 's,/rtc[0-9],,'
36genfscon sysfs /devices/platform/rtc_cmos/rtc u:object_r:sysfs_rtc:s0
37## find /sys/devices/LNXSYSTM:00/* -type d -name 'wakeup[0-9]*'
38genfscon sysfs /devices/LNXSYSTM:00/LNXPWRBN:00/wakeup u:object_r:sysfs_wakeup:s0
39genfscon sysfs /devices/LNXSYSTM:00/LNXSLPBN:00/wakeup u:object_r:sysfs_wakeup:s0
40genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/wakeup u:object_r:sysfs_wakeup:s0
41genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/wakeup u:object_r:sysfs_wakeup:s0
42genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:01/wakeup u:object_r:sysfs_wakeup:s0
43genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:02/wakeup u:object_r:sysfs_wakeup:s0
44genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:03/wakeup u:object_r:sysfs_wakeup:s0
45genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:04/wakeup u:object_r:sysfs_wakeup:s0
46genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:05/wakeup u:object_r:sysfs_wakeup:s0
47genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:06/wakeup u:object_r:sysfs_wakeup:s0
48genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:07/wakeup u:object_r:sysfs_wakeup:s0
49genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/wakeup u:object_r:sysfs_wakeup:s0
50genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:09/wakeup u:object_r:sysfs_wakeup:s0
51genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:0a/wakeup u:object_r:sysfs_wakeup:s0
52genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:0b/wakeup u:object_r:sysfs_wakeup:s0
53genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:0c/wakeup u:object_r:sysfs_wakeup:s0
54genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:0d/wakeup u:object_r:sysfs_wakeup:s0
55genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:0e/wakeup u:object_r:sysfs_wakeup:s0
56genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:0f/wakeup u:object_r:sysfs_wakeup:s0
57genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:10/wakeup u:object_r:sysfs_wakeup:s0
58genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:11/wakeup u:object_r:sysfs_wakeup:s0
59genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:12/wakeup u:object_r:sysfs_wakeup:s0
60genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:13/wakeup u:object_r:sysfs_wakeup:s0
61genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:14/wakeup u:object_r:sysfs_wakeup:s0
62genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:15/wakeup u:object_r:sysfs_wakeup:s0
63genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:16/wakeup u:object_r:sysfs_wakeup:s0
64genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:17/wakeup u:object_r:sysfs_wakeup:s0
65genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:18/wakeup u:object_r:sysfs_wakeup:s0
66genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:19/wakeup u:object_r:sysfs_wakeup:s0
67genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1a/wakeup u:object_r:sysfs_wakeup:s0
68genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1b/wakeup u:object_r:sysfs_wakeup:s0
69genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/wakeup u:object_r:sysfs_wakeup:s0
70genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1d/wakeup u:object_r:sysfs_wakeup:s0
71genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1e/wakeup u:object_r:sysfs_wakeup:s0
72genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1f/wakeup u:object_r:sysfs_wakeup:s0
73genfscon sysfs /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:20/wakeup u:object_r:sysfs_wakeup:s0
74## find /sys/devices/platform/* -type d -name 'wakeup[0-9]*'
75genfscon sysfs /devices/platform/rtc_cmos/rtc/rtc0/wakeup3 u:object_r:sysfs_wakeup:s0
76genfscon sysfs /devices/platform/rtc_cmos/rtc/rtc0/wakeup4 u:object_r:sysfs_wakeup:s0
77cf_rtc_wakeup_alarmtimer(/devices/platform/rtc_cmos, 0, 1)
78## currently disabled
79#genfscon sysfs /devices/LNXSYSTM:00/GFSH0001:00/wakeup u:object_r:sysfs_wakeup:s0
80#genfscon sysfs /devices/platform/GFSH0001:00/power_supply u:object_r:sysfs_batteryinfo:s0
81#genfscon sysfs /devices/platform/GFSH0001:00/power_supply/ac/wakeup3 u:object_r:sysfs_wakeup:s0
82#genfscon sysfs /devices/platform/GFSH0001:00/power_supply/battery/wakeup4 u:object_r:sysfs_wakeup:s0
83genfscon sysfs /devices/virtual/mac80211_hwsim/hwsim0/net u:object_r:sysfs_net:s0
84genfscon sysfs /devices/virtual/mac80211_hwsim/hwsim1/net u:object_r:sysfs_net:s0
85
86# crosvm (arm64)
87cf_pci_block_device(/devices/platform/10000.pci/pci0000:00, 0xf, 14)
88cf_pci_gpu_device(/devices/platform/10000.pci/pci0000:00, 0x2)
89## find /sys/devices/platform/* -type d -name 'rtc[0-9]' | sed 's,/rtc[0-9],,'
90genfscon sysfs /devices/platform/2000.rtc/rtc u:object_r:sysfs_rtc:s0
91## find /sys/devices/platform/* -type d -name 'wakeup[0-9]'
92## arm64 2000.rtc on crosvm does not currently expose a wakeup node
93
94# qemu (x86)
95cf_pci_block_device(/devices/pci0000:00, 0xf, 13)
96#cf_pci_gpu_device(/devices/pci0000:00, 0x2) - duplicated with crosvm(x86)
97## find /sys/devices/platform/* -type d -name 'rtc[0-9]' | sed 's,/rtc[0-9],,'
98genfscon sysfs /devices/pnp0/00:04/rtc u:object_r:sysfs_rtc:s0
99## find /sys/devices/platform/* -type d -name 'wakeup[0-9][0-9]'
100cf_rtc_wakeup_alarmtimer(/devices/pnp0/00:04, 0, 19)
101
102# qemu (arm64)
103cf_pci_block_device(/devices/platform/4010000000.pcie/pci0000:00, 0xe, 13)
104cf_pci_gpu_device(/devices/platform/4010000000.pcie/pci0000:00, 0x1)
105## find /sys/devices/platform/* -type d -name 'rtc[0-9]' | sed 's,/rtc[0-9],,'
106genfscon sysfs /devices/platform/9010000.pl031/rtc u:object_r:sysfs_rtc:s0
107## find /sys/devices/platform/* -type d -name 'wakeup[0-9]'
108cf_rtc_wakeup_alarmtimer(/devices/platform/9010000.pl031, 0, 0)
109
110# qemu (arm)
111cf_pci_block_device(/devices/platform/3f000000.pcie/pci0000:00, 0xe, 13)
112cf_pci_gpu_device(/devices/platform/3f000000.pcie/pci0000:00, 0x1)
113genfscon sysfs /devices/platform/rtc-test.1/wakeup/wakeup2 u:object_r:sysfs_wakeup:s0
114genfscon sysfs /devices/platform/rtc-test.2/wakeup/wakeup3 u:object_r:sysfs_wakeup:s0
115
116# qemu (riscv64)
117cf_pci_block_device(/devices/platform/soc/30000000.pci/pci0000:00, 0xf, 14)
118cf_pci_gpu_device(/devices/platform/soc/30000000.pci/pci0000:00, 0x1)
119
120# common on all platforms / vm managers
121genfscon sysfs /devices/platform/rtc-test.0/rtc u:object_r:sysfs_rtc:s0
122genfscon sysfs /devices/platform/rtc-test.1/rtc u:object_r:sysfs_rtc:s0
123genfscon sysfs /devices/platform/rtc-test.2/rtc u:object_r:sysfs_rtc:s0
124genfscon sysfs /bus/iio/devices u:object_r:sysfs_iio_devices:s0
125cf_rtc_wakeup_alarmtimer(/devices/platform/rtc-test.1, 2, 0)
126genfscon sysfs /devices/platform/rtc-test.2/wakeup u:object_r:sysfs_wakeup:s0
127dnl
128popdef(`cf_pci_block_device')dnl
129popdef(`cf_pci_gpu_device')dnl
130popdef(`cf_rtc_wakeup_alarmtimer')dnl
131