Re: [PATCH] KVM: arm64: Cleanup the __get_fault_info() to take out the code that validates HPFAR

From: Marc Zyngier
Date: Tue Sep 27 2022 - 06:18:15 EST


On Tue, 27 Sep 2022 01:14:16 -0400,
Oliver Upton <oliver.upton@xxxxxxxxx> wrote:
>
> Hi Mingwei,
>
> On Tue, Sep 27, 2022 at 12:27:15AM +0000, Mingwei Zhang wrote:
> > Cleanup __get_fault_info() to take out the code that checks HPFAR. The
> > conditions in __get_fault_info() that checks if HPFAR contains a valid IPA
> > is slightly messy in that several conditions are written within one IF
> > statement acrossing multiple lines and are connected with different logical
> > operators. Among them, some conditions come from ARM Spec, while others
> ^~~~~~~~
>
> Call it the ARM ARM or Arm ARM, depending on what stylization you
> subscribe to :)
>
> > come from CPU erratum. This makes the code hard to read and
> > difficult to extend.
>
> I'd recommend you avoid alluding to future changes unless they're posted
> on the mailing list.

Honestly, I'd refrain from such changes *unless* they enable something
else. The current code is well understood by people hacking on it, and
although I don't mind revamping it, it has to be for a good reason.

I'd be much more receptive to such a change if it was a prefix to
something that actually made a significant change.

Thanks,

M.

--
Without deviation from the norm, progress is not possible.