src/worker.cc
// More detailed error printout for hardware errors in memory or MMIO
// regions.
More detailed error printout for hardware errors in memory or MMIO
regions.
More detailed error printout for hardware errors in memory or MMIO regions .
void MemoryRegionThread::ProcessError(struct ErrorRecord *error,
                                      int priority,
                                      const char *message) {
  uint32 buffer_offset;
  if (phase_ == kPhaseCopy) {
    WorkerThread::ProcessError(error, priority, message);
  } else if (phase_ == kPhaseCheck) {
    os_->Flush(error->vaddr);
    error->reread = *(error->vaddr);
    char *good = reinterpret_cast<char*>(&(error->expected));
    char *bad = reinterpret_cast<char*>(&(error->actual));
    sat_assert(error->expected != error->actual);
    unsigned int offset = 0;
    for (offset = 0; offset < (sizeof(error->expected) - 1); offset++) {
      if (good[offset] != bad[offset])
        break;
    }
    error->vbyteaddr = reinterpret_cast<char*>(error->vaddr) + offset;
    buffer_offset = error->vbyteaddr - region_;
    error->paddr = os_->VirtualToPhysical(error->vbyteaddr);
    logprintf(priority,
              "%s: miscompare on %s, CRC check at %p(0x%llx), "
              "offset %llx: read:0x%016llx, reread:0x%016llx "
              "expected:0x%016llx\n",
              message,
              identifier_.c_str(),
              error->vaddr,
              error->paddr,
              buffer_offset,
              error->actual,
              error->reread,
              error->expected);
  } else {
    logprintf(0, "Process Error: memory region thread raised an "
              "unexpected error.");
  }
}
void MemoryRegionThread :: ProcessError ( struct ErrorRecord * error , int priority , const char * message ) { uint32 buffer_offset ; if ( phase_ == kPhaseCopy ) { WorkerThread :: ProcessError ( error , priority , message ) ; } else if ( phase_ == kPhaseCheck ) { os_ -> Flush ( error -> vaddr ) ; error -> reread = * ( error -> vaddr ) ; char * good = reinterpret_cast < char * > ( & ( error -> expected ) ) ; char * bad = reinterpret_cast < char * > ( & ( error -> actual ) ) ; sat_assert ( error -> expected != error -> actual ) ; unsigned int offset = 0 ; for ( offset = 0 ; offset < ( sizeof ( error -> expected ) - 1 ) ; offset ++ ) { if ( good [ offset ] != bad [ offset ] ) break ; } error -> vbyteaddr = reinterpret_cast < char * > ( error -> vaddr ) + offset ; buffer_offset = error -> vbyteaddr - region_ ; error -> paddr = os_ -> VirtualToPhysical ( error -> vbyteaddr ) ; logprintf ( priority , " " " " " \n " , message , identifier_ . c_str ( ) , error -> vaddr , error -> paddr , buffer_offset , error -> actual , error -> reread , error -> expected ) ; } else { logprintf ( 0 , " " " " ) ; } }
More detailed error printout for hardware errors in memory or MMIO
regions.
More detailed error printout for hardware errors in memory or MMIO regions .
// If the error occurred on the Copy Phase, it means that // the source data (i.e., the main memory) is wrong. so // just pass it to the original ProcessError to call a // bad-dimm error // A error on the Check Phase means that the memory region tested // has an error. Gathering more information and then reporting // the error. // Determine if this is a write or read error. // Find physical address if possible.