[PATCH 17/18] KVM: arm64: Introduce the EL1 pKVM MMU

Quentin Perret qperret at google.com
Wed Nov 6 08:58:58 PST 2024


On Monday 04 Nov 2024 at 13:32:03 (+0000), Quentin Perret wrote:
> +bool pkvm_pgtable_test_clear_young(struct kvm_pgtable *pgt, u64 addr, u64 size, bool mkold)
> +{
> +	pkvm_handle_t handle = pkvm_pgt_to_handle(pgt);
> +	struct pkvm_mapping *mapping;
> +	struct rb_node *tmp;
> +	bool young = false;
> +
> +	read_lock(&pgt->pkvm.mappings_lock);
> +	for_each_mapping_in_range(pgt, addr, addr + size, mapping, tmp)
> +		young |= kvm_call_hyp_nvhe(__pkvm_host_wrprotect_guest, handle, mapping->gfn, mkold);
> +	read_unlock(&pgt->pkvm.mappings_lock);
> +
> +	return young;
> +}

I just observed a funny behaviour in one of my tests, the above explains
it ... Can you find the bug? Ahem. I'll fix in v2 obviously.



More information about the linux-arm-kernel mailing list