On 31/01/18 08:18, Alex Shi wrote:
Here lm_alias get the virtual address of __bp_harden_hyp_vecs_start from 0xffff000008098800(for example) to 0xffff800008098800 Code basing on v4.15-rc3 works well for this new address 0xffff80000.... but code basing on v4.9 will report null page:
Unable to handle kernel paging request at virtual address ffff8000000....
And without the lm_alias, the kernel booted well. Another place used lm_alias is in kvm_get_hyp_vector(),
Is this safe to drop lm_alias? Or is there some place to request pages for aliaed adderss?
After read through the lm_alias stories, I found v4.9 has no this support yet. So I remove this function, and qemu machine boot well.
The updated commit is here: https://git.linaro.org/kernel/linux-linaro-stable.git/log/?h=lts-v4.9-kpti 9a07085
Now, I am working on another issue on juno, cpu lockup 23s' with kvm support:
0.734497] Initramfs unpacking failed: junk in compressed archive [ 0.740906] hw perfevents: enabled with armv8_cortex_a72 PMU driver, 7 counters available [ 0.749082] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available [ 0.757280] kvm [1]: 8-bit VMID [ 0.760394] kvm [1]: IDMAP page: 808a7000 [ 0.764363] kvm [1]: HYP VA range: 800000000000:ffffffffffff [ 0.770554] kvm [1]: Hyp mode initialized successfully [ 21.777786] INFO: rcu_preempt detected stalls on CPUs/tasks: [ 21.783392] 1-...: (7 GPs behind) idle=3c1/1/0 softirq=42/42 fqs=2626 [ 21.789934] (detected by 2, t=5255 jiffies, g=-271, c=-272, q=1) [ 21.795967] Task dump for CPU 1: [ 21.799156] swapper/1 R running task 0 0 1 0x00000002 [ 21.806139] Call trace: [ 21.808563] [<ffff000008085600>] __switch_to+0x88/0xb0 [ 21.813644] [<0000000000000007>] 0x7 [ 28.241786] NMI watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [swapper/0:1] [ 28.249016] Modules linked in: [ 28.252035] [ 28.253507] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.9.78-00037-g9a07085 #76 [ 28.260737] Hardware name: ARM Juno development board (r2) (DT) [ 28.266592] task: ffff800976ca8000 task.stack: ffff800976cb0000 [ 28.272455] PC is at smp_call_function_many+0x26c/0x2d0 [ 28.277624] LR is at smp_call_function_many+0x22c/0x2d0 [ 28.282791] pc : [<ffff00000812bcdc>] lr : [<ffff00000812bc9c>] pstate: 80000045 [ 28.290108] sp : ffff800976cb3c40 [ 28.293382] x29: ffff800976cb3c40 x28: ffff000008d67000 [ 28.298642] x27: ffff000008d67384 x26: 0000000000000040 [ 28.303903] x25: 0000000000000000 x24: ffff0000080a6670 [ 28.309162] x23: 0000000000000001 x22: ffff000008d2a880 [ 28.314422] x21: ffff80097ff88980 x20: ffff80097ff88988 [ 28.319681] x19: ffff000008d67530 x18: 0000000000000010 [ 28.324941] x17: 0000000000000000 x16: 0000000100000000 [ 28.330200] x15: ffff000088e43c27 x14: 0000000000000006 [ 28.335459] x13: ffff000008e43c35 x12: 0000000000000009
<educated-guess> You've entered HYP with a bogus address (likely bogus vectors), and you're stuck on a recursive exception. </educated-guess>
M.