2018-04-09 14:13:54 +00:00
|
|
|
assert_spec x86
|
|
|
|
|
|
|
|
# perform write tests when requested
|
|
|
|
if {[info exists env(GENODE_TEST_WRITE)]} {
|
|
|
|
set test_write 1
|
|
|
|
} else {
|
|
|
|
set test_write 0
|
|
|
|
}
|
|
|
|
|
|
|
|
set is_qemu [have_include power_on/qemu]
|
|
|
|
set is_old [expr [have_spec fiasco] || [have_spec okl4] || [have_spec pistachio]]
|
|
|
|
set is_32bit_x86_hw [expr !$is_qemu && [have_spec 32bit]]
|
|
|
|
|
|
|
|
#
|
|
|
|
# Only run tests on supported platforms
|
|
|
|
#
|
|
|
|
if {[expr [have_spec linux] || $is_32bit_x86_hw || [expr $is_qemu && $is_old]]} {
|
|
|
|
puts "This run script is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Qemu and on certain platforms only use the small set of tests
|
|
|
|
#
|
|
|
|
set small_test [expr $is_qemu || [have_spec foc] || [have_spec sel4]]
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check used commands
|
|
|
|
#
|
2018-06-19 17:55:04 +00:00
|
|
|
set dd [installed_command dd]
|
2018-04-09 14:13:54 +00:00
|
|
|
|
2020-03-04 21:12:20 +00:00
|
|
|
#
|
|
|
|
# Query writeable for policy
|
|
|
|
#
|
|
|
|
proc writeable { } {
|
|
|
|
|
|
|
|
global test_write
|
|
|
|
|
|
|
|
if {$test_write} {
|
|
|
|
return yes
|
|
|
|
} else {
|
|
|
|
return no
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-09 14:13:54 +00:00
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
set build_components {
|
2019-01-03 17:01:49 +00:00
|
|
|
core init timer
|
2022-05-03 12:02:30 +00:00
|
|
|
server/report_rom
|
|
|
|
app/pci_decode
|
|
|
|
drivers/acpi
|
|
|
|
drivers/platform
|
2018-04-09 14:13:54 +00:00
|
|
|
drivers/nvme
|
|
|
|
app/block_tester
|
|
|
|
}
|
|
|
|
|
|
|
|
build $build_components
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create raw image
|
|
|
|
#
|
|
|
|
catch { exec $dd if=/dev/zero of=bin/nvme.raw bs=1M count=0 seek=32768 }
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
append config {
|
|
|
|
<config verbose="no">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
|
|
|
|
|
|
|
<default caps="100"/>
|
|
|
|
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
2022-05-03 12:02:30 +00:00
|
|
|
</start>
|
2018-04-09 14:13:54 +00:00
|
|
|
|
2022-05-03 12:02:30 +00:00
|
|
|
<start name="report_rom">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config>
|
|
|
|
<policy label="pci_decode -> system" report="acpi_drv -> acpi"/>
|
|
|
|
<policy label="platform_drv -> devices" report="pci_decode -> devices"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
2018-04-09 14:13:54 +00:00
|
|
|
|
2022-05-03 12:02:30 +00:00
|
|
|
<start name="acpi_drv" caps="350">
|
2020-03-04 21:12:20 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2022-05-03 12:02:30 +00:00
|
|
|
<route>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="RM"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="pci_decode" caps="350">
|
2022-11-18 13:11:38 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2022-05-03 12:02:30 +00:00
|
|
|
<route>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<service name="ROM" label="system"> <child name="report_rom"/> </service>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="RM"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="platform_drv" caps="100" managing_system="yes">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Platform"/>
|
|
|
|
</provides>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="devices"> <child name="report_rom"/> </service>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<service name="IRQ"> <parent/> </service>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
|
|
|
<service name="IO_PORT"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
2022-10-10 13:17:55 +00:00
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
2022-05-03 12:02:30 +00:00
|
|
|
</route>
|
|
|
|
<config>
|
|
|
|
<report devices="yes"/>
|
|
|
|
<policy label="nvme_drv -> " info="yes"> <pci class="NVME"/> </policy>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nvme_drv">
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
2018-04-09 14:13:54 +00:00
|
|
|
<provides> <service name="Block"/> </provides>
|
|
|
|
<config>
|
2020-03-04 21:12:20 +00:00
|
|
|
<policy label_prefix="block_tester" writeable="} [writeable] {"/>
|
2018-04-09 14:13:54 +00:00
|
|
|
</config>
|
2021-11-02 10:54:31 +00:00
|
|
|
<route>
|
|
|
|
<service name="Platform"><child name="platform_drv"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
</route>
|
2018-04-09 14:13:54 +00:00
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="block_tester" caps="200">
|
|
|
|
<resource name="RAM" quantum="64M"/>
|
|
|
|
<config verbose="no" report="no" log="yes" stop_on_error="no">
|
|
|
|
<tests>}
|
|
|
|
|
|
|
|
append_if $small_test config {
|
2019-05-07 14:37:20 +00:00
|
|
|
<sequential length="256M" size="64K"/>
|
2018-04-09 14:13:54 +00:00
|
|
|
<random length="256M" size="64K" seed="0xdeadbeef"/>}
|
|
|
|
|
|
|
|
append_if [expr !$small_test] config {
|
2019-05-07 14:37:20 +00:00
|
|
|
<sequential length="1G" size="4K" batch="128"/>
|
|
|
|
<sequential length="1G" size="8K" batch="128"/>
|
|
|
|
<sequential length="1G" size="64K"/>
|
|
|
|
<sequential length="3G" size="1M" batch="128"/>
|
|
|
|
<random length="1G" size="16K" seed="0xdeadbeef"/>
|
|
|
|
<random length="3G" size="512K" seed="0xc0ffee"/>
|
2018-04-09 14:13:54 +00:00
|
|
|
<ping_pong length="1G" size="16K"/>}
|
|
|
|
|
|
|
|
append_if $test_write config {
|
2019-05-07 14:37:20 +00:00
|
|
|
<sequential length="256M" size="64K" batch="128" write="yes"/>
|
|
|
|
<replay batch="128">
|
2018-04-09 14:13:54 +00:00
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="2048" count="1016"/>
|
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="2048" count="1016"/>
|
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="2048" count="1016"/>
|
|
|
|
<request type="read" lba="4096" count="1"/>
|
|
|
|
<request type="read" lba="51881" count="1"/>
|
|
|
|
<request type="read" lba="51890" count="1"/>
|
|
|
|
<request type="read" lba="114184" count="14"/>
|
|
|
|
<request type="read" lba="114198" count="1"/>
|
|
|
|
<request type="read" lba="114033" count="127"/>
|
|
|
|
<request type="read" lba="114160" count="24"/>
|
|
|
|
<request type="write" lba="0" count="1"/>
|
|
|
|
<request type="read" lba="12288" count="2048"/>
|
|
|
|
<request type="write" lba="4096" count="2048"/>
|
|
|
|
<request type="write" lba="0" count="1"/>
|
|
|
|
<request type="write" lba="2048" count="1"/>
|
|
|
|
<request type="write" lba="5696" count="1"/>
|
|
|
|
<request type="write" lba="5696" count="1"/>
|
2020-03-04 21:12:20 +00:00
|
|
|
<request type="sync" lba="0" count="1"/>
|
2018-04-09 14:13:54 +00:00
|
|
|
<request type="write" lba="5696" count="1"/>
|
|
|
|
<request type="read" lba="4096" count="1"/>
|
|
|
|
<request type="read" lba="61440" count="16"/>
|
|
|
|
<request type="read" lba="158777" count="127"/>
|
|
|
|
<request type="write" lba="40960" count="2048"/>
|
|
|
|
<request type="write" lba="0" count="1"/>
|
|
|
|
<request type="write" lba="2073" count="1"/>
|
|
|
|
<request type="read" lba="190483" count="64"/>
|
|
|
|
<request type="read" lba="190411" count="53"/>
|
|
|
|
<request type="read" lba="190464" count="11"/>
|
|
|
|
<request type="read" lba="106074" count="64"/>
|
|
|
|
<request type="read" lba="105954" count="56"/>
|
|
|
|
<request type="read" lba="122802" count="24"/>
|
|
|
|
<request type="read" lba="123594" count="64"/>
|
|
|
|
<request type="read" lba="123722" count="64"/>
|
|
|
|
</replay>}
|
|
|
|
append config {
|
|
|
|
</tests>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Block"><child name="nvme_drv"/></service>
|
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
set boot_modules {
|
|
|
|
core init timer nvme_drv
|
2022-05-03 12:02:30 +00:00
|
|
|
pci_decode platform_drv report_rom acpi_drv
|
2018-04-09 14:13:54 +00:00
|
|
|
ld.lib.so block_tester
|
|
|
|
}
|
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2021-05-11 11:56:44 +00:00
|
|
|
append qemu_args " -nographic "
|
2018-04-09 14:13:54 +00:00
|
|
|
append qemu_args " -drive id=nvme0,file=bin/nvme.raw,format=raw,if=none "
|
|
|
|
append qemu_args " -device nvme,drive=nvme0,serial=fnord,id=nvme0n1 "
|
|
|
|
|
|
|
|
run_genode_until {.*child "block_tester" exited with exit value 0.*\n} 300
|
|
|
|
|
|
|
|
exec rm -f bin/nvme.raw
|