machdep.c (2fee8756294820ff9ec6f8d17324e7d8a0a45040) | machdep.c (d2ae03bae2add82124973876dec95eb126ff34c8) |
---|---|
1/*- 2 * Copyright (c) 2014 Andrew Turner 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 64 unchanged lines hidden (view full) --- 73#include <vm/vm_phys.h> 74#include <vm/pmap.h> 75#include <vm/vm_map.h> 76#include <vm/vm_pager.h> 77 78#include <machine/armreg.h> 79#include <machine/cpu.h> 80#include <machine/debug_monitor.h> | 1/*- 2 * Copyright (c) 2014 Andrew Turner 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 64 unchanged lines hidden (view full) --- 73#include <vm/vm_phys.h> 74#include <vm/pmap.h> 75#include <vm/vm_map.h> 76#include <vm/vm_pager.h> 77 78#include <machine/armreg.h> 79#include <machine/cpu.h> 80#include <machine/debug_monitor.h> |
81#include <machine/hypervisor.h> |
|
81#include <machine/kdb.h> 82#include <machine/machdep.h> 83#include <machine/metadata.h> 84#include <machine/md_var.h> 85#include <machine/pcb.h> 86#include <machine/undefined.h> 87#include <machine/vmparam.h> 88 --- 30 unchanged lines hidden (view full) --- 119uintptr_t boot_canary = 0x49a2d892bc05a0b1ul; 120#endif 121 122static struct trapframe proc0_tf; 123 124int early_boot = 1; 125int cold = 1; 126static int boot_el; | 82#include <machine/kdb.h> 83#include <machine/machdep.h> 84#include <machine/metadata.h> 85#include <machine/md_var.h> 86#include <machine/pcb.h> 87#include <machine/undefined.h> 88#include <machine/vmparam.h> 89 --- 30 unchanged lines hidden (view full) --- 120uintptr_t boot_canary = 0x49a2d892bc05a0b1ul; 121#endif 122 123static struct trapframe proc0_tf; 124 125int early_boot = 1; 126int cold = 1; 127static int boot_el; |
128static uint64_t hcr_el2; |
|
127 128struct kva_md_info kmi; 129 130int64_t dczva_line_size; /* The size of cache line the dc zva zeroes */ 131int has_pan; 132 133/* 134 * Physical address of the EFI System Table. Stashed from the metadata hints --- 51 unchanged lines hidden (view full) --- 186 __asm __volatile(".inst 0xd500409f | (0x1 << 8)"); 187 } 188} 189 190bool 191has_hyp(void) 192{ 193 | 129 130struct kva_md_info kmi; 131 132int64_t dczva_line_size; /* The size of cache line the dc zva zeroes */ 133int has_pan; 134 135/* 136 * Physical address of the EFI System Table. Stashed from the metadata hints --- 51 unchanged lines hidden (view full) --- 188 __asm __volatile(".inst 0xd500409f | (0x1 << 8)"); 189 } 190} 191 192bool 193has_hyp(void) 194{ 195 |
194 return (boot_el == 2); | 196 /* 197 * XXX The E2H check is wrong, but it's close enough for now. Needs to 198 * be re-evaluated once we're running regularly in EL2. 199 */ 200 return (boot_el == 2 && (hcr_el2 & HCR_E2H) == 0); |
195} 196 197static void 198cpu_startup(void *dummy) 199{ 200 vm_paddr_t size; 201 int i; 202 --- 657 unchanged lines hidden (view full) --- 860#endif 861 vm_offset_t lastaddr; 862 caddr_t kmdp; 863 bool valid; 864 865 TSRAW(&thread0, TS_ENTER, __func__, NULL); 866 867 boot_el = abp->boot_el; | 201} 202 203static void 204cpu_startup(void *dummy) 205{ 206 vm_paddr_t size; 207 int i; 208 --- 657 unchanged lines hidden (view full) --- 866#endif 867 vm_offset_t lastaddr; 868 caddr_t kmdp; 869 bool valid; 870 871 TSRAW(&thread0, TS_ENTER, __func__, NULL); 872 873 boot_el = abp->boot_el; |
874 hcr_el2 = abp->hcr_el2; |
|
868 869 /* Parse loader or FDT boot parametes. Determine last used address. */ 870 lastaddr = parse_boot_param(abp); 871 872 /* Find the kernel address */ 873 kmdp = preload_search_by_type("elf kernel"); 874 if (kmdp == NULL) 875 kmdp = preload_search_by_type("elf64 kernel"); --- 251 unchanged lines hidden --- | 875 876 /* Parse loader or FDT boot parametes. Determine last used address. */ 877 lastaddr = parse_boot_param(abp); 878 879 /* Find the kernel address */ 880 kmdp = preload_search_by_type("elf kernel"); 881 if (kmdp == NULL) 882 kmdp = preload_search_by_type("elf64 kernel"); --- 251 unchanged lines hidden --- |