From: Jay.Estabrook@compaq.com
To: axp-list@redhat.com
Subject: Re: how to simulate an unaligned ldl_l
Date: Mon, 14 Feb 2000 00:07:05 -0500 [thread overview]
Message-ID: <200002140507.AAA02511@alpha2.estabrook.org> (raw)
In-Reply-To: Your message of Sun, 13 Feb 2000 18:20:48 -0500. <Pine.LNX.4.10.10002131812010.16865-100000@notfoo.nightmoose.net>
>>> "Ross A. Knepper" said:
>
> i've been looking at porting reiserfs to alpha. unfortunately, it has a
> bunch of unaligned data accesses. naturally, intel doesnt care. on
> alpha, most unaligned LDx/STx instructions are emulated by a software
> trap (outside the kernel that is -- i don't know about inside). however,
> this is not the case with the load_locked and store_conditional
> instructions.
Uh, oh... :-\
> i'm looking at a number of routines that use these instructions for
> atomicity, via clear_bit(), set_bit(), etc. in asm/bitops.h. is there any
> clever way to circumvent this problem? the only hack i can think of at
> the moment is to use ldl_u to extract it, put it into an aligned longword
> buffer and do the ldl_l on that address instead. i feel like i'd have to
> be insane to try this, however :)
>
> anybody had this problem before? found a solution?
The only solution is to align those accesses.
The load_locked and store_conditional *MUST* be used with aligned operands,
otherwise what they are attempting to do (protect change of state from SMP
meddling) cannot be relied on.
And I believe strongly that this will be a problem on other architectures
beside Alpha. You must convince the authors to rework the data structures to
size and align the important fields correctly for operation on other
platorms than INTEL.
--Jay++
---------------------------------------------------------------
Jay A Estabrook Alpha Engineering - LINUX
Compaq Computer Corp. - MRO1-2/K20 (508) 467-2080
200 Forest Street, Marlboro MA 01752 Jay.Estabrook@compaq.com
---------------------------------------------------------------
next prev parent reply other threads:[~2000-02-14 8:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-13 23:20 how to simulate an unaligned ldl_l Ross A. Knepper
2000-02-14 5:07 ` Jay.Estabrook [this message]
2000-02-14 13:15 ` Peter Rival
2000-02-14 15:26 ` set_program_attributes message J. Pedro Sousa do Amaral
2000-02-14 15:51 ` how to simulate an unaligned ldl_l Joseph A. Martin
2000-02-15 3:08 ` Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox