Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp924428pxb; Thu, 9 Sep 2021 15:31:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhoCl0amWI0UmlI72kdFDnTVjhTTfRNh6fUg/oHZKZ0pDm0guIPThmkF9joZh5UpsAlJOn X-Received: by 2002:a92:dc8b:: with SMTP id c11mr4080859iln.235.1631226701673; Thu, 09 Sep 2021 15:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631226701; cv=none; d=google.com; s=arc-20160816; b=yvQNDItKooBEIC3OGursXWNNMCtiUG6drVMSFhLyldkm9PsDCMpACpBUE8YePameUv AsquScCJM1CoKmy3YlNKtMYfdDiA0boE/uqiMpbKsuJUIcjf0yAcl2sM5hyjOntK+dtC c62pRYwI6A3teAWLvOtc0+zjnLWYF5WgJeFjfKARr5nmITECbG67Tnnv69y45NFo5QdC 7tmrCPG29v9FN2j192Ila4IjpzoqxuUrRjTUz4WBCt3iwEeS+5z/AK1Wwob+i52MNJNx vVTAPSfbqAtwy50SJpIYcC+RS2OYKGS53H9hMGikWvtC/ozpuEL6fGqc+e0qij6OUOBs 2gPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=z6l5KSYd2UWZHXazF9BmrbSsVpVuYtysUQylbL6UGpg=; b=CHDtJIIS0PP7tSMTmKSmGLt6Uw6yJevZy0SFwNljMqSehwjyX+md+WWg+bLI0/ahu8 dajO10CSqQjbThA7tzTxThMazpYNK/EgOsdaFWwpXbfoVkxLgSLfOA6lfb4MJGS04G02 lSrgRilRL7WG9j2t7tHGJeM3qAUSHKVZbcQi9o9ne9ZpjxAlQz3Erb3WEydDrEZHpEeW 8AFcK1s9bizcdV4m9Ql6NwVc/O6WpvG+69E9CmoYHh8KlCkM3cWx/ntNY8FkfvVfGXfJ 2/2H4T81g6EbLiG5jUOx6x3PLwjtwB8vfBDQy5Fw99Rxx3IxE6K73LTz9SYrq91t8WIu IKqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2021083001 header.b=YCPqxJ2H; 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=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k14si3677513ilo.4.2021.09.09.15.31.29; Thu, 09 Sep 2021 15:31:41 -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=@zytor.com header.s=2021083001 header.b=YCPqxJ2H; 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=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245368AbhIIWJz (ORCPT + 99 others); Thu, 9 Sep 2021 18:09:55 -0400 Received: from terminus.zytor.com ([198.137.202.136]:47923 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231819AbhIIWJy (ORCPT ); Thu, 9 Sep 2021 18:09:54 -0400 Received: from tazenda.hos.anvin.org ([IPv6:2601:646:8600:3c70:7285:c2ff:fefb:fd4]) (authenticated bits=0) by mail.zytor.com (8.16.1/8.15.2) with ESMTPSA id 189M8Rx1240627 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 9 Sep 2021 15:08:34 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 189M8Rx1240627 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2021083001; t=1631225314; bh=z6l5KSYd2UWZHXazF9BmrbSsVpVuYtysUQylbL6UGpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YCPqxJ2Hcn1AAXkLmlRJUTLG3Gx/wwnepYIVidE9ChSF8Ye9t4DuDx64BR0fVZ+uq DX4cLDcx3HNUp6UX9kwvkIzO2JbjLHC7oILQ+DQ4GBGdHqumpv3etF1EyNPOeoEc58 NEg5HIcV7GKMIL4syuyLfxZO8Yinq8h4Af1TDKKgSTZKmieGniH0mcMDTnyKGZoJuQ gohRYjuOBIcV3FqyOPbdRKAws5fnxodsWqYlnbZ4dZ6TZSkzn5KHJFyDpUu+EgNnjz 5wOrqCjibI8ztqrfb8TIWkjkqtxJAS0O/kUPxOnTG6CwmOUx6D8CF14FMPc/3W8TVi NJmEx9BB32mLQ== From: "H. Peter Anvin (Intel)" To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski Cc: Linux Kernel Mailing List , x86@kernel.org, "H. Peter Anvin (Intel)" Subject: [PATCH v2 0/2] x86/asm: avoid register pressure from static_cpu_has() Date: Thu, 9 Sep 2021 15:08:16 -0700 Message-Id: <20210909220818.417312-1-hpa@zytor.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210908171716.3340120-1-hpa@zytor.com> References: <20210908171716.3340120-1-hpa@zytor.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). However, currently there is no convenient way to make gcc generate a %rip-relative immediate reference without splitting code into i386 and x86-64 versions, so add a new macro to for this purpose. Changes in v2: -------------- * Add new macro to * *Actually* generate the %rip-relative addressing mode.