arm-hyp haskell: resolveVAddr needs to mask

LargePages and SuperSections are not duplicated as in normal ARM, so we need
to mask to get to the base address.
This commit is contained in:
Gerwin Klein 2017-04-22 19:10:02 +10:00 committed by Alejandro Gomez-Londono
parent cbc528beba
commit 424df79856
1 changed files with 3 additions and 3 deletions

View File

@ -1168,7 +1168,7 @@ FIXME ARMHYP TODO clean up, fix for ifdef for ARM arch-parametrise
> ArchInvocationLabel ARMPageUnify_Instruction -> Unify
> _ -> error "Should never be called without a flush invocation"
> pageBase :: VPtr -> VMPageSize -> VPtr
> pageBase :: (Num a, Bits a) => a -> VMPageSize -> a
> pageBase vaddr size = vaddr .&. (complement $ mask (pageBitsForSize size))
> resolveVAddr :: PPtr PDE -> VPtr -> Kernel (Maybe (VMPageSize, PAddr))
@ -1178,7 +1178,7 @@ FIXME ARMHYP TODO clean up, fix for ifdef for ARM arch-parametrise
> case pde of
#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT
> SectionPDE frame _ _ _ -> return $ Just (ARMSection, frame)
> SuperSectionPDE frame _ _ _ -> return $ Just (ARMSuperSection, frame)
> SuperSectionPDE frame _ _ _ -> return $ Just (ARMSuperSection, pageBase frame ARMSuperSection)
> PageTablePDE table -> do
#else
> SectionPDE frame _ _ _ _ _ _ -> return $ Just (ARMSection, frame)
@ -1190,7 +1190,7 @@ FIXME ARMHYP TODO clean up, fix for ifdef for ARM arch-parametrise
> pte <- getObject pteSlot
> case pte of
#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT
> LargePagePTE frame _ _ _ -> return $ Just (ARMLargePage, frame)
> LargePagePTE frame _ _ _ -> return $ Just (ARMLargePage, pageBase frame ARMLargePage)
> SmallPagePTE frame _ _ _ -> return $ Just (ARMSmallPage, frame)
#else
> LargePagePTE frame _ _ _ _ -> return $ Just (ARMLargePage, frame)