On 01/02/18 09:31, Alex Shi wrote:
I really don't understand your questions, so let me explain how things work:
Sorry for my idiot on virt machine. And many thanks for patient explanation!
From the doc Documentation/virtual/kvm/arm/hyp-abi.txt, I guess the correct concept is KVM is a hypervisor.
- The kernel embeds all of the KVM text. Some of that text is meant to
be mapped at EL2.
- All the mappings at HYP are at an offset from the linear mapping, and
you can convert a linear mapping VA to a HYP VA using kern_hyp_va().
why we need this mapping? and who/when did this mapping? Both of address are accessed from same EL level?
We need this mapping because EL2 cannot use the same VAs as EL1. Only only has a single TTBR, and thus cannot use negative addressing. The page tables are created by EL1, and only EL2 is accessing memory via this mapping.
That's how KVM/arm64 worked since the beginning of times, and not much has changed since then.
It looks like the base kernel difference between 4.9 and 4.15-rc3 (https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/log/?h=kpti) cause this boot panic.
Guess the 4.15-rc3 did the linear mapping for __bp_harden_hyp_vecs_start while 4.9 didn't. So, in this patch, __bp_harden_hyp_vecs_start need be accessed with difference address. I thought that since I can not figure the map change during my backporting.
[...]
Sorry, I cannot be of help here, other than doing the backport myself (and I don't have the bandwidth for that now).
M.