[PATCH v5 09/43] arm64: RME: ioctls to create and configure realms

Steven Price steven.price at arm.com
Fri Nov 1 09:22:46 PDT 2024


On 30/10/2024 07:55, Aneesh Kumar K.V wrote:
> Steven Price <steven.price at arm.com> writes:
> 
>> +
>> +out_undelegate_tables:
>> +	while (--i >= 0) {
>> +		phys_addr_t pgd_phys = kvm->arch.mmu.pgd_phys + i * PAGE_SIZE;
>> +
>> +		WARN_ON(rmi_granule_undelegate(pgd_phys));
>> +	}
>> +	WARN_ON(rmi_granule_undelegate(rd_phys));
>> +free_rd:
>> +	free_page((unsigned long)rd);
>> +	return r;
>> +}
>> +
> 
> we should avoid that free_page on an undelegate failure? rd_phys we can
> handle here. Not sure how to handle the pgd_phys.

Good point. I think for pgd_phys setting kvm->arch.mmu.pgt=NULL should
be sufficient to prevent the pages being freed.

Thanks,
Steve




More information about the linux-arm-kernel mailing list