What is happening under the hood when a 5D Mk3 displays a histogram (luminance or RGB)? What exactly is the data it uses (raw sensor data, jpeg or something else)?
The majority of cameras use the JPEG preview (with picture styles applied) embedded in a RAW file as the source data for the histogram and blinkies. In other words, it's just using what's sent to your LCD display for review. This is probably due to limited processor load and data paths, and is a cause for complaint among photographers--that the data they're seeing represented is based on after-compression data of roughly 1/10th of the image. You may actually have more latitude on either end of the scale with RAW files.
The closest you might be able to get to true representation of the histogram of your RAW file is to use the Magic Lantern firmware add-on and enable RAW histograms.