public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] asm-generic: allow generic unaligned access if the arch supports it
@ 2014-03-27 17:46 Ard Biesheuvel
  2014-03-28 18:14 ` Arnd Bergmann
  0 siblings, 1 reply; 11+ messages in thread
From: Ard Biesheuvel @ 2014-03-27 17:46 UTC (permalink / raw)
  To: arnd, linux-arch; +Cc: robherring2, Ard Biesheuvel

Switch the default unaligned access method to 'hardware implemented'
if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 include/asm-generic/unaligned.h | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
index 03cf5936bad6..1ac097279db1 100644
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -4,22 +4,27 @@
 /*
  * This is the most generic implementation of unaligned accesses
  * and should work almost anywhere.
- *
- * If an architecture can handle unaligned accesses in hardware,
- * it may want to use the linux/unaligned/access_ok.h implementation
- * instead.
  */
 #include <asm/byteorder.h>
 
+/* Set by the arch if it can handle unaligned accesses in hardware. */
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+# include <linux/unaligned/access_ok.h>
+#endif
+
 #if defined(__LITTLE_ENDIAN)
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
+# ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+#  include <linux/unaligned/le_struct.h>
+#  include <linux/unaligned/be_byteshift.h>
+# endif
 # include <linux/unaligned/generic.h>
 # define get_unaligned	__get_unaligned_le
 # define put_unaligned	__put_unaligned_le
 #elif defined(__BIG_ENDIAN)
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
+# ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+#  include <linux/unaligned/be_struct.h>
+#  include <linux/unaligned/le_byteshift.h>
+# endif
 # include <linux/unaligned/generic.h>
 # define get_unaligned	__get_unaligned_be
 # define put_unaligned	__put_unaligned_be
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-27 17:46 [PATCH] asm-generic: allow generic unaligned access if the arch supports it Ard Biesheuvel
@ 2014-03-28 18:14 ` Arnd Bergmann
  2014-03-28 18:24   ` Ard Biesheuvel
  0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2014-03-28 18:14 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: linux-arch, robherring2

On Thursday 27 March 2014, Ard Biesheuvel wrote:
> Switch the default unaligned access method to 'hardware implemented'
> if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

Is this part of a longer series of patches? If so, please keep
the patch with the others and merge it through an appropriate
tree.

If not, I guess I'll have to send it myself, but it will be
the only asm-generic patch for the merge window ;-)

	Arnd

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-28 18:14 ` Arnd Bergmann
@ 2014-03-28 18:24   ` Ard Biesheuvel
  2014-03-31  9:59     ` Catalin Marinas
  0 siblings, 1 reply; 11+ messages in thread
From: Ard Biesheuvel @ 2014-03-28 18:24 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arch, Rob Herring, Catalin Marinas

On 28 March 2014 19:14, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday 27 March 2014, Ard Biesheuvel wrote:
>> Switch the default unaligned access method to 'hardware implemented'
>> if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> Is this part of a longer series of patches? If so, please keep
> the patch with the others and merge it through an appropriate
> tree.
>

No, not really. I ran into the alignment issue while working on the
arm64 crypto stuff, but it is unclear when that will be going in.

> If not, I guess I'll have to send it myself, but it will be
> the only asm-generic patch for the merge window ;-)
>

Perhaps Catalin is interested in taking it, as arm64 is the only arch
that defines HAVE_EFFICIENT_UNALIGNED_ACCESS /and/ uses the
asm-generic version of unaligned.h.

@Catalin?

http://marc.info/?l=linux-arch&m=139594237116121&w=2

Regards,
Ard.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-28 18:24   ` Ard Biesheuvel
@ 2014-03-31  9:59     ` Catalin Marinas
  2014-03-31 10:07       ` Ard Biesheuvel
  2014-04-08  6:48       ` Ard Biesheuvel
  0 siblings, 2 replies; 11+ messages in thread
From: Catalin Marinas @ 2014-03-31  9:59 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: Arnd Bergmann, linux-arch@vger.kernel.org, Rob Herring

On Fri, Mar 28, 2014 at 06:24:04PM +0000, Ard Biesheuvel wrote:
> On 28 March 2014 19:14, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Thursday 27 March 2014, Ard Biesheuvel wrote:
> >> Switch the default unaligned access method to 'hardware implemented'
> >> if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.
> >>
> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> >
> > Is this part of a longer series of patches? If so, please keep
> > the patch with the others and merge it through an appropriate
> > tree.
> >
> 
> No, not really. I ran into the alignment issue while working on the
> arm64 crypto stuff, but it is unclear when that will be going in.
> 
> > If not, I guess I'll have to send it myself, but it will be
> > the only asm-generic patch for the merge window ;-)
> 
> Perhaps Catalin is interested in taking it, as arm64 is the only arch
> that defines HAVE_EFFICIENT_UNALIGNED_ACCESS /and/ uses the
> asm-generic version of unaligned.h.
> 
> @Catalin?
> 
> http://marc.info/?l=linux-arch&m=139594237116121&w=2

I can take this, providing it doesn't break anything else. I'll push it
to -next but won't send it with the first arm64 pull request.

-- 
Catalin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-31  9:59     ` Catalin Marinas
@ 2014-03-31 10:07       ` Ard Biesheuvel
  2014-03-31 17:24         ` Catalin Marinas
  2014-04-08  6:48       ` Ard Biesheuvel
  1 sibling, 1 reply; 11+ messages in thread
From: Ard Biesheuvel @ 2014-03-31 10:07 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Arnd Bergmann, linux-arch@vger.kernel.org, Rob Herring

On 31 March 2014 11:59, Catalin Marinas <catalin.marinas@arm.com> wrote:
> On Fri, Mar 28, 2014 at 06:24:04PM +0000, Ard Biesheuvel wrote:
>> On 28 March 2014 19:14, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Thursday 27 March 2014, Ard Biesheuvel wrote:
>> >> Switch the default unaligned access method to 'hardware implemented'
>> >> if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.
>> >>
>> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> >
>> > Acked-by: Arnd Bergmann <arnd@arndb.de>
>> >
>> > Is this part of a longer series of patches? If so, please keep
>> > the patch with the others and merge it through an appropriate
>> > tree.
>> >
>>
>> No, not really. I ran into the alignment issue while working on the
>> arm64 crypto stuff, but it is unclear when that will be going in.
>>
>> > If not, I guess I'll have to send it myself, but it will be
>> > the only asm-generic patch for the merge window ;-)
>>
>> Perhaps Catalin is interested in taking it, as arm64 is the only arch
>> that defines HAVE_EFFICIENT_UNALIGNED_ACCESS /and/ uses the
>> asm-generic version of unaligned.h.
>>
>> @Catalin?
>>
>> http://marc.info/?l=linux-arch&m=139594237116121&w=2
>
> I can take this, providing it doesn't break anything else. I'll push it
> to -next but won't send it with the first arm64 pull request.
>

Yes, please.

As I said, it can only affect arm64, and only users of
get_unaligned_xx/put_unaligned_xx so it should be safe as far as I can
tell.

Regards,
Ard.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-31 10:07       ` Ard Biesheuvel
@ 2014-03-31 17:24         ` Catalin Marinas
  2014-03-31 18:22           ` Ard Biesheuvel
  0 siblings, 1 reply; 11+ messages in thread
From: Catalin Marinas @ 2014-03-31 17:24 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: Arnd Bergmann, linux-arch@vger.kernel.org, Rob Herring

On Mon, Mar 31, 2014 at 11:07:54AM +0100, Ard Biesheuvel wrote:
> On 31 March 2014 11:59, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > On Fri, Mar 28, 2014 at 06:24:04PM +0000, Ard Biesheuvel wrote:
> >> On 28 March 2014 19:14, Arnd Bergmann <arnd@arndb.de> wrote:
> >> > On Thursday 27 March 2014, Ard Biesheuvel wrote:
> >> >> Switch the default unaligned access method to 'hardware implemented'
> >> >> if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.
> >> >>
> >> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >> >
> >> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> >> >
> >> > Is this part of a longer series of patches? If so, please keep
> >> > the patch with the others and merge it through an appropriate
> >> > tree.
> >> >
> >>
> >> No, not really. I ran into the alignment issue while working on the
> >> arm64 crypto stuff, but it is unclear when that will be going in.
> >>
> >> > If not, I guess I'll have to send it myself, but it will be
> >> > the only asm-generic patch for the merge window ;-)
> >>
> >> Perhaps Catalin is interested in taking it, as arm64 is the only arch
> >> that defines HAVE_EFFICIENT_UNALIGNED_ACCESS /and/ uses the
> >> asm-generic version of unaligned.h.
> >>
> >> @Catalin?
> >>
> >> http://marc.info/?l=linux-arch&m=139594237116121&w=2
> >
> > I can take this, providing it doesn't break anything else. I'll push it
> > to -next but won't send it with the first arm64 pull request.
> 
> Yes, please.
> 
> As I said, it can only affect arm64, and only users of
> get_unaligned_xx/put_unaligned_xx so it should be safe as far as I can
> tell.

It actually affects arch/arm as well which selects
HAVE_EFFICIENT_UNALIGNED_ACCESS for v6/v7 and uses the generic
unaligned.h

-- 
Catalin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-31 17:24         ` Catalin Marinas
@ 2014-03-31 18:22           ` Ard Biesheuvel
  2014-03-31 18:36             ` Russell King - ARM Linux
  0 siblings, 1 reply; 11+ messages in thread
From: Ard Biesheuvel @ 2014-03-31 18:22 UTC (permalink / raw)
  To: Catalin Marinas, Russell King - ARM Linux
  Cc: Arnd Bergmann, linux-arch@vger.kernel.org, Rob Herring,
	linux-arm-kernel@lists.infradead.org

On 31 March 2014 19:24, Catalin Marinas <catalin.marinas@arm.com> wrote:
> On Mon, Mar 31, 2014 at 11:07:54AM +0100, Ard Biesheuvel wrote:
>> On 31 March 2014 11:59, Catalin Marinas <catalin.marinas@arm.com> wrote:
>> > On Fri, Mar 28, 2014 at 06:24:04PM +0000, Ard Biesheuvel wrote:
>> >> On 28 March 2014 19:14, Arnd Bergmann <arnd@arndb.de> wrote:
>> >> > On Thursday 27 March 2014, Ard Biesheuvel wrote:
>> >> >> Switch the default unaligned access method to 'hardware implemented'
>> >> >> if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.
>> >> >>
>> >> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> >> >
>> >> > Acked-by: Arnd Bergmann <arnd@arndb.de>
>> >> >
>> >> > Is this part of a longer series of patches? If so, please keep
>> >> > the patch with the others and merge it through an appropriate
>> >> > tree.
>> >> >
>> >>
>> >> No, not really. I ran into the alignment issue while working on the
>> >> arm64 crypto stuff, but it is unclear when that will be going in.
>> >>
>> >> > If not, I guess I'll have to send it myself, but it will be
>> >> > the only asm-generic patch for the merge window ;-)
>> >>
>> >> Perhaps Catalin is interested in taking it, as arm64 is the only arch
>> >> that defines HAVE_EFFICIENT_UNALIGNED_ACCESS /and/ uses the
>> >> asm-generic version of unaligned.h.
>> >>
>> >> @Catalin?
>> >>
>> >> http://marc.info/?l=linux-arch&m=139594237116121&w=2
>> >
>> > I can take this, providing it doesn't break anything else. I'll push it
>> > to -next but won't send it with the first arm64 pull request.
>>
>> Yes, please.
>>
>> As I said, it can only affect arm64, and only users of
>> get_unaligned_xx/put_unaligned_xx so it should be safe as far as I can
>> tell.
>
> It actually affects arch/arm as well which selects
> HAVE_EFFICIENT_UNALIGNED_ACCESS for v6/v7 and uses the generic
> unaligned.h
>

Oops, my bad. I did a quick 'find -name unaligned.h' but misread 'arc'
for 'arm'.

@Russell: ARM is a user of asm-generic/unaligned.h, and I proposed a
patch to asm-generic that switches to unaligned accesses if
HAVE_EFFICIENT_UNALIGNED_ACCESS is set by the arch. This should affect
a fair amount of code living under net/ and drivers/ that don't test
for the Kconfig symbol but expect get_unaligned_xx/put_unaligned_xx to
turn into something suitable depending on the arch. Any objections?

@Arnd: anyone else you feel should be cc'ed on this?

Regards,
Ard.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-31 18:22           ` Ard Biesheuvel
@ 2014-03-31 18:36             ` Russell King - ARM Linux
  2014-03-31 18:51               ` Ard Biesheuvel
  0 siblings, 1 reply; 11+ messages in thread
From: Russell King - ARM Linux @ 2014-03-31 18:36 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Catalin Marinas, Arnd Bergmann, linux-arch@vger.kernel.org,
	Rob Herring, linux-arm-kernel@lists.infradead.org

On Mon, Mar 31, 2014 at 08:22:43PM +0200, Ard Biesheuvel wrote:
> On 31 March 2014 19:24, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > It actually affects arch/arm as well which selects
> > HAVE_EFFICIENT_UNALIGNED_ACCESS for v6/v7 and uses the generic
> > unaligned.h
> >
> 
> Oops, my bad. I did a quick 'find -name unaligned.h' but misread 'arc'
> for 'arm'.
> 
> @Russell: ARM is a user of asm-generic/unaligned.h, and I proposed a
> patch to asm-generic that switches to unaligned accesses if
> HAVE_EFFICIENT_UNALIGNED_ACCESS is set by the arch. This should affect
> a fair amount of code living under net/ and drivers/ that don't test
> for the Kconfig symbol but expect get_unaligned_xx/put_unaligned_xx to
> turn into something suitable depending on the arch. Any objections?

I'm not sure what you're talking about here, or what change you're
proposing.  Without any kind of frame of reference, I can't comment.
Sorry.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-31 18:36             ` Russell King - ARM Linux
@ 2014-03-31 18:51               ` Ard Biesheuvel
  2014-04-08  9:49                 ` Russell King - ARM Linux
  0 siblings, 1 reply; 11+ messages in thread
From: Ard Biesheuvel @ 2014-03-31 18:51 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Catalin Marinas, Arnd Bergmann, linux-arch@vger.kernel.org,
	Rob Herring, linux-arm-kernel@lists.infradead.org

On 31 March 2014 20:36, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> On Mon, Mar 31, 2014 at 08:22:43PM +0200, Ard Biesheuvel wrote:
>> On 31 March 2014 19:24, Catalin Marinas <catalin.marinas@arm.com> wrote:
>> > It actually affects arch/arm as well which selects
>> > HAVE_EFFICIENT_UNALIGNED_ACCESS for v6/v7 and uses the generic
>> > unaligned.h
>> >
>>
>> Oops, my bad. I did a quick 'find -name unaligned.h' but misread 'arc'
>> for 'arm'.
>>
>> @Russell: ARM is a user of asm-generic/unaligned.h, and I proposed a
>> patch to asm-generic that switches to unaligned accesses if
>> HAVE_EFFICIENT_UNALIGNED_ACCESS is set by the arch. This should affect
>> a fair amount of code living under net/ and drivers/ that don't test
>> for the Kconfig symbol but expect get_unaligned_xx/put_unaligned_xx to
>> turn into something suitable depending on the arch. Any objections?
>
> I'm not sure what you're talking about here, or what change you're
> proposing.  Without any kind of frame of reference, I can't comment.
> Sorry.
>

My apologies. I assumed the mail thread including a link to the patch
would be clear enough.

Currently, asm-generic's version of unaligned.h (defining stuff like
get_unaligned() and put_unaligned()) unconditionally defaults to the
most cautious method of performing unaligned memory accesses, even if
the Kconfig symbol HAVE_EFFICIENT_UNALIGNED_ACCESS is defined.
However, in that case, it makes sense to use a definition for
get_unaligned()/put_unaligned() that lets the hardware perform the
unaligned accesses instead.

So that is what I proposed here

http://marc.info/?l=linux-arch&m=139594237116121&w=2

and in the mail exchange that followed, I stated that arm64 should be
the only arch affected by this change. However, I didn't look
carefully enough and, as Catalin pointed out, ARM will also be
affected by it.

So that is why I redirected this thread to you: would you object to
changing asm-generic/unaligned.h so that calls to
get_aligned()/put_aligned() on ARM v6/v7 will let the CPU perform the
unaligned access?

Regards,
Ard.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-31  9:59     ` Catalin Marinas
  2014-03-31 10:07       ` Ard Biesheuvel
@ 2014-04-08  6:48       ` Ard Biesheuvel
  1 sibling, 0 replies; 11+ messages in thread
From: Ard Biesheuvel @ 2014-04-08  6:48 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Arnd Bergmann, linux-arch@vger.kernel.org, Rob Herring,
	Russell King - ARM Linux, linux-arm-kernel@lists.infradead.org

On 31 March 2014 11:59, Catalin Marinas <catalin.marinas@arm.com> wrote:
> On Fri, Mar 28, 2014 at 06:24:04PM +0000, Ard Biesheuvel wrote:
>> On 28 March 2014 19:14, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Thursday 27 March 2014, Ard Biesheuvel wrote:
>> >> Switch the default unaligned access method to 'hardware implemented'
>> >> if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.
>> >>
>> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> >
>> > Acked-by: Arnd Bergmann <arnd@arndb.de>
>> >
>> > Is this part of a longer series of patches? If so, please keep
>> > the patch with the others and merge it through an appropriate
>> > tree.
>> >
>>
>> No, not really. I ran into the alignment issue while working on the
>> arm64 crypto stuff, but it is unclear when that will be going in.
>>
>> > If not, I guess I'll have to send it myself, but it will be
>> > the only asm-generic patch for the merge window ;-)
>>
>> Perhaps Catalin is interested in taking it, as arm64 is the only arch
>> that defines HAVE_EFFICIENT_UNALIGNED_ACCESS /and/ uses the
>> asm-generic version of unaligned.h.
>>
>> @Catalin?
>>
>> http://marc.info/?l=linux-arch&m=139594237116121&w=2
>
> I can take this, providing it doesn't break anything else. I'll push it
> to -next but won't send it with the first arm64 pull request.
>

Are you still interested in taking this? Russell doesn't appear
particularly unhappy with it, so I guess it should sit in -next for a
bit before getting it merged.

-- 
Ard.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] asm-generic: allow generic unaligned access if the arch supports it
  2014-03-31 18:51               ` Ard Biesheuvel
@ 2014-04-08  9:49                 ` Russell King - ARM Linux
  0 siblings, 0 replies; 11+ messages in thread
From: Russell King - ARM Linux @ 2014-04-08  9:49 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Catalin Marinas, Arnd Bergmann, linux-arch@vger.kernel.org,
	Rob Herring, linux-arm-kernel@lists.infradead.org

On Mon, Mar 31, 2014 at 08:51:54PM +0200, Ard Biesheuvel wrote:
> On 31 March 2014 20:36, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> > On Mon, Mar 31, 2014 at 08:22:43PM +0200, Ard Biesheuvel wrote:
> >> On 31 March 2014 19:24, Catalin Marinas <catalin.marinas@arm.com> wrote:
> >> > It actually affects arch/arm as well which selects
> >> > HAVE_EFFICIENT_UNALIGNED_ACCESS for v6/v7 and uses the generic
> >> > unaligned.h
> >> >
> >>
> >> Oops, my bad. I did a quick 'find -name unaligned.h' but misread 'arc'
> >> for 'arm'.
> >>
> >> @Russell: ARM is a user of asm-generic/unaligned.h, and I proposed a
> >> patch to asm-generic that switches to unaligned accesses if
> >> HAVE_EFFICIENT_UNALIGNED_ACCESS is set by the arch. This should affect
> >> a fair amount of code living under net/ and drivers/ that don't test
> >> for the Kconfig symbol but expect get_unaligned_xx/put_unaligned_xx to
> >> turn into something suitable depending on the arch. Any objections?
> >
> > I'm not sure what you're talking about here, or what change you're
> > proposing.  Without any kind of frame of reference, I can't comment.
> > Sorry.
> >
> 
> My apologies. I assumed the mail thread including a link to the patch
> would be clear enough.
> 
> Currently, asm-generic's version of unaligned.h (defining stuff like
> get_unaligned() and put_unaligned()) unconditionally defaults to the
> most cautious method of performing unaligned memory accesses, even if
> the Kconfig symbol HAVE_EFFICIENT_UNALIGNED_ACCESS is defined.
> However, in that case, it makes sense to use a definition for
> get_unaligned()/put_unaligned() that lets the hardware perform the
> unaligned accesses instead.
> 
> So that is what I proposed here
> 
> http://marc.info/?l=linux-arch&m=139594237116121&w=2
> 
> and in the mail exchange that followed, I stated that arm64 should be
> the only arch affected by this change. However, I didn't look
> carefully enough and, as Catalin pointed out, ARM will also be
> affected by it.
> 
> So that is why I redirected this thread to you: would you object to
> changing asm-generic/unaligned.h so that calls to
> get_aligned()/put_aligned() on ARM v6/v7 will let the CPU perform the
> unaligned access?

The change looks fine to me, but given where we are in the cycle, I'd
rather hold off until after the merge window before queuing this up.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-04-08  9:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 17:46 [PATCH] asm-generic: allow generic unaligned access if the arch supports it Ard Biesheuvel
2014-03-28 18:14 ` Arnd Bergmann
2014-03-28 18:24   ` Ard Biesheuvel
2014-03-31  9:59     ` Catalin Marinas
2014-03-31 10:07       ` Ard Biesheuvel
2014-03-31 17:24         ` Catalin Marinas
2014-03-31 18:22           ` Ard Biesheuvel
2014-03-31 18:36             ` Russell King - ARM Linux
2014-03-31 18:51               ` Ard Biesheuvel
2014-04-08  9:49                 ` Russell King - ARM Linux
2014-04-08  6:48       ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox