Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2714185imb; Mon, 4 Mar 2019 12:09:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxMSNGA9tQMEWiw6mvXcpEso5SpvBeCaXRUtf5uGIKTJJT6JJbsyV26tsqGgEbfZWjskYTD X-Received: by 2002:a63:29c3:: with SMTP id p186mr20220636pgp.24.1551730158876; Mon, 04 Mar 2019 12:09:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551730158; cv=none; d=google.com; s=arc-20160816; b=vkAnvuW3E1fatmDeVzcvKZ+KpoMsYoIGjw6KZOCGcjiTxYYQlAi0CIfX6wb8eEF/4y 9WrcD6aJ4BWjGRX4JWB5dhQOPQqtThOP3cpnvdpbEnrz8nA8vuvSJhbIEiizNOsXuMDW maxbfpKgHu2cj4LMkXAkiaU90TSdXKNNxOSM6hfkfTzUI3ylGN+6XMD0fp7M3gcfmHVL Ki80nCnmZ5L16ZNiFgxa6dhm6eCwSBQdXcUdbmnxuHlwKE6MgImjstNXYj9Rzcc6ACqS k3r3np0MMqVLVyr7k0ZZGiBTTEQ3om3I5s4vQOhfD8zHSSy4tJ3nzx3NVEp2T5rqt0xq 5Sjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=skgQMhcYtq632wwU3Gs0kqhjc28WEnQw9ZSN5F7zXHo=; b=s45q9ekKdUOZYI6igkc6iEqHp+9edvtLq564XqfA/dyXAaRaAca8Z8LnpWWt6EJkz7 djjnmk96/uodmcvAvD+CruHNkztHg03MR6eWmwSQN3SUS0lLrq1XCQFQW765+jzxJo4e 7KrfXU3wNS0oQ2YL2JZIoeEJsU4U2eozSDHhbAO4dv5IkIQxd6C9SGlBaYZBabYTamSx NTLlfR/mtgwrOy2RjpSiElZPKYzxkX7l/F4bbT/PUp9l2Gfu469gbgVak9NWKbSk1bfY oD1VmHH+higBF9DO2zwdaqbLhIJ8sXwHDpT89EhMMR7h///czYicNWcqOVMC2xnvzxL4 u3mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fIny3qO1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si6260887pfi.248.2019.03.04.12.09.03; Mon, 04 Mar 2019 12:09:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fIny3qO1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726281AbfCDUIS (ORCPT + 99 others); Mon, 4 Mar 2019 15:08:18 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:45270 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfCDUIS (ORCPT ); Mon, 4 Mar 2019 15:08:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=skgQMhcYtq632wwU3Gs0kqhjc28WEnQw9ZSN5F7zXHo=; b=fIny3qO1zNTPfe2d/J3vthD8S yAuzivRXQzemj6RVrgmFEHZIE/GDEDpoMAYjj6vSEUmpLcXMymHj/BahIcCnDS5Ai/YAFT8PWkbmF UGB45scmTKx17dxr/kRIpQtDyDnFNbuiFv9m7kdHe0Idm8OhDJYXHgXMx07TbPIa8hjmR4AclE8BJ n7DSQwLSPqAiK9lL/W8ekuu/EHq4eywFhx6f6c9iu6TSo0L61WAg5B6KJweKJllngnJ0iXRQE/FKz 2vOl5UKkwJR+B1pTPROAS/hDeujI6F46A8hWAU89JiJN6vN6SCno+9c6fno/ppCAB6KqSv0grmX9C yCURh2dMg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0tsh-0003Ca-HR; Mon, 04 Mar 2019 20:08:11 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A09DE201383D7; Mon, 4 Mar 2019 21:08:09 +0100 (CET) Date: Mon, 4 Mar 2019 21:08:09 +0100 From: Peter Zijlstra To: Fenghua Yu Cc: Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Paolo Bonzini , Ashok Raj , Ravi V Shankar , Xiaoyao Li , linux-kernel , x86 , kvm@vger.kernel.org Subject: Re: [PATCH v4 04/17] x86/split_lock: Align x86_capability to unsigned long to avoid split locked access Message-ID: <20190304200809.GS32494@hirez.programming.kicks-ass.net> References: <1551494711-213533-1-git-send-email-fenghua.yu@intel.com> <1551494711-213533-5-git-send-email-fenghua.yu@intel.com> <20190304191512.GB231946@romley-ivt3.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190304191512.GB231946@romley-ivt3.sc.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 04, 2019 at 11:15:12AM -0800, Fenghua Yu wrote: > On Mon, Mar 04, 2019 at 10:52:19AM -0800, Dave Hansen wrote: > > On 3/1/19 6:44 PM, Fenghua Yu wrote: > > > diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h > > > index 33051436c864..eb8ae701ef65 100644 > > > --- a/arch/x86/include/asm/processor.h > > > +++ b/arch/x86/include/asm/processor.h > > > @@ -93,7 +93,9 @@ struct cpuinfo_x86 { > > > __u32 extended_cpuid_level; > > > /* Maximum supported CPUID level, -1=no CPUID: */ > > > int cpuid_level; > > > - __u32 x86_capability[NCAPINTS + NBUGINTS]; > > > + /* Unsigned long alignment to avoid split lock in atomic bitmap ops */ > > > + __u32 x86_capability[NCAPINTS + NBUGINTS] > > > + __aligned(sizeof(unsigned long)); > > > > I think this also warrants a comment in the changelog about the > > alignment of 'struct cpuinfo_x86'. > > How about add "Depending on the starting address where GCC generates > for data of struct cpuinfo_x86, x86_capability[] may or may not align to > unsigned long...."? Composite types inherit the strictest alignment of their members. Without that alignment hints would be utterly useless.