[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/7] hw/char/serial: Assert serial_ioport_read/write offset f
From: |
Richard Henderson |
Subject: |
Re: [PATCH 1/7] hw/char/serial: Assert serial_ioport_read/write offset fits 8 bytes |
Date: |
Fri, 11 Sep 2020 16:06:30 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 9/6/20 6:55 PM, Philippe Mathieu-Daudé wrote:
> The serial device has 8 registers, each 8-bit. The MemoryRegionOps
> 'serial_io_ops' is initialized with max_access_size=1, and all
> memory_region_init_io() callers correctly set the region size to
> 8 bytes:
> - serial_io_realize
> - serial_isa_realizefn
> - serial_pci_realize
> - multi_serial_pci_realize
>
> It is safe to assert the offset argument of serial_ioport_read()
> and serial_ioport_write() is always less than 8.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/char/serial.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
- [PATCH 0/7] hw/char/serial: Housekeeping, Philippe Mathieu-Daudé, 2020/09/06
- [PATCH 1/7] hw/char/serial: Assert serial_ioport_read/write offset fits 8 bytes, Philippe Mathieu-Daudé, 2020/09/06
- Re: [PATCH 1/7] hw/char/serial: Assert serial_ioport_read/write offset fits 8 bytes,
Richard Henderson <=
- [PATCH 2/7] hw/char/serial: Replace commented DPRINTF() by trace event, Philippe Mathieu-Daudé, 2020/09/06
- [PATCH 4/7] hw/char/serial: Rename I/O read/write trace events, Philippe Mathieu-Daudé, 2020/09/06
- [PATCH 5/7] hw/char/serial: Make 'wakeup' property boolean, Philippe Mathieu-Daudé, 2020/09/06
- [PATCH 3/7] hw/char/serial: Remove old DEBUG_SERIAL commented code, Philippe Mathieu-Daudé, 2020/09/06
- [PATCH 6/7] hw/char/serial-isa: Alias QDEV properties from generic serial object, Philippe Mathieu-Daudé, 2020/09/06
- [PATCH 7/7] hw/char/serial: Let SerialState have an 'id' field, Philippe Mathieu-Daudé, 2020/09/06