Message ID | 20160718110122.13149.24916.stgit@hegdevasant.in.ibm.com |
---|---|
State | Accepted |
Headers | show |
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes: > We have used TCE_MASK value (4095) instead of TCE_PSIZE (4096) to align memory > source address. In some corner cases (like source memory size = 4097) we may > endup doing wrong mapping and corrupting part of SYSDUMP. > > This patch uses ALIGN_UP macro with TCE_PSIZE value for alignining memory. > > Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> > --- > hw/fsp/fsp-mdst-table.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Merged to master as of a7f9956 Should this also head to stable? (presumably 5.1)?
On 07/28/2016 10:04 AM, Stewart Smith wrote: > Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes: > >> We have used TCE_MASK value (4095) instead of TCE_PSIZE (4096) to align memory >> source address. In some corner cases (like source memory size = 4097) we may >> endup doing wrong mapping and corrupting part of SYSDUMP. >> >> This patch uses ALIGN_UP macro with TCE_PSIZE value for alignining memory. >> >> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> >> --- >> hw/fsp/fsp-mdst-table.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > Merged to master as of a7f9956 > > Should this also head to stable? (presumably 5.1)? Yes please. -Vasant
diff --git a/hw/fsp/fsp-mdst-table.c b/hw/fsp/fsp-mdst-table.c index e6018aa..0f145ba 100644 --- a/hw/fsp/fsp-mdst-table.c +++ b/hw/fsp/fsp-mdst-table.c @@ -90,7 +90,7 @@ static inline uint32_t get_dump_region_map_size(uint64_t addr, uint32_t size) start = addr & ~TCE_MASK; end = addr + size; - end = (end + (TCE_MASK - 1)) & ~TCE_MASK; + end = ALIGN_UP(end, TCE_PSIZE); return (end - start); }
We have used TCE_MASK value (4095) instead of TCE_PSIZE (4096) to align memory source address. In some corner cases (like source memory size = 4097) we may endup doing wrong mapping and corrupting part of SYSDUMP. This patch uses ALIGN_UP macro with TCE_PSIZE value for alignining memory. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> --- hw/fsp/fsp-mdst-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)