mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Robin Holt <holt@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>,
	Jean Delvare <jdelvare@suse.de>,
	DuanZhenzhong <zhenzhong.duan@oracle.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Yu, Fenghua" <fenghua.yu@intel.com>
Subject: Re: memcpy_fromio in dmi_scan.c
Date: Thu, 25 Apr 2013 13:37:01 -0700	[thread overview]
Message-ID: <20130425133701.04d31844cb594030a0431171@linux-foundation.org> (raw)
In-Reply-To: <20130425095242.GT3658@sgi.com>

On Thu, 25 Apr 2013 04:52:42 -0500 Robin Holt <holt@sgi.com> wrote:

> On Wed, Apr 24, 2013 at 09:07:24PM -0500, Robin Holt wrote:
> > On Wed, Apr 24, 2013 at 08:16:50PM +0000, Luck, Tony wrote:
> > > > That being said, "my" SN2 machine was previously running kernel 3.0.34
> > > > which has the old dmi_scan code and it also said "DMI not present or
> > > > invalid." Plus dmidecode fails on this machine with:
> > > >
> > > > /sys/firmware/efi/systab: SMBIOS entry point missing
> > > >
> > > > So it might as well be that DMI support on SN2 was already broken.
> > > > Please let me know your findings on other SN2 machines.
> > > 
> > > I don't have an sn2 to test. Added Robin Holt to Cc list
> > 
> > I will try and boot an sn2 machine first thing tomorrow morning.
> > I don't recall dmidecode being broken, but that was quite a while ago.
> > I thought the license validation code we used on sn2 used data from the
> > dmidecode output.
> 
>  # uname -r
> 3.0.13-0.27-default
>  # dmidecode
> # dmidecode 2.9
> /sys/firmware/efi/systab: SMBIOS entry point missing
> 
> 
> It looks like it is broken there as well.  This is running a SLES11SP2
> kernel with no local changes.
> 
> dmesg show:
> DMI not present or invalid.
> 

So what's the fix?  This?

--- a/drivers/firmware/dmi_scan.c~a
+++ a/drivers/firmware/dmi_scan.c
@@ -500,9 +500,12 @@ void __init dmi_scan_machine(void)
 			goto error;
 
 		for (q = p; q < p + 0x10000; q += 16) {
-			if (memcmp(q, "_SM_", 4) == 0 && q - p <= 0xFFE0)
+			char buf[5];
+
+			memcpy_from_io(buf, q, 5);
+			if (memcmp(buf, "_SM_", 4) == 0 && q - p <= 0xFFE0)
 				rc = smbios_present(q);
-			else if (memcmp(q, "_DMI_", 5) == 0)
+			else if (memcmp(buf, "_DMI_", 5) == 0)
 				rc = dmi_present(q);
 			else
 				continue;
_


  reply	other threads:[~2013-04-25 20:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 13:18 Jean Delvare
2013-04-23  3:25 ` DuanZhenzhong
2013-04-23  7:28   ` Jean Delvare
2013-04-23 22:00     ` Luck, Tony
2013-04-24 19:22       ` Jean Delvare
2013-04-24 20:16         ` Luck, Tony
2013-04-25  2:07           ` Robin Holt
2013-04-25  9:52             ` Robin Holt
2013-04-25 20:37               ` Andrew Morton [this message]
2013-07-08 13:54                 ` Jean Delvare
2013-04-25  1:51         ` Zhenzhong Duan
2013-04-25 10:02         ` Robin Holt

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=20130425133701.04d31844cb594030a0431171@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fenghua.yu@intel.com \
    --cc=holt@sgi.com \
    --cc=jdelvare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.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

all inboxes | Powered by JetHome®