Commit 15a7d5ee authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL
Browse files

Add Service_PagesUnsafe64 & PagesSafe64

These use a page block with a 64bit address fields (matching OS_Memory
64). The page list(s) contain the full list of pages involved in the
operation, unlike the 32bit PagesUnsafe / PagesSafe calls, which only
list pages which have 32bit addresses. The kernel issues the service
calls in the following order:

1. Service_PagesUnsafe64
2. Service_PagesUnsafe
3. Service_PagesSafe
4. Service_PagesSafe64

Since only one PagesUnsafe operation can occur at a time, a program
which supports both service calls can safely ignore the PagesUnsafe /
PagesSafe calls if a PagesUnsafe64 operation is in progress (the
PagesUnsafe call will only list a subset of the pages from the
PagesUnsafe64 call). The 32bit PagesUnsafe / PagesSafe calls will be
skipped if no 32bit pages are being replaced.

The addition of these calls means that NeedsSpecificPages DAs (and PMPs)
can now request pages which have large physical addresses.

Note that the page replacement logic now has the restriction that pages
which have 32bit physical addresses can only be replaced by other pages
which have 32bit physical addresses. This is necessary to ensure that
users of the old 32bit APIs see the page replacement take place. However
it does mean that programs will be unable to claim pages of low RAM
which are in use if there are not enough free low RAM pages in the free
pool.

A future optimisation would be to update the service calls so that they
don't list required pages which are in the free pool; if all the
required pages are in the free pool this would allow the service calls
(and FIQ claiming) to be skipped completely.
parent 235668bc
This diff is collapsed.
......@@ -279,12 +279,11 @@ AllocateBackingLevel2 Entry "r0-r8,r11"
; replaced with a substitute.
;
; In: r0 = log addr of page being replaced
; r1 = phys addr of replacement page
; r1,r2 = phys addr of replacement page
;
; Out: r0-r4, r7-r12 can be corrupted
;
UpdateL1PTForPageReplacement ROUT
MOV r2, #0 ; XXX high phys addr
LDR r3, =LL3PT
SUBS r0, r0, r3
MOVCC pc, lr ; address is below L3PT
......
......@@ -303,7 +303,7 @@ ShuffleDoublyMappedRegionForGrow ROUT
EXIT
; R2 = grow amount, bytes
; R3 = 32bit page list to add page numbers to, or null if not needed
; R3 = 64bit page list to add page numbers to, or null if not needed
; R11 = src DANode (free pool)
; R12 = dest DANode
DoTheGrowCommon ROUT
......@@ -355,8 +355,8 @@ DoTheGrowCommon ROUT
ADD r1, r1, #PageSize
TEQ r3, #0
ADD r4, r4, #PageSize
ASSERT MemPageBlock32_PageNum = 0
STRNE r2, [r3], #MemPageBlock32_Size ; store page number and move on
ASSERT MemPageBlock64_PageNum = 0
STRNE r2, [r3], #MemPageBlock64_Size ; store page number and move on
CMP r4, r10 ; have we done all of it?
BNE %BT30 ; [no, so loop]
[ FastCDA_Bulk
......
......@@ -289,7 +289,7 @@ AllocateBackingLevel2 Entry "r0-r8,r11"
; replaced with a substitute.
;
; In: r0 = log addr of page being replaced
; r1 = phys addr of replacement page
; r1,r2 = phys addr of replacement page
;
; Out: r0-r4, r7-r12 can be corrupted
;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment