From: Dominik Brodowski <devel@brodo.de>
To: Bill Davidsen <davidsen@tmr.com>
Cc: davej@suse.de, torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] resolve ACPI oops on boot
Date: Wed, 24 Jul 2002 00:55:19 +0200 [thread overview]
Message-ID: <20020724005518.A837@brodo.de> (raw)
In-Reply-To: <Pine.LNX.3.96.1020723165428.2194A-100000@gatekeeper.tmr.com>; from davidsen@tmr.com on Tue, Jul 23, 2002 at 05:20:57PM -0400
On Tue, Jul 23, 2002 at 05:20:57PM -0400, Bill Davidsen wrote:
> On Thu, 18 Jul 2002, Dominik Brodowski wrote:
>
> > An u8 was casted into an u32, then all 32 bits were set to zero, this
> > causing another variable - in my case, processor flags - to be corrupted.
> >
> > Dominik
>
> But that's not what's happening here, the pointer is being cast, if the
> object of the pointer is not u32, then casting the pointer doesn't fix the
> real problem. If the "data" pointer points to a u8, then no casting will
> make it work right when you save 32 bits into an 8 bit space. If this
> changes the problem it's because of alignment, perhaps.
There is the argument "size" to acpi_hw_low_level_read which makes sure that
only the right data is being read. Problem is that a sort of
"segmentation fault" occurs when such a cast allows writing in different
memory than allocated for the value.
> You give neither the kernel version nor the architecture
kernel version 2.5.2[5,6] or 2.4.-kernels with acpi-patch 20020709,
architecture: all architectures that implement Embedded Controllers.
> I think the cast is just to avoid the compiler whining about types, the
> version I have is actually type "(acpi_generic_address*)" not (u32*), I
> would think the compiler would still complain, but maybe only with
> -pedantic or whatever.
The casts were probably introduced for that reason. Per se, they are not
critical - but if there is any assumption later on that the data structure
is indeed of the large size, there is a problem.
Dominik
next prev parent reply other threads:[~2002-07-23 22:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-18 21:15 [PATCH] resolve ACPI oops on boot Dominik Brodowski
2002-07-23 21:20 ` Bill Davidsen
2002-07-23 22:55 ` Dominik Brodowski [this message]
2002-07-30 16:21 ` Bill Davidsen
2002-07-24 23:12 ` Matthew Harrell
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=20020724005518.A837@brodo.de \
--to=devel@brodo.de \
--cc=davej@suse.de \
--cc=davidsen@tmr.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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