|
|
@ -1562,7 +1562,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/tests/02_exception_sync_page_fault.rs
|
|
|
|
diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virtual_mem_part3_precomputed_tables/translation_table_tool/arch.rb
|
|
|
|
diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virtual_mem_part3_precomputed_tables/translation_table_tool/arch.rb
|
|
|
|
--- 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb
|
|
|
|
--- 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb
|
|
|
|
+++ 15_virtual_mem_part3_precomputed_tables/translation_table_tool/arch.rb
|
|
|
|
+++ 15_virtual_mem_part3_precomputed_tables/translation_table_tool/arch.rb
|
|
|
|
@@ -0,0 +1,323 @@
|
|
|
|
@@ -0,0 +1,335 @@
|
|
|
|
+# frozen_string_literal: true
|
|
|
|
+# frozen_string_literal: true
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
|
|
+# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
|
@ -1617,9 +1617,6 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virt
|
|
|
|
+# Arch::
|
|
|
|
+# Arch::
|
|
|
|
+#---------------------------------------------------------------------------------------------------
|
|
|
|
+#---------------------------------------------------------------------------------------------------
|
|
|
|
+module Arch
|
|
|
|
+module Arch
|
|
|
|
+FALSE = 0b0
|
|
|
|
|
|
|
|
+TRUE = 0b1
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+#---------------------------------------------------------------------------------------------------
|
|
|
|
+#---------------------------------------------------------------------------------------------------
|
|
|
|
+# Arch::ARMv8
|
|
|
|
+# Arch::ARMv8
|
|
|
|
+#---------------------------------------------------------------------------------------------------
|
|
|
|
+#---------------------------------------------------------------------------------------------------
|
|
|
@ -1642,6 +1639,9 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virt
|
|
|
|
+ module Valid
|
|
|
|
+ module Valid
|
|
|
|
+ OFFSET = 0
|
|
|
|
+ OFFSET = 0
|
|
|
|
+ NUMBITS = 1
|
|
|
|
+ NUMBITS = 1
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ FALSE = 0
|
|
|
|
|
|
|
|
+ TRUE = 1
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ attr_bitfield(:__next_level_table_addr, NextLevelTableAddr::OFFSET, NextLevelTableAddr::NUMBITS)
|
|
|
|
+ attr_bitfield(:__next_level_table_addr, NextLevelTableAddr::OFFSET, NextLevelTableAddr::NUMBITS)
|
|
|
@ -1662,11 +1662,17 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virt
|
|
|
|
+ module UXN
|
|
|
|
+ module UXN
|
|
|
|
+ OFFSET = 54
|
|
|
|
+ OFFSET = 54
|
|
|
|
+ NUMBITS = 1
|
|
|
|
+ NUMBITS = 1
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ FALSE = 0
|
|
|
|
|
|
|
|
+ TRUE = 1
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ module PXN
|
|
|
|
+ module PXN
|
|
|
|
+ OFFSET = 53
|
|
|
|
+ OFFSET = 53
|
|
|
|
+ NUMBITS = 1
|
|
|
|
+ NUMBITS = 1
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ FALSE = 0
|
|
|
|
|
|
|
|
+ TRUE = 1
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ module OutputAddr
|
|
|
|
+ module OutputAddr
|
|
|
@ -1677,6 +1683,9 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virt
|
|
|
|
+ module AF
|
|
|
|
+ module AF
|
|
|
|
+ OFFSET = 10
|
|
|
|
+ OFFSET = 10
|
|
|
|
+ NUMBITS = 1
|
|
|
|
+ NUMBITS = 1
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ FALSE = 0
|
|
|
|
|
|
|
|
+ TRUE = 1
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ module SH
|
|
|
|
+ module SH
|
|
|
@ -1710,6 +1719,9 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virt
|
|
|
|
+ module Valid
|
|
|
|
+ module Valid
|
|
|
|
+ OFFSET = 0
|
|
|
|
+ OFFSET = 0
|
|
|
|
+ NUMBITS = 1
|
|
|
|
+ NUMBITS = 1
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+ FALSE = 0
|
|
|
|
|
|
|
|
+ TRUE = 1
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ attr_bitfield(:uxn, UXN::OFFSET, UXN::NUMBITS)
|
|
|
|
+ attr_bitfield(:uxn, UXN::OFFSET, UXN::NUMBITS)
|
|
|
@ -1821,7 +1833,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virt
|
|
|
|
+ @lvl2.each_with_index do |descriptor, i|
|
|
|
|
+ @lvl2.each_with_index do |descriptor, i|
|
|
|
|
+ descriptor.next_level_table_addr = @lvl3[i].phys_start_addr
|
|
|
|
+ descriptor.next_level_table_addr = @lvl3[i].phys_start_addr
|
|
|
|
+ descriptor.type = Stage1TableDescriptor::Type::TABLE
|
|
|
|
+ descriptor.type = Stage1TableDescriptor::Type::TABLE
|
|
|
|
+ descriptor.valid = TRUE
|
|
|
|
+ descriptor.valid = Stage1TableDescriptor::Valid::TRUE
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+
|
|
|
@ -1864,22 +1876,22 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/translation_table_tool/arch.rb 15_virt
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ desc.pxn = case attributes.execute_never
|
|
|
|
+ desc.pxn = case attributes.execute_never
|
|
|
|
+ when :XN
|
|
|
|
+ when :XN
|
|
|
|
+ TRUE
|
|
|
|
+ Stage1PageDescriptor::PXN::TRUE
|
|
|
|
+ when :X
|
|
|
|
+ when :X
|
|
|
|
+ FALSE
|
|
|
|
+ Stage1PageDescriptor::PXN::FALSE
|
|
|
|
+ else
|
|
|
|
+ else
|
|
|
|
+ raise 'Invalid input'
|
|
|
|
+ raise 'Invalid input'
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ desc.uxn = TRUE
|
|
|
|
+ desc.uxn = Stage1PageDescriptor::UXN::TRUE
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ # rubocop:enable Metrics/MethodLength
|
|
|
|
+ # rubocop:enable Metrics/MethodLength
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ def set_lvl3_entry(desc, output_addr, attributes)
|
|
|
|
+ def set_lvl3_entry(desc, output_addr, attributes)
|
|
|
|
+ desc.output_addr = output_addr
|
|
|
|
+ desc.output_addr = output_addr
|
|
|
|
+ desc.af = TRUE
|
|
|
|
+ desc.af = Stage1PageDescriptor::AF::TRUE
|
|
|
|
+ desc.type = Stage1PageDescriptor::Type::PAGE
|
|
|
|
+ desc.type = Stage1PageDescriptor::Type::PAGE
|
|
|
|
+ desc.valid = TRUE
|
|
|
|
+ desc.valid = Stage1PageDescriptor::Valid::TRUE
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ set_attributes(desc, attributes)
|
|
|
|
+ set_attributes(desc, attributes)
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|