Commit ca509ab3 authored by Chuanxiao Dong's avatar Chuanxiao Dong Committed by Tomasz Nowicki
Browse files

ANDROID: pkvm: x86: Add fastpath to donate a page from host to guest



Donating a page from host to protected VM will unmap this page from host
EPT and then map to the pgstate pgt. In this case, as pgstate pgt is
not shadow EPT, it is safe not to do the host TLB flushing right after
unmapping this page from host EPT as this page is not mapped in shadow
EPT and protected VM cannot use it. The host TLB flushing can be
done right before mapping the donated page into shadow EPT. So, introduce
a new function __pkvm_host_donate_guest_fastpath() which will not do the
host EPT TLB flushing when donating a page to a protected VM. The caller
should do TLB flushing after donating a bunch of pages.

This fastpath interface is only used during the pre-population stage to
reduce the population time significantly. The EPT violation handling at
the runtime stage is still using the original donate interface.

Bug: 395299836
Test: Boot, verify cpus are de-privileged and run a minimal protected vm.

Change-Id: Icd6f21e883e3525974b276709adac0d38ebf5487
Signed-off-by: default avatarChuanxiao Dong <chuanxiao.dong@intel.com>
Reviewed-by: default avatarJason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: default avatarVineeth Pillai <vineethrp@google.com>
parent adc6cd67
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment