From 41603a26ca2991162f3bd3a29356f326798d8987 Mon Sep 17 00:00:00 2001 From: Adrian Danis Date: Thu, 2 Jun 2016 12:15:46 +1000 Subject: [PATCH] Correct merge of master --- .../arch_include/arm/interfaces/sel4arch.xml | 19 ------------------- .../aarch32/interfaces/sel4arch.xml | 19 +++++++++++++++++++ libsel4/tools/syscall_stub_gen.py | 18 +++++++++++++----- src/arch/arm/32/kernel/vspace.c | 10 ++++++++++ 4 files changed, 42 insertions(+), 24 deletions(-) diff --git a/libsel4/arch_include/arm/interfaces/sel4arch.xml b/libsel4/arch_include/arm/interfaces/sel4arch.xml index a1575aac6..c20bb6eb2 100644 --- a/libsel4/arch_include/arm/interfaces/sel4arch.xml +++ b/libsel4/arch_include/arm/interfaces/sel4arch.xml @@ -77,23 +77,4 @@ - - - - - - - - - - - - - - - - - - - diff --git a/libsel4/sel4_arch_include/aarch32/interfaces/sel4arch.xml b/libsel4/sel4_arch_include/aarch32/interfaces/sel4arch.xml index c896fc579..544ff48ca 100644 --- a/libsel4/sel4_arch_include/aarch32/interfaces/sel4arch.xml +++ b/libsel4/sel4_arch_include/aarch32/interfaces/sel4arch.xml @@ -46,4 +46,23 @@ + + + + + + + + + + + + + + + + + + + diff --git a/libsel4/tools/syscall_stub_gen.py b/libsel4/tools/syscall_stub_gen.py index 494e2325e..72aa21de7 100644 --- a/libsel4/tools/syscall_stub_gen.py +++ b/libsel4/tools/syscall_stub_gen.py @@ -51,12 +51,14 @@ WORD_SIZE_BITS_ARCH = { "ia32": 32, "aarch64": 64, "ia64": 64, - "x86_64": 64 + "x86_64": 64, + "arm_hyp": 32, } MESSAGE_REGISTERS_FOR_ARCH = { "aarch32": 4, "ia32": 2, + "arm_hyp": 4, } WORD_CONST_SUFFIX_BITS = { @@ -233,6 +235,16 @@ def init_data_types(wordsize): def init_arch_types(wordsize): arch_types = { "aarch32" : [ + Type("seL4_ARM_VMAttributes", wordsize, wordsize), + CapType("seL4_ARM_Page", wordsize), + CapType("seL4_ARM_PageTable", wordsize), + CapType("seL4_ARM_PageDirectory", wordsize), + CapType("seL4_ARM_ASIDControl", wordsize), + CapType("seL4_ARM_ASIDPool", wordsize), + StructType("seL4_UserContext", wordsize * 17, wordsize), + ], + + "arm_hyp" : [ Type("seL4_ARM_VMAttributes", wordsize, wordsize), CapType("seL4_ARM_Page", wordsize), CapType("seL4_ARM_PageTable", wordsize), @@ -243,7 +255,6 @@ def init_arch_types(wordsize): CapType("seL4_ARM_IOSpace", wordsize), CapType("seL4_ARM_IOPageTable", wordsize), StructType("seL4_UserContext", wordsize * 17, wordsize), - ], "ia32" : [ @@ -681,9 +692,6 @@ def generate_stub_file(arch, wordsize, input_files, output_file, use_only_ipc_bu """ result = [] - if arch == "arm_hyp": - arch = "aarch32" - # Ensure architecture looks sane. if arch not in WORD_SIZE_BITS_ARCH.keys(): raise Exception("Invalid architecture.") diff --git a/src/arch/arm/32/kernel/vspace.c b/src/arch/arm/32/kernel/vspace.c index 86e8c5ae6..90aae68f7 100644 --- a/src/arch/arm/32/kernel/vspace.c +++ b/src/arch/arm/32/kernel/vspace.c @@ -3029,12 +3029,22 @@ readWordFromVSpace(pde_t *pd, word_t vaddr) offset = vaddr & MASK(ARMSectionBits); } else { ptSlot = lookupPTSlot(pd, vaddr); +#ifdef ARM_HYP + if (ptSlot.status == EXCEPTION_NONE && pte_ptr_get_pteType(ptSlot.ptSlot) == pte_pte_small) { + paddr = pte_pte_small_ptr_get_address(ptSlot.ptSlot); + if (pte_pte_small_ptr_get_contiguous_hint(ptSlot.ptSlot)) { + offset = vaddr & MASK(ARMLargePageBits); + } else { + offset = vaddr & MASK(ARMSmallPageBits); + } +#else if (ptSlot.status == EXCEPTION_NONE && pte_ptr_get_pteType(ptSlot.ptSlot) == pte_pte_small) { paddr = pte_pte_small_ptr_get_address(ptSlot.ptSlot); offset = vaddr & MASK(ARMSmallPageBits); } else if (ptSlot.status == EXCEPTION_NONE && pte_ptr_get_pteType(ptSlot.ptSlot) == pte_pte_large) { paddr = pte_pte_large_ptr_get_address(ptSlot.ptSlot); offset = vaddr & MASK(ARMLargePageBits); +#endif } else { ret.status = EXCEPTION_LOOKUP_FAULT; return ret;