Hello community, here is the log from the commit of package mcelog for openSUSE:Factory checked in at 2016-02-12 11:21:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mcelog (Old) and /work/SRC/openSUSE:Factory/.mcelog.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mcelog" Changes: -------- --- /work/SRC/openSUSE:Factory/mcelog/mcelog.changes 2015-07-05 17:57:38.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.mcelog.new/mcelog.changes 2016-02-12 11:21:15.000000000 +0100 @@ -1,0 +2,11 @@ +Thu Jan 28 14:25:26 UTC 2016 - tr...@suse.de + +- Update to latest version 1.29. + Mostly little bug fixes. + +------------------------------------------------------------------- +Mon Sep 28 13:26:21 UTC 2015 - tr...@suse.de + +- Update to version v124. Adds skylake CPU support and some bug fixes. + +------------------------------------------------------------------- Old: ---- mcelog-1.20.tar.bz2 New: ---- mcelog-1.29.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mcelog.spec ++++++ --- /var/tmp/diff_new_pack.YvKqG2/_old 2016-02-12 11:21:16.000000000 +0100 +++ /var/tmp/diff_new_pack.YvKqG2/_new 2016-02-12 11:21:16.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package mcelog # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,16 +17,12 @@ Name: mcelog +Version: 1.29 +Release: 0 Summary: Log Machine Check Events License: GPL-2.0 Group: System/Monitoring -Version: 1.20 -Release: 0 -ExclusiveArch: %{ix86} x86_64 -BuildRequires: libesmtp-devel -BuildRequires: pkgconfig(systemd) -BuildRequires: pkgconfig(udev) -Requires: logrotate +Url: https://git.kernel.org/cgit/utils/cpu/mce/mcelog.git Source: mcelog-%{version}.tar.bz2 Source2: mcelog.sysconfig Source3: mcelog.systemd @@ -45,17 +41,20 @@ Patch10: patches/add-f16h-support.patch Patch11: mcelog-socket-path.patch Patch12: fix_setgroups_missing_call.patch - -BuildRoot: %{_tmppath}/%{name}-%{version}-build -PreReq: %fillup_prereq -Url: https://git.kernel.org/cgit/utils/cpu/mce/mcelog.git +BuildRequires: libesmtp-devel +BuildRequires: pkgconfig(systemd) +BuildRequires: pkgconfig(udev) +Requires: logrotate +Requires(pre): %fillup_prereq # Previously version was wrong, mainline decided to go for 1.0.1. not 1.1 Obsoletes: mcelog = 1.1 +BuildRoot: %{_tmppath}/%{name}-%{version}-build +ExclusiveArch: %ix86 x86_64 %{?systemd_requires} %description mcelog retrieves machine check events from an x86-64 kernel in a cron -job, decodes them, and logs them to /var/log/mcelog. +job, decodes them, and logs them to %{_localstatedir}/log/mcelog. A machine check event is a hardware error detected by the CPU. @@ -63,12 +62,6 @@ In addition, it allows decoding machine check kernel panic messages. - - -Authors: --------- - Andi Kleen <a...@firstfloor.org> - %prep %setup -q %patch1 -p1 @@ -86,38 +79,34 @@ %build export SUSE_ASNEEDED=0 -make CFLAGS="$RPM_OPT_FLAGS" +make %{?_smp_mflags} CFLAGS="%{optflags}" %install -export prefix=$RPM_BUILD_ROOT/usr -export etcprefix=$RPM_BUILD_ROOT +export prefix=%{buildroot}%{_prefix} +export etcprefix=%{buildroot} make -e install -mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/ -install -m644 mcelog.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/mcelog - -mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates -install -m 644 %SOURCE2 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mcelog +mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/ +install -m644 mcelog.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/mcelog -mkdir -p $RPM_BUILD_ROOT/%_docdir/%name -install -m 644 %SOURCE6 $RPM_BUILD_ROOT/%_docdir/%name/README.email_setup -install -m 644 lk10-mcelog.pdf $RPM_BUILD_ROOT/%_docdir/%name/lk10-mcelog.pdf -install -D -m 0644 %SOURCE3 %{buildroot}%{_unitdir}/mcelog.service -install -D -m 0644 %SOURCE4 %{buildroot}%{_udevrulesdir}/90-mcelog.rules -install -D -m 0644 %SOURCE5 %{buildroot}%{_tmpfilesdir}/mcelog.conf -ln -sf %_sbindir/service ${RPM_BUILD_ROOT}%_sbindir/rcmcelog +mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates +install -m 644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.mcelog -%clean -rm -rf $RPM_BUILD_ROOT +mkdir -p %{buildroot}/%{_docdir}/%{name} +install -m 644 %{SOURCE6} %{buildroot}/%{_docdir}/%{name}/README.email_setup +install -m 644 lk10-mcelog.pdf %{buildroot}/%{_docdir}/%{name}/lk10-mcelog.pdf +install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/mcelog.service +install -D -m 0644 %{SOURCE4} %{buildroot}%{_udevrulesdir}/90-mcelog.rules +install -D -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/mcelog.conf +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcmcelog %pre %service_add_pre %{name}.service %post %fillup_only -%{?tmpfiles_create:%tmpfiles_create %{_tmpfilesdir}/mcelog.conf} %udev_rules_update - %service_add_post %{name}.service +%{?tmpfiles_create:%tmpfiles_create %{_tmpfilesdir}/mcelog.conf} %preun %service_del_preun %{name}.service @@ -129,17 +118,17 @@ %defattr (-,root,root,755) %{_mandir}/man8/* %{_mandir}/man5/* -/usr/sbin/mcelog -%config /etc/logrotate.d/mcelog -%dir /etc/mcelog -%config /etc/mcelog/mcelog.conf -/var/adm/fillup-templates/sysconfig.mcelog -/etc/mcelog/*trigger +%{_sbindir}/mcelog +%config %{_sysconfdir}/logrotate.d/mcelog +%dir %{_sysconfdir}/mcelog +%config %{_sysconfdir}/mcelog/mcelog.conf +%{_localstatedir}/adm/fillup-templates/sysconfig.mcelog +%{_sysconfdir}/mcelog/*trigger %{_unitdir}/mcelog.service %{_udevrulesdir}/90-mcelog.rules %{_tmpfilesdir}/mcelog.conf -%_docdir/%name -%_sbindir/rcmcelog +%{_docdir}/%{name} +%{_sbindir}/rcmcelog %ghost /run/mcelog %changelog ++++++ Start-consolidating-AMD-specific-stuff.patch ++++++ --- /var/tmp/diff_new_pack.YvKqG2/_old 2016-02-12 11:21:16.000000000 +0100 +++ /var/tmp/diff_new_pack.YvKqG2/_new 2016-02-12 11:21:16.000000000 +0100 @@ -16,22 +16,22 @@ rename k8.c => amd.c (97%) rename k8.h => amd.h (79%) -Index: mcelog-1.20/Makefile +Index: mcelog-1.29/Makefile =================================================================== ---- mcelog-1.20.orig/Makefile 2015-06-15 15:15:14.281052761 +0200 -+++ mcelog-1.20/Makefile 2015-06-15 15:15:52.523239254 +0200 -@@ -33,7 +33,7 @@ +--- mcelog-1.29.orig/Makefile 2016-01-28 15:33:45.402475555 +0100 ++++ mcelog-1.29/Makefile 2016-01-28 15:33:51.646831409 +0100 +@@ -33,7 +33,7 @@ all: mcelog - .PHONY: install clean depend + .PHONY: install clean depend FORCE -OBJ := p4.o k8.o mcelog.o dmi.o tsc.o core2.o bitfield.o intel.o \ +OBJ := p4.o amd.o mcelog.o dmi.o tsc.o core2.o bitfield.o intel.o \ nehalem.o dunnington.o tulsa.o config.o memutil.o msg.o \ eventloop.o leaky-bucket.o memdb.o server.o trigger.o \ client.o cache.o sysfs.o yellow.o page.o rbtree.o \ -Index: mcelog-1.20/k8.c +Index: mcelog-1.29/k8.c =================================================================== ---- mcelog-1.20.orig/k8.c 2015-06-15 14:25:23.000000000 +0200 +--- mcelog-1.29.orig/k8.c 2016-01-20 18:33:20.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,281 +0,0 @@ -/* Based on K8 decoding code written for the 2.4 kernel by Andi Kleen and @@ -315,10 +315,10 @@ - } - return 1; -} -Index: mcelog-1.20/amd.c +Index: mcelog-1.29/amd.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mcelog-1.20/amd.c 2015-06-15 15:15:52.531239713 +0200 ++++ mcelog-1.29/amd.c 2016-01-28 15:33:51.646831409 +0100 @@ -0,0 +1,282 @@ +/* Based on K8 decoding code written for the 2.4 kernel by Andi Kleen and + * Eric Morton. Hacked and extended for mcelog by AK. @@ -602,9 +602,9 @@ + } + return 1; +} -Index: mcelog-1.20/k8.h +Index: mcelog-1.29/k8.h =================================================================== ---- mcelog-1.20.orig/k8.h 2015-06-15 14:25:23.000000000 +0200 +--- mcelog-1.29.orig/k8.h 2016-01-20 18:33:20.000000000 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -char *k8_bank_name(unsigned num); @@ -618,10 +618,10 @@ -#define K8_MCELOG_THRESHOLD_LINK (4 * 9 + 1) -#define K8_MCELOG_THRESHOLD_L3_CACHE (4 * 9 + 2) -#define K8_MCELOG_THRESHOLD_FBDIMM (4 * 9 + 3) -Index: mcelog-1.20/amd.h +Index: mcelog-1.29/amd.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mcelog-1.20/amd.h 2015-06-15 15:15:52.539240159 +0200 ++++ mcelog-1.29/amd.h 2016-01-28 15:33:51.650831636 +0100 @@ -0,0 +1,14 @@ +char *k8_bank_name(unsigned num); +void decode_amd_mc(enum cputype, struct mce *mce, int *ismemerr); @@ -637,10 +637,10 @@ + +#define CASE_AMD_CPUS \ + case CPU_K8 -Index: mcelog-1.20/mcelog.c +Index: mcelog-1.29/mcelog.c =================================================================== ---- mcelog-1.20.orig/mcelog.c 2015-06-15 15:15:14.293053554 +0200 -+++ mcelog-1.20/mcelog.c 2015-06-15 15:15:52.543240384 +0200 +--- mcelog-1.29.orig/mcelog.c 2016-01-28 15:33:45.406475783 +0100 ++++ mcelog-1.29/mcelog.c 2016-01-28 15:33:51.650831636 +0100 @@ -41,7 +41,7 @@ #include <fnmatch.h> #include "mcelog.h" @@ -650,7 +650,7 @@ #include "intel.h" #include "p4.h" #include "dmi.h" -@@ -410,9 +410,9 @@ +@@ -419,9 +419,9 @@ static void dump_mce(struct mce *m, unsi time_t t = m->time; Wprintf("TIME %llu %s", m->time, ctime(&t)); } ++++++ email.patch ++++++ --- /var/tmp/diff_new_pack.YvKqG2/_old 2016-02-12 11:21:16.000000000 +0100 +++ /var/tmp/diff_new_pack.YvKqG2/_new 2016-02-12 11:21:16.000000000 +0100 @@ -7,26 +7,27 @@ msg.c | 8 ++ 6 files changed, 343 insertions(+), 2 deletions(-) -Index: mcelog-1.20/Makefile +Index: mcelog-1.29/Makefile =================================================================== ---- mcelog-1.20.orig/Makefile 2015-06-15 14:25:23.000000000 +0200 -+++ mcelog-1.20/Makefile 2015-06-15 15:15:14.281052761 +0200 +--- mcelog-1.29.orig/Makefile 2016-01-20 18:33:20.000000000 +0100 ++++ mcelog-1.29/Makefile 2016-02-01 17:35:54.959649090 +0100 @@ -1,3 +1,4 @@ +CONFIG_EMAIL := 1 CFLAGS := -g -Os prefix := /usr etcprefix := -@@ -38,7 +39,8 @@ - client.o cache.o sysfs.o yellow.o page.o rbtree.o \ - xeon75xx.o sandy-bridge.o ivy-bridge.o haswell.o msr.o bus.o unknown.o +@@ -40,8 +41,9 @@ OBJ := p4.o k8.o mcelog.o dmi.o tsc.o co + broadwell_de.o broadwell_epex.o msr.o bus.o \ + unknown.o DISKDB_OBJ := diskdb.o dimm.o db.o --CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ} +EMAIL_OBJ := email.o -+CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ} ${EMAIL_OBJ} + CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ} \ +- version.o version.c version.tmp ++ ${EMAIL_OBJ} version.o version.c version.tmp DOC := mce.pdf ADD_DEFINES := -@@ -50,6 +52,12 @@ +@@ -53,6 +55,12 @@ OBJ += ${DISKDB_OBJ} all: dbquery endif @@ -38,12 +39,12 @@ + SRC := $(OBJ:.o=.c) - mcelog: ${OBJ} -Index: mcelog-1.20/email.c + mcelog: ${OBJ} version.o +Index: mcelog-1.29/email.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mcelog-1.20/email.c 2015-06-15 15:15:14.285053019 +0200 -@@ -0,0 +1,199 @@ ++++ mcelog-1.29/email.c 2016-02-01 17:33:02.709891934 +0100 +@@ -0,0 +1,200 @@ +#include <unistd.h> +#include <signal.h> +#include <ctype.h> @@ -107,7 +108,8 @@ + debug=0; + + email_env = getenv("MCELOG_ADMIN_EMAIL"); -+ if (email_env) { ++ /* No email validation, but at least check for not being empty... */ ++ if (email_env && strlen(email_env) > 1) { + strncpy(c_recipient, email_env, MAX_STRING_LEN - 1); + return 1; + } @@ -243,10 +245,10 @@ + smtp_destroy_session (session); + return 0; +} -Index: mcelog-1.20/email.h +Index: mcelog-1.29/email.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ mcelog-1.20/email.h 2015-06-15 15:15:14.289053315 +0200 ++++ mcelog-1.29/email.h 2016-02-01 17:33:02.709891934 +0100 @@ -0,0 +1,34 @@ +#ifndef _MCELOG_EMAIL_H_ +#define _MCELOG_EMAIL_H_ @@ -282,10 +284,10 @@ +#endif + +#endif -Index: mcelog-1.20/mcelog.c +Index: mcelog-1.29/mcelog.c =================================================================== ---- mcelog-1.20.orig/mcelog.c 2015-06-15 14:25:23.000000000 +0200 -+++ mcelog-1.20/mcelog.c 2015-06-15 15:15:14.293053554 +0200 +--- mcelog-1.29.orig/mcelog.c 2016-01-20 18:33:20.000000000 +0100 ++++ mcelog-1.29/mcelog.c 2016-02-01 17:35:10.417125475 +0100 @@ -37,6 +37,7 @@ #include <assert.h> #include <signal.h> @@ -304,7 +306,7 @@ enum cputype cputype = CPU_GENERIC; char *logfn = LOG_DEV_FILENAME; -@@ -72,7 +76,7 @@ +@@ -72,7 +76,7 @@ static double cpumhz; static int cpumhz_forced; int ascii_mode; int dump_raw_ascii; @@ -313,23 +315,23 @@ static char *inputfile; char *processor_flags; static int foreground; -@@ -949,6 +953,7 @@ - "--pidfile file Write pid of daemon into file\n" +@@ -973,6 +977,7 @@ void usage(void) "--no-imc-log Disable extended iMC logging\n" + "--is-cpu-supported Exit with return code indicating whether the CPU is supported\n" ); + email_usage(); diskdb_usage(); + printf("\n"); print_cputypes(); - exit(1); -@@ -1016,6 +1021,7 @@ - { "debug-numerrors", 0, NULL, O_DEBUG_NUMERRORS }, /* undocumented: for testing */ +@@ -1043,6 +1048,7 @@ static struct option options[] = { { "no-imc-log", 0, NULL, O_NO_IMC_LOG }, + { "is-cpu-supported", 0, NULL, O_IS_CPU_SUPPORTED }, DISKDB_OPTIONS + EMAIL_OPTIONS {} }; -@@ -1193,11 +1199,86 @@ +@@ -1223,11 +1229,86 @@ static void drop_cred(void) } } @@ -416,7 +418,7 @@ if (recordlen == 0) { Wprintf("no data in mce record\n"); -@@ -1224,12 +1305,16 @@ +@@ -1254,12 +1335,16 @@ static void process(int fd, unsigned rec finish = 1; if (!mce_filter(mce, recordlen)) continue; @@ -433,7 +435,7 @@ flushlog(); } -@@ -1340,6 +1425,8 @@ +@@ -1370,6 +1455,8 @@ int main(int ac, char **av) exit(0); } else if (diskdb_cmd(opt, ac, av)) { exit(0); @@ -442,7 +444,7 @@ } else if (opt == 0) break; } -@@ -1368,6 +1455,10 @@ +@@ -1402,6 +1489,10 @@ int main(int ac, char **av) logfn = av[optind++]; if (av[optind]) usage(); @@ -453,11 +455,11 @@ checkdmi(); general_setup(); -Index: mcelog-1.20/mcelog.h +Index: mcelog-1.29/mcelog.h =================================================================== ---- mcelog-1.20.orig/mcelog.h 2015-06-15 14:25:23.000000000 +0200 -+++ mcelog-1.20/mcelog.h 2015-06-15 15:15:14.297053784 +0200 -@@ -131,6 +131,7 @@ +--- mcelog-1.29.orig/mcelog.h 2016-01-20 18:33:20.000000000 +0100 ++++ mcelog-1.29/mcelog.h 2016-02-01 17:35:07.072936045 +0100 +@@ -134,6 +134,7 @@ enum cputype { enum option_ranges { O_COMMON = 500, O_DISKDB = 1000, @@ -465,10 +467,10 @@ }; enum syslog_opt { -Index: mcelog-1.20/msg.c +Index: mcelog-1.29/msg.c =================================================================== ---- mcelog-1.20.orig/msg.c 2015-06-15 14:25:23.000000000 +0200 -+++ mcelog-1.20/msg.c 2015-06-15 15:15:14.301053996 +0200 +--- mcelog-1.29.orig/msg.c 2016-01-20 18:33:20.000000000 +0100 ++++ mcelog-1.29/msg.c 2016-02-01 17:33:02.713892160 +0100 @@ -8,10 +8,13 @@ #include "mcelog.h" #include "msg.h" @@ -483,7 +485,7 @@ static char *output_fn; int need_stdout(void) -@@ -135,6 +138,11 @@ +@@ -135,6 +138,11 @@ int Wprintf(char *fmt, ...) n = vfprintf(output_fh ? output_fh : stdout, fmt, ap); va_end(ap); } ++++++ mcelog-1.20.tar.bz2 -> mcelog-1.29.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/Makefile new/mcelog-1.29/Makefile --- old/mcelog-1.20/Makefile 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/Makefile 2016-01-20 18:33:20.000000000 +0100 @@ -30,15 +30,18 @@ all: mcelog -.PHONY: install clean depend +.PHONY: install clean depend FORCE OBJ := p4.o k8.o mcelog.o dmi.o tsc.o core2.o bitfield.o intel.o \ nehalem.o dunnington.o tulsa.o config.o memutil.o msg.o \ eventloop.o leaky-bucket.o memdb.o server.o trigger.o \ client.o cache.o sysfs.o yellow.o page.o rbtree.o \ - xeon75xx.o sandy-bridge.o ivy-bridge.o haswell.o msr.o bus.o unknown.o + xeon75xx.o sandy-bridge.o ivy-bridge.o haswell.o \ + broadwell_de.o broadwell_epex.o msr.o bus.o \ + unknown.o DISKDB_OBJ := diskdb.o dimm.o db.o -CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ} +CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ} \ + version.o version.c version.tmp DOC := mce.pdf ADD_DEFINES := @@ -52,7 +55,7 @@ SRC := $(OBJ:.o=.c) -mcelog: ${OBJ} +mcelog: ${OBJ} version.o # dbquery intentionally not installed by default install: mcelog mcelog.conf mcelog.conf.5 mcelog.triggers.5 @@ -80,7 +83,7 @@ rm -f ${CLEAN} ${OBJ} tsc: tsc.c - gcc -o tsc ${CFLAGS} -DSTANDALONE tsc.c ${LDFLAGS} + $(CC) -o tsc ${CFLAGS} -DSTANDALONE tsc.c ${LDFLAGS} dbquery: db.o dbquery.o memutil.o @@ -89,6 +92,21 @@ %.o: %.c $(CC) -c $(CFLAGS) $(CPPFLAGS) $(WARNINGS) $(ADD_DEFINES) -o $@ $< +version.tmp: FORCE + ( echo -n "char version[] = \"" ; \ + if type -p git >/dev/null; then \ + if [ -d .git ] ; then \ + git describe --tags HEAD | tr -d '\n'; \ + else \ + echo -n "unknown" ; \ + fi ; \ + else echo -n "unknown" ; fi ; \ + echo '";' \ + ) > version.tmp + +version.c: version.tmp + cmp version.tmp version.c || mv version.tmp version.c + .depend: ${SRC} ${CC} -MM -I. ${SRC} > .depend.X && mv .depend.X .depend @@ -111,7 +129,7 @@ echo $(SRC) config-test: config.c - gcc -DTEST=1 config.c -o config-test + $(CC) -DTEST=1 config.c -o config-test test: $(MAKE) -C tests test DEBUG="" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/broadwell_de.c new/mcelog-1.29/broadwell_de.c --- old/mcelog-1.20/broadwell_de.c 1970-01-01 01:00:00.000000000 +0100 +++ new/mcelog-1.29/broadwell_de.c 2016-01-20 18:33:20.000000000 +0100 @@ -0,0 +1,104 @@ +/* Copyright (C) 2015 Intel Corporation + Decode Intel Broadwell D specific machine check errors. + + mcelog is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; version + 2. + + mcelog is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should find a copy of v2 of the GNU General Public License somewhere + on your Linux system; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Author: Tony Luck +*/ + +#include "mcelog.h" +#include "bitfield.h" +#include "broadwell_de.h" +#include "memdb.h" + +/* See IA32 SDM Vol3B Table 16-24 */ + +static char *pcu_1[] = { + [0x00] = "No Error", + [0x09] = "MC_MESSAGE_CHANNEL_TIMEOUT", + [0x13] = "MC_DMI_TRAINING_TIMEOUT", + [0x15] = "MC_DMI_CPU_RESET_ACK_TIMEOUT", + [0x1E] = "MC_VR_ICC_MAX_LT_FUSED_ICC_MAX", + [0x25] = "MC_SVID_COMMAN_TIMEOUT", + [0x26] = "MCA_PKGC_DIRECT_WAKE_RING_TIMEOUT", + [0x29] = "MC_VR_VOUT_MAC_LT_FUSED_SVID", + [0x2B] = "MC_PKGC_WATCHDOG_HANG_CBZ_DOWN", + [0x2C] = "MC_PKGC_WATCHDOG_HANG_CBZ_UP", + [0x44] = "MC_CRITICAL_VR_FAILED", + [0x46] = "MC_VID_RAMP_DOWN_FAILED", + [0x49] = "MC_SVID_WRITE_REG_VOUT_MAX_FAILED", + [0x4B] = "MC_BOOT_VID_TIMEOUT_DRAM_0", + [0x4F] = "MC_SVID_COMMAND_ERROR", + [0x52] = "MC_FIVR_CATAS_OVERVOL_FAULT", + [0x53] = "MC_FIVR_CATAS_OVERCUR_FAULT", + [0x57] = "MC_SVID_PKGC_REQUEST_FAILED", + [0x58] = "MC_SVID_IMON_REQUEST_FAILED", + [0x59] = "MC_SVID_ALERT_REQUEST_FAILED", + [0x62] = "MC_INVALID_PKGS_RSP_QPI", + [0x64] = "MC_INVALID_PKG_STATE_CONFIG", + [0x67] = "MC_HA_IMC_RW_BLOCK_ACK_TIMEOUT", + [0x6A] = "MC_MSGCH_PMREQ_CMP_TIMEOUT", + [0x72] = "MC_WATCHDOG_TIMEOUT_PKGS_MASTER", + [0x81] = "MC_RECOVERABLE_DIE_THERMAL_TOO_HOT" +}; + +static struct field pcu_mc4[] = { + FIELD(24, pcu_1), + {} +}; + +/* See IA32 SDM Vol3B Table 16-18 */ + +static struct field memctrl_mc9[] = { + SBITFIELD(16, "Address parity error"), + SBITFIELD(17, "HA Wrt buffer Data parity error"), + SBITFIELD(18, "HA Wrt byte enable parity error"), + SBITFIELD(19, "Corrected patrol scrub error"), + SBITFIELD(20, "Uncorrected patrol scrub error"), + SBITFIELD(21, "Corrected spare error"), + SBITFIELD(22, "Uncorrected spare error"), + SBITFIELD(23, "Corrected memory read error"), + SBITFIELD(24, "iMC, WDB, parity errors"), + {} +}; + +void bdw_de_decode_model(int cputype, int bank, u64 status, u64 misc) +{ + switch (bank) { + case 4: + Wprintf("PCU: "); + switch (EXTRACT(status, 0, 15) & ~(1ull << 12)) { + case 0x402: case 0x403: + Wprintf("Internal errors "); + break; + case 0x406: + Wprintf("Intel TXT errors "); + break; + case 0x407: + Wprintf("Other UBOX Internal errors "); + break; + } + if (EXTRACT(status, 16, 19) & 3) + Wprintf("PCU internal error "); + if (EXTRACT(status, 20, 23) & 4) + Wprintf("Ubox error "); + decode_bitfield(status, pcu_mc4); + break; + case 9: case 10: + Wprintf("MemCtrl: "); + decode_bitfield(status, memctrl_mc9); + break; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/broadwell_de.h new/mcelog-1.29/broadwell_de.h --- old/mcelog-1.20/broadwell_de.h 1970-01-01 01:00:00.000000000 +0100 +++ new/mcelog-1.29/broadwell_de.h 2016-01-20 18:33:20.000000000 +0100 @@ -0,0 +1,2 @@ +void bdw_d_decode_model(int cputype, int bank, u64 status, u64 misc); +void bdw_de_decode_model(int cputype, int bank, u64 status, u64 misc); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/broadwell_epex.c new/mcelog-1.29/broadwell_epex.c --- old/mcelog-1.20/broadwell_epex.c 1970-01-01 01:00:00.000000000 +0100 +++ new/mcelog-1.29/broadwell_epex.c 2016-01-20 18:33:20.000000000 +0100 @@ -0,0 +1,149 @@ +/* Copyright (C) 2015 Intel Corporation + Decode Intel Broadwell specific machine check errors. + + mcelog is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; version + 2. + + mcelog is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should find a copy of v2 of the GNU General Public License somewhere + on your Linux system; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Author: Tony Luck +*/ + +#include "mcelog.h" +#include "bitfield.h" +#include "broadwell_epex.h" +#include "memdb.h" + +/* See IA32 SDM Vol3B Table 16-20 */ + +static char *pcu_1[] = { + [0x00] = "No Error", + [0x09] = "MC_MESSAGE_CHANNEL_TIMEOUT", + [0x0D] = "MC_IMC_FORCE_SR_S3_TIMEOUT", + [0x0E] = "MC_CPD_UNCPD_SD_TIMEOUT", + [0x13] = "MC_DMI_TRAINING_TIMEOUT", + [0x15] = "MC_DMI_CPU_RESET_ACK_TIMEOUT", + [0x1E] = "MC_VR_ICC_MAX_LT_FUSED_ICC_MAX", + [0x25] = "MC_SVID_COMMAN_TIMEOUT", + [0x29] = "MC_VR_VOUT_MAC_LT_FUSED_SVID", + [0x2B] = "MC_PKGC_WATCHDOG_HANG_CBZ_DOWN", + [0x2C] = "MC_PKGC_WATCHDOG_HANG_CBZ_UP", + [0x39] = "MC_PKGC_WATCHDOG_HANG_C3_UP_SF", + [0x44] = "MC_CRITICAL_VR_FAILED", + [0x45] = "MC_ICC_MAX_NOTSUPPORTED", + [0x46] = "MC_VID_RAMP_DOWN_FAILED", + [0x47] = "MC_EXCL_MODE_NO_PMREQ_CMP", + [0x48] = "MC_SVID_READ_REG_ICC_MAX_FAILED", + [0x49] = "MC_SVID_WRITE_REG_VOUT_MAX_FAILED", + [0x4B] = "MC_BOOT_VID_TIMEOUT_DRAM_0", + [0x4C] = "MC_BOOT_VID_TIMEOUT_DRAM_1", + [0x4D] = "MC_BOOT_VID_TIMEOUT_DRAM_2", + [0x4E] = "MC_BOOT_VID_TIMEOUT_DRAM_3", + [0x4F] = "MC_SVID_COMMAND_ERROR", + [0x52] = "MC_FIVR_CATAS_OVERVOL_FAULT", + [0x53] = "MC_FIVR_CATAS_OVERCUR_FAULT", + [0x57] = "MC_SVID_PKGC_REQUEST_FAILED", + [0x58] = "MC_SVID_IMON_REQUEST_FAILED", + [0x59] = "MC_SVID_ALERT_REQUEST_FAILED", + [0x60] = "MC_INVALID_PKGS_REQ_PCH", + [0x61] = "MC_INVALID_PKGS_REQ_QPI", + [0x62] = "MC_INVALID_PKGS_RSP_QPI", + [0x63] = "MC_INVALID_PKGS_RSP_PCH", + [0x64] = "MC_INVALID_PKG_STATE_CONFIG", + [0x67] = "MC_HA_IMC_RW_BLOCK_ACK_TIMEOUT", + [0x68] = "MC_IMC_RW_SMBUS_TIMEOUT", + [0x69] = "MC_HA_FAILSTS_CHANGE_DETECTED", + [0x6A] = "MC_MSGCH_PMREQ_CMP_TIMEOUT", + [0x70] = "MC_WATCHDOG_TIMEOUT_PKGC_SLAVE", + [0x71] = "MC_WATCHDOG_TIMEOUT_PKGC_MASTER", + [0x72] = "MC_WATCHDOG_TIMEOUT_PKGS_MASTER", + [0x7C] = "MC_BIOS_RST_CPL_INVALID_SEQ", + [0x7D] = "MC_MORE_THAN_ONE_TXT_AGENT", + [0x81] = "MC_RECOVERABLE_DIE_THERMAL_TOO_HOT" +}; + +static struct field pcu_mc4[] = { + FIELD(24, pcu_1), + {} +}; + +/* See IA32 SDM Vol3B Table 16-21 */ + +static char *qpi[] = { + [0x02] = "Intel QPI physical layer detected drift buffer alarm", + [0x03] = "Intel QPI physical layer detected latency buffer rollover", + [0x10] = "Intel QPI link layer detected control error from R3QPI", + [0x11] = "Rx entered LLR abort state on CRC error", + [0x12] = "Unsupported or undefined packet", + [0x13] = "Intel QPI link layer control error", + [0x15] = "RBT used un-initialized value", + [0x20] = "Intel QPI physical layer detected a QPI in-band reset but aborted initialization", + [0x21] = "Link failover data self healing", + [0x22] = "Phy detected in-band reset (no width change)", + [0x23] = "Link failover clock failover", + [0x30] = "Rx detected CRC error - successful LLR after Phy re-init", + [0x31] = "Rx detected CRC error - successful LLR wihout Phy re-init", +}; + +static struct field qpi_mc[] = { + FIELD(16, qpi), + {} +}; + +/* See IA32 SDM Vol3B Table 16-26 */ + +static struct field memctrl_mc9[] = { + SBITFIELD(16, "DDR3 address parity error"), + SBITFIELD(17, "Uncorrected HA write data error"), + SBITFIELD(18, "Uncorrected HA data byte enable error"), + SBITFIELD(19, "Corrected patrol scrub error"), + SBITFIELD(20, "Uncorrected patrol scrub error"), + SBITFIELD(21, "Corrected spare error"), + SBITFIELD(22, "Uncorrected spare error"), + SBITFIELD(24, "iMC write data buffer parity error"), + SBITFIELD(25, "DDR4 command address parity error"), + {} +}; + +void bdw_epex_decode_model(int cputype, int bank, u64 status, u64 misc) +{ + switch (bank) { + case 4: + Wprintf("PCU: "); + switch (EXTRACT(status, 0, 15) & ~(1ull << 12)) { + case 0x402: case 0x403: + Wprintf("Internal errors "); + break; + case 0x406: + Wprintf("Intel TXT errors "); + break; + case 0x407: + Wprintf("Other UBOX Internal errors "); + break; + } + if (EXTRACT(status, 16, 19)) + Wprintf("PCU internal error "); + decode_bitfield(status, pcu_mc4); + break; + case 5: + case 20: + case 21: + Wprintf("QPI: "); + decode_bitfield(status, qpi_mc); + break; + case 9: case 10: case 11: case 12: + case 13: case 14: case 15: case 16: + Wprintf("MemCtrl: "); + decode_bitfield(status, memctrl_mc9); + break; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/broadwell_epex.h new/mcelog-1.29/broadwell_epex.h --- old/mcelog-1.20/broadwell_epex.h 1970-01-01 01:00:00.000000000 +0100 +++ new/mcelog-1.29/broadwell_epex.h 2016-01-20 18:33:20.000000000 +0100 @@ -0,0 +1 @@ +void bdw_epex_decode_model(int cputype, int bank, u64 status, u64 misc); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/bus.c new/mcelog-1.29/bus.c --- old/mcelog-1.20/bus.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/bus.c 2016-01-20 18:33:20.000000000 +0100 @@ -58,6 +58,9 @@ char *msg; char *location; + if (!bus_trigger) + return; + if (socket >= 0) asprintf(&location, "CPU %d on socket %d", cpu, socket); else @@ -67,9 +70,6 @@ asprintf(&env[ei++], "LOCATION=%s", location); free(location); - if (!bus_trigger) - goto out; - if (socket >= 0) asprintf(&env[ei++], "SOCKETID=%d", socket); asprintf(&env[ei++], "MESSAGE=%s", msg); @@ -85,7 +85,6 @@ run_trigger(bus_trigger, NULL, env); for (i = 0; i < ei; i++) free(env[i]); -out: free(msg); } @@ -97,6 +96,9 @@ char *msg; char *location; + if (!iomca_trigger) + return; + if (socket >= 0) asprintf(&location, "CPU %d on socket %d", cpu, socket); else @@ -106,9 +108,6 @@ asprintf(&env[ei++], "LOCATION=%s", location); free(location); - if (!iomca_trigger) - goto out; - if (socket >= 0) asprintf(&env[ei++], "SOCKETID=%d", socket); asprintf(&env[ei++], "MESSAGE=%s", msg); @@ -123,7 +122,6 @@ run_trigger(iomca_trigger, NULL, env); for (i = 0; i < ei; i++) free(env[i]); -out: free(msg); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/cache.c new/mcelog-1.29/cache.c --- old/mcelog-1.20/cache.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/cache.c 2016-01-20 18:33:20.000000000 +0100 @@ -97,9 +97,14 @@ static void read_cpu_map(struct cache *c, char *cfn) { char *map = read_field(cfn, "shared_cpu_map"); + if (map[0] == 0) { + c->cpumap = NULL; + goto out; + } c->cpumaplen = cpumap_len(map); c->cpumap = xalloc(c->cpumaplen); parse_cpumap(map, c->cpumap, c->cpumaplen); +out: free(map); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/dimm.c new/mcelog-1.29/dimm.c --- old/mcelog-1.20/dimm.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/dimm.c 2016-01-20 18:33:20.000000000 +0100 @@ -351,14 +351,14 @@ Eprintf("Cannot run error trigger %s for %s\n", trigger, loc); open_dimm_db(NULL); } -void new_error(unsigned long addr, unsigned long max_error, char *trigger) +void new_error(unsigned long long addr, unsigned long max_error, char *trigger) { struct dmi_memdev **devs; int i; devs = dmi_find_addr(addr); if (devs[0] == NULL) { - Wprintf("No memory found for address %lx\n", addr); + Wprintf("No memory found for address %Lx\n", addr); exit(1); } for (i = 0; devs[i]; i++) { @@ -366,7 +366,7 @@ char *loc = dmi_getstring(&d->header, d->device_locator); struct group *g = find_entry(dimm_db, NULL, "Locator", loc); if (!g) { // shouldn't happen - Eprintf("No record found for %lx\n", addr); + Eprintf("No record found for %Lx\n", addr); return; } unsigned long val = inc_val(g, "corrected errors"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/dimm.h new/mcelog-1.29/dimm.h --- old/mcelog-1.20/dimm.h 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/dimm.h 2016-01-20 18:33:20.000000000 +0100 @@ -1,6 +1,6 @@ void close_dimm_db(void); int open_dimm_db(char *fn); -void new_error(unsigned long addr, unsigned long max_error, char *trigger); +void new_error(unsigned long long addr, unsigned long max_error, char *trigger); void reset_dimm(char *locator); void gc_dimms(void); void dump_all_dimms(void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/dmi.c new/mcelog-1.29/dmi.c --- old/mcelog-1.20/dmi.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/dmi.c 2016-01-20 18:33:20.000000000 +0100 @@ -228,8 +228,6 @@ } a = (struct anchor*)((char*)abase + (entry_point_addr - addr_start)); goto fill_entries; - } else { - return -1; } legacy: @@ -272,6 +270,7 @@ round_down(a->table, pagesize)); if (entries == (struct dmi_entry *)-1) { Eprintf("Cannot mmap SMBIOS tables at %x", a->table); + entries = NULL; goto out_mmap; } entries = (struct dmi_entry *)(((char *)entries) + corr); @@ -337,7 +336,7 @@ Wprintf("%s ", type_details[i]); } -static void dump_memdev(struct dmi_memdev *md, unsigned long addr) +static void dump_memdev(struct dmi_memdev *md, unsigned long long addr) { char tmp[20]; char unit[10]; @@ -346,7 +345,7 @@ if (md->header.length < offsetof(struct dmi_memdev, manufacturer)) { if (verbose > 0) - printf("Memory device for address %lx too short %u\n", + printf("Memory device for address %llx too short %u\n", addr, md->header.length); return; } @@ -500,7 +499,7 @@ dmi_dimms[i]->device_locator); if (!strcmp(b, loc)) { if (verbose > 0) - printf("Ambigious locators `%s'<->`%s'." + printf("Ambiguous locators `%s'<->`%s'." FAILED, b, loc); return 0; } @@ -538,7 +537,7 @@ DMIGET(dmi_dimms[i],device_set)); } -struct dmi_memdev **dmi_find_addr(unsigned long addr) +struct dmi_memdev **dmi_find_addr(unsigned long long addr) { struct dmi_memdev **devs; int i, k; @@ -582,7 +581,7 @@ return devs; } -void dmi_decodeaddr(unsigned long addr) +void dmi_decodeaddr(unsigned long long addr) { struct dmi_memdev **devs = dmi_find_addr(addr); if (devs[0]) { @@ -591,7 +590,7 @@ for (i = 0; devs[i]; i++) dump_memdev(devs[i], addr); } else { - Wprintf("No DIMM found for %lx in SMBIOS\n", addr); + Wprintf("No DIMM found for %llx in SMBIOS\n", addr); } free(devs); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/dmi.h new/mcelog-1.29/dmi.h --- old/mcelog-1.20/dmi.h 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/dmi.h 2016-01-20 18:33:20.000000000 +0100 @@ -62,10 +62,10 @@ } __attribute__((packed)); int opendmi(void); -void dmi_decodeaddr(unsigned long addr); +void dmi_decodeaddr(unsigned long long addr); int dmi_sanity_check(void); unsigned dmi_dimm_size(unsigned short size, char *unit); -struct dmi_memdev **dmi_find_addr(unsigned long addr); +struct dmi_memdev **dmi_find_addr(unsigned long long addr); void dmi_set_verbosity(int v); char *dmi_getstring(struct dmi_entry *e, unsigned number); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/genconfig.py new/mcelog-1.29/genconfig.py --- old/mcelog-1.20/genconfig.py 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/genconfig.py 2016-01-20 18:33:20.000000000 +0100 @@ -66,7 +66,7 @@ print """ -.\" Auto generated mcelog.conf manpage. Do not edit. +.\\" Auto generated mcelog.conf manpage. Do not edit. .TH "mcelog.conf" 5 "mcelog" """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/intel.c new/mcelog-1.29/intel.c --- old/mcelog-1.20/intel.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/intel.c 2016-01-20 18:33:20.000000000 +0100 @@ -35,7 +35,8 @@ cpu == CPU_SANDY_BRIDGE || cpu == CPU_SANDY_BRIDGE_EP || cpu == CPU_IVY_BRIDGE || cpu == CPU_IVY_BRIDGE_EPEX || cpu == CPU_HASWELL || cpu == CPU_HASWELL_EPEX || cpu == CPU_BROADWELL || - cpu == CPU_KNIGHTS_LANDING) + cpu == CPU_BROADWELL_DE || cpu == CPU_BROADWELL_EPEX || + cpu == CPU_KNIGHTS_LANDING || cpu == CPU_SKYLAKE) memory_error_support = 1; } @@ -73,8 +74,12 @@ return CPU_HASWELL; else if (model == 0x3f) return CPU_HASWELL_EPEX; - else if (model == 0x3d || model == 0x56) + else if (model == 0x3d) return CPU_BROADWELL; + else if (model == 0x4f) + return CPU_BROADWELL_EPEX; + else if (model == 0x56) + return CPU_BROADWELL_DE; else if (model == 0x57) return CPU_KNIGHTS_LANDING; else if (model == 0x1c || model == 0x26 || model == 0x27 || @@ -82,6 +87,8 @@ model == 0x37 || model == 0x4a || model == 0x4c || model == 0x4d || model == 0x5a || model == 0x5d) return CPU_ATOM; + else if (model == 0x4e || model == 0x5e) + return CPU_SKYLAKE; if (model > 0x1a) { Eprintf("Family 6 Model %x CPU: only decoding architectural errors\n", model); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/intel.h new/mcelog-1.29/intel.h --- old/mcelog-1.20/intel.h 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/intel.h 2016-01-20 18:33:20.000000000 +0100 @@ -21,5 +21,8 @@ case CPU_HASWELL: \ case CPU_HASWELL_EPEX: \ case CPU_BROADWELL: \ - case CPU_KNIGHTS_LANDING + case CPU_BROADWELL_DE: \ + case CPU_BROADWELL_EPEX: \ + case CPU_KNIGHTS_LANDING: \ + case CPU_SKYLAKE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/mcelog.8 new/mcelog-1.29/mcelog.8 --- old/mcelog-1.20/mcelog.8 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/mcelog.8 2016-01-20 18:33:20.000000000 +0100 @@ -16,6 +16,8 @@ .\".br .\"mcelog [options] \-\-dump-memory[=locator] .br +mcelog [options] \-\-is\-cpu\-supported +.br mcelog \-\-version .SH DESCRIPTION X86 CPUs report errors detected by the CPU as @@ -81,6 +83,10 @@ so the output should be always saved somewhere and mcelog not run in uncontrolled ways. +When invoked with the +.I \-\-is\-cpu\-supported +option mcelog exits with code 0 if the current CPU is supported, 1 otherwise. + .SH OPTIONS When the .B \-\-syslog @@ -294,7 +300,7 @@ The kernel prefers old messages over new. If the log buffer overflows only old ones will be kept. -The exact output in the log file depends on the CPU, unless the --raw option is used. +The exact output in the log file depends on the CPU, unless the \-\-raw option is used. mcelog will report serious errors to the syslog during decoding. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/mcelog.c new/mcelog-1.29/mcelog.c --- old/mcelog-1.20/mcelog.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/mcelog.c 2016-01-20 18:33:20.000000000 +0100 @@ -85,6 +85,7 @@ static char *logfile; static int debug_numerrors; int imc_log = -1; +static int check_only = 0; static int is_cpu_supported(void); @@ -131,7 +132,7 @@ } } -static void resolveaddr(unsigned long addr) +static void resolveaddr(unsigned long long addr) { if (addr && do_dmi && dmi_forced) dmi_decodeaddr(addr); @@ -232,8 +233,11 @@ [CPU_HASWELL] = "Haswell", /* Fill in better name */ [CPU_HASWELL_EPEX] = "Intel Xeon v3 (Haswell) EP/EX", [CPU_BROADWELL] = "Broadwell", + [CPU_BROADWELL_DE] = "Intel Xeon (Broadwell) D family", + [CPU_BROADWELL_EPEX] = "Intel Xeon v4 (Broadwell) EP/EX", [CPU_KNIGHTS_LANDING] = "Knights Landing", [CPU_ATOM] = "ATOM", + [CPU_SKYLAKE] = "Skylake", }; static struct config_choice cpu_choices[] = { @@ -273,10 +277,15 @@ { "haswell-ep", CPU_HASWELL_EPEX }, { "haswell-ex", CPU_HASWELL_EPEX }, { "broadwell", CPU_BROADWELL }, + { "broadwell-d", CPU_BROADWELL_DE }, + { "broadwell-ep", CPU_BROADWELL_EPEX }, + { "broadwell-ex", CPU_BROADWELL_EPEX }, { "knightslanding", CPU_KNIGHTS_LANDING }, { "xeon-v2", CPU_IVY_BRIDGE_EPEX }, { "xeon-v3", CPU_HASWELL_EPEX }, + { "xeon-v4", CPU_BROADWELL_EPEX }, { "atom", CPU_ATOM }, + { "skylake", CPU_SKYLAKE }, { NULL } }; @@ -439,7 +448,8 @@ } if (cputype != CPU_SANDY_BRIDGE_EP && cputype != CPU_IVY_BRIDGE_EPEX && cputype != CPU_HASWELL_EPEX && cputype != CPU_BROADWELL && - cputype != CPU_KNIGHTS_LANDING) + cputype != CPU_BROADWELL_DE && cputype != CPU_BROADWELL_EPEX && + cputype != CPU_KNIGHTS_LANDING && cputype != CPU_SKYLAKE) resolveaddr(m->addr); if (!ascii_mode && ismemerr && (m->status & MCI_STATUS_ADDRV)) { diskdb_resolve_addr(m->addr); @@ -918,22 +928,35 @@ { fprintf(stderr, "Usage:\n" +"\n" " mcelog [options] [mcelogdevice]\n" "Decode machine check error records from current kernel.\n" +"\n" " mcelog [options] --daemon\n" "Run mcelog in daemon mode, waiting for errors from the kernel.\n" +"\n" " mcelog [options] --client\n" "Query a currently running mcelog daemon for errors\n" +"\n" " mcelog [options] --ascii < log\n" " mcelog [options] --ascii --file log\n" "Decode machine check ASCII output from kernel logs\n" +"\n" "Options:\n" +"--version Show the version of mcelog and exit\n" "--cpu CPU Set CPU type CPU to decode (see below for valid types)\n" +"--intel-cpu FAMILY,MODEL Set CPU type for an Intel CPU based on family and model from cpuid\n" +"--k8 Set the CPU to be an AMD K8\n" +"--p4 Set the CPU to be an Intel Pentium4\n" +"--core2 Set the CPU to be an Intel Core2\n" +"--generic Set the CPU to a generic version\n" "--cpumhz MHZ Set CPU Mhz to decode time (output unreliable, not needed on new kernels)\n" "--raw (with --ascii) Dump in raw ASCII format for machine processing\n" "--daemon Run in background waiting for events (needs newer kernel)\n" +"--client Query a currently running mcelog daemon for errors\n" "--ignorenodev Exit silently when the device cannot be opened\n" "--file filename With --ascii read machine check log from filename instead of stdin\n" +"--logfile filename Log decoded machine checks in file filename\n" "--syslog Log decoded machine checks in syslog (default stdout or syslog for daemon)\n" "--syslog-error Log decoded machine checks in syslog with error level\n" "--no-syslog Never log anything to syslog\n" @@ -948,8 +971,10 @@ "--num-errors N Only process N errors (for testing)\n" "--pidfile file Write pid of daemon into file\n" "--no-imc-log Disable extended iMC logging\n" +"--is-cpu-supported Exit with return code indicating whether the CPU is supported\n" ); diskdb_usage(); + printf("\n"); print_cputypes(); exit(1); } @@ -982,6 +1007,7 @@ O_PIDFILE, O_DEBUG_NUMERRORS, O_NO_IMC_LOG, + O_IS_CPU_SUPPORTED, }; static struct option options[] = { @@ -1015,6 +1041,7 @@ { "pidfile", 1, NULL, O_PIDFILE }, { "debug-numerrors", 0, NULL, O_DEBUG_NUMERRORS }, /* undocumented: for testing */ { "no-imc-log", 0, NULL, O_NO_IMC_LOG }, + { "is-cpu-supported", 0, NULL, O_IS_CPU_SUPPORTED }, DISKDB_OPTIONS {} }; @@ -1117,6 +1144,9 @@ case O_NO_IMC_LOG: imc_log = 0; break; + case O_IS_CPU_SUPPORTED: + check_only = 1; + break; case 0: break; default: @@ -1346,15 +1376,19 @@ /* before doing anything else let's see if the CPUs are supported */ if (!cpu_forced && !is_cpu_supported()) { - fprintf(stderr, "CPU is unsupported\n"); + if (!check_only) + fprintf(stderr, "CPU is unsupported\n"); exit(1); } + if (check_only) + exit(0); /* If the user didn't tell us not to use iMC logging, check if CPU supports it */ if (imc_log == -1) { switch (cputype) { case CPU_SANDY_BRIDGE_EP: case CPU_IVY_BRIDGE_EPEX: + case CPU_HASWELL_EPEX: imc_log = 1; break; default: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/mcelog.h new/mcelog-1.29/mcelog.h --- old/mcelog-1.20/mcelog.h 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/mcelog.h 2016-01-20 18:33:20.000000000 +0100 @@ -124,8 +124,11 @@ CPU_HASWELL, CPU_HASWELL_EPEX, CPU_BROADWELL, + CPU_BROADWELL_DE, + CPU_BROADWELL_EPEX, CPU_KNIGHTS_LANDING, CPU_ATOM, + CPU_SKYLAKE, }; enum option_ranges { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/memdb.c new/mcelog-1.29/memdb.c --- old/mcelog-1.20/memdb.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/memdb.c 2016-01-20 18:33:20.000000000 +0100 @@ -379,6 +379,14 @@ channel, dimm) == 3) return 1; /* Add more DMI formats here */ + /* For new AMI BIOS Node0_Bank0 */ + if (sscanf(bl, "Node%u_Bank%u", socketid, dimm) == 2) + return 1; + + /* For old AMI BIOS A1_BANK0*/ + if (sscanf(bl, "A%u_BANK%u", socketid, dimm) == 2) + return 1; + return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/msr.c new/mcelog-1.29/msr.c --- old/mcelog-1.20/msr.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/msr.c 2016-01-20 18:33:20.000000000 +0100 @@ -49,6 +49,7 @@ switch (cputype) { case CPU_SANDY_BRIDGE_EP: case CPU_IVY_BRIDGE_EPEX: + case CPU_HASWELL_EPEX: msr = 0x17f; /* MSR_ERROR_CONTROL */ bit = 0x2; /* MemError Log Enable */ break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/nehalem.c new/mcelog-1.29/nehalem.c --- old/mcelog-1.20/nehalem.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/nehalem.c 2016-01-20 18:33:20.000000000 +0100 @@ -124,13 +124,17 @@ "Reserved 7" }; -void decode_memory_controller(u32 status) +void decode_memory_controller(u32 status, u8 bank) { char channel[30]; if ((status & 0xf) == 0xf) strcpy(channel, "unspecified"); - else - sprintf(channel, "%u", status & 0xf); + else { + if (cputype == CPU_KNIGHTS_LANDING) /* Fix for Knights Landing MIC */ + sprintf(channel, "%u", (status & 0xf) + 3 * (bank == 15)); + else + sprintf(channel, "%u", status & 0xf); + } Wprintf("MEMORY CONTROLLER %s_CHANNEL%s_ERR\n", mmm_mnemonic[(status >> 4) & 7], channel); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/nehalem.h new/mcelog-1.29/nehalem.h --- old/mcelog-1.20/nehalem.h 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/nehalem.h 2016-01-20 18:33:20.000000000 +0100 @@ -1,4 +1,4 @@ void nehalem_decode_model(u64 status, u64 misc); void xeon75xx_decode_model(struct mce *m, unsigned msize); -void decode_memory_controller(u32 status); +void decode_memory_controller(u32 status, u8 bank); void nehalem_memerr_misc(struct mce *m, int *channel, int *dimm); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/p4.c new/mcelog-1.29/p4.c --- old/mcelog-1.20/p4.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/p4.c 2016-01-20 18:33:20.000000000 +0100 @@ -36,6 +36,8 @@ #include "sandy-bridge.h" #include "ivy-bridge.h" #include "haswell.h" +#include "broadwell_de.h" +#include "broadwell_epex.h" /* decode mce for P4/Xeon and Core2 family */ @@ -52,7 +54,7 @@ static char* get_LL_str(__u8 ll) { static char* LL[] = {"Level-0", "Level-1", "Level-2", "Level-3"}; - if (ll > NELE(LL)) { + if (ll >= NELE(LL)) { return "UNKNOWN"; } @@ -118,7 +120,8 @@ return II[i]; } -static int decode_mca(u64 status, u64 misc, u64 track, int cpu, int *ismemerr, int socket) +static int decode_mca(u64 status, u64 misc, u64 track, int cpu, int *ismemerr, int socket, + u8 bank) { #define TLB_LL_MASK 0x3 /*bit 0, bit 1*/ #define TLB_LL_SHIFT 0x0 @@ -231,7 +234,7 @@ run_iomca_trigger(socket, cpu, seg, bus, dev, fn); } } else if (test_prefix(7, mca)) { - decode_memory_controller(mca); + decode_memory_controller(mca, bank); *ismemerr = 1; } else { Wprintf("Unknown Error %x\n", mca); @@ -286,7 +289,7 @@ }; static int decode_mci(__u64 status, __u64 misc, int cpu, unsigned mcgcap, int *ismemerr, - int socket) + int socket, __u8 bank) { u64 track = 0; @@ -326,7 +329,7 @@ decode_tracking(track); } Wprintf("MCA: "); - return decode_mca(status, misc, track, cpu, ismemerr, socket); + return decode_mca(status, misc, track, cpu, ismemerr, socket, bank); } static void decode_mcg(__u64 mcgstatus) @@ -368,7 +371,7 @@ decode_mcg(log->mcgstatus); if (decode_mci(log->status, log->misc, cpu, log->mcgcap, ismemerr, - socket)) + socket, log->bank)) run_unknown_trigger(socket, cpu, log); if (test_prefix(11, (log->status & 0xffffL))) { @@ -415,6 +418,12 @@ case CPU_HASWELL_EPEX: hsw_decode_model(cputype, log->bank, log->status, log->misc); break; + case CPU_BROADWELL_DE: + bdw_de_decode_model(cputype, log->bank, log->status, log->misc); + break; + case CPU_BROADWELL_EPEX: + bdw_epex_decode_model(cputype, log->bank, log->status, log->misc); + break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/server.c new/mcelog-1.29/server.c --- old/mcelog-1.20/server.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/server.c 2016-01-20 18:33:20.000000000 +0100 @@ -297,9 +297,9 @@ if (fd < 0) return 0; - sigaction(SIGALRM, &sa, &oldsa); + sigaction(SIGALRM, &sa, &oldsa); if (sigsetjmp(ping_timeout_ctx, 1) == 0) { - ret = 0; + ret = -1; alarm(initial_ping_timeout); if (connect(fd, un, sizeof(struct sockaddr_un)) < 0) goto cleanup; @@ -315,7 +315,7 @@ sigaction(SIGALRM, &oldsa, NULL); alarm(0); close(fd); - return ret; + return ret; } void server_setup(void) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/unknown.c new/mcelog-1.29/unknown.c --- old/mcelog-1.20/unknown.c 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/unknown.c 2016-01-20 18:33:20.000000000 +0100 @@ -50,6 +50,9 @@ char *msg; char *location; + if (!unknown_trigger) + return; + if (socket >= 0) asprintf(&location, "CPU %d on socket %d", cpu, socket); else @@ -58,9 +61,6 @@ asprintf(&env[ei++], "LOCATION=%s", location); free(location); - if (!unknown_trigger) - goto out; - if (socket >= 0) asprintf(&env[ei++], "SOCKETID=%d", socket); asprintf(&env[ei++], "MESSAGE=%s", msg); @@ -76,7 +76,6 @@ run_trigger(unknown_trigger, NULL, env); for (i = 0; i < ei; i++) free(env[i]); -out: free(msg); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcelog-1.20/version.h new/mcelog-1.29/version.h --- old/mcelog-1.20/version.h 2015-06-15 14:25:23.000000000 +0200 +++ new/mcelog-1.29/version.h 2016-01-20 18:33:20.000000000 +0100 @@ -1,2 +1,3 @@ -#define MCELOG_VERSION "1.20" +extern char version[]; +#define MCELOG_VERSION version ++++++ mcelog.systemd ++++++ --- /var/tmp/diff_new_pack.YvKqG2/_old 2016-02-12 11:21:16.000000000 +0100 +++ /var/tmp/diff_new_pack.YvKqG2/_new 2016-02-12 11:21:16.000000000 +0100 @@ -4,6 +4,7 @@ [Service] EnvironmentFile=-/etc/sysconfig/mcelog +ExecStartPre=/sbin/modprobe msr ExecStart=/usr/sbin/mcelog --ignorenodev --daemon --foreground StandardOutput=syslog ++++++ mcelog_invert_prefill_db_warning.patch ++++++ --- /var/tmp/diff_new_pack.YvKqG2/_old 2016-02-12 11:21:16.000000000 +0100 +++ /var/tmp/diff_new_pack.YvKqG2/_new 2016-02-12 11:21:16.000000000 +0100 @@ -2,11 +2,11 @@ memdb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -Index: mcelog-1.20/memdb.c +Index: mcelog-1.29/memdb.c =================================================================== ---- mcelog-1.20.orig/memdb.c 2015-06-15 14:25:23.000000000 +0200 -+++ mcelog-1.20/memdb.c 2015-06-15 15:15:25.925718586 +0200 -@@ -422,11 +422,11 @@ +--- mcelog-1.29.orig/memdb.c 2016-01-20 18:33:20.000000000 +0100 ++++ mcelog-1.29/memdb.c 2016-01-28 15:33:46.958564233 +0100 +@@ -430,11 +430,11 @@ void prefill_memdb(int do_dmi) md->location = xstrdup(bl); md->name = xstrdup(dmi_getstring(&d->header, d->device_locator)); }