Re: [PATCH 04/10] arm64: mops: document boot requirements for MOPS

From: Kristina Martsenko
Date: Tue Apr 11 2023 - 12:58:09 EST


On 04/04/2023 11:50, Catalin Marinas wrote:
> On Fri, Mar 24, 2023 at 01:00:43AM +0000, Kristina Martsenko wrote:
>> On 17/03/2023 15:07, Catalin Marinas wrote:
>>> On Thu, Feb 16, 2023 at 04:00:06PM +0000, Kristina Martsenko wrote:
>>>> + For CPUs with Memory Copy and Memory Set instructions (FEAT_MOPS):
>>>> +
>>>> + - If the kernel is entered at EL1 and EL2 is present:
>>>> +
>>>> + - HCRX_EL2.MSCEn (bit 11) must be initialised to 0b1.
>>>> +
>>>> + - HCRX_EL2.MCE2 (bit 10) must be initialised to 0b0.
>>>
>>> Regarding MCE2, does EL1 actually care if EL2 wants to handle all the
>>> memcpy/memset exceptions?
>>
>> Note that this series does not add support for mops in guests yet.
>
> You mean there's no KVM support. But Linux may be run under a different
> hypervisor (e.g. Hyper-V) as a guest.
>
>> I think booting.txt can be updated when that support is added.
>
> In booting.txt, when you say the kernel entered at EL1, it implies that
> it may be run as a guest under a random hypervisor.
>
> So maybe we should detail the MCE2 requirement a bit, saying that it can
> be either 0 or 1 but, for the latter, the hypervisor must handle the
> corresponding exceptions.

That makes sense. I was going to add this, but then realized that MCE2 only
traps memcpy exceptions from EL1, not EL0, so it does not have any effect with
this series. So I think we can just drop the MCE2 requirement entirely for now
and specify the requirement later when we add memcpy instructions into the
kernel itself.

Thanks,
Kristina