Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1281880pxb; Fri, 10 Sep 2021 02:18:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuzFsrdYxOL3ZtF9YNSLwNUAL/vicI4uf21jKOQWv6gvzzv/RkUK0awLCNtS/EGmftvRqx X-Received: by 2002:a17:907:77d0:: with SMTP id kz16mr8303098ejc.334.1631265522825; Fri, 10 Sep 2021 02:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631265522; cv=none; d=google.com; s=arc-20160816; b=vcAq9scpp0MIjD4WULGB4KddA9jNopf6B4I4VzFkNyojKgXwdT4scai2ABu/OD0sSC 152hJKT968qh2Xe3usNn1OFkTBmhEXnUfvbZFoH9n++nELPi6ZDksasVj9b0HNiEOGKO 8uclRAEUYUDKnKcGnDcLPh+ZzIOc5Jp2gxEKN+M36qDZigVvXmpWY7eqGUqHqxhVtYWu PaHi7nmpY6trcKV4DjcT9009LD2r95cqtGWYeCuVrhaqdR9xzM1LOKYdWI4jLP0hBTaO wtSX/32gk/5QxJxRdN+9YZLFr6oHh1qoDo1RHpCDDxcGcbSTluypoGuSAIsv5RcwAd32 cjyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ja789o5lI09KtLVM89FV5cMUUR8FmCvg4bkLQy1qXl8=; b=xINEnv95/htnnhLuaI4f/dStqrq2wtjfTSJB+vOpv4jO/G+uadEg+7wrRVJuQRm+wE Nkxv1VipUfZgaJSz0LbjihpVEqr/xpIE0fhycShMn3d8rCCBmnR406Eix8b5ix8jOO6k MWQCpjbJp2tahGFSI9/y2yLAUgFsBFotKsScgUaUsi6Eej+Q0yz0Pl9KWhRd0WBFUhNY DPuL4xZi9lYs3Dgr93yZCg7iexLwjaUuJNS+eEVp/qtho3452mlx5nbfHp+Pji/Qp4rB rAdWWszXPXZPiBQ9qVc89Yq5HthkGxPV+onFNKZQSOVWPXVW9zPWjIrssJLGqB+pypuv +R2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=imkkjsyc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si4061309edd.193.2021.09.10.02.18.19; Fri, 10 Sep 2021 02:18:42 -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=pass header.i=@alien8.de header.s=dkim header.b=imkkjsyc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231962AbhIJJSI (ORCPT + 99 others); Fri, 10 Sep 2021 05:18:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231818AbhIJJSH (ORCPT ); Fri, 10 Sep 2021 05:18:07 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3C1C061574 for ; Fri, 10 Sep 2021 02:16:56 -0700 (PDT) Received: from zn.tnic (p200300ec2f0f0700510d70add229dcc0.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:700:510d:70ad:d229:dcc0]) (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 BEEF61EC0390; Fri, 10 Sep 2021 11:16:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1631265410; 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=ja789o5lI09KtLVM89FV5cMUUR8FmCvg4bkLQy1qXl8=; b=imkkjsyc7cbeo0ydp99Hl/kGC9iP6/QoOmN7hllKdWKCqgFgCit0/cMXo6QCOYP0y9INS5 tcFVOJsitifC9vXV+XuPksAFOSaFHCgOn3DejKArpzi1nJoEkLPbx//UCFGWztRfwnfKa3 dBHxQkNLAGQqh8RvmJ6TvvbpT5aHQ94= Date: Fri, 10 Sep 2021 11:16:47 +0200 From: Borislav Petkov To: "H. Peter Anvin (Intel)" Cc: Thomas Gleixner , Ingo Molnar , Andy Lutomirski , Linux Kernel Mailing List , x86@kernel.org Subject: Re: [PATCH v2 0/2] x86/asm: avoid register pressure from static_cpu_has() Message-ID: References: <20210908171716.3340120-1-hpa@zytor.com> <20210909220818.417312-1-hpa@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210909220818.417312-1-hpa@zytor.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 09, 2021 at 03:08:16PM -0700, H. Peter Anvin (Intel) wrote: > gcc will sometimes manifest the address of boot_cpu_data in a register > as part of constant propagation. When multiple static_cpu_has() are > used this may foul the mainline code with a register load which will > only be used on the fallback path, which is unused after > initialization. > > Explicitly force gcc to use immediate (rip-relative) addressing for > the fallback path, thus removing any possible register use from > static_cpu_has(). Right, maybe I'm missing something but what is wrong with the immediate addressing variant, i.e., that thing: testb $0x8,0xffffffff89346eea and you need to *force* %rip-relative? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette