Re: [PATCH v5 2/5] KVM: arm64: Add pre_fault_memory implementation

"Thomson, Jack" <[email protected]>
Newsgroups org.kernel.vger.kvm,dev.linux.lists.kvmarm,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
Hi Vincent,

On 27/07/2026 12:11 pm, Vincent Donnefort wrote:
>> +	unsigned long		*page_size;
> 
> It looks a bit odd in that struct.
> 
> Also, transparent_hugepage_adjust() modifies pfn and gfn. So perhaps it'd be
> better to introduce a struct kvm_s2_fault_mapping that can be used to get what
> has actually been mapped in kvm_s2_fault_map()?
> 

Yeah that's much nicer I'll do that thanks for the suggestion!

>> +	if (vcpu_is_protected(vcpu))
>> +		return -EOPNOTSUPP;
> 
> It could just call pkvm_mem_abort() when the VM is protected?
> 

I see, I don't have a setup to test this properly myself, so at the
moment I left the protected vm's out and don't advertise the capability,
if there's a usecase happy to look at it as a follow-up.

>> +	/*
>> +	 * pKVM stage-2 mappings aren't directly walkable from the host; let
>> +	 * the fault path handle both new and existing mappings.
>> +	 */
> 
> pKVM has a host interval-tree where we keep track of what has been mapped and at
> what level. This tree is also protected with the mmu_lock.
> 

Thanks, that sounds better. I'll have a look at moving to that for v6 then.

-- 
Thanks,
Jack
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.