2 * Copyright (c) 2014 Andrew Turner
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 #include "opt_platform.h"
31 #include <sys/cdefs.h>
32 __FBSDID("$FreeBSD$");
34 #include <sys/param.h>
35 #include <sys/systm.h>
42 #include <sys/imgact.h>
44 #include <sys/kernel.h>
45 #include <sys/limits.h>
46 #include <sys/linker.h>
47 #include <sys/msgbuf.h>
50 #include <sys/ptrace.h>
51 #include <sys/reboot.h>
52 #include <sys/rwlock.h>
53 #include <sys/sched.h>
54 #include <sys/signalvar.h>
55 #include <sys/syscallsubr.h>
56 #include <sys/sysent.h>
57 #include <sys/sysproto.h>
58 #include <sys/ucontext.h>
61 #include <vm/vm_kern.h>
62 #include <vm/vm_object.h>
63 #include <vm/vm_page.h>
65 #include <vm/vm_map.h>
66 #include <vm/vm_pager.h>
68 #include <machine/armreg.h>
69 #include <machine/cpu.h>
70 #include <machine/debug_monitor.h>
71 #include <machine/kdb.h>
72 #include <machine/devmap.h>
73 #include <machine/machdep.h>
74 #include <machine/metadata.h>
75 #include <machine/pcb.h>
76 #include <machine/reg.h>
77 #include <machine/vmparam.h>
80 #include <machine/vfp.h>
84 #include <dev/fdt/fdt_common.h>
85 #include <dev/ofw/openfirm.h>
88 struct pcpu __pcpu[MAXCPU];
90 static struct trapframe proc0_tf;
92 vm_paddr_t phys_avail[PHYS_AVAIL_SIZE + 2];
93 vm_paddr_t dump_avail[PHYS_AVAIL_SIZE + 2];
100 #define PHYSMAP_SIZE (2 * (VM_PHYSSEG_MAX - 1))
101 vm_paddr_t physmap[PHYSMAP_SIZE];
104 struct kva_md_info kmi;
106 int64_t dcache_line_size; /* The minimum D cache line size */
107 int64_t icache_line_size; /* The minimum I cache line size */
108 int64_t idcache_line_size; /* The minimum cache line size */
111 cpu_startup(void *dummy)
116 vm_ksubmap_init(&kmi);
118 vm_pager_bufferinit();
121 SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL);
124 cpu_idle_wakeup(int cpu)
131 bzero(void *buf, size_t len)
141 fill_regs(struct thread *td, struct reg *regs)
143 struct trapframe *frame;
145 frame = td->td_frame;
146 regs->sp = frame->tf_sp;
147 regs->lr = frame->tf_lr;
148 regs->elr = frame->tf_elr;
149 regs->spsr = frame->tf_spsr;
151 memcpy(regs->x, frame->tf_x, sizeof(regs->x));
157 set_regs(struct thread *td, struct reg *regs)
159 struct trapframe *frame;
161 frame = td->td_frame;
162 frame->tf_sp = regs->sp;
163 frame->tf_lr = regs->lr;
164 frame->tf_elr = regs->elr;
165 frame->tf_spsr = regs->spsr;
167 memcpy(frame->tf_x, regs->x, sizeof(frame->tf_x));
173 fill_fpregs(struct thread *td, struct fpreg *regs)
179 if ((pcb->pcb_fpflags & PCB_FP_STARTED) != 0) {
181 * If we have just been running VFP instructions we will
182 * need to save the state to memcpy it below.
184 vfp_save_state(td, pcb);
186 memcpy(regs->fp_q, pcb->pcb_vfp, sizeof(regs->fp_q));
187 regs->fp_cr = pcb->pcb_fpcr;
188 regs->fp_sr = pcb->pcb_fpsr;
191 memset(regs->fp_q, 0, sizeof(regs->fp_q));
196 set_fpregs(struct thread *td, struct fpreg *regs)
202 memcpy(pcb->pcb_vfp, regs->fp_q, sizeof(regs->fp_q));
203 pcb->pcb_fpcr = regs->fp_cr;
204 pcb->pcb_fpsr = regs->fp_sr;
210 fill_dbregs(struct thread *td, struct dbreg *regs)
213 panic("ARM64TODO: fill_dbregs");
217 set_dbregs(struct thread *td, struct dbreg *regs)
220 panic("ARM64TODO: set_dbregs");
224 ptrace_set_pc(struct thread *td, u_long addr)
227 panic("ARM64TODO: ptrace_set_pc");
232 ptrace_single_step(struct thread *td)
240 ptrace_clear_single_step(struct thread *td)
248 exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
250 struct trapframe *tf = td->td_frame;
252 memset(tf, 0, sizeof(struct trapframe));
255 tf->tf_lr = imgp->entry_addr;
256 tf->tf_elr = imgp->entry_addr;
259 /* Sanity check these are the same size, they will be memcpy'd to and fro */
260 CTASSERT(sizeof(((struct trapframe *)0)->tf_x) ==
261 sizeof((struct gpregs *)0)->gp_x);
262 CTASSERT(sizeof(((struct trapframe *)0)->tf_x) ==
263 sizeof((struct reg *)0)->x);
266 get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret)
268 struct trapframe *tf = td->td_frame;
270 if (clear_ret & GET_MC_CLEAR_RET) {
271 mcp->mc_gpregs.gp_x[0] = 0;
272 mcp->mc_gpregs.gp_spsr = tf->tf_spsr & ~PSR_C;
274 mcp->mc_gpregs.gp_x[0] = tf->tf_x[0];
275 mcp->mc_gpregs.gp_spsr = tf->tf_spsr;
278 memcpy(&mcp->mc_gpregs.gp_x[1], &tf->tf_x[1],
279 sizeof(mcp->mc_gpregs.gp_x[1]) * (nitems(mcp->mc_gpregs.gp_x) - 1));
281 mcp->mc_gpregs.gp_sp = tf->tf_sp;
282 mcp->mc_gpregs.gp_lr = tf->tf_lr;
283 mcp->mc_gpregs.gp_elr = tf->tf_elr;
289 set_mcontext(struct thread *td, mcontext_t *mcp)
291 struct trapframe *tf = td->td_frame;
293 memcpy(tf->tf_x, mcp->mc_gpregs.gp_x, sizeof(tf->tf_x));
295 tf->tf_sp = mcp->mc_gpregs.gp_sp;
296 tf->tf_lr = mcp->mc_gpregs.gp_lr;
297 tf->tf_elr = mcp->mc_gpregs.gp_elr;
298 tf->tf_spsr = mcp->mc_gpregs.gp_spsr;
304 get_fpcontext(struct thread *td, mcontext_t *mcp)
311 curpcb = curthread->td_pcb;
313 if ((curpcb->pcb_fpflags & PCB_FP_STARTED) != 0) {
315 * If we have just been running VFP instructions we will
316 * need to save the state to memcpy it below.
318 vfp_save_state(td, curpcb);
320 memcpy(mcp->mc_fpregs.fp_q, curpcb->pcb_vfp,
321 sizeof(mcp->mc_fpregs));
322 mcp->mc_fpregs.fp_cr = curpcb->pcb_fpcr;
323 mcp->mc_fpregs.fp_sr = curpcb->pcb_fpsr;
324 mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags;
325 mcp->mc_flags |= _MC_FP_VALID;
333 set_fpcontext(struct thread *td, mcontext_t *mcp)
340 if ((mcp->mc_flags & _MC_FP_VALID) != 0) {
341 curpcb = curthread->td_pcb;
344 * Discard any vfp state for the current thread, we
345 * are about to override it.
349 memcpy(curpcb->pcb_vfp, mcp->mc_fpregs.fp_q,
350 sizeof(mcp->mc_fpregs));
351 curpcb->pcb_fpcr = mcp->mc_fpregs.fp_cr;
352 curpcb->pcb_fpsr = mcp->mc_fpregs.fp_sr;
353 curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags;
367 if (!sched_runnable())
380 /* We should have shutdown by now, if not enter a low power sleep */
383 __asm __volatile("wfi");
388 * Flush the D-cache for non-DMA I/O so that the I-cache can
389 * be made coherent later.
392 cpu_flush_dcache(void *ptr, size_t len)
398 /* Get current clock frequency for the given CPU ID. */
400 cpu_est_clockrate(int cpu_id, uint64_t *rate)
403 panic("ARM64TODO: cpu_est_clockrate");
407 cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
410 pcpu->pc_acpi_id = 0xffffffff;
420 if (td->td_md.md_spinlock_count == 0) {
421 daif = intr_disable();
422 td->td_md.md_spinlock_count = 1;
423 td->td_md.md_saved_daif = daif;
425 td->td_md.md_spinlock_count++;
437 daif = td->td_md.md_saved_daif;
438 td->td_md.md_spinlock_count--;
439 if (td->td_md.md_spinlock_count == 0)
443 #ifndef _SYS_SYSPROTO_H_
444 struct sigreturn_args {
450 sys_sigreturn(struct thread *td, struct sigreturn_args *uap)
457 if (copyin(uap->sigcntxp, &uc, sizeof(uc)))
460 spsr = uc.uc_mcontext.mc_gpregs.gp_spsr;
461 if ((spsr & PSR_M_MASK) != PSR_M_EL0t ||
462 (spsr & (PSR_F | PSR_I | PSR_A | PSR_D)) != 0)
465 set_mcontext(td, &uc.uc_mcontext);
466 set_fpcontext(td, &uc.uc_mcontext);
468 /* Restore signal mask. */
469 kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0);
471 return (EJUSTRETURN);
475 * Construct a PCB from a trapframe. This is called from kdb_trap() where
476 * we want to start a backtrace from the function that caused us to enter
477 * the debugger. We have the context in the trapframe, but base the trace
478 * on the PCB. The PCB doesn't have to be perfect, as long as it contains
479 * enough for a backtrace.
482 makectx(struct trapframe *tf, struct pcb *pcb)
486 for (i = 0; i < PCB_LR; i++)
487 pcb->pcb_x[i] = tf->tf_x[i];
489 pcb->pcb_x[PCB_LR] = tf->tf_lr;
490 pcb->pcb_pc = tf->tf_elr;
491 pcb->pcb_sp = tf->tf_sp;
495 sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
499 struct trapframe *tf;
500 struct sigframe *fp, frame;
502 int code, onstack, sig;
506 PROC_LOCK_ASSERT(p, MA_OWNED);
508 sig = ksi->ksi_signo;
509 code = ksi->ksi_code;
511 mtx_assert(&psp->ps_mtx, MA_OWNED);
514 onstack = sigonstack(tf->tf_sp);
516 CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm,
519 /* Allocate and validate space for the signal handler context. */
520 if ((td->td_pflags & TDP_ALTSTACK) != 0 && !onstack &&
521 SIGISMEMBER(psp->ps_sigonstack, sig)) {
522 fp = (struct sigframe *)(td->td_sigstk.ss_sp +
523 td->td_sigstk.ss_size);
524 #if defined(COMPAT_43)
525 td->td_sigstk.ss_flags |= SS_ONSTACK;
528 fp = (struct sigframe *)td->td_frame->tf_sp;
531 /* Make room, keeping the stack aligned */
533 fp = (struct sigframe *)STACKALIGN(fp);
535 /* Fill in the frame to copy out */
536 get_mcontext(td, &frame.sf_uc.uc_mcontext, 0);
537 get_fpcontext(td, &frame.sf_uc.uc_mcontext);
538 frame.sf_si = ksi->ksi_info;
539 frame.sf_uc.uc_sigmask = *mask;
540 frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ?
541 ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE;
542 frame.sf_uc.uc_stack = td->td_sigstk;
543 mtx_unlock(&psp->ps_mtx);
544 PROC_UNLOCK(td->td_proc);
546 /* Copy the sigframe out to the user's stack. */
547 if (copyout(&frame, fp, sizeof(*fp)) != 0) {
548 /* Process has trashed its stack. Kill it. */
549 CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp);
555 tf->tf_x[1] = (register_t)&fp->sf_si;
556 tf->tf_x[2] = (register_t)&fp->sf_uc;
558 tf->tf_elr = (register_t)catcher;
559 tf->tf_sp = (register_t)fp;
560 tf->tf_lr = (register_t)(PS_STRINGS - *(p->p_sysent->sv_szsigcode));
562 CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_elr,
566 mtx_lock(&psp->ps_mtx);
570 init_proc0(vm_offset_t kstack)
572 struct pcpu *pcpup = &__pcpu[0];
574 proc_linkup0(&proc0, &thread0);
575 thread0.td_kstack = kstack;
576 thread0.td_pcb = (struct pcb *)(thread0.td_kstack) - 1;
577 thread0.td_pcb->pcb_fpflags = 0;
578 thread0.td_pcb->pcb_vfpcpu = UINT_MAX;
579 thread0.td_frame = &proc0_tf;
580 pcpup->pc_curpcb = thread0.td_pcb;
589 } EFI_MEMORY_DESCRIPTOR;
592 add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap,
595 u_int i, insert_idx, _physmap_idx;
597 _physmap_idx = *physmap_idxp;
603 * Find insertion point while checking for overlap. Start off by
604 * assuming the new entry will be added to the end.
606 insert_idx = _physmap_idx;
607 for (i = 0; i <= _physmap_idx; i += 2) {
608 if (base < physmap[i + 1]) {
609 if (base + length <= physmap[i]) {
613 if (boothowto & RB_VERBOSE)
615 "Overlapping memory regions, ignoring second region\n");
620 /* See if we can prepend to the next entry. */
621 if (insert_idx <= _physmap_idx &&
622 base + length == physmap[insert_idx]) {
623 physmap[insert_idx] = base;
627 /* See if we can append to the previous entry. */
628 if (insert_idx > 0 && base == physmap[insert_idx - 1]) {
629 physmap[insert_idx - 1] += length;
634 *physmap_idxp = _physmap_idx;
635 if (_physmap_idx == PHYSMAP_SIZE) {
637 "Too many segments in the physical address map, giving up\n");
642 * Move the last 'N' entries down to make room for the new
645 for (i = _physmap_idx; i > insert_idx; i -= 2) {
646 physmap[i] = physmap[i - 2];
647 physmap[i + 1] = physmap[i - 1];
650 /* Insert the new entry. */
651 physmap[insert_idx] = base;
652 physmap[insert_idx + 1] = base + length;
656 #define efi_next_descriptor(ptr, size) \
657 ((struct efi_md *)(((uint8_t *) ptr) + size))
660 add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
663 struct efi_md *map, *p;
668 static const char *types[] = {
674 "RuntimeServicesCode",
675 "RuntimeServicesData",
676 "ConventionalMemory",
681 "MemoryMappedIOPortSpace",
686 * Memory map data provided by UEFI via the GetMemoryMap
689 efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf;
690 map = (struct efi_md *)((uint8_t *)efihdr + efisz);
692 if (efihdr->descriptor_size == 0)
694 ndesc = efihdr->memory_size / efihdr->descriptor_size;
696 if (boothowto & RB_VERBOSE)
697 printf("%23s %12s %12s %8s %4s\n",
698 "Type", "Physical", "Virtual", "#Pages", "Attr");
700 for (i = 0, p = map; i < ndesc; i++,
701 p = efi_next_descriptor(p, efihdr->descriptor_size)) {
702 if (boothowto & RB_VERBOSE) {
703 if (p->md_type <= EFI_MD_TYPE_PALCODE)
704 type = types[p->md_type];
707 printf("%23s %012lx %12p %08lx ", type, p->md_phys,
708 p->md_virt, p->md_pages);
709 if (p->md_attr & EFI_MD_ATTR_UC)
711 if (p->md_attr & EFI_MD_ATTR_WC)
713 if (p->md_attr & EFI_MD_ATTR_WT)
715 if (p->md_attr & EFI_MD_ATTR_WB)
717 if (p->md_attr & EFI_MD_ATTR_UCE)
719 if (p->md_attr & EFI_MD_ATTR_WP)
721 if (p->md_attr & EFI_MD_ATTR_RP)
723 if (p->md_attr & EFI_MD_ATTR_XP)
725 if (p->md_attr & EFI_MD_ATTR_RT)
730 switch (p->md_type) {
731 case EFI_MD_TYPE_CODE:
732 case EFI_MD_TYPE_DATA:
733 case EFI_MD_TYPE_BS_CODE:
734 case EFI_MD_TYPE_BS_DATA:
735 case EFI_MD_TYPE_FREE:
737 * We're allowed to use any entry with these types.
744 if (!add_physmap_entry(p->md_phys, (p->md_pages * PAGE_SIZE),
745 physmap, physmap_idxp))
752 try_load_dtb(caddr_t kmdp)
756 dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
757 if (dtbp == (vm_offset_t)NULL) {
758 printf("ERROR loading DTB\n");
762 if (OF_install(OFW_FDT, 0) == FALSE)
763 panic("Cannot install FDT");
765 if (OF_init((void *)dtbp) != 0)
766 panic("OF_init failed with the found device tree");
773 int dcache_line_shift, icache_line_shift;
776 ctr_el0 = READ_SPECIALREG(ctr_el0);
778 /* Read the log2 words in each D cache line */
779 dcache_line_shift = CTR_DLINE_SIZE(ctr_el0);
780 /* Get the D cache line size */
781 dcache_line_size = sizeof(int) << dcache_line_shift;
783 /* And the same for the I cache */
784 icache_line_shift = CTR_ILINE_SIZE(ctr_el0);
785 icache_line_size = sizeof(int) << icache_line_shift;
787 idcache_line_size = MIN(dcache_line_size, icache_line_size);
791 initarm(struct arm64_bootparams *abp)
793 struct efi_map_header *efihdr;
795 vm_offset_t lastaddr;
800 /* Set the module data location */
801 preload_metadata = (caddr_t)(uintptr_t)(abp->modulep);
803 /* Find the kernel address */
804 kmdp = preload_search_by_type("elf kernel");
806 kmdp = preload_search_by_type("elf64 kernel");
808 boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
809 kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
815 /* Find the address to start allocating from */
816 lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t);
818 /* Load the physical memory ranges */
820 efihdr = (struct efi_map_header *)preload_search_info(kmdp,
821 MODINFO_METADATA | MODINFOMD_EFI_MAP);
822 add_efi_map_entries(efihdr, physmap, &physmap_idx);
824 /* Print the memory map */
826 for (i = 0; i < physmap_idx; i += 2) {
827 dump_avail[i] = physmap[i];
828 dump_avail[i + 1] = physmap[i + 1];
829 mem_len += physmap[i + 1] - physmap[i];
832 dump_avail[i + 1] = 0;
834 /* Set the pcpu data, this is needed by pmap_bootstrap */
836 pcpu_init(pcpup, 0, sizeof(struct pcpu));
839 * Set the pcpu pointer with a backup in tpidr_el1 to be
840 * loaded when entering the kernel from userland.
844 "msr tpidr_el1, %0" :: "r"(pcpup));
846 PCPU_SET(curthread, &thread0);
848 /* Do basic tuning, hz etc */
853 /* Bootstrap enough of pmap to enter the kernel proper */
854 pmap_bootstrap(abp->kern_l1pt, KERNBASE - abp->kern_delta,
855 lastaddr - KERNBASE);
857 arm_devmap_bootstrap(0, NULL);
861 init_proc0(abp->kern_stack);
862 msgbufinit(msgbufp, msgbufsize);
864 init_param2(physmem);
875 DB_SHOW_COMMAND(specialregs, db_show_spregs)
877 #define PRINT_REG(reg) \
878 db_printf(__STRING(reg) " = %#016lx\n", READ_SPECIALREG(reg))
880 PRINT_REG(actlr_el1);
881 PRINT_REG(afsr0_el1);
882 PRINT_REG(afsr1_el1);
884 PRINT_REG(amair_el1);
885 PRINT_REG(ccsidr_el1);
886 PRINT_REG(clidr_el1);
887 PRINT_REG(contextidr_el1);
888 PRINT_REG(cpacr_el1);
889 PRINT_REG(csselr_el1);
891 PRINT_REG(currentel);
893 PRINT_REG(dczid_el0);
898 /* ARM64TODO: Enable VFP before reading floating-point registers */
902 PRINT_REG(id_aa64afr0_el1);
903 PRINT_REG(id_aa64afr1_el1);
904 PRINT_REG(id_aa64dfr0_el1);
905 PRINT_REG(id_aa64dfr1_el1);
906 PRINT_REG(id_aa64isar0_el1);
907 PRINT_REG(id_aa64isar1_el1);
908 PRINT_REG(id_aa64pfr0_el1);
909 PRINT_REG(id_aa64pfr1_el1);
910 PRINT_REG(id_afr0_el1);
911 PRINT_REG(id_dfr0_el1);
912 PRINT_REG(id_isar0_el1);
913 PRINT_REG(id_isar1_el1);
914 PRINT_REG(id_isar2_el1);
915 PRINT_REG(id_isar3_el1);
916 PRINT_REG(id_isar4_el1);
917 PRINT_REG(id_isar5_el1);
918 PRINT_REG(id_mmfr0_el1);
919 PRINT_REG(id_mmfr1_el1);
920 PRINT_REG(id_mmfr2_el1);
921 PRINT_REG(id_mmfr3_el1);
923 /* Missing from llvm */
924 PRINT_REG(id_mmfr4_el1);
926 PRINT_REG(id_pfr0_el1);
927 PRINT_REG(id_pfr1_el1);
931 PRINT_REG(mpidr_el1);
932 PRINT_REG(mvfr0_el1);
933 PRINT_REG(mvfr1_el1);
934 PRINT_REG(mvfr2_el1);
935 PRINT_REG(revidr_el1);
936 PRINT_REG(sctlr_el1);
941 PRINT_REG(tpidr_el0);
942 PRINT_REG(tpidr_el1);
943 PRINT_REG(tpidrro_el0);
944 PRINT_REG(ttbr0_el1);
945 PRINT_REG(ttbr1_el1);
950 DB_SHOW_COMMAND(vtop, db_show_vtop)
955 phys = arm64_address_translate_s1e1r(addr);
956 db_printf("Physical address reg: 0x%016lx\n", phys);
958 db_printf("show vtop <virt_addr>\n");