[PATCH v4 2/3] hw: misc: edu: rename local vars in edu_check_range

2022-10-18 Thread Chris Friedt
This serves to make the local variables a bit less ambiguous. The latter two arguments are named to match DMA_START, and DMA_SIZE. Signed-off-by: Chris Friedt --- hw/misc/edu.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c

[PATCH v4 1/3] hw: misc: edu: fix 2 off-by-one errors

2022-10-18 Thread Chris Friedt
opposite end, in the case that size1 was 4096, within() would fail because of the non-inclusive check 'end1 < end2', which should have been 'end1 <= end2'. The error message would previously say EDU: DMA range 0x4-0x40fff out of bounds (0x4-0x40fff)!

[PATCH v4 3/3] hw: misc: edu: use qemu_log_mask instead of hw_error

2022-10-18 Thread Chris Friedt
Log a guest error instead of a hardware error when the guest tries to DMA to / from an invalid address. Signed-off-by: Chris Friedt --- hw/misc/edu.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 52afbd792a..a18f803815 100644

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 >&

[PATCH v3 2/2] hw: misc: edu: rename local vars in edu_check_range

2022-10-17 Thread Chris Friedt
This serves to make the local variables a bit less ambiguous. The latter two arguments are named to match DMA_START, and DMA_SIZE. Signed-off-by: Chris Friedt --- hw/misc/edu.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c

[PATCH v3 1/2] hw: misc: edu: fix 2 off-by-one errors

2022-10-17 Thread Chris Friedt
//gitlab.com/qemu-project/qemu/-/issues/1254 Signed-off-by: Chris Friedt --- hw/misc/edu.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index e935c418d4..b3de8d206a 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -103,1

[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] hw: misc: edu: fix 2 off-by-one errors

2022-10-14 Thread Chris Friedt
(0x4-0x40fff)! Note: the original change (and error message) was when parameters were uint32_t. Signed-off-by: Chris Friedt Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1254 --- hw/misc/edu.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/misc/e