Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1308303imm; Fri, 29 Jun 2018 15:41:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI4j/zayeEzlb11224CuHUHGvaM2Ymf2O5Z16KTrDthSpXxIjvfh11ep9zc6U86YDQky1ko X-Received: by 2002:a17:902:b68c:: with SMTP id c12-v6mr16823367pls.114.1530312092743; Fri, 29 Jun 2018 15:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530312092; cv=none; d=google.com; s=arc-20160816; b=WXcsGrUjboeEVK2WRVPjyxp5UfcqXN9L35B9dX6Lg2w1z81YkdpQVYzqj8m5m446Hg V9qE7lm/fendOvWOmTlRkxBnNqSvX4kyNKuF8+au5REhB1j8uYA9iv7KaztRAKCkv5kC cSl2YYQGtvNi/0gswKm5Z0OQYEx3RbA2kFkzjPI3tvyOnXoz3zdsz6FVFfzZMttKEyXX ElQxOugkJALDp0DFytdgZR6KH9dIgz4Sjfl9dt6DaN6GukkdxQUSuUhZIRLuNgT1VmRi cM0lBdGz/kUGE7SK0hpaFgAErTaxldKlNAVtqXXyBgJa/BxGS0AQMAortn6FOeBcwwTH YvHw== 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:arc-authentication-results; bh=TaSM+VF/tn7Ul1/CbgNl3wulfs7ErS1xvMj6nfBdVy8=; b=wAhykpXPiilGjnzMYMfmvZYUmUng6FWyiEKZD1AtGzt8gS0lwaQ/16cKAqZDjYWeHR BPMKwuupc00d3wQ71XxfUInv0D81mv+bn5qrH4JBebaAPwZrjYwmamCYOj0M7acW75va Tep2vs8TNkhy4Yv2oRs1402Ck1cWosxAyPv33YbqdiWbg02ebgbJd0tCXaXm8nW/k86Q 3Vf5GVADb+70LLIceO62u6D4t/57ih4b85R4aBkhqgNp8gWpa6Q6lt3jTQ/50AdI8Sie xxdJFhG+5g5zN1tJ7GlMkrgPJk/PEPTL4oL3DusGX+rvdBZhNNcJ82DZhkfVyL2H9yLH oDUQ== 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 f8-v6si9255055pgr.35.2018.06.29.15.41.18; Fri, 29 Jun 2018 15:41:32 -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 S935153AbeF2Uj0 (ORCPT + 99 others); Fri, 29 Jun 2018 16:39:26 -0400 Received: from mga03.intel.com ([134.134.136.65]:4464 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934227AbeF2UjZ (ORCPT ); Fri, 29 Jun 2018 16:39:25 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 13:39:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,287,1526367600"; d="scan'208";a="71101619" Received: from romley-ivt3.sc.intel.com ([172.25.110.60]) by orsmga002.jf.intel.com with ESMTP; 29 Jun 2018 13:39:24 -0700 Date: Fri, 29 Jun 2018 13:38:44 -0700 From: Fenghua Yu To: Thomas Gleixner Cc: Fenghua Yu , Dave Hansen , Ingo Molnar , H Peter Anvin , Ashok Raj , Alan Cox , Peter Zijlstra , Rafael Wysocki , Tony Luck , Ravi V Shankar , linux-kernel , x86 Subject: Re: [PATCH v2 2/4] x86/split_lock: Align x86_capability to unsigned long to avoid split locked access Message-ID: <20180629203844.GA68178@romley-ivt3.sc.intel.com> References: <1530282807-66555-1-git-send-email-fenghua.yu@intel.com> <1530282807-66555-3-git-send-email-fenghua.yu@intel.com> <20180629190346.GO18979@romley-ivt3.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Jun 29, 2018 at 10:08:59PM +0200, Thomas Gleixner wrote: > On Fri, 29 Jun 2018, Fenghua Yu wrote: > > > On Fri, Jun 29, 2018 at 06:35:39PM +0200, Thomas Gleixner wrote: > > > On Fri, 29 Jun 2018, Dave Hansen wrote: > > > > > > Plus what enforces proper alignment for the other capability related > > > u32 arrays? > > > > Do you want me to enforce unsigned long alignment for all that are used by > > locked BTS/BTR? > > If there are variables which might be unaligned and accessed with locked > instructions and you have them identified, then why are you asking whether > they should be fixed? > > Ignoring them because they do not trigger #AC right now, is only the > correct answer if you are a follower of the 'works by chance' cult. > > Yeah, I know that most of this industry just works by chance.... > Ok. I can work on fixing alignment for these instructions in next version. 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? 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? Thanks. -Fenghua