mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Fenghua Yu' <fenghua.yu@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	H Peter Anvin <hpa@zytor.com>, Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ashok Raj <ashok.raj@intel.com>, Tony Luck <tony.luck@intel.com>,
	Ravi V Shankar <ravi.v.shankar@intel.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, x86 <x86@kernel.org>
Subject: RE: [PATCH v2 0/4] Fix some 4-byte vs. 8-byte alignment issues in atomic bit operations
Date: Tue, 26 Nov 2019 10:13:37 +0000	[thread overview]
Message-ID: <965b5dcf35b54f8b96008a82e6d581c1@AcuMS.aculab.com> (raw)
In-Reply-To: <1574710984-208305-1-git-send-email-fenghua.yu@intel.com>

From: Fenghua Yu
> Sent: 25 November 2019 19:43
...
> Change Log:
> v2:
> - Remove patch 1 and 3 in v1 because they are in the tip tree already.
> - Add new patches 2-4 per David Laight's comments:
> https://lore.kernel.org/lkml/e7c75de9191847ed98c573f9ad871518@AcuMS.aculab.com/
> Running "grep -r --include '*.[ch]' '_bit([^(]*, *([^)]*\*)' ."
> returns about 200 results. Most of them don't have split lock issues.

Except that any code that has to cast the long[] array argument to any of
the bitops functions is almost certainly broken in some way or other.
At best it is relying on accidental alignment of whatever address it is passing
to avoid alignment faults (for general misaligned accesses).

In other cases attempting to run the code on a BE system will update the
wrong bits - potentially in some other member of the structure.

Now, you might say that 'this code is LE only', but at some point it might
get used on a BE system.

So all of those 200 results need fixing to remove the casts.
Just using the unblocked __bit_xxx() functions doesn't fix
all the problems.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


      parent reply	other threads:[~2019-11-26 10:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 19:43 Fenghua Yu
2019-11-25 19:43 ` [PATCH v2 1/4] drivers/net/b44: Change to non-atomic " Fenghua Yu
2019-11-26  9:49   ` David Laight
2019-12-04 15:19     ` Peter Zijlstra
2019-11-25 19:43 ` [PATCH v2 2/4] xen-pcifront: Align address of flags to size of unsigned long Fenghua Yu
2019-11-26  9:53   ` David Laight
2019-11-26 10:02   ` Jürgen Groß
2019-12-02 18:28     ` Luck, Tony
2019-12-02 22:29     ` Fenghua Yu
2019-11-25 19:43 ` [PATCH v2 3/4] mtd: rawnand: fsmc: Change to non-atomic bit operations Fenghua Yu
2019-12-04 15:28   ` Peter Zijlstra
2019-11-25 19:43 ` [PATCH v2 4/4] x86/mce: Force alignment for atomic " Fenghua Yu
2019-11-26 10:13 ` David Laight [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=965b5dcf35b54f8b96008a82e6d581c1@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=ashok.raj@intel.com \
    --cc=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ravi.v.shankar@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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

Powered by JetHome