summaryrefslogtreecommitdiffstats
path: root/src/usr/trace/bufferpage.C
Commit message (Collapse)AuthorAgeFilesLines
* Fix race condition in BufferPage allocation functionZach Clark2019-09-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BufferPage::claimEntry implements a lockfree algorithm to allocate space for trace messages within a single page of memory. In performing the bounds check for the allocation, a local copy of a member variable is created, and a compare-and-swap strategy is used to update the member variable with the new size of the allocated portion of the buffer. However, in the bounds check, the member variable was mistakenly used, rather than the local copy. This leads to a race condition where if the member variable is updated in memory by another thread between the time that its value is loaded from memory for the bounds check and loaded again for the local variable, the bounds check can succeed when it should fail and the allocation can go beyond the bounds of the page owned by the BufferPage object. This issue manifests only when the claimEntry function is compiled by GCC (versions 4.9.2 and 8.2.0 tested) with size optimization (-Os) because at this level, the compiler emits two load instructions for the value of the member variable. Using -O3, only a single load instruction is emitted and so the race condition is averted. Change-Id: I89fbffee9806972bab410c4bc75022a33793b453 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84284 Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com> Reviewed-by: Glenn Miles <milesg@ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E Bofferding <bofferdn@us.ibm.com>
* Log traces to error logs in HBRTMatt Derksen2017-10-191-1/+19
| | | | | | | | | | | | | | | | This enables buffer tracing at hostboot runtime. Will add these traces to runtime errors for better debug Change-Id: I795bb7deafdd02adea4588ebf8dfb11cbce116a0 RTC:172770 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48084 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
* Change copyright prolog for all files to Apache.Patrick Williams2014-05-211-11/+11
| | | | | | | Change-Id: I5664587b4f889099290ef50d50fa9ce5e580e1eb Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11167 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
* Lockless trace implementationPatrick Williams2012-12-141-0/+79
RTC: 35396 Change-Id: I96ea0d95606f04abb4dc2b0470345ca475b53912 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2520 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
OpenPOWER on IntegriCloud