|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] ns16550: limit mapped MMIO size
commit b9730aaae72b813f0e01124e79ccc3b25509f3d3
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Nov 17 13:23:11 2015 +0100
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Nov 17 13:23:11 2015 +0100
ns16550: limit mapped MMIO size
There's no point in mapping more than the memory we actually may need
to touch, and in fact the too large region could actually extend into
another device's one (which currently is benign on x86 since only a
single page gets mapped anyway, but which is a latent bug on ARM
whenever PCI support gets enabled there).
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
xen/drivers/char/ns16550.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index ebe01ec..09abca8 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -931,6 +931,8 @@ pci_uart_config(struct ns16550 *uart, bool_t skip_amt,
unsigned int bar_idx)
uart->io_base += bar_idx * uart_param[p].uart_offset;
if ( uart_param[p].base_baud )
uart->clock_hz = uart_param[p].base_baud * 16;
+ size = max(8U << uart_param[p].reg_shift,
+ uart_param[p].uart_offset);
/* Set device and MMIO region read only to Dom0 */
uart->enable_ro = 1;
break;
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |