Beispiel #1
0
            for before in xrange(offset, index + 1):
                v = region[before]
                if not (v == 0xff):
                    self.reporting.report_bad_memory(
                        physaddr + before - offset, 0xff, v)
                    error_offset = before

            for after in xrange(index + 1, last_element):
                v = region[after]
                if not (v == 0x00):
                    self.reporting.report_bad_memory(physaddr + after - offset,
                                                     0x00, v)
                    error_offset = after

        # Test all ZEROes - second reset
        for index in xrange(offset, last_element):
            region[index] = 0

        for index in xrange(offset, last_element):
            v = region[index]
            if not (v == 0):
                self.reporting.report_bad_memory(physaddr + index - offset, 0,
                                                 v)
                error_offset = index

        return error_offset


ScannerBaseclass.register(QuadraticScanner)
Beispiel #2
0
        return error_offsets

    return type(
        clsname, (ScannerBaseclass, ), {
            'name': staticmethod(name),
            'shortname': staticmethod(shortname),
            'test': test
        })


Memtest86AddressBits = build_class(
    "Memtest86AddressBits",
    "Memtest86+ #0: Address test, walking ones",
    "xmt86-addressbits",  # renamed because it needs a really large memory block
    memtest86pcext.address_bits)
ScannerBaseclass.register(Memtest86AddressBits)

Memtest86AddressOwn = build_class("Memtest86AddressOwn",
                                  "Memtest86+ #1: Address test, own address",
                                  "mt86-addressown",
                                  memtest86pcext.address_own)
ScannerBaseclass.register(Memtest86AddressOwn)

Memtest86MovingInvOnesZeros = build_class(
    "Memtest86MovingInvOnesZeros",
    "Memtest86+ #2: Moving inversions, ones & zeros", "mt86-mvinv10",
    memtest86pcext.mv_inv_onezeros)
ScannerBaseclass.register(Memtest86MovingInvOnesZeros)

Memtest86MovingInv8Bit = build_class(
    "Memtest86MovingInv8Bit",
Beispiel #3
0
        '''
        self.reporting = reporting

    @staticmethod
    def name():
        return "Linear time test (CExt)"

    @staticmethod
    def shortname():
        return "linear-cext"

    def test_single(self, region, offset, physaddr):
        """
        - region supports __getitem(x)__ and __setitem(x,b)__, with b being casted to a byte 
        - offset is the first byte tested, The bytes region[offset..offset+PAGE_SIZE-1] are tested
        
        return: None if page ok, offset of an error if test failed
        """
        
        error_offset = None
        ret = memtestcext.lineartest(region.get_mmap(), offset, physmem.PAGE_SIZE)

        # TODO: do proper reporting
        if ret >= 0:
            self.reporting.report_bad_memory(physaddr + ret, 0x55, 0xaa)
            error_offset = offset + ret

        return error_offset

ScannerBaseclass.register(LinearCExtScanner)
Beispiel #4
0
                frame = item/physmem.PAGE_SIZE
                self.reporting.report_bad_memory(physaddr[frame] + item % physmem.PAGE_SIZE, 0x55, 0xaa)

        return error_offsets

    return type(clsname, (ScannerBaseclass,), {
            'name': staticmethod(name),
            'shortname': staticmethod(shortname),
            'test': test
            })

Memtest86AddressBits = build_class("Memtest86AddressBits",
                                   "Memtest86+ #0: Address test, walking ones",
                                   "xmt86-addressbits", # renamed because it needs a really large memory block
                                   memtest86pcext.address_bits)
ScannerBaseclass.register(Memtest86AddressBits)

Memtest86AddressOwn = build_class("Memtest86AddressOwn",
                                  "Memtest86+ #1: Address test, own address",
                                  "mt86-addressown",
                                  memtest86pcext.address_own)
ScannerBaseclass.register(Memtest86AddressOwn)

Memtest86MovingInvOnesZeros = build_class("Memtest86MovingInvOnesZeros",
                                          "Memtest86+ #2: Moving inversions, ones & zeros",
                                          "mt86-mvinv10",
                                          memtest86pcext.mv_inv_onezeros)
ScannerBaseclass.register(Memtest86MovingInvOnesZeros)

Memtest86MovingInv8Bit = build_class("Memtest86MovingInv8Bit",
                                     "Memtest86+ #3: Moving inversions, 8 bit pattern",
Beispiel #5
0
        # Test all ONEs -- quadratic runtime (linear number of writes, quadratic number of reads)
        for index in xrange(offset, last_element):
            region[index] = 0xff
            
            for before in xrange(offset, index + 1):
                v =  region[before]
                if not (v == 0xff):
                    self.reporting.report_bad_memory(physaddr + before - offset, 0xff, v)
                    error_offset = before
            
            for after in xrange( index + 1, last_element):
                v =  region[after]
                if not (v == 0x00):
                    self.reporting.report_bad_memory(physaddr + after - offset, 0x00, v)
                    error_offset = after
                
         
        # Test all ZEROes - second reset
        for index in xrange(offset, last_element):
            region[index] = 0
        
        for index in xrange(offset, last_element):
            v =  region[index]
            if not (v == 0):
                self.reporting.report_bad_memory(physaddr + index - offset, 0, v)
                error_offset = index
   
        return error_offset

ScannerBaseclass.register(QuadraticScanner)