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

2022-09-28 Thread Marc Zyngier
Mingwei, On Tue, 27 Sep 2022 13:48:52 -0400, Mingwei Zhang wrote: > > > > > 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. >

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

2022-09-27 Thread Mingwei Zhang
> > 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 >

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

2022-09-27 Thread Mingwei Zhang
> > +static inline bool __hpfar_is_valid(u64 esr) > > Unlike what the name implies, this function returns true for some > cases that HPFAR is not valid (i.e. SEA). I think the function > returns true when KVM doesn't need HPFAR, or when HPFAR is valid. > IMHO the name might be a bit misleading,

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

2022-09-27 Thread Marc Zyngier
On Tue, 27 Sep 2022 01:14:16 -0400, Oliver Upton wrote: > > Hi Mingwei, > > On Tue, Sep 27, 2022 at 12:27:15AM +, 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 >

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

2022-09-27 Thread Reiji Watanabe
Hi Mingwei, On Mon, Sep 26, 2022 at 5:27 PM 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 >

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

2022-09-26 Thread Oliver Upton
Hi Mingwei, On Tue, Sep 27, 2022 at 12:27:15AM +, 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

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

2022-09-26 Thread Mingwei Zhang
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