Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1481735rdb; Tue, 30 Jan 2024 22:53:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOJlj0M05iJlrUntgs8xU3gQy/sKoc+mV+xPHXToRR9jurgUp9NWzDppAew/5AuqPIHkxX X-Received: by 2002:a05:622a:1b18:b0:42a:9aba:1a19 with SMTP id bb24-20020a05622a1b1800b0042a9aba1a19mr903461qtb.4.1706684030843; Tue, 30 Jan 2024 22:53:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706684030; cv=pass; d=google.com; s=arc-20160816; b=A9xU7fjd+vsANDFaZJAaRX9GswN1FfpuFYQKtUPha0bzCBVE66IlsayrCqyNfxgThw QSfrzS1gddiHxSWw8NY2qwvY0FkxGqCgTOVkZfxf2GtBge2iVv/5Kc5nzHheNDThbKO6 q6su29t6mNyIkfB05pZxzawl+s0YttbUgNZm4P8yRNTMXasK3mbLf0HUqDUGfTd3NC3k ipd4yNYqva81yQvtYmsz8TzH2UQXPupecfwyWA3SskmdNbhK70IpMm2qVPIWAvhzFSin vGSibbcokGvEAHVKiy4VtAB0s2POUrTga7hTEYUj4wdTDM/I61z15ZiYBap2CHuDEbRX HfeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=8dMZ3OwOckg/8nEeQlzzg6EqDAiFIDc7gYYU0A2bM1c=; fh=yJljtzh3Eto59TBGrDhF/pn9Ll7giX/gqpCpYIPyfpw=; b=q3bw742jKOHM+3tBFH415l+VsarlE1hpKlQ2oH0fB7e0hw4YJYvdnKxzTepnBE2V8w WUsUowJ0jtLFo3d0tWQ02wkSySsAxo5qWvDU+lDZE5HWowqRqOQOCpsNX/d14x6tdNq4 GQC9QNDS0gnagZikVAnTbYyDBsivwVBpXyNdNQh0MmHarvn2MsmVFJqM4sWolyJfiZuO qx/xuRvbd4RJ8y1vnvT7zDiCKTRb8BF0xTeiporaV50Tae/jSGQ72/sndLNq0aeFlka7 TyP+2+Kc/hLoikeFuaaV4u5/75ErdbrTQWO9R7GgmqgymsE0KIVbEHmDCz2Db+wb9782 lVOw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tDX0evQ8; arc=pass (i=1 spf=pass spfdomain=flex--maskray.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-45845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCV4wOFhTP8b7TX+eZOTm7rD0h1QIc2nz3T/Il9jwhRL6DhD09vqVX/52M2Ypum59HOMi4DNcwKvRxYshpaPGh0ma7+6t2EWWjjbkASCZA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l13-20020a05622a050d00b0042a98c2228fsi8096477qtx.302.2024.01.30.22.53.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:53:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45845-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=@google.com header.s=20230601 header.b=tDX0evQ8; arc=pass (i=1 spf=pass spfdomain=flex--maskray.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-45845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 96C181C26A33 for ; Wed, 31 Jan 2024 06:53:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04B0154277; Wed, 31 Jan 2024 06:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tDX0evQ8" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 F00B15102A for ; Wed, 31 Jan 2024 06:53:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706684024; cv=none; b=Sv+aFLCoJgPyRRI0ACC1zdD906h5r4vZVZZ3XBeVkFhkNgujB114NyaBxBiyNKbkGYBC54FmKRCViZ4diN6o429fefjt8fOxUv5r7SUMsA81PZBlbkJiuM6wAGrP4SJwED3CrnWHU/TNMIChZhq1SS+P6/9Gs/TVcz+CO1pBWkc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706684024; c=relaxed/simple; bh=/V9Rglm98djqCs8KSL/PzgVQzNmWOOniqe3fv5n82uk=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=dZI9xzpAAiligrCxxWoIiU7DQDmdtXvf3d5uOs1Iq7Pbbo8gpVXbdzATXByWVXS4GDfu4vDwHMdB867w19Q9gp95lAK34YjhgaSKjcvCMU/iNE+Y+k+RVm98nLcNOPimcHvDuQNfPGKLyol1Vs9EndRW4bv9Ac6kwoiyStOX7HI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--maskray.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tDX0evQ8; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--maskray.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc6bad01539so723308276.3 for ; Tue, 30 Jan 2024 22:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706684021; x=1707288821; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=8dMZ3OwOckg/8nEeQlzzg6EqDAiFIDc7gYYU0A2bM1c=; b=tDX0evQ83kB053vtN120fkPeVd6r4wClFnCakaCvMmxq/4Ld3v1MPKauEkC5o8DfYj v4DdRSCDpYm08rvxneWApirhgCH00yH+9HWkSPa+KwKx1Dr6MCmnppYO+oI+GUvyU3DB bY2y4TppWbIw+HJhjRLiF2ILxBmcm8Zzj3Z8H60no4yLXQ/NwUXEFAIUij1yhjFYSB3o i17DSrWVwR6fzTQhB82VFn8hf9ycpCjEiFwkhwHIJYpQ3G853ewWm4HcXRndYQ4nkq52 7BRy7gDEXy8naGL7wakzxsrsg5T+yGuXY68hliBQined/Fq/sFek31VyTvvEV/h07NZK FZhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706684021; x=1707288821; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8dMZ3OwOckg/8nEeQlzzg6EqDAiFIDc7gYYU0A2bM1c=; b=gtuk5GhUV2e4iWZxsR42vqGGFrpcWUo96XLJLACFePw/c/V5yhtpMyQStyrjfRfRAG GKCajVkXd49/+2T3hp5yuR8pJjvcS53rvus39D73ckooddiXD6Xpl7vZhCzbQfBQwy0o x3XYXoDsKrgv1zw21lblwzfZq0Zm2SwpGj/g2+4w45S25yYCJIRH9qJu/rb34/KaGwLp 2rIzXtCQC9ZNHGeH0eIp3z2wGmXpzovur+uAAzjyjSO2CKqfFXu3qQw+GJDUMdgl6DB9 ap1BbwwVuUehMSAjGuehbDkNID/vFQJ3Y5Di8f8umwsaPkJ9KoxhmOUtKCy3ii15B1lo RqXg== X-Gm-Message-State: AOJu0Yy/N/mMGBiAA0lyZnKwR7q5E/D6wJDrnjefeGV7fifRKJONtU3g gQ4DEcQcm+eSC0/+ddbKPmV2Bx2IGqS/6TYXDWaw6zVK/6Ant6/eBcIwyEz3lbQzUkBzvfaaCDY tgpgMYQ== X-Received: from maskray.svl.corp.google.com ([2620:15c:2d3:205:bc85:d604:bdab:a3ed]) (user=maskray job=sendgmr) by 2002:a05:6902:1188:b0:dbe:30cd:8fcb with SMTP id m8-20020a056902118800b00dbe30cd8fcbmr35684ybu.0.1706684020985; Tue, 30 Jan 2024 22:53:40 -0800 (PST) Date: Tue, 30 Jan 2024 22:53:22 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Message-ID: <20240131065322.1126831-1-maskray@google.com> Subject: [PATCH] arm64: jump_label: use constraint "S" instead of "i" From: Fangrui Song To: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Cc: Jisheng Zhang , Ard Biesheuvel , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Fangrui Song Content-Type: text/plain; charset="UTF-8" The constraint "i" seems to be copied from x86 (and with a redundant modifier "c"). It works with -fno-PIE but not with -fPIE/-fPIC in GCC's aarch64 port. The constraint "S", which denotes a symbol reference (e.g. function, global variable) or label reference, is more appropriate, and has been available in GCC since 2012 and in Clang since 7.0. Signed-off-by: Fangrui Song Link: https://maskray.me/blog/2024-01-30-raw-symbol-names-in-inline-assembly --- arch/arm64/include/asm/jump_label.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/jump_label.h b/arch/arm64/include/asm/jump_label.h index 48ddc0f45d22..31862b3bb33d 100644 --- a/arch/arm64/include/asm/jump_label.h +++ b/arch/arm64/include/asm/jump_label.h @@ -23,9 +23,9 @@ static __always_inline bool arch_static_branch(struct static_key * const key, " .pushsection __jump_table, \"aw\" \n\t" " .align 3 \n\t" " .long 1b - ., %l[l_yes] - . \n\t" - " .quad %c0 - . \n\t" + " .quad %0 - . \n\t" " .popsection \n\t" - : : "i"(&((char *)key)[branch]) : : l_yes); + : : "S"(&((char *)key)[branch]) : : l_yes); return false; l_yes: @@ -40,9 +40,9 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const ke " .pushsection __jump_table, \"aw\" \n\t" " .align 3 \n\t" " .long 1b - ., %l[l_yes] - . \n\t" - " .quad %c0 - . \n\t" + " .quad %0 - . \n\t" " .popsection \n\t" - : : "i"(&((char *)key)[branch]) : : l_yes); + : : "S"(&((char *)key)[branch]) : : l_yes); return false; l_yes: -- 2.43.0.429.g432eaa2c6b-goog