mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
ANDROID: KVM: arm64: Fix state masking in guest_request_walker()
guest_request_walker() takes a desired state and a desired mask, the
aim of the latter being to determine which bits of the actual pte state
are relevant to the matching operation. Unfortunately, the mask is
incorrect applied to the desired state, leading to duplicated MMIO_GUARD
requests for the same physical address being erroneously rejected.
Fix the state masking to get MMIO_GUARD_MAP working the same way as
previous kernels.
Bug: 278749606
Bug: 352732786
Cc: Vincent Donnefort <vdonnefort@google.com>
Fixes: 4ea14179f1
("ANDROID: KVM: arm64: mem_protect to use a walker for guest memory transition")
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I83b91b7eea51eab1307eed32e38b942623847d52
This commit is contained in:
parent
a8759911ea
commit
0fc8eacf64
|
@ -1545,7 +1545,7 @@ static int guest_request_walker(const struct kvm_pgtable_visit_ctx *ctx,
|
|||
phys_addr_t phys;
|
||||
|
||||
state = guest_get_page_state(pte, 0);
|
||||
if ((data->desired_state & data->desired_mask) != state)
|
||||
if (data->desired_state != (state & data->desired_mask))
|
||||
return (state & PKVM_NOPAGE) ? -EFAULT : -EINVAL;
|
||||
|
||||
if (state & PKVM_NOPAGE) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user