mirror of
https://github.com/torvalds/linux.git
synced 2024-12-02 17:11:33 +00:00
KVM: x86/mmu: Avoid pointer arithmetic when iterating over SPTEs
Replace the pointer arithmetic used to iterate over SPTEs in is_empty_shadow_page() with more standard interger-based iteration. No functional change intended. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Link: https://lore.kernel.org/r/20230729004722.1056172-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c4f92cfe02
commit
242a6dd8da
@ -1692,15 +1692,15 @@ bool kvm_test_age_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
|
|||||||
#ifdef MMU_DEBUG
|
#ifdef MMU_DEBUG
|
||||||
static int is_empty_shadow_page(u64 *spt)
|
static int is_empty_shadow_page(u64 *spt)
|
||||||
{
|
{
|
||||||
u64 *pos;
|
int i;
|
||||||
u64 *end;
|
|
||||||
|
|
||||||
for (pos = spt, end = pos + SPTE_ENT_PER_PAGE; pos != end; pos++)
|
for (i = 0; i < SPTE_ENT_PER_PAGE; i++) {
|
||||||
if (is_shadow_present_pte(*pos)) {
|
if (is_shadow_present_pte(spt[i])) {
|
||||||
printk(KERN_ERR "%s: %p %llx\n", __func__,
|
printk(KERN_ERR "%s: %p %llx\n", __func__,
|
||||||
pos, *pos);
|
&spt[i], spt[i]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user