lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120921123645.GD26869@aftab.osrc.amd.com>
Date:	Fri, 21 Sep 2012 14:36:45 +0200
From:	Borislav Petkov <bp@...64.org>
To:	Josh Hunt <johunt@...mai.com>
Cc:	"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] amd64_edac: Memory size reported double on processor
 family 0Fh

On Fri, Sep 14, 2012 at 09:39:00AM -0500, Josh Hunt wrote:
> On 09/14/2012 07:55 AM, Josh Hunt wrote:
> >
> >Thanks to your help I was able to test your branch, but it still does
> >not resolve the problem. Removal of the "factor=1" workaround fixes the
> >memory size reporting on boot, but the sysfs values are still incorrect.
> >
> 
> Please disregard what I said earlier about the shift still being
> wrong. Looking at the dmesg more I see now that the # of pages are
> correctly reported (262144), however sysfs is still wrong.
> 
> [   25.837588] EDAC DEBUG: init_csrows: MC node: 0, csrow: 0
> [   25.837589] EDAC DEBUG: amd64_csrow_nr_pages: csrow: 0, channel:
> 0, DBAM idx: 2
> [   25.837591] EDAC DEBUG: amd64_csrow_nr_pages: nr_pages/channel: 262144
> [   25.837592] EDAC amd64: CS0: Unbuffered DDR2 RAM
> [   25.837724] EDAC DEBUG: init_csrows: Total csrow0 pages: 262144
> [   25.837725] DBG: init_csrows: channel_count:2
> [   25.837856] DBG: init_csrows: channel_count:2
> [   25.837988] EDAC DEBUG: init_csrows: MC node: 0, csrow: 1
> [   25.837989] EDAC DEBUG: amd64_csrow_nr_pages: csrow: 1, channel:
> 0, DBAM idx: 2
> [   25.837991] EDAC DEBUG: amd64_csrow_nr_pages: nr_pages/channel: 262144
> [   25.837992] EDAC amd64: CS1: Unbuffered DDR2 RAM
> [   25.838157] EDAC DEBUG: init_csrows: Total csrow1 pages: 262144
> [   25.838158] DBG: init_csrows: channel_count:2
> [   25.838289] DBG: init_csrows: channel_count:2
> [   25.838421] EDAC DEBUG: init_csrows: MC node: 0, csrow: 2
> [   25.838422] EDAC DEBUG: amd64_csrow_nr_pages: csrow: 2, channel:
> 0, DBAM idx: 2
> [   25.838424] EDAC DEBUG: amd64_csrow_nr_pages: nr_pages/channel: 262144
> [   25.838425] EDAC amd64: CS2: Unbuffered DDR2 RAM
> [   25.838556] EDAC DEBUG: init_csrows: Total csrow2 pages: 262144
> [   25.838558] DBG: init_csrows: channel_count:2
> [   25.838689] DBG: init_csrows: channel_count:2
> [   25.838820] EDAC DEBUG: init_csrows: MC node: 0, csrow: 3
> [   25.838822] EDAC DEBUG: amd64_csrow_nr_pages: csrow: 3, channel:
> 0, DBAM idx: 2
> [   25.838823] EDAC DEBUG: amd64_csrow_nr_pages: nr_pages/channel: 262144
> [   25.838824] EDAC amd64: CS3: Unbuffered DDR2 RAM
> [   25.838957] EDAC DEBUG: init_csrows: Total csrow3 pages: 262144
> 
> I looked into this and see that sysfs is doing the double counting
> b/c it loops over the # of channels:
> 
> [  131.423949] DBG: csrow_size_show: i:0 nr_pages:262144 nr_channels:2
> [  131.424112] DBG: csrow_size_show: i:1 nr_pages:524288 nr_channels:2
> 
> I verified this in init_csrows:
> [   25.838958] DBG: init_csrows: channel_count:2
> 
> Since I don't know the details of the hardware here it's hard for me
> to suggest a fix, but it would seem that k8_early_channel_count()
> needs to be modified to only return 1 in this case?

Ok, I think this is still the old code you're looking at so it would be
cool if you could test with my patchset I sent you last week.

Because with it, it all looks fine on my K8 here:

It has 2 2048MB single-ranked DIMMs on each node and edac output looks
like this:

[   52.920302] EDAC DEBUG: amd64_debug_display_dimm_sizes: F2x080 (DRAM Bank Address Mapping): 0x00000060
[   52.920302] EDAC MC: DCT0 chip selects:
[   52.920304] EDAC amd64: MC: 0:     0MB 1:     0MB
[   52.920305] EDAC amd64: MC: 2:  2048MB 3:  2048MB
[   52.920306] EDAC amd64: MC: 4:     0MB 5:     0MB
[   52.920308] EDAC amd64: MC: 6:     0MB 7:     0MB

...

[   52.920344] EDAC DEBUG: init_csrows: node 1, NBCFG=0x0ad00044[ChipKillEccCap: 1|DramEccEn: 1]
[   52.920345] EDAC DEBUG: init_csrows: MC node: 1, csrow: 2
[   52.920346] EDAC DEBUG: amd64_csrow_nr_pages: csrow: 2, channel: 0, DBAM idx: 6
[   52.920347] EDAC DEBUG: amd64_csrow_nr_pages: nr_pages/channel: 524288
[   52.920348] EDAC amd64: CS2: Registered DDR2 RAM
[   52.920350] EDAC DEBUG: init_csrows: Total csrow2 pages: 524288
[   52.920351] EDAC DEBUG: init_csrows: MC node: 1, csrow: 3
[   52.920352] EDAC DEBUG: amd64_csrow_nr_pages: csrow: 3, channel: 0, DBAM idx: 6
[   52.920353] EDAC DEBUG: amd64_csrow_nr_pages: nr_pages/channel: 524288
[   52.920354] EDAC amd64: CS3: Registered DDR2 RAM
[   52.920355] EDAC DEBUG: init_csrows: Total csrow3 pages: 524288

$ cat /sys/devices/system/edac/mc/mc0/csrow2/size_mb
2048
$ cat /sys/devices/system/edac/mc/mc0/csrow3/size_mb
2048

So what am I missing?

Thanks.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ