aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arm64/include')
-rw-r--r--sys/arm64/include/cpu.h10
-rw-r--r--sys/arm64/include/elf.h6
-rw-r--r--sys/arm64/include/pcpu.h1
-rw-r--r--sys/arm64/include/pmap.h7
-rw-r--r--sys/arm64/include/proc.h6
-rw-r--r--sys/arm64/include/stack.h7
6 files changed, 28 insertions, 9 deletions
diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h
index 05844ad63036..bdbc601edd26 100644
--- a/sys/arm64/include/cpu.h
+++ b/sys/arm64/include/cpu.h
@@ -277,6 +277,16 @@ void ptrauth_thread0(struct thread *);
void ptrauth_mp_start(uint64_t);
#endif
+/* Memory Tagging Extension (MTE) support */
+void mte_fork(struct thread *, struct thread *);
+void mte_exec(struct thread *);
+void mte_copy_thread(struct thread *, struct thread *);
+void mte_thread_alloc(struct thread *);
+void mte_thread0(struct thread *);
+
+void mte_sync_tags(vm_page_t page);
+void mte_copy_tags(vm_page_t, vm_page_t, char *, char *);
+
/* Functions to read the sanitised view of the special registers */
void update_special_regs(u_int);
void update_special_reg_iss(u_int, uint64_t, uint64_t);
diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h
index a5a90f8c7712..7940bb259256 100644
--- a/sys/arm64/include/elf.h
+++ b/sys/arm64/include/elf.h
@@ -96,6 +96,12 @@ __ElfType(Auxinfo);
/* First __FreeBSD_version that supports Top Byte Ignore (TBI) */
#define TBI_VERSION 1500058
+/*
+ * The HWCAP values must be identical to Linux. Many userspace programs
+ * will define missing HWCAP values to the Linux version. To keep these
+ * working when we add the HWCAP it must be the same.
+ */
+
/* HWCAP */
#define HWCAP_FP (1 << 0)
#define HWCAP_ASIMD (1 << 1)
diff --git a/sys/arm64/include/pcpu.h b/sys/arm64/include/pcpu.h
index 286a40e7de3d..d04f975350d8 100644
--- a/sys/arm64/include/pcpu.h
+++ b/sys/arm64/include/pcpu.h
@@ -55,7 +55,6 @@ struct debug_monitor_state;
#ifdef _KERNEL
-struct pcb;
struct pcpu;
static inline struct pcpu *
diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h
index 00b54a874e12..cf20827fa666 100644
--- a/sys/arm64/include/pmap.h
+++ b/sys/arm64/include/pmap.h
@@ -70,9 +70,13 @@ struct md_page {
TAILQ_HEAD(,pv_entry) pv_list;
int pv_gen;
vm_memattr_t pv_memattr;
- uint8_t pv_reserve[3];
+ uint8_t pv_flags;
+ uint8_t pv_reserve[2];
};
+/* machine page flags */
+#define PV_MTE_TAGGED 0x01 /* page is tagged with MTE */
+
enum pmap_stage {
PM_INVALID,
PM_STAGE1,
@@ -148,6 +152,7 @@ void pmap_activate_vm(pmap_t);
void pmap_bootstrap_dmap(vm_size_t);
void pmap_bootstrap(void);
int pmap_change_attr(void *va, vm_size_t size, int mode);
+int pmap_change_dmap_attr(int);
int pmap_change_prot(void *va, vm_size_t size, vm_prot_t prot);
void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode);
void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t);
diff --git a/sys/arm64/include/proc.h b/sys/arm64/include/proc.h
index d5879a794269..22ceb614413d 100644
--- a/sys/arm64/include/proc.h
+++ b/sys/arm64/include/proc.h
@@ -69,9 +69,11 @@ struct mdthread {
uint64_t md_efirt_tmp;
int md_efirt_dis_pf;
- int md_reserved0;
+ u_int md_flags;
+#define MD_FLAG_MTE_ASYNC_FAULT_SHIFT 0
+#define MD_FLAG_MTE_ASYNC_FAULT (1u << 0)
uint64_t md_sctlr;
- uint64_t md_reserved1;
+ uint64_t md_gcr; /* FEAT_MTE: Tag Control Register */
};
struct mdproc {
diff --git a/sys/arm64/include/stack.h b/sys/arm64/include/stack.h
index 19e9e837e3ee..23e7a5af27de 100644
--- a/sys/arm64/include/stack.h
+++ b/sys/arm64/include/stack.h
@@ -39,11 +39,9 @@ bool unwind_frame(struct thread *, struct unwind_state *);
#ifdef _SYS_PROC_H_
-#include <machine/pcb.h>
-
#define GET_STACK_USAGE(total, used) do { \
struct thread *td = curthread; \
- (total) = td->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb); \
+ (total) = ptoa(td->td_kstack_pages); \
(used) = td->td_kstack + (total) - (char *)&td; \
} while (0)
@@ -51,8 +49,7 @@ static __inline bool
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
{
return (va >= (vm_offset_t)td->td_kstack && va + len >= va &&
- va + len <= (vm_offset_t)td->td_kstack + td->td_kstack_pages *
- PAGE_SIZE - sizeof(struct pcb));
+ va + len <= (vm_offset_t)td_kstack_top(td));
}
#endif /* _SYS_PROC_H_ */