From: David Brazdil <hidden> Date: 2021-07-28 15:32:44
Hi, here is an off-by-one bug fix and a very minor improvement for
the range_is_memory function in hyp.
David Brazdil (2):
KVM: arm64: Fix off-by-one in range_is_memory
KVM: arm64: Minor optimization of range_is_memory
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--
2.32.0.432.gabb21c7263-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: David Brazdil <hidden> Date: 2021-07-28 15:32:47
Hyp checks whether an address range only covers RAM by checking the
start/endpoints against a list of memblock_region structs. However,
the endpoint here is exclusive but internally is treated as inclusive.
Fix the off-by-one error that caused valid address ranges to be
rejected.
Cc: Quentin Perret <redacted>
Fixes: 90134ac9cabb6 ("KVM: arm64: Protect the .hyp sections from the host")
Signed-off-by: David Brazdil <redacted>
---
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: David Brazdil <hidden> Date: 2021-07-28 15:32:49
Currently range_is_memory finds the corresponding struct memblock_region
for both the lower and upper bounds of the given address range with two
rounds of binary search, and then checks that the two memblocks are the
same. Simplify this by only doing binary search on the lower bound and
then checking that the upper bound is in the same memblock.
Signed-off-by: David Brazdil <redacted>
---
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
On Wednesday 28 Jul 2021 at 15:32:31 (+0000), David Brazdil wrote:
quoted hunk
Hyp checks whether an address range only covers RAM by checking the
start/endpoints against a list of memblock_region structs. However,
the endpoint here is exclusive but internally is treated as inclusive.
Fix the off-by-one error that caused valid address ranges to be
rejected.
Cc: Quentin Perret <redacted>
Fixes: 90134ac9cabb6 ("KVM: arm64: Protect the .hyp sections from the host")
Signed-off-by: David Brazdil <redacted>
---
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
On Wednesday 28 Jul 2021 at 15:32:32 (+0000), David Brazdil wrote:
quoted hunk
Currently range_is_memory finds the corresponding struct memblock_region
for both the lower and upper bounds of the given address range with two
rounds of binary search, and then checks that the two memblocks are the
same. Simplify this by only doing binary search on the lower bound and
then checking that the upper bound is in the same memblock.
Signed-off-by: David Brazdil <redacted>
---
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Nit: maybe drop the second if and simplify to:
return is_in_mem_range(end - 1, &r);
With that:
Reviewed-by: Quentin Perret <redacted>
Thanks,
Quentin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Marc Zyngier <maz@kernel.org> Date: 2021-08-20 11:06:30
On Wed, 28 Jul 2021 15:32:30 +0000, David Brazdil wrote:
the range_is_memory function in hyp.
David Brazdil (2):
KVM: arm64: Fix off-by-one in range_is_memory
KVM: arm64: Minor optimization of range_is_memory
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
Applied to kvm-arm64/mmu/el2-tracking, thanks!
[2/2] KVM: arm64: Minor optimization of range_is_memory
commit: 14ecf075fe5be01860927fdf3aa11d7b18023ab2
Cheers,
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel