Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp8305imm; Thu, 21 Jun 2018 12:57:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIx54G1my3RmpLfMXjrCmv3d4N5O3WvZg976cae/r3AIGsYjDmWW3++dlZ9guRfsPzxqEVv X-Received: by 2002:a17:902:16a:: with SMTP id 97-v6mr29661522plb.336.1529611037278; Thu, 21 Jun 2018 12:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529611037; cv=none; d=google.com; s=arc-20160816; b=tP+gMyc8ILAV6+4GO4bZhXcQSzwnRJlroqkCmuBSrrGx3TF9rmJnLOt+cyGhJ3dsLC kUM8MltkzGVfEmAook4jzxRJe0hVRjRfZzFl4HSTZlkYO2GFtmuGZ3hDw5J0PdNtTs3t nazib2kyM2NTdPAIQhThY4EKix3zKvkjhlHUZDBMWikCmVITuarUnUAUk9V/JXRZ6G+A tSqWZo9kMtsHgl1iN34Gpn7X/uYJHZjvZsOqnVisX4Gt6uVthS3EHJi+Wb1G+ZsGNlkM VdX7q/BjKocYHFdKMBHnqsgKgblwoj/8IzfFS9mJNdhFJUUiZDs0l5fTOSK42TJfSgHJ 16wg== 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:arc-authentication-results; bh=Z84Xm/UqbzujvAjIs+QD/VTeO6yPNzfp+L8JEZkP/ds=; b=xbrfM8fb7nDBNIZYg3E8i5mcY9f9CUnMshLDFUFeAVLQhqJF2aHYstzng1KRZ2lbSF PF/GrA9YHKlWTYBsmYUHTy03kR42ut+62EMcZptL8YvFbyqOWRYTVW3Kj08EZk0UIxbX XZUPh8h3Gn+irtMI2x+SnQAcwjM12Zi16ejAqPP+KCBwBwWf0mfv0JBWMVvJrDmZyrbP peWDufeBqZ4Wvy8pEqFf+70WsgAoohs0d2yTUR2KC5YVUW4ElHdnS9e9s7lSQZt0O5Eo 6Rht27JewqzCAyPyCaFcdgzlP34kgEIhNAIrOFKfR1AVmb7KrqIuwP9YTf7x1NEGx7zu ZaSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=YULie6aw; 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 o25-v6si3668822pge.7.2018.06.21.12.57.00; Thu, 21 Jun 2018 12:57:17 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=YULie6aw; 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 S933282AbeFUTzw (ORCPT + 99 others); Thu, 21 Jun 2018 15:55:52 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33222 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932899AbeFUTzv (ORCPT ); Thu, 21 Jun 2018 15:55:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=Z84Xm/UqbzujvAjIs+QD/VTeO6yPNzfp+L8JEZkP/ds=; b=YULie6awFV/YM+JoRNhxMJdmI UuQ6C9Qo0Qm+bXod3mvUOtr7/ndC5mE7+N1qX841/5R66m3e8xc73rNjWSXUYW7kUwQutF7B8W0yt TCD9ZRdRAH1Pb85J9SGzN2lDoGbTna3ASf6gb4Mu8x82n7ITzsaASuQtWqcTrLG949PviPz3IqMQ/ SWhpTfZfLAxXRdyvosM9lhorrOV+17AzTFuUHjxIFY+SIZ251Qes493QGzuOcVdHBAcDKXPQADMsv ZI2hvQoDoT+VwEMEZWPkL56Z+WSChE36O2rKHrCPv9GxHnIU4h2/g0VV8FfgIw752p/bfVNAkdDZd CM1/P9S3A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fW5gE-0001GU-PZ; Thu, 21 Jun 2018 19:55:44 +0000 Received: by worktop (Postfix, from userid 1000) id EF9BE6E093E; Thu, 21 Jun 2018 21:55:40 +0200 (CEST) Date: Thu, 21 Jun 2018 21:55:40 +0200 From: Peter Zijlstra To: Fenghua Yu Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Ashok Raj , Dave Hansen , Rafael Wysocki , Tony Luck , Alan Cox , Ravi V Shankar , Arjan van de Ven , linux-kernel , x86 Subject: Re: [RFC PATCH 04/16] x86/split_lock: Use non locked bit set instruction in set_cpu_cap Message-ID: <20180621195540.GC13636@worktop.programming.kicks-ass.net> References: <1527435965-202085-1-git-send-email-fenghua.yu@intel.com> <1527435965-202085-5-git-send-email-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527435965-202085-5-git-send-email-fenghua.yu@intel.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 27, 2018 at 08:45:53AM -0700, Fenghua Yu wrote: > set_bit() called by set_cpu_cap() is a locked bit set instruction for > atomic operation. > > Since the c->x86_capability can span two cache lines depending on kernel > configuration and building evnironment, the locked bit set instruction may > cause #AC exception when #AC exception for split lock is enabled. That doesn't make sense. Sure the bitmap may be longer, but depending on if the argument is an immediate or not we either use a byte instruction (which can never cross a cacheline boundary) or a 'word' aligned BTS. And the bitmap really _should_ be 'unsigned long' aligned. If it is not aligned, fix that too. /me looks at cpuinfo_x86 and finds x86_capability is in fact a __u32 array.. see that's broken and needs fixing first.