Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Feb 2008 02:49:35 GMT
From:      Arthur Hartwig <arthur.hartwig@nokia.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/120516: Intel "G0" stepping Xeon CPUs perform badly
Message-ID:  <200802110249.m1B2nZRQ015876@www.freebsd.org>
Resent-Message-ID: <200802110300.m1B305VQ069874@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         120516
>Category:       misc
>Synopsis:       Intel "G0" stepping Xeon CPUs perform badly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 11 03:00:04 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Arthur Hartwig
>Release:        6.3 but applies to all FreeBSD versions
>Organization:
Nokia
>Environment:
>Description:
The Intel Xeon "G0" stepping CPU (family/id values = 0x6fb) perform badly.

Intel has released some documentation stating that the MTRR base and mask register values for the CPU stepping should hold values significant to 38 bits corresponding to the 38 bits of physical address on these CPUs (up from 36 bits of physical address on previous CPUs).

FreeBSD leaves the boot CPU MTRRs alone but (in i686_mrstoreone() in sys/i386/i386/i686_mem.c) masks the AP MTRRs to 36 bits. In Nokia testing using a custome memory stress tester we saw a "B3" stepping CPU (family/id value of 0x6f7) do around 38 test cycles per minute on each of the two CPUs enabled. When the two quad core CPU packages were replaced by G0 stepping quad core CPUs the number of test cycles dropped to 32 on CPU0 and 0.6 on CPU1. Though the BIOS was correctly setting the MTRRs to the 38 bit values recommended by Intel FreeBSD was masking them to 36 bits on the non boot cpu (e.g. base and mask of 0x00000000c0000000 and 0x00000003f0000000 became 0x00000000c0000000 and 0x00000000f0000000).

Because the BIOS was known to correctly set the MTRRs the call to mem_range_AP_init() in init_secondary() in i386/i386/mp_machdep.c was removed so the AP MTRRs were not modified. Then CPU0 ran about 38 test cycles per minute and CPU1 about 39 test cycles per minute.


>How-To-Repeat:

>Fix:
If it is felt that FreeBSD cannot rely on the BIOS to correctly set the MTRRs then the best fix is probably to modify i686_mrstoreone() to use the cpuid instruction to determine the physical address width of memory and construct appropriately sized masks.

This problem most likely also affects the amd64 architecture but I have not looked into that issue.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802110249.m1B2nZRQ015876>