From owner-svn-src-head@freebsd.org Tue Jun 12 18:58:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4B8C1012D16; Tue, 12 Jun 2018 18:58:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 720627487A; Tue, 12 Jun 2018 18:58:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F6AA69C1; Tue, 12 Jun 2018 18:58:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CIwvW7066103; Tue, 12 Jun 2018 18:58:57 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CIwvwB066102; Tue, 12 Jun 2018 18:58:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201806121858.w5CIwvwB066102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 12 Jun 2018 18:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335010 - head/usr.sbin/cpucontrol X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/usr.sbin/cpucontrol X-SVN-Commit-Revision: 335010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 18:58:58 -0000 Author: sbruno Date: Tue Jun 12 18:58:56 2018 New Revision: 335010 URL: https://svnweb.freebsd.org/changeset/base/335010 Log: cpucontrol: - fix debugging for family on AMD cpus and add useful debugging for which file is being selected for update. Reviewed by: cem Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15574 Modified: head/usr.sbin/cpucontrol/amd10h.c Modified: head/usr.sbin/cpucontrol/amd10h.c ============================================================================== --- head/usr.sbin/cpucontrol/amd10h.c Tue Jun 12 18:42:41 2018 (r335009) +++ head/usr.sbin/cpucontrol/amd10h.c Tue Jun 12 18:58:56 2018 (r335010) @@ -139,7 +139,8 @@ amd10h_update(const char *dev, const char *path) WARNX(1, "found cpu family %#x model %#x " "stepping %#x extfamily %#x extmodel %#x.", - (signature >> 8) & 0x0f, (signature >> 4) & 0x0f, + ((signature >> 8) & 0x0f) + ((signature >> 20) & 0xff), + (signature >> 4) & 0x0f, (signature >> 0) & 0x0f, (signature >> 20) & 0xff, (signature >> 16) & 0x0f); WARNX(1, "microcode revision %#x", revision); @@ -147,6 +148,7 @@ amd10h_update(const char *dev, const char *path) /* * Open the firmware file. */ + WARNX(1, "checking %s for update.", path); fd = open(path, O_RDONLY, 0); if (fd < 0) { WARN(0, "open(%s)", path); @@ -215,7 +217,9 @@ amd10h_update(const char *dev, const char *path) for (i = 0; equiv_cpu_table[i].installed_cpu != 0; i++) { if (signature == equiv_cpu_table[i].installed_cpu) { equiv_id = equiv_cpu_table[i].equiv_cpu; - WARNX(3, "equiv_id: %x", equiv_id); + WARNX(3, "equiv_id: %x, signature %8x," + " equiv_cpu_table[%d] %8x", equiv_id, signature, + i, equiv_cpu_table[i].installed_cpu); break; } } @@ -249,10 +253,16 @@ amd10h_update(const char *dev, const char *path) fw_data += section_header->size; fw_size -= section_header->size; - if (fw_header->processor_rev_id != equiv_id) + if (fw_header->processor_rev_id != equiv_id) { + WARNX(1, "firmware processort_rev_id %x, equiv_id %x", + fw_header->processor_rev_id, equiv_id); continue; /* different cpu */ - if (fw_header->patch_id <= revision) + } + if (fw_header->patch_id <= revision) { + WARNX(1, "patch_id %x, revision %x", + fw_header->patch_id, revision); continue; /* not newer revision */ + } if (fw_header->nb_dev_id != 0 || fw_header->sb_dev_id != 0) { WARNX(2, "Chipset-specific microcode is not supported"); }