genode/repos/ports/run/microcode.run
Christian Helmuth eb94f03416 microcode.run: do not twiddle with MAKEFLAGS
Unconditionally setting MAKEFLAGS to just 's' is not nice because other
flags cannot be passed through the run script. What the script desires
is to disable the automatically enabled '--print-directory' for sub-make
instances when calling tool/port/current by declaring
'--no-print-directory'.
2021-05-05 11:55:27 +02:00

93 lines
2.1 KiB
Plaintext

assert_spec x86
set path_microcode "[exec [genode_dir]/tool/ports/current --no-print-directory microcode_intel]/src/app/intel/intel-ucode"
set microcode_files [glob -nocomplain -dir $path_microcode *-*-*]
if { [get_cmd_switch --autopilot] } {
if {[have_include "power_on/qemu"]} {
puts "\nRun script does not support Qemu.\n"
exit 0
}
# platform_info data about CPUs on other kernels missing
assert_spec nova
if { [have_spec x86_64] } {
copy_file $path_microcode/06-3c-03 bin/micro.code
} else {
copy_file $path_microcode/06-17-06 bin/micro.code
}
}
if {![file exists bin/micro.code]} {
puts "\nMissing bin/micro.code file for your target machine."
puts "Please select for your target CPU the microcode patch located in $path_microcode/xx-xx-xx."
puts "and copy it to bin/micro.code. xx-xx-xx stands for your target CPU, family-model-stepping\n"
exit 0
}
proc apply_microcode { } { return true }
build "core init test/microcode"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="CPU"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="50"/>
<start name="test-microcode">
<resource name="RAM" quantum="10M"/>
</start>
</config>
}
foreach file $microcode_files {
copy_file $file bin/ }
set boot_modules { core ld.lib.so init test-microcode }
set microcode_files [glob -tails -dir bin {[0-9,a-f][0-9,a-f]-[0-9,a-f][0-9,a-f]-[0-9,a-f][0-9,a-f]}]
append boot_modules $microcode_files
build_boot_image $boot_modules
append qemu_args "-nographic "
append qemu_args "-smp 4 "
run_genode_until "microcode check done" 30
# cleanup
if { [get_cmd_switch --autopilot] } {
file delete -force bin/micro.code
foreach file $microcode_files {
file delete bin/$file
}
}
# check results
grep_output {\[init -\> test-microcode}
# no errors please
set filtered_output $output
grep_output {Error: }
compare_output_to {}
# no warnings please
set output $filtered_output
grep_output {Warning: }
compare_output_to {}