Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp866136ybg; Mon, 27 Jul 2020 01:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl/Cvp0s825ZWSu/mmF44QVkkfZINW+t+sDEktqBOvbK8uyDcae9HFPaEVOVBH9y/PaSei X-Received: by 2002:a17:906:2e83:: with SMTP id o3mr20138609eji.261.1595838393719; Mon, 27 Jul 2020 01:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595838393; cv=none; d=google.com; s=arc-20160816; b=lW2SmLdZrJj+UUiigXHQTvCoMdXFgFT7lk3B6XyyuYZO3YTO9qA6tQ96VmRjl8L63G GnlHsPIhblJnbOcu8ix1aesMczNJ5lqJS6dvwu2VwLUKm4iF5JipN9lCGYxUNh0wPdEe qb10KlaNaS0u+OtFwrXD0qUdx8HOlcVQDxW0NSkmIMw+Tcnn+kGX3J7LnGt/fpeTvT1j ttE6IhT9pQRFVhykkaaKqqXlMji6tuFiQjdmLSHBEqwLE0elb7weiIgkMv0yVJus4mfL p3M1jj0LQp3EM0HX5r2c74sInogoJgyBmuD1QEl0BPhAuMUH0ziUsHH3gSoE+Pu1+QU2 IAYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=eVJ7iMLYvYBztQgI6lzk7PXnjd4f0FDCuiAwyc2KUMU=; b=QtXNfwLreT+lyOP6he8wcYM4dme783yCcMcQhq74qSyvmNTT92VGdjl0ec8No+/gbL gcDLmXZnWw4AxJ/4pm3me7RbvFUgQ1SY5bApujUioIfZgKalZNtHurW2dNYc7rdrdGX/ pThO58tvRzKXRrRO6wsG45W/a1Ruu85Xwx2iKtWZzamPGZj0mAjeqw7ctOQrsU7MeCxF Fa+qW6cwFdYx7oZP8Afmspdc/DO0OzI9PhGJDO/KioXfGGa5b9G/wZQXLNX9ZE5F9WFJ 7jbGAGXFSphJjZ+elfUpd0iJ+V473Z53vDxJVhIgwGfKtr43sMDDOkHBZjRGS+eKiEqm 3RMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b="Ld5F/2GO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si1717223edr.500.2020.07.27.01.26.11; Mon, 27 Jul 2020 01:26:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b="Ld5F/2GO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726475AbgG0IX4 (ORCPT + 99 others); Mon, 27 Jul 2020 04:23:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbgG0IX4 (ORCPT ); Mon, 27 Jul 2020 04:23:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5CAAC061794; Mon, 27 Jul 2020 01:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=eVJ7iMLYvYBztQgI6lzk7PXnjd4f0FDCuiAwyc2KUMU=; b=Ld5F/2GObxGjYm8R5RCxUuQYt/ 1FH1UvnOqVuIbFrhkDFL+Ja2v1A7KYYjW7eNlyEnc6PmN7qeJ5m6ZWUroYpkEeLF5x1IYdSsJ1qR+ 3m+kQhs7UtxlWvc5JUyY+lRQOrUadghJ6CHgyyTHnomFXp1J1WbQLZ++4ajnRpzv2QT8RvGdYPCYc AkGf42Zow+YcodrMuuv44N9PzIZKTRJKPkDdOzkQIbmtxyapl+G2qpH5MooyhG50+nr9ZrIXY73aN Q3MNpXxGvQ77yND9pjoJNkKzqPaujuIA8bwt/iF+iIoS7avN2fPxJKLvOxfNv1WoXKvvc8repx2fF ubfRyEfQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jzyQE-0002iI-27; Mon, 27 Jul 2020 08:23:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4331D30411F; Mon, 27 Jul 2020 10:23:44 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CEE302BDC8D50; Mon, 27 Jul 2020 10:23:44 +0200 (CEST) Date: Mon, 27 Jul 2020 10:23:44 +0200 From: peterz@infradead.org To: Ricardo Neri Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , x86@kernel.org, Dave Hansen , Tony Luck , Cathy Zhang , Fenghua Yu , "H. Peter Anvin" , Kyung Min Park , "Ravi V. Shankar" , Sean Christopherson , linux-kernel@vger.kernel.org, Ricardo Neri , Dave Hansen , linux-edac@vger.kernel.org Subject: Re: [PATCH 4/4] x86/cpu: Use SERIALIZE in sync_core() when available Message-ID: <20200727082344.GE119549@hirez.programming.kicks-ass.net> References: <20200727043132.15082-1-ricardo.neri-calderon@linux.intel.com> <20200727043132.15082-5-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727043132.15082-5-ricardo.neri-calderon@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 26, 2020 at 09:31:32PM -0700, Ricardo Neri wrote: > @@ -75,6 +77,12 @@ static inline void sync_core(void) > * Like all of Linux's memory ordering operations, this is a > * compiler barrier as well. > */ > + > + if (boot_cpu_has(X86_FEATURE_SERIALIZE)) { > + serialize(); > + return; > + } > + > iret_to_self(); I was sorta expecting something like: alternative(IRET_TO_SELF, SERIALIZE, X86_FEATURE_SERIALIZE); But instead you used boot_cpu_has() which is a dynamic test.