Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp778623lqt; Tue, 19 Mar 2024 03:45:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU87NwUY+r/3359tpcsPaLJ8u7DJrobSvGxRMmVksQJXZrh6+oGSZFhcpWWylSrgTQUJ3i+G59nwvNOLPRqElBMExAs7VlzkaOR45qP8Q== X-Google-Smtp-Source: AGHT+IFd/xhvXS6cYpwywFcgc1PxY9Av9mUbXkrSG5r13gyee3GLCWaFPPF2QFU0N6Vac8FYew6u X-Received: by 2002:a9d:77d3:0:b0:6e4:b891:c9eb with SMTP id w19-20020a9d77d3000000b006e4b891c9ebmr15664149otl.30.1710845107829; Tue, 19 Mar 2024 03:45:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710845107; cv=pass; d=google.com; s=arc-20160816; b=TuyXVZKG4hr+wlbyEaJTQsWJ8lDtKb3ffik+L88U1srKlsXXaMYuiSIWXBhEwsWK5P HpIUaw/WeZL1fsy8W1yaXhkzPYE3/Ytcyg4P2fqgmwBXa9ldIMcvPSHpRTvBNqb74Br3 3fmkhmfvbcOFR78BhhEUL83mCfxa3X+oqJYtTp9RTAohTBMvAN19KNGSHcn4QG9sdgX+ jagE+qUHzP8fYj3f/MxmLPrbjFFa3tmEhsdn2nH4A7UA9WMKyKm1BO9dKoVfU/MxAyzs Dt56PufFgH2vd6vtLHKqF7fk+HVYmaOAtz2IKdnFi1H7byfq09249/1Gf55sRNWDRwSI 8GkA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MQ1yb6iGb3d17BmqG638lsarTHpqGq0a9mQ6hQHFbc8=; fh=mO7kZwire9MTqwwLSqeQwiSnZQULJiVWAWVpmY3+/zE=; b=kggpdUU8n3ju/+s9FXQhQixmq/DigGeTp5gy1ZxGIYqHRZs/YhAZDq20eNLwWoHKdb jaiwKPlIxSVizQl7cBXljeGAMe7Xv9VrKBHC8Q/ak+YTLmkxEZpIat/8pafA0X3bM4qZ 6Wj/aLJoQi6wAyFPNDFfK5eTV4SILiJ/rMUCh8bt4gWnob8qB5mfxiTjtxRaA7MtFMMx 1a3fX8jRycyMC8ouro7627KTT10CNzd+D/dp83/MX2wVZnKVdd+2s6VE204pw8K/DceA TPd/s4P5b+c74SBQky+FP/L2p4GYmxbSHb/yYG9yFbBhSxKZx/SAtr0hZ134iwTt7Ibh 4esQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WGR8xswj; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-107402-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id os18-20020a05620a811200b0078a1854f6f8si263995qkn.420.2024.03.19.03.45.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 03:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107402-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WGR8xswj; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-107402-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107402-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 4414E1C21DF5 for ; Tue, 19 Mar 2024 10:45:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F39B97E770; Tue, 19 Mar 2024 10:44:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WGR8xswj" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 712DD7E56B for ; Tue, 19 Mar 2024 10:44:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710845071; cv=none; b=MQhvxrLfX+DMVgmRUi4i0R9JJJRf0svlEQvykmgX5lSrF6C7g9uiNKmrzEZ5gZS6ydDkbxrYpBp9sQLL7ejJ9lJG/6OwyR3GrXVclFoZrmKaH0dyvyNiz44W0adxt3v22DxeRhHDEET4G5V0FndSNZVvkPPCqL2cBZbvuMZoZ7w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710845071; c=relaxed/simple; bh=d7tiEHopGAl3cIz2XD2WOO3+d1hLbV9VFAs1Dhfjv2E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D31EZXyaIEkrnxHdEQlFIuwbcbrOtNWWugUp0fLXOf74xbKoy2kJ5/G93FfnsvBukrlg6VBjcCkw5Jq3AqmMlBiR01Iu4mFMFjXghDNBjDAjHSMRrFsT43RH9yntSlOv6klercOAPbKtU8Y2Vt/YnCwpQ5Ud6JcLUzHe4BClckQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WGR8xswj; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a46dd7b4bcbso66799466b.3 for ; Tue, 19 Mar 2024 03:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710845068; x=1711449868; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MQ1yb6iGb3d17BmqG638lsarTHpqGq0a9mQ6hQHFbc8=; b=WGR8xswjzDNvHKDiOf10WFPVqKuhFsUcRjBoA9SQy/jenAD832ESrIaE1A2VnmTX4Y AQ2/4FmfHAXEYwoxZLWuwrVaJU7vDivYqhQkKX7u2ZWtFTlzHm0hBfwy23Eexa3wYmz5 282TzrFNa4crejk8AxXeJCeHcUqL9+HsBicTrYTdydrPBY+I+oT+AErOiglMP+pmBuVa KUTsTv0TX8cL9BSgyaX1aXjaC5GgpDejK4L9JVrMP06Adiq06mYDE891AQk2cnDuSkfq OmoZM6eUQw/RUNmpzoDovzS4vKpg+Q3FPxzNfxvU5ixvqo5qKS38E/TKFPFSXplXsokj aQBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710845068; x=1711449868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MQ1yb6iGb3d17BmqG638lsarTHpqGq0a9mQ6hQHFbc8=; b=BdJ4wGdNk5SWUPWWsl6G1gfBLNbBIigKQq9qU1En37iedkmd63xCJk3YNOQpk/o4i1 tjTZvTu7Zvrp/BfMVBVwPPfew9jAzGr+i5w5pRwSyYY3l11cAb3wOYhRHOUuUoeC93C0 klK0QCPfhiKnlyJpWLTaK7V+HzxRN6k/Ms4kAMNv70I7gV8hFrHSq+9XL20fEfKkMLBW l5MvgkfYea0Ux7OUQOcp11vSj6po2SHZuyMlTH/1LBmkFbTl+xwZGesI1FVb2KLkjj/0 KreCQP58cQg7arQdViiYb6cMvvhgIJzrz4Ym3T3vzuNuFcFoASaX4uLDDTF5qkK3/m26 iY0A== X-Forwarded-Encrypted: i=1; AJvYcCU1iqIA0okk+IJikzIlidCF48ac3SBpP3VFLVoxdAtQFLLgpDamGWMnRyUlZvDLcVnFDgk/GpJs94Hm1CeVMpX4NTmk94TaBXc7dQ24 X-Gm-Message-State: AOJu0YySLdYehxYfk2DTgOt9ZV0nQass1UKxmgSYjPLT3luCbUxvcnxs /4CybZbZwAntk4rMXppscUowAXlOygrI91SCrkeOp5ynWmN5u5fF X-Received: by 2002:a17:907:33d3:b0:a46:1a14:3563 with SMTP id zk19-20020a17090733d300b00a461a143563mr10374480ejb.50.1710845067548; Tue, 19 Mar 2024 03:44:27 -0700 (PDT) Received: from 123000256IE.iskraemeco.si ([193.77.86.250]) by smtp.gmail.com with ESMTPSA id bx21-20020a170906a1d500b00a4655976025sm5882342ejb.82.2024.03.19.03.44.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 03:44:26 -0700 (PDT) From: Uros Bizjak To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak , Andy Lutomirski , Brian Gerst , Denys Vlasenko , "H . Peter Anvin" , Linus Torvalds , Ingo Molnar , Josh Poimboeuf , Sean Christopherson Subject: [PATCH -tip 3/3] x86/asm: Use %a instead of %P operand modifier in asm templates Date: Tue, 19 Mar 2024 11:40:14 +0100 Message-ID: <20240319104418.284519-4-ubizjak@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319104418.284519-1-ubizjak@gmail.com> References: <20240319104418.284519-1-ubizjak@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The "P" asm operand modifier is a x86 target-specific modifier. For x86_64, when used with a symbol reference, the "%P" modifier emits "sym" instead of "sym(%rip)". This property is currently used to issue bare symbol reference. The generic "a" operand modifier should be used instead. The "a" asm operand modifier substitutes a memory reference, with the actual operand treated as address. For x86_64, when a symbol is provided, the "a" modifier emits "sym(%rip)" instead of "sym", enabling shorter %rip-relative addressing. Also note that unlike GCC, clang emits %rip-relative symbol reference with "P" asm operand modifier, so the patch also unifies symbol handling with both compilers. No functional changes intended. Signed-off-by: Uros Bizjak Cc: Andy Lutomirski Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Ingo Molnar Cc: Josh Poimboeuf Cc: Sean Christopherson --- arch/x86/include/asm/cpufeature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index fa938ed96506..daae5c6e7d0e 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -172,7 +172,7 @@ static __always_inline bool _static_cpu_has(u16 bit) ALTERNATIVE_TERNARY("jmp 6f", %c[feature], "", "jmp %l[t_no]") ".pushsection .altinstr_aux,\"ax\"\n" "6:\n" - " testb %[bitnum]," _ASM_RIP(%P[cap_byte]) "\n" + " testb %[bitnum], %a[cap_byte]\n" " jnz %l[t_yes]\n" " jmp %l[t_no]\n" ".popsection\n" -- 2.44.0