Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1277094yba; Thu, 4 Apr 2019 07:40:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpoaN9Y5u1dDuxtZ4ML9jmLTVj4YY5re32q58kxybfC/PYMmVCG73koTm+RncrDgoNzHPC X-Received: by 2002:a63:720e:: with SMTP id n14mr6146919pgc.93.1554388844368; Thu, 04 Apr 2019 07:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554388844; cv=none; d=google.com; s=arc-20160816; b=FHdYdcjJT+nsE/9Dkf201O8/1VzIjdfq2IayEmcapMjffo67IIdfV3zria7NaavgmH nCdxCyFNIsuOLdjUJwQboYpsfLjLDDqJ271eVhYdCicTeGpmC9JVw176gt/qWMZHG0mZ 2DokPB3edjvrv/N2OyGYbfCXSCA5f559CNgF58It6SMgRHLU/hBFcd4OJ/NUbuckV66Q TL5eohO/LgsuUP8GajgOVWyEgYoESpbj2v7D7R9KyexB87NrS+Ya8eZytnOeW7Ep8AoZ j+95Z5gI4Wdbzsi6QJye+YdM71EM7HD4O+H4NoO8vGqBkXOruncXhBQa7TW7ZJIaRQj/ 0O7A== 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=n6kK5AoazVvyMd+L0CyOKXnnpfZyOQimMyqPjIuZd2w=; b=SgJY5PGmpiKdQstrxDndQbulfPRNeumeryZbWRzfpj4BUA1KKWNPizC2t2w0gNf6Wg T0QG9jfNnFArMKllMlFuUX/qPkV8sD8SCGlH5IVjwcREJPTmEa7lTf5+Y0f/3RVFfDBI Hu/owzfjUHLdp3KNZIwkxSfJeMuNy4Lt/DRb3s5BpcqheLNwSXbhSxUSDarNAfpITwvZ gUhp4YL7E+F9yRAnuEtlVAk4gjQRVP+hGcFK+axb3rcrcoOmUlYJo2rrLrtv+VHAFzR+ v30pbbWuaMD1lgezOUsfqQJ7ApntLH+ffVM9eNUdJBx7P6Z6+QOsRoCzAf8xHmDHXky9 h3Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=myuIZy2B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92si6501762plw.138.2019.04.04.07.40.28; Thu, 04 Apr 2019 07:40:44 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=myuIZy2B; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729033AbfDDOjv (ORCPT + 99 others); Thu, 4 Apr 2019 10:39:51 -0400 Received: from mail.skyhub.de ([5.9.137.197]:34200 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727310AbfDDOjv (ORCPT ); Thu, 4 Apr 2019 10:39:51 -0400 Received: from zn.tnic (p200300EC2F148A00329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2f14:8a00:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C94771EC05DE; Thu, 4 Apr 2019 16:39:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554388788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=n6kK5AoazVvyMd+L0CyOKXnnpfZyOQimMyqPjIuZd2w=; b=myuIZy2BZEXZwEZWuz78vZg+LOR2S+efFJPTsmqg+u12/K5P2pO6b9aRt8tROxS+AYJ5TR bj4VCa8ODpP03mkHoDpgL4/qGCuM9ALVb+WJovefMj1txbh6oJDuaNqv/deQ37rU/5UqKa 4mh9QdtTTjDCTfTLjY0Qm5lMTeewyCo= Date: Thu, 4 Apr 2019 16:39:43 +0200 From: Borislav Petkov To: Fenghua Yu 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: <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 Content-Disposition: inline In-Reply-To: <1554326526-172295-2-git-send-email-fenghua.yu@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 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.