From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH v6 01/20] x86/common: Align cpu_caps_cleared and cpu_caps_set to unsigned long Date: Thu, 4 Apr 2019 16:39:43 +0200 Message-ID: <20190404143942.GD22539@zn.tnic> References: <1554326526-172295-1-git-send-email-fenghua.yu@intel.com> <1554326526-172295-2-git-send-email-fenghua.yu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Thomas Gleixner , Ingo Molnar , H Peter Anvin , Dave Hansen , Paolo Bonzini , Ashok Raj , Peter Zijlstra , Kalle Valo , Xiaoyao Li , Michael Chan , Ravi V Shankar , linux-kernel , x86 , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, kvm@vger.kernel.org To: Fenghua Yu Return-path: Content-Disposition: inline In-Reply-To: <1554326526-172295-2-git-send-email-fenghua.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Apr 03, 2019 at 02:21:47PM -0700, Fenghua Yu wrote: > cpu_caps_cleared and cpu_caps_set may not be aligned to unsigned long. > Atomic operations (i.e. set_bit and clear_bit) on the bitmaps may access Please end function names with parentheses. > two cache lines (a.k.a. split lock) and lock the bus to block all memory not "lock the bus" but "cause the CPU to do a bus lock... " > accesses from other processors to ensure atomicity. > > To avoid the overall performance degradation from the bus locking, align > the two variables to unsigned long. > > Defining the variables as unsigned long may also fix the issue because > they are naturally aligned to unsigned long. But that needs additional > code changes. Adding __aligned(unsigned long) is a simpler fix. > > Signed-off-by: Fenghua Yu > --- > arch/x86/kernel/cpu/common.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) With the above nitpicks addressed: Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.