Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1352042yba; Thu, 4 Apr 2019 09:04:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKPnUtezhAD2624NfQhHtjHaIzATrBwpkznHLZUHvMG4qbLPy13ZE7YNGSu3T0PmK1tRn0 X-Received: by 2002:a17:902:2b88:: with SMTP id l8mr6886788plb.262.1554393888837; Thu, 04 Apr 2019 09:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554393888; cv=none; d=google.com; s=arc-20160816; b=Awn6dRZMSSVKyUPcRjVMB0fZFw2mkd94KQ1RTC7F+La02oeVzIQWL8ZyERUaYiy7d1 4gYd89Zuf1gA8bSPVlXSOrN5ob4N7oV6cWF/DioKYlQcLG7WxaIhmtHDCDG/gaor+4bu FTcezTKySCV12qSNuEl0Q8WC8ofbVlWFCx2teIk2FNjTNTIgtbMnBxkOfIV8GLBjT3wE Xxmoo74lQppzo/C24fj5CVM1jTVDA2Ux5CeRAlu3mrB3J0cv1q1zWW4KIa73J8OnVt+9 KBNeCG9iG0Q8ch6sZO3I53hsEXx43NeR4qnnNSYeIQBUJqnr4HjkO6UqVy2M8MITeI5Y NkVA== 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; bh=R/CZfXrr3c0Pk/SzUaLr1s2hD/mbpnO06ofwjjbmAeE=; b=KZ5WK1IubRwScKSoo0JeeKxauoGBZxpieHDLiePRcT9iWMEopAlWrY1y+Bkf66J76j P36pgBmUZtZuL2esYMCDkP/Ic4SfLf50Tsk6k70ixz7I5v6ojKANqLdFf+Cet7FmBxFE nTTtvO9An+cRoohnrtCBjJspku325KzmlUl+hpYR0bDAmoA4Io06KvL4XgRbJWHhrI0i RDX/h8mu5VfJCfOCwcVvH+NusMO6Y4QB2SpMb7KWHz1srbCyJK21/ThMHLJVyAxZGPFP HdkKup6j1iVZuGp0n/Jy3afQp2j8pr4PwwZzATYhORLOXPaVCutNMkmL/C4/3FxYkcQt kgxg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25si3144577pgv.442.2019.04.04.09.04.28; Thu, 04 Apr 2019 09:04:48 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729431AbfDDQCE (ORCPT + 99 others); Thu, 4 Apr 2019 12:02:04 -0400 Received: from mga05.intel.com ([192.55.52.43]:18965 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728710AbfDDQCE (ORCPT ); Thu, 4 Apr 2019 12:02:04 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2019 09:02:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,308,1549958400"; d="scan'208";a="313154179" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga005.jf.intel.com with ESMTP; 04 Apr 2019 09:02:02 -0700 Date: Thu, 4 Apr 2019 08:54:23 -0700 From: Fenghua Yu To: Borislav Petkov 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 Subject: Re: [PATCH v6 01/20] x86/common: Align cpu_caps_cleared and cpu_caps_set to unsigned long Message-ID: <20190404155422.GA177894@romley-ivt3.sc.intel.com> References: <1554326526-172295-1-git-send-email-fenghua.yu@intel.com> <1554326526-172295-2-git-send-email-fenghua.yu@intel.com> <20190404143942.GD22539@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190404143942.GD22539@zn.tnic> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 04, 2019 at 04:39:43PM +0200, Borislav Petkov wrote: > 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. Sure. > > > 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... " Sure. > > > 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 Thank you for your review! -Fenghua