[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8fdfb671-f223-163b-12cd-3c97d94f91b4@intel.com>
Date: Fri, 29 Jun 2018 13:48:45 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Fenghua Yu <fenghua.yu@...el.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>, H Peter Anvin <hpa@...or.com>,
Ashok Raj <ashok.raj@...el.com>,
Alan Cox <alan@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Rafael Wysocki <rafael.j.wysocki@...el.com>,
Tony Luck <tony.luck@...el.com>,
Ravi V Shankar <ravi.v.shankar@...el.com>,
linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: Re: [PATCH v2 2/4] x86/split_lock: Align x86_capability to unsigned
long to avoid split locked access
On 06/29/2018 01:38 PM, Fenghua Yu wrote:
> How to handle data that is used in generic code which can be used on
> non-Intel platform? For exmple, if I do this change for struct efi in
> include/linux/efi.h because set_bit() sets bits in efi.flags:
> - unsigned long flags;
> + unsigned long flags __aligned(unsigned long);
> } efi;
>
> People may argue that the alignment unnecessarily increases size of 'efi'
> on non-Intel platform which doesn't have split lock issue. Do we care this
> argument?
Unaligned memory accesses are bad, pretty much universally. This is a
general good practice that we should have been doing anyway. Let folks
complain. Don't let it stop you.
Also, look at the size of that structure. Look at how many pointers it
has. Do you think *anyone* is going to complain about an extra 4 bytes
in a 400-byte structure?
> Another question, there will be a bunch of one-line changes for
> the alignment (i.e. adding __aligned(unsigned long)) in various files.
> Will the changes be put in one big patch or in separate one-liner patches?
Just group them logically.
Powered by blists - more mailing lists