Re: [PATCH] iommu: Up front sanity check in the arm_lpae_map

2020-12-07 Thread zhukeqian
Hi Robin, On 2020/12/7 20:46, Robin Murphy wrote: > On 2020-12-07 12:15, zhukeqian wrote: >> Hi, >> >> On 2020/12/7 20:05, Will Deacon wrote: >>> On Mon, Dec 07, 2020 at 12:01:09PM +, Robin Murphy wrote: On 2020-12-05 08:29, Keqian Zhu wrote: > ... then we have more chance to detect w

Re: [PATCH] iommu: Up front sanity check in the arm_lpae_map

2020-12-07 Thread Robin Murphy
On 2020-12-07 12:15, zhukeqian wrote: Hi, On 2020/12/7 20:05, Will Deacon wrote: On Mon, Dec 07, 2020 at 12:01:09PM +, Robin Murphy wrote: On 2020-12-05 08:29, Keqian Zhu wrote: ... then we have more chance to detect wrong code logic. I don't follow that justification - it's still the s

Re: [PATCH] iommu: Up front sanity check in the arm_lpae_map

2020-12-07 Thread zhukeqian
Hi, On 2020/12/7 20:05, Will Deacon wrote: > On Mon, Dec 07, 2020 at 12:01:09PM +, Robin Murphy wrote: >> On 2020-12-05 08:29, Keqian Zhu wrote: >>> ... then we have more chance to detect wrong code logic. >> >> I don't follow that justification - it's still the same check with the same >> out

Re: [PATCH] iommu: Up front sanity check in the arm_lpae_map

2020-12-07 Thread Will Deacon
On Mon, Dec 07, 2020 at 12:01:09PM +, Robin Murphy wrote: > On 2020-12-05 08:29, Keqian Zhu wrote: > > ... then we have more chance to detect wrong code logic. > > I don't follow that justification - it's still the same check with the same > outcome, so how does moving it have any effect on th

Re: [PATCH] iommu: Up front sanity check in the arm_lpae_map

2020-12-07 Thread Robin Murphy
On 2020-12-05 08:29, Keqian Zhu wrote: ... then we have more chance to detect wrong code logic. I don't follow that justification - it's still the same check with the same outcome, so how does moving it have any effect on the chance to detect errors? AFAICS the only difference it would make

Re: [PATCH] iommu: Up front sanity check in the arm_lpae_map

2020-12-07 Thread zhukeqian
Hi Will, On 2020/12/7 18:59, Will Deacon wrote: > On Sat, Dec 05, 2020 at 04:29:57PM +0800, Keqian Zhu wrote: >> ... then we have more chance to detect wrong code logic. > > This could do with being a bit more explicit. Something like: > > Although handling a mapping request with no permis

Re: [PATCH] iommu: Up front sanity check in the arm_lpae_map

2020-12-07 Thread Will Deacon
On Sat, Dec 05, 2020 at 04:29:57PM +0800, Keqian Zhu wrote: > ... then we have more chance to detect wrong code logic. This could do with being a bit more explicit. Something like: Although handling a mapping request with no permissions is a trivial no-op, defer the early return u

[PATCH] iommu: Up front sanity check in the arm_lpae_map

2020-12-05 Thread Keqian Zhu
... then we have more chance to detect wrong code logic. Signed-off-by: Keqian Zhu --- drivers/iommu/io-pgtable-arm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index a7a9bc08dcd1..8ade72adab31 10064