Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-11-01 Thread Christopher Friedt
Hi Jiri, Peter, Are you able to review the more recent version of this change? Look for the subject "[PATCH v4 x/3] hw: misc: edu: ..." I believe I addressed all concerns. Cheers, C On Mon, Oct 17, 2022 at 12:36 PM Christopher Friedt wrote: > > On Mon, Oct 17, 2022 at 2:23 AM Jiri Slaby wr

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-18 Thread Alex Bennée
Peter Maydell writes: > On Tue, 18 Oct 2022 at 10:21, Alex Bennée wrote: >> >> >> Jiri Slaby writes: >> >> > On 17. 10. 22, 16:13, Peter Maydell wrote: >> >> * for situations where the guest has misprogrammed the device, >> >> log that with qemu_log_mask(LOG_GUEST_ERROR, ...) >> >>

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-18 Thread Peter Maydell
On Tue, 18 Oct 2022 at 10:21, Alex Bennée wrote: > > > Jiri Slaby writes: > > > On 17. 10. 22, 16:13, Peter Maydell wrote: > >> * for situations where the guest has misprogrammed the device, > >> log that with qemu_log_mask(LOG_GUEST_ERROR, ...) > >> and continue with whatever the real

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-18 Thread Alex Bennée
Jiri Slaby writes: > On 17. 10. 22, 16:13, Peter Maydell wrote: >> * for situations where the guest has misprogrammed the device, >> log that with qemu_log_mask(LOG_GUEST_ERROR, ...) >> and continue with whatever the real hardware would do, or >> some reasonable choice if the h/w

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Jiri Slaby
On 17. 10. 22, 15:44, Alexander Bulekov wrote: On 221015 1710, Chris Friedt wrote: From: Christopher Friedt In the case that size1 was zero, because of the explicit 'end1 > addr' check, the range check would fail and the error message would read as shown below. The correct comparison is 'end1

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Jiri Slaby
On 17. 10. 22, 16:13, Peter Maydell wrote: * for situations where the guest has misprogrammed the device, log that with qemu_log_mask(LOG_GUEST_ERROR, ...) and continue with whatever the real hardware would do, or some reasonable choice if the h/w spec is vague As I wrote in the p

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Alex Bennée
Chris Friedt writes: >> On Oct 17, 2022, at 1:22 PM, Alex Bennée wrote: >> >> > >> >> Peter Maydell writes: >> On Mon, 17 Oct 2022 at 14:50, Alexander Bulekov wrote: On 221015 1710, Chris Friedt wrote: > From: Christopher Friedt > Reviewed-by: Alexander Bu

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Chris Friedt
> On Oct 17, 2022, at 1:22 PM, Alex Bennée wrote: > > > > > Peter Maydell writes: > >>> On Mon, 17 Oct 2022 at 14:50, Alexander Bulekov wrote: >>> >>> On 221015 1710, Chris Friedt wrote: From: Christopher Friedt >>> Reviewed-by: Alexander Bulekov >>> >>> As a side-note, se

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Alex Bennée
Peter Maydell writes: > On Mon, 17 Oct 2022 at 14:50, Alexander Bulekov wrote: >> >> On 221015 1710, Chris Friedt wrote: >> > From: Christopher Friedt >> > >> > In the case that size1 was zero, because of the explicit >> > 'end1 > addr' check, the range check would fail and the error >> > mes

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Christopher Friedt
On Mon, Oct 17, 2022 at 2:23 AM Jiri Slaby wrote: > On 15. 10. 22, 23:10, Chris Friedt wrote: > > From: Christopher Friedt > This should be split into two patches. This way, it's hard to review. I can do that :-) Thanks for the review

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Peter Maydell
On Mon, 17 Oct 2022 at 14:50, Alexander Bulekov wrote: > > On 221015 1710, Chris Friedt wrote: > > From: Christopher Friedt > > > > In the case that size1 was zero, because of the explicit > > 'end1 > addr' check, the range check would fail and the error > > message would read as shown below. The

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Jiri Slaby
On 15. 10. 22, 23:10, Chris Friedt wrote: From: Christopher Friedt In the case that size1 was zero, because of the explicit 'end1 > addr' check, the range check would fail and the error message would read as shown below. The correct comparison is 'end1 >= addr' (or 'addr <= end1'). EDU: DMA ra

Re: [v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Alexander Bulekov
On 221015 1710, Chris Friedt wrote: > From: Christopher Friedt > > In the case that size1 was zero, because of the explicit > 'end1 > addr' check, the range check would fail and the error > message would read as shown below. The correct comparison > is 'end1 >= addr' (or 'addr <= end1'). > > EDU

[v2] hw: misc: edu: fix 2 off-by-one errors

2022-10-15 Thread Chris Friedt
From: Christopher Friedt In the case that size1 was zero, because of the explicit 'end1 > addr' check, the range check would fail and the error message would read as shown below. The correct comparison is 'end1 >= addr' (or 'addr <= end1'). EDU: DMA range 0x4-0x3 out of bounds (0x4-0

[PATCH v2] hw: misc: edu: fix 2 off-by-one errors

2022-01-08 Thread Christopher Friedt
In the case that size1 was zero, because of the explicit 'end1 > addr' check, the range check would fail and the error message would read as shown below. The correct comparison is 'end1 >= addr' (or 'addr <= end1'). EDU: DMA range 0x4-0x3 out of bounds (0x4-0x3)! At the opposite e