add arm64 support
- add arm64 dependent codes with GICv3 and SVE support - fix bugs based on architecture separation requests
This commit is contained in:
39
kernel/config/config.smp-arm64.in
Normal file
39
kernel/config/config.smp-arm64.in
Normal file
@@ -0,0 +1,39 @@
|
||||
CC = ${CROSS_COMPILE}gcc
|
||||
LD = ${CROSS_COMPILE}ld
|
||||
OBJDUMP = ${CROSS_COMPILE}objdump
|
||||
OBJCOPY = ${CROSS_COMPILE}objcopy
|
||||
|
||||
# ARM64_MEMORY_LAYOUT
|
||||
# ----+-----------+-----------------------
|
||||
# # | page size | virtual memory space
|
||||
# ----+-----------+-----------------------
|
||||
# 1 | 4KB | 39bit [linux-linaro-tracking, upstream kernel]
|
||||
# 2 | 4KB | 48bit
|
||||
# 3 | 64KB | 42bit [CentOS]
|
||||
# 4 | 64KB | 48bit
|
||||
# ----+-----------+-----------------------
|
||||
HOST_DIR=@KDIR@
|
||||
HOST_CONFIG=$(HOST_DIR)/.config
|
||||
HOST_KERNEL_CONFIG_ARM64_64K_PAGES=$(shell grep -E "^CONFIG_ARM64_64K_PAGES=y" $(HOST_CONFIG) | sed 's|CONFIG_ARM64_64K_PAGES=||g')
|
||||
HOST_KERNEL_CONFIG_ARM64_VA_BITS=$(shell grep -E "^CONFIG_ARM64_VA_BITS=" $(HOST_CONFIG) | sed 's|CONFIG_ARM64_VA_BITS=||g')
|
||||
|
||||
ifeq ($(HOST_KERNEL_CONFIG_ARM64_64K_PAGES), y)
|
||||
ifeq ($(HOST_KERNEL_CONFIG_ARM64_VA_BITS), 42)
|
||||
$(info PAGE_SIZE:64KB VA_BITS:42 PGTABLE_LEVELS:2)
|
||||
ARM64_MEMORY_LAYOUT=3
|
||||
else
|
||||
$(info PAGE_SIZE:64KB VA_BITS:48, PGTABLE_LEVELS:3)
|
||||
ARM64_MEMORY_LAYOUT=4
|
||||
endif
|
||||
else
|
||||
ifeq ($(HOST_KERNEL_CONFIG_ARM64_VA_BITS), 39)
|
||||
$(info PAGE_SIZE:4KB VA_BITS:39 PGTABLE_LEVELS:3)
|
||||
ARM64_MEMORY_LAYOUT=1
|
||||
else
|
||||
$(info PAGE_SIZE:4KB VA_BITS:48 PGTABLE_LEVELS:4)
|
||||
ARM64_MEMORY_LAYOUT=2
|
||||
endif
|
||||
endif
|
||||
|
||||
$(info linker script:smp-arm64_type$(ARM64_MEMORY_LAYOUT).lds)
|
||||
LDFLAGS += -T $(SRC)/config/smp-arm64_type$(ARM64_MEMORY_LAYOUT).lds
|
||||
50
kernel/config/smp-arm64_type1.lds
Normal file
50
kernel/config/smp-arm64_type1.lds
Normal file
@@ -0,0 +1,50 @@
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD FLAGS(5);
|
||||
data PT_LOAD FLAGS(7);
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
. = 0xffffffffff800000; /* KERNEL_START */
|
||||
_head = .;
|
||||
|
||||
.text : {
|
||||
*(.text);
|
||||
} : text
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
.data : {
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
} :data
|
||||
.rodata : {
|
||||
*(.rodata .rodata.*)
|
||||
} :data
|
||||
|
||||
.vdso : ALIGN(0x1000) {
|
||||
vdso_page = .;
|
||||
|
||||
. = vdso_page + 0x0000;
|
||||
*(.vdso.data)
|
||||
|
||||
. = vdso_page + 0x1000;
|
||||
*(.vdso.text)
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
} : data = 0xf4
|
||||
|
||||
.bss : {
|
||||
*(.bss .bss.*)
|
||||
}
|
||||
. = ALIGN(0x1000);
|
||||
idmap_page_table = .;
|
||||
. += 0x1000; /* PAGE_SIZE */
|
||||
swapper_page_table = .;
|
||||
. += 0x1000; /* PAGE_SIZE */
|
||||
idmap_pg_dir = .;
|
||||
. += 0x3000; /* IDMAP_DIR_SIZE */
|
||||
swapper_pg_dir = .;
|
||||
. += 0x2000; /* SWAPPER_DIR_SIZE */
|
||||
|
||||
_end = .;
|
||||
}
|
||||
50
kernel/config/smp-arm64_type2.lds
Normal file
50
kernel/config/smp-arm64_type2.lds
Normal file
@@ -0,0 +1,50 @@
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD FLAGS(5);
|
||||
data PT_LOAD FLAGS(7);
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
. = 0xffffffffff800000; /* KERNEL_START */
|
||||
_head = .;
|
||||
|
||||
.text : {
|
||||
*(.text);
|
||||
} : text
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
.data : {
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
} :data
|
||||
.rodata : {
|
||||
*(.rodata .rodata.*)
|
||||
} :data
|
||||
|
||||
.vdso : ALIGN(0x1000) {
|
||||
vdso_page = .;
|
||||
|
||||
. = vdso_page + 0x0000;
|
||||
*(.vdso.data)
|
||||
|
||||
. = vdso_page + 0x1000;
|
||||
*(.vdso.text)
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
} : data = 0xf4
|
||||
|
||||
.bss : {
|
||||
*(.bss .bss.*)
|
||||
}
|
||||
. = ALIGN(0x1000);
|
||||
idmap_page_table = .;
|
||||
. += 0x1000; /* PAGE_SIZE */
|
||||
swapper_page_table = .;
|
||||
. += 0x1000; /* PAGE_SIZE */
|
||||
idmap_pg_dir = .;
|
||||
. += 0x3000; /* IDMAP_DIR_SIZE */
|
||||
swapper_pg_dir = .;
|
||||
. += 0x3000; /* SWAPPER_DIR_SIZE */
|
||||
|
||||
_end = .;
|
||||
}
|
||||
50
kernel/config/smp-arm64_type3.lds
Normal file
50
kernel/config/smp-arm64_type3.lds
Normal file
@@ -0,0 +1,50 @@
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD FLAGS(5);
|
||||
data PT_LOAD FLAGS(7);
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
. = 0xffffffffe0000000; /* KERNEL_START */
|
||||
_head = .;
|
||||
|
||||
.text : {
|
||||
*(.text);
|
||||
} : text
|
||||
|
||||
. = ALIGN(0x10000);
|
||||
.data : {
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
} :data
|
||||
.rodata : {
|
||||
*(.rodata .rodata.*)
|
||||
} :data
|
||||
|
||||
.vdso : ALIGN(0x10000) {
|
||||
vdso_page = .;
|
||||
|
||||
. = vdso_page + 0x00000;
|
||||
*(.vdso.data)
|
||||
|
||||
. = vdso_page + 0x10000;
|
||||
*(.vdso.text)
|
||||
|
||||
. = ALIGN(0x10000);
|
||||
} : data = 0xf4
|
||||
|
||||
.bss : {
|
||||
*(.bss .bss.*)
|
||||
}
|
||||
. = ALIGN(0x10000);
|
||||
idmap_page_table = .;
|
||||
. += 0x10000; /* PAGE_SIZE */
|
||||
swapper_page_table = .;
|
||||
. += 0x10000; /* PAGE_SIZE */
|
||||
idmap_pg_dir = .;
|
||||
. += 0x30000; /* IDMAP_DIR_SIZE */
|
||||
swapper_pg_dir = .;
|
||||
. += 0x20000; /* SWAPPER_DIR_SIZE */
|
||||
|
||||
_end = .;
|
||||
}
|
||||
50
kernel/config/smp-arm64_type4.lds
Normal file
50
kernel/config/smp-arm64_type4.lds
Normal file
@@ -0,0 +1,50 @@
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD FLAGS(5);
|
||||
data PT_LOAD FLAGS(7);
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
. = 0xffffffffe0000000; /* KERNEL_START */
|
||||
_head = .;
|
||||
|
||||
.text : {
|
||||
*(.text);
|
||||
} : text
|
||||
|
||||
. = ALIGN(0x10000);
|
||||
.data : {
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
} :data
|
||||
.rodata : {
|
||||
*(.rodata .rodata.*)
|
||||
} :data
|
||||
|
||||
.vdso : ALIGN(0x10000) {
|
||||
vdso_page = .;
|
||||
|
||||
. = vdso_page + 0x00000;
|
||||
*(.vdso.data)
|
||||
|
||||
. = vdso_page + 0x10000;
|
||||
*(.vdso.text)
|
||||
|
||||
. = ALIGN(0x10000);
|
||||
} : data = 0xf4
|
||||
|
||||
.bss : {
|
||||
*(.bss .bss.*)
|
||||
}
|
||||
. = ALIGN(0x10000);
|
||||
idmap_page_table = .;
|
||||
. += 0x10000; /* PAGE_SIZE */
|
||||
swapper_page_table = .;
|
||||
. += 0x10000; /* PAGE_SIZE */
|
||||
idmap_pg_dir = .;
|
||||
. += 0x30000; /* IDMAP_DIR_SIZE */
|
||||
swapper_pg_dir = .;
|
||||
. += 0x30000; /* SWAPPER_DIR_SIZE */
|
||||
|
||||
_end = .;
|
||||
}
|
||||
Reference in New Issue
Block a user