Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp219754lqp; Tue, 11 Jun 2024 22:03:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwfrUGvioCKS9NjjfLtUSBj1XOZthUjQJQ08tfrapmJl9ksSNZ7w9X8bwDSkhNEDy0j82yAr6u3ykT02P8LBzsJKcllxR7dx943fGzRA== X-Google-Smtp-Source: AGHT+IFnqVns+6D3mdJmx8X/Ojl12eWN+7jBMsI0SKB0DvqKZ9DuB3Lf5kn6TRTaORtKYLqgjOVa X-Received: by 2002:a05:620a:24c6:b0:795:5a78:46a9 with SMTP id af79cd13be357-797f61036abmr77957385a.52.1718168594792; Tue, 11 Jun 2024 22:03:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718168594; cv=pass; d=google.com; s=arc-20160816; b=g/sfC+cGjnuoaei6jHcEaHeakYj4ub7UP1nDJORm9APpSrIngQPs/8XEB4GRrXO3GS +xARWKVsEtUb3y2C4UVAzcOAdcu9+sXFZlf7Bkx54h3szHo0vRSDN1Yh1IEvSLUcOK4C 2S9ldRb5iggpbOo1lou1xsbnp7gUFJVwqvYCYvtcQfg9uRd1D6Y33QHSgPPHOiBPaby6 OEnVBv11jKSYSetamgLaHEmr7VFT9+7VVVNZAoJl3cAw25TLQEP4kpQbidg0wk7R9YrF u7yHBdxf5UxpHwGZuL5U9ts/mrnBTJA+xGv8hzKjq8dyL5OtiQhiBArFTuPXPWy8NOkl D1VQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=trQpTqykyKSeqlzCFLsagVehmLmfBojca+iGHcLXTZo=; fh=c6V4fmJXvbVHBa1H3S6zCJa98quzaIPNv8yS2EijSDw=; b=q9FhFiyVEy4CJseLzQzimJ2Xkd7R1/L5+ycHiUvf5gpQmbRluX1jCr1PiWx7hjhPQT m0/8SCHx/6ILH/ZqIoF0GNm+a7TQSqbX5+i6u/tF2XxoT/aq0tKk/TXwo9VKZ4zl3S7H YriGkjwpQiH92mPDnx244FAMTYQ7ibcVaCmgbLvv+z3EILC2t+zxUjXjxW0DZNziQDCI 7bE4J7RBEx522Sqgsi0/GNfNKb1zwyrFaOngrdt6TR7MH5kAXV6bL2+comVcavQr+S4f SUBQgETp3fY7CUOgQiNdZpG+BYJpwn9tDx7jLbjFj9xbxrIrwuQR7dtD1/AbVpHEme30 hcHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vLfV0A3Z; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-79548d157absi1123593385a.458.2024.06.11.22.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 22:03:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vLfV0A3Z; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 80AE01C23C2E for ; Wed, 12 Jun 2024 05:03:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D12A374C3; Wed, 12 Jun 2024 05:03:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vLfV0A3Z" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 822AF2D057; Wed, 12 Jun 2024 05:03:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718168584; cv=none; b=SkURDJkqOmWrquvaC3L401zM7vt4h+0UjEafbukGh+1BOdBA1OptCw4Np/+PCSqPgm17xn4iPnGm0CdcbFFoSkK0qlm+gXRcUZGNpFPvzpbCQGMJ3g9oWmj37B0KKrDAO427sI0CJ4+K3KlxeOgSAll5c1mAvuZkxmwUqOQEBT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718168584; c=relaxed/simple; bh=Hdj1hfWIwNnT4QKFFbAGuif/SUHOpPIdfT5rD392TDo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Dlhxpjc3LDEH5BWC4Q54o0E3hRP1lwDtQzLCWvH0JXp5G5FTaYep+iRbZedBvg3OXIzmSynaDi5nl9tfHuvXdEGWHjehShAWMOt1cTkou4ZK7PZWndDfJFZ8eUnLja8n+OKjUToJ4QmzkfGPg6DM6pl2ywMRU873fE69+JP/oxU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vLfV0A3Z; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 703F4C32786; Wed, 12 Jun 2024 05:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718168584; bh=Hdj1hfWIwNnT4QKFFbAGuif/SUHOpPIdfT5rD392TDo=; h=From:To:Cc:Subject:Date:From; b=vLfV0A3Zr0eO3WSn0K5XshaIpl7E/RxZN9sgOucOteWyLYJ7RkWwiJsHznJufS2bg U7PQd1z7cec74N0AmbxmvYY1ubQGZ4qGdUFzcUQrLJm73NuExeXZcecRMMOKeLEH/l hVXBNJgcryIQ/ZUQomeN08XMVMwsvkVVxRbqzEp3TgWRUyUsQzEmYm6bibZyr1w1K6 PLLTbLTT+6bM7KJGpWcw2aMOE0Dg4WSutOWsi1ISUYbbMJ+G9nb9tS3G6bj2LUfX4y kF6ouVSS13azcymjOujfpsv3YMfxCO6m0Mq98NJau6R5d2xMrVenmC8a5+FU5/xJaD kk3Burl6eARaw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: linux-kernel@vger.kernel.org, "H . Peter Anvin" , Dmitry Safonov <0x7f454c46@gmail.com>, Masahiro Yamada , "Mike Rapoport (IBM)" , Rick Edgecombe , Yu-cheng Yu Subject: [PATCH] x86/kconfig: add as-instr64 macro to properly evaluate AS_WRUSS Date: Wed, 12 Jun 2024 14:02:55 +0900 Message-ID: <20240612050257.3670768-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some instructions are only available on the 64-bit architecture. Bi-arch compilers that default to -m32 need the explicit -m64 option to evaluate them properly. Fixes: 18e66b695e78 ("x86/shstk: Add Kconfig option for shadow stack") Reported-by: Dmitry Safonov <0x7f454c46@gmail.com> Closes: https://lore.kernel.org/all/20240612-as-instr-opt-wrussq-v2-1-bd950f7eead7@gmail.com/ Signed-off-by: Masahiro Yamada --- arch/x86/Kconfig.assembler | 2 +- scripts/Kconfig.include | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig.assembler b/arch/x86/Kconfig.assembler index 59aedf32c4ea..6d20a6ce0507 100644 --- a/arch/x86/Kconfig.assembler +++ b/arch/x86/Kconfig.assembler @@ -36,6 +36,6 @@ config AS_VPCLMULQDQ Supported by binutils >= 2.30 and LLVM integrated assembler config AS_WRUSS - def_bool $(as-instr,wrussq %rax$(comma)(%rbx)) + def_bool $(as-instr64,wrussq %rax$(comma)(%rbx)) help Supported by binutils >= 2.31 and LLVM integrated assembler diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index 3ee8ecfb8c04..3500a3d62f0d 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -33,7 +33,8 @@ ld-option = $(success,$(LD) -v $(1)) # $(as-instr,) # Return y if the assembler supports , n otherwise -as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o /dev/null -) +as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) $(2) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o /dev/null -) +as-instr64 = $(as-instr,$(1),$(m64-flag)) # check if $(CC) and $(LD) exist $(error-if,$(failure,command -v $(CC)),C compiler '$(CC)' not found) -- 2.43.0