Hi Julien,

(Sending this email directly “To:” Bertrand and Stefano to catch their 
attention about
one question that you ask them)

> On Oct 14, 2023, at 02:31, Julien Grall <[email protected]> wrote:
> 
> Hi Henry,
> 
> some more remarks.
> 
> On 09/10/2023 02:03, Henry Wang wrote:
>> +/*
>> + * Invalidate all entries in the root page-tables. This is
>> + * useful to get fault on entry and do an action.
>> + *
>> + * p2m_invalid_root() should not be called when the P2M is shared with
>> + * the IOMMU because it will cause IOMMU fault.
>> + */
>> +void p2m_invalidate_root(struct p2m_domain *p2m)
> 
> I think this function doesn't make sense for the MPU. What would invalidate?
> 
> The only caller outside of the file is in arch_domain_creation_finished(). 
> This was used for set/way emulation which I believe will be difficult to 
> implement efficiently for the MPU (see my other reply to this patch).
> 
> So I would consider to move arch_domain_creation_finished() in mmu/p2m.c or 
> creating a new function p2m_domain_creation_finished() which is called from 
> arch_domain_creation_finished().

Yeah make sense, I will do the suggested change in v8.

> [...]
> 
>> +/*
>> + * Clean & invalidate RAM associated to the guest vCPU.
>> + *
>> + * The function can only work with the current vCPU and should be called
>> + * with IRQ enabled as the vCPU could get preempted.
>> + */
>> +void p2m_flush_vm(struct vcpu *v)
> I believe an implementation of p2m_flush_vm() would be quite expensive for 
> the MPU. It would be better to not emulate set/way for now.
> 
> It would also feel a bit odd to leave it unimplemented and called from 
> check_for_vcpu_work(). So maybe we want to rename it. I don't have a goood 
> name suggestion though. Bertrand, Stefano?

See the beginning of this email.

Kind regards,
Henry

> 
> [...]
> 
> -- 
> Julien Grall

Reply via email to