On 02/01/2018 06:23 PM, Alex Shi wrote:
On 02/01/2018 05:43 PM, Marc Zyngier wrote:
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.
Hi Marc,
Many thanks for the info!
Would you like to tell me when the specific __bp_harden_hyp_vecs_start or bp_hardening_data got linear mapped?
What I seen is, if cpu boot in EL1, above variable wasn't linear mapped. If cpu boot in EL2, then above variable seems linear mapped before install bp vector, and then the kvm_map_vectors() do mapping them later.
What I missed?
Thank a lot!