Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144891616
D5741.id14701.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D5741.id14701.diff
View Options
Index: sys/arm64/arm64/machdep.c
===================================================================
--- sys/arm64/arm64/machdep.c
+++ sys/arm64/arm64/machdep.c
@@ -110,6 +110,10 @@
int64_t idcache_line_size; /* The minimum cache line size */
int64_t dczva_line_size; /* The size of cache line the dc zva zeroes */
+void (*pagezero)(void *);
+void pagezero_cache(void *);
+
+
static void
cpu_startup(void *dummy)
{
@@ -817,7 +821,11 @@
/* Same as with above calculations */
dczva_line_shift = DCZID_BS_SIZE(dczid_el0);
dczva_line_size = sizeof(int) << dczva_line_shift;
+
+ /* Change pagezero function */
+ pagezero = pagezero_cache;
}
+
}
void
Index: sys/arm64/arm64/pmap.c
===================================================================
--- sys/arm64/arm64/pmap.c
+++ sys/arm64/arm64/pmap.c
@@ -244,6 +244,11 @@
static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m,
struct spglist *free);
static int pmap_unuse_l3(pmap_t, vm_offset_t, pd_entry_t, struct spglist *);
+void pagezero_simple(void *p);
+void pagezero_cache(void *p);
+
+/* pagezero_simple is default pagezero */
+void (*pagezero)(void *p) = pagezero_simple;
/*
* These load the old table data and store the new value.
@@ -266,13 +271,6 @@
memcpy(d, s, PAGE_SIZE);
}
-static __inline void
-pagezero(void *p)
-{
-
- bzero(p, PAGE_SIZE);
-}
-
#define pmap_l1_index(va) (((va) >> L1_SHIFT) & Ln_ADDR_MASK)
#define pmap_l2_index(va) (((va) >> L2_SHIFT) & Ln_ADDR_MASK)
#define pmap_l3_index(va) (((va) >> L3_SHIFT) & Ln_ADDR_MASK)
Index: sys/arm64/arm64/support.S
===================================================================
--- sys/arm64/arm64/support.S
+++ sys/arm64/arm64/support.S
@@ -33,6 +33,7 @@
__FBSDID("$FreeBSD$");
#include <machine/setjmp.h>
+#include <machine/param.h>
#include "assym.s"
@@ -290,3 +291,38 @@
mov x0, x1
ret
END(longjmp)
+
+/*
+ * pagezero, simple implementation
+ */
+ENTRY(pagezero_simple)
+ add x1, x0, #PAGE_SIZE
+
+1:
+ stp xzr, xzr, [x0], #0x10
+ stp xzr, xzr, [x0], #0x10
+ stp xzr, xzr, [x0], #0x10
+ stp xzr, xzr, [x0], #0x10
+ cmp x0, x1
+ b.ne 1b
+ ret
+
+END(pagezero_simple)
+
+/*
+ * pagezero, cache assisted
+ */
+ENTRY(pagezero_cache)
+ add x1, x0, #PAGE_SIZE
+
+ ldr x2, =dczva_line_size
+ ldr x2, [x2]
+
+1:
+ dc zva, x0
+ add x0, x0, x2
+ cmp x0, x1
+ b.ne 1b
+ ret
+
+END(pagezero_cache)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 14, 8:00 PM (7 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28713304
Default Alt Text
D5741.id14701.diff (2 KB)
Attached To
Mode
D5741: arm64: pagezero improvement
Attached
Detach File
Event Timeline
Log In to Comment