linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: tmhikaru@gmail.com
Cc: linux-kernel@vger.kernel.org, Zhenzhong Duan <zhenzhong.duan@oracle.com>
Subject: Re: 3.2.38 most of the time has 100% cpu use reported
Date: Sat, 16 Feb 2013 05:18:10 +0000	[thread overview]
Message-ID: <1360991890.5374.414.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <20130216032327.GA2094@roll>

[-- Attachment #1: Type: text/plain, Size: 4435 bytes --]

On Fri, 2013-02-15 at 22:23 -0500, tmhikaru@gmail.com wrote:
> On Thu, Feb 14, 2013 at 05:04:07AM +0000, Ben Hutchings wrote:
> > On Tue, 2013-02-12 at 00:01 -0500, tmhikaru@gmail.com wrote:
> > > 	Okay, I finally have located the patch causing this bizzare problem
> > > for me. Before I discuss it, I'm going to drag out the kernel bug reporting
> > > guidelines and try to make a proper bug report out of this.
> > > 
> > > [1.] One line summary of the problem:
> > > 3.2.38 most of the time has 100% cpu use reported
> > > 
> > > [2.] Full description of the problem/report:
> > > Reverse applying the patch for
> > > 
> > > [9a1f08a1a192f9177d7063d903773aed800b840f] drivers/firmware/dmi_scan.c: fetch dmi version from SMBIOS if it exists
> > > 
> > > on top of a clean 3.2.38 tree makes the problem go away.
> > [...]
> > > I have to admit I have no idea what the patch I'm reversing actually does,
> > 
> > It changes how we look for the version of a BIOS interface (DMI or
> > SMBIOS).  All the code that it touches, and the version number variable,
> > are discarded after boot and therefore can have very limited effect on
> > what happens later!
> 
> Actually upon poking about, I noticed something VERY different about what
> the patch does to my computer during the boot process.  Let me show you
> dmesg output from a good kernel without the patch, then a bad one with the
> patch, then I'll point out the important differences I noticed:
[...]
> Important bits I noticed: The 'bad' kernel initially boots with acpi
> disabled, then later turns it back on, whereas the 'good' one boots with
> acpi completely enabled with no problems.
>
> Also, very early on just after yelling about the NX bit not existing in my
> cpu, it says this: (-good/+bad)
> 
> -[    0.000000] DMI 2.3 present.
> -[    0.000000] DMI: ECS M848A/M848A, BIOS 07.00T 04/02/01
> +[    0.000000] Legacy DMI 0.0 present.
> +[    0.000000] DMI:  , BIOS  

Oh wow, this has really gone very wrong.

> The 'good' kernel without the patch finds something for DMI (That is in fact
> my motherboard model number, so I know it's doing *something* right) whereas
> the bad one with the patch...  Does not.
>
> Anyway, I suppose I could try using acpi=force as the kernel suggests for a
> workaround for now, but I'm still convinced something went wrong with that
> patch now more than ever.  Due to the fact that ACPI gets reenabled I didn't
> catch on that something was going wrong so early in the boot process with it
> until now.
>
> One thing I want to emphasize is that the only difference between the two
> kernels is that lone patch.
>
> As for perf top, I tried running it as you suggested, but I honestly can't
> figure out how to get this thing to dump output to a file. Every time I
> redirect stdio/stderr I get a empty file, I don't know what I'm doing wrong.
> Any tips?
[...]

Don't worry about it - I think the log messages are a pretty good clue.

Does this patch fix the log messages and/or the other issues?

--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -416,6 +416,9 @@ static int __init dmi_present(const char __iomem *p)
 
 	memcpy_fromio(buf, p, 15);
 	if (dmi_checksum(buf, 15)) {
+		print_hex_dump(KERN_INFO, "DMI entry: ", DUMP_PREFIX_NONE,
+			       16, 1, buf, 15, false);
+
 		dmi_num = (buf[13] << 8) | buf[12];
 		dmi_len = (buf[7] << 8) | buf[6];
 		dmi_base = (buf[11] << 24) | (buf[10] << 16) |
@@ -442,10 +445,12 @@ static int __init dmi_present(const char __iomem *p)
 static int __init smbios_present(const char __iomem *p)
 {
 	u8 buf[32];
-	int offset = 0;
 
 	memcpy_fromio(buf, p, 32);
 	if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) {
+		print_hex_dump(KERN_INFO, "SMBIOS entry: ", DUMP_PREFIX_NONE,
+			       16, 1, buf, 16, false);
+
 		dmi_ver = (buf[6] << 8) + buf[7];
 
 		/* Some BIOS report weird SMBIOS version, fix that up */
@@ -461,9 +466,9 @@ static int __init smbios_present(const char __iomem *p)
 			dmi_ver = 0x0206;
 			break;
 		}
-		offset = 16;
+		return dmi_present(p + 16);
 	}
-	return dmi_present(buf + offset);
+	return 1;
 }
 
 void __init dmi_scan_machine(void)
--- END ---

If not, can you report back the 'SMBIOS entry:' and 'DMI entry:' log
lines this produces.

Ben.

-- 
Ben Hutchings
Computers are not intelligent.	They only think they are.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2013-02-16  5:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 14:27 Linux 3.2.38 Ben Hutchings
2013-02-06 14:34 ` Ben Hutchings
2013-02-07 17:36 ` tmhikaru
2013-02-08  1:11   ` Ben Hutchings
2013-02-08 14:27     ` Roland Eggner
2013-02-08 19:08   ` tmhikaru
2013-02-10 15:11     ` tmhikaru
2013-02-12  5:01       ` 3.2.38 most of the time has 100% cpu use reported tmhikaru
2013-02-14  5:04         ` Ben Hutchings
2013-02-16  3:23           ` tmhikaru
2013-02-16  5:18             ` Ben Hutchings [this message]
2013-02-16  6:42               ` tmhikaru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360991890.5374.414.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tmhikaru@gmail.com \
    --cc=zhenzhong.duan@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).