All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Arnd Bergmann <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, peterz@infradead.org, babu.moger@oracle.com,
	gregkh@linuxfoundation.org, nico@linaro.org,
	akpm@linux-foundation.org, tglx@linutronix.de,
	will.deacon@arm.com, linux-kernel@vger.kernel.org,
	torvalds@linux-foundation.org, arnd@arndb.de, hpa@zytor.com
Subject: [tip:locking/urgent] locking/qrwlock: include asm/byteorder.h as needed
Date: Tue, 6 Feb 2018 03:57:47 -0800	[thread overview]
Message-ID: <tip-ca66e797120fb09b8138623fb4b563e952586ef5@git.kernel.org> (raw)
In-Reply-To: <20180202154104.1522809-1-arnd@arndb.de>

Commit-ID:  ca66e797120fb09b8138623fb4b563e952586ef5
Gitweb:     https://git.kernel.org/tip/ca66e797120fb09b8138623fb4b563e952586ef5
Author:     Arnd Bergmann <arnd@arndb.de>
AuthorDate: Fri, 2 Feb 2018 16:40:44 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 6 Feb 2018 10:28:58 +0100

locking/qrwlock: include asm/byteorder.h as needed

Moving the qrwlock struct definition into a header file introduced
a subtle bug on all little-endian machines, where some files in some
configurations would see the fields in an incorrect order.  This was
found by building with an LTO enabled compiler that warns every time we
try to link together files with incompatible data structures.

A second patch changes linux/kconfig.h to always define the symbols,
but this seems to be the root cause of most of the issues, so I'd suggest
we do both.

On a current linux-next kernel, I verified that this header is
responsible for all type mismatches as a result from the endianess
confusion.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Babu Moger <babu.moger@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nicolas Pitre <nico@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Fixes: e0d02285f16e ("locking/qrwlock: Use 'struct qrwlock' instead of 'struct __qrwlock'")
Link: http://lkml.kernel.org/r/20180202154104.1522809-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/asm-generic/qrwlock_types.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/asm-generic/qrwlock_types.h b/include/asm-generic/qrwlock_types.h
index 137ecdd..c36f1d5 100644
--- a/include/asm-generic/qrwlock_types.h
+++ b/include/asm-generic/qrwlock_types.h
@@ -3,6 +3,7 @@
 #define __ASM_GENERIC_QRWLOCK_TYPES_H
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 #include <asm/spinlock_types.h>
 
 /*

      parent reply	other threads:[~2018-02-06 11:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 15:40 [PATCH 1/2] locking/qrwlock: include asm/byteorder.h as needed Arnd Bergmann
2018-02-02 15:40 ` [PATCH 2/2] Kbuild: always define endianess in kconfig.h Arnd Bergmann
2018-02-02 16:31   ` Masahiro Yamada
2018-02-02 16:44     ` Arnd Bergmann
2018-02-02 19:49   ` Andrew Morton
2018-02-06 11:57 ` tip-bot for Arnd Bergmann [this message]

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=tip-ca66e797120fb09b8138623fb4b563e952586ef5@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=babu.moger@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nico@linaro.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will.deacon@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.