src/worker.cc
// Print error information about a data miscompare.
Print error information about a data miscompare.
Print error information about a data miscompare .
void WorkerThread::ProcessTagError(struct ErrorRecord *error,
                                   int priority,
                                   const char *message) {
  char dimm_string[256] = "";
  char tag_dimm_string[256] = "";
  bool read_error = false;
  int apic_id = apicid();
  os_->Flush(error->vaddr);
  error->reread = *(error->vaddr);
  if (error->actual != error->reread) {
    read_error = true;
  }
  sat_assert(error->expected != error->actual);
  error->vbyteaddr = reinterpret_cast<char*>(error->vaddr);
  error->paddr = os_->VirtualToPhysical(error->vbyteaddr);
  error->tagpaddr = os_->VirtualToPhysical(error->tagvaddr);
  os_->FindDimm(error->paddr, dimm_string, sizeof(dimm_string));
  os_->FindDimm(error->tagpaddr, tag_dimm_string, sizeof(tag_dimm_string));
  if (priority < 5) {
    logprintf(priority,
              "%s: Tag from %p(0x%llx:%s) (%s) "
              "miscompare on CPU %d(0x%s) at %p(0x%llx:%s): "
              "read:0x%016llx, reread:0x%016llx expected:0x%016llx\n",
              message,
              error->tagvaddr, error->tagpaddr,
              tag_dimm_string,
              read_error ? "read error" : "write error",
              apic_id,
              CurrentCpusFormat().c_str(),
              error->vaddr,
              error->paddr,
              dimm_string,
              error->actual,
              error->reread,
              error->expected);
  }
  errorcount_ += 1;
  *(error->vaddr) = error->expected;
  os_->Flush(error->vaddr);
}
void WorkerThread :: ProcessTagError ( struct ErrorRecord * error , int priority , const char * message ) { char dimm_string [ 256 ] = " " ; char tag_dimm_string [ 256 ] = " " ; bool read_error = false ; int apic_id = apicid ( ) ; os_ -> Flush ( error -> vaddr ) ; error -> reread = * ( error -> vaddr ) ; if ( error -> actual != error -> reread ) { read_error = true ; } sat_assert ( error -> expected != error -> actual ) ; error -> vbyteaddr = reinterpret_cast < char * > ( error -> vaddr ) ; error -> paddr = os_ -> VirtualToPhysical ( error -> vbyteaddr ) ; error -> tagpaddr = os_ -> VirtualToPhysical ( error -> tagvaddr ) ; os_ -> FindDimm ( error -> paddr , dimm_string , sizeof ( dimm_string ) ) ; os_ -> FindDimm ( error -> tagpaddr , tag_dimm_string , sizeof ( tag_dimm_string ) ) ; if ( priority < 5 ) { logprintf ( priority , " " " " " \n " , message , error -> tagvaddr , error -> tagpaddr , tag_dimm_string , read_error ? " " : " " , apic_id , CurrentCpusFormat ( ) . c_str ( ) , error -> vaddr , error -> paddr , dimm_string , error -> actual , error -> reread , error -> expected ) ; } errorcount_ += 1 ; * ( error -> vaddr ) = error -> expected ; os_ -> Flush ( error -> vaddr ) ; }
Print error information about a data miscompare.
Print error information about a data miscompare .
// Determine if this is a write or read error. // Distinguish read and write errors. // Find physical address if possible. // Pretty print DIMM mapping if available. // Pretty print DIMM mapping if available. // Report parseable error. // Overwrite incorrect data with correct data to prevent // future miscompares when this data is reused.