Commit 2bc3a6c3 authored by Zhiyuan Lv's avatar Zhiyuan Lv Committed by Tomasz Nowicki
Browse files

ANDROID: pkvm: x86: Fix a minor calculating issue



check_and_init_iommu() tries to get a common set of page level and page
size mask between ept and dmar units. Both page level and size are with
mask value. The current code used min() to calculate mask value which is
not correct. For example, if EPT only supports 5-level while dmar
supports 4-level, the current logic will get the result of 4-level but
the correct result should be 0. This may not happen in reality, though,
as the 5-level capability most likely implies 4-level as well. Still
have the small fix to make the code looking more right.

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

Change-Id: Ia42541900e9bf6f05ae567664e986f136f1a2cc8
Signed-off-by: default avatarZhiyuan Lv <zhiyuan.lv@intel.com>
Reviewed-by: default avatarJason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: default avatarVineeth Pillai <vineethrp@google.com>
parent de5df41d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment