Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1061914rdb; Mon, 19 Feb 2024 03:06:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWDcm3xtOaQ1GpsEqMnRxl6mUmbE1UsVk1yqkYI6Gt4CtBrKjyP2QQJblWjfOFHLcdGfk4eDtxwE9TQQoC99HMRY2VfzMF66jzXrpNJIg== X-Google-Smtp-Source: AGHT+IF3FJ8sgUggSAWkQgY4whNZaN9qki09Yht9keBwb6VFkFfwN/FP3Dj/ykWhKhc7565tJs8Y X-Received: by 2002:a17:906:84c:b0:a3e:52d2:b63a with SMTP id f12-20020a170906084c00b00a3e52d2b63amr2517221ejd.65.1708340811293; Mon, 19 Feb 2024 03:06:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708340811; cv=pass; d=google.com; s=arc-20160816; b=UAK1xlvywVPu0gsr7cHXFqQMNVIuHIk6g1ytLED1HO14oUUDm2Kedp0CGhWeveqQE9 JPHkQxpQrib0Ro3vxwvj4De97EojkN5mA9ebRhHzrfC+crgg6f6Op5qH38Tu35JbBoJ8 H5onWSlJW2ZOJxVJ+nRxLNgWcAVlS6IrrEr6Vq9iLRTfCrHtBE3+w4zmdQ5WPG8onQ9s wZW48SqJLSVgiFRyyJz4S4X/lvwXwX84WiLm69FBsbvK7ppMRjXJKEjWzJvdqaUx8OTr TcfkGAy0QJNOczt//gxYMmbaAubd0LQAEg4LZjt6bLtjYM5XCIYSVbGVHWFTCJSzj6cq hwOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=V4/nvw1yTN7swHgo1Eqd2yTxSA4hfFyka5VXoKO1K9g=; fh=v4/O1CU0viSRVzh+C6J6t59mWEOTRYJ7rPTMKmG9o10=; b=Ej3MQG6NFzQXXIJApDHHNDZiBDEgBUin66V5VhChTgdHNd7d1kW3PW+89UFhXkUqez 2FDRhG0fB29KxOnb0xVVXPsEruN8uVYwudthKooLSAiU5BL6D/0Pz7SBc/2zb/GlNIV1 UOOZp7Y/HYJ9aC0rz23r9Khe6vokUwmxVpzWePbmLQssjmTBis6eMlkg/bE2Sp//P1zH mO6iNPhIKQlQMKlpXjEazazrQKr+jmJ/Way7j7UibHjZNEFGcK28GhbInsDdIzY2iM4k 5ppBnlOBu7huEm5irlaRITGDePUisO4XOZfCddm9VlMOhUPLqjp8K6U4jYXtebTqaPXc mlTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HvqTtu1G; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71158-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cb26-20020a170906a45a00b00a3e62703445si1364491ejb.571.2024.02.19.03.06.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 03:06:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HvqTtu1G; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71158-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71158-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7585F1F23900 for ; Mon, 19 Feb 2024 10:57:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECC4D28DDF; Mon, 19 Feb 2024 10:57:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HvqTtu1G" 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 27BF228DBD for ; Mon, 19 Feb 2024 10:57:17 +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=1708340238; cv=none; b=A/qCDZ72TX45iINhEhcQBpQZlKmLSnzeUcsrvPJhmC1H/9aiXzQiziCvLWtvcLpJcTINhSDLs+2r08G1e6+e5w4C/X1LSjM6GKW7NRYvEN4szjZnimCry/lEn3f7O7NXqZMLcOzV0h89EVQz5IiRvwkKIA79WekPInC553Oyt5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708340238; c=relaxed/simple; bh=9dOeyiDJsSefv4EBMEfGuKU7J4MB2+An6FzWYy2il5o=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=uGyYjhMZ3ilI4J6xGz93r4SkSG+l9jwgt/2vZEdzHfm2Y8c03lesVjJ5kN8q8danw+K5hJxdMXP22RCpZawGsiIrgNlFkKYzUoeFTMrL1WcltQzrPILOitxNOe8rHmSD3cxfWfKIp0+npCIyBlxw7D+1pzlCosHBET/lTGGsq/c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HvqTtu1G; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6541C43394 for ; Mon, 19 Feb 2024 10:57:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708340237; bh=9dOeyiDJsSefv4EBMEfGuKU7J4MB2+An6FzWYy2il5o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HvqTtu1GDkne6c7hAAj4kowEJY0j5GUBUUZnIYkpw+D6Br7atvu5XQtpHhF80dNSD 5U8YYjjPENNs/6r6OKEWvmq4AU9+iclJ/FW//j+GXhl09mtA3xN66fb9vO1k/zmT4h Ce+tnRbA1oMFTmv/2kcKxBrOEgDq+vmL3PcMFLXGUKOlM0V4c/szqTinzPZw9A60Ep s++XUKH67LEna8+8jZghIMjHvfjrUzET9gecJr+yyElUqniFx4IkbruclWl/gFictk 62TyS/iy1oM0uzy+9SDkLEBfmjxo66z1nMsLsNGjjoOAHI2DRTZeADK2l5Wzv7EGls wRymHK5x6lQfQ== Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-512b84bdaf1so621992e87.1 for ; Mon, 19 Feb 2024 02:57:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWSaDrngAgRLU07oLVsCsaPBTmlO5z5TSi9neX491QIFAwsY84ED+u4+6rxQa/fF+fM66hd+/mGu++pJ5WdxV41hY3h5d8s9aSP/PrF X-Gm-Message-State: AOJu0YxHrTvNs4QTAEuIpnBykPRyN5bLWuZ2weV0x9XPNfy2L3QsPXKZ b1sp/7xwDCeDiayCBghYoV01p7u4Q7AEjL60eyeMP7KupdBpIoyzCy6XUkrfXGRJx2p/FGju5QT 9f/cG1zicmjFSvhx/5JWmG0musVA= X-Received: by 2002:a05:6512:239c:b0:512:ae18:7492 with SMTP id c28-20020a056512239c00b00512ae187492mr3296031lfv.11.1708340236084; Mon, 19 Feb 2024 02:57:16 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240206074552.541154-1-maskray@google.com> In-Reply-To: From: Ard Biesheuvel Date: Mon, 19 Feb 2024 11:57:04 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] arm64: jump_label: use constraints "Si" instead of "i" To: Geert Uytterhoeven Cc: Fangrui Song , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Jisheng Zhang , Dave Martin , Peter Smith , llvm@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 19 Feb 2024 at 11:56, Ard Biesheuvel wrote: > > On Mon, 19 Feb 2024 at 11:03, Geert Uytterhoeven w= rote: > > > > Hi Fangrui, > > > > On Tue, Feb 6, 2024 at 8:46=E2=80=AFAM Fangrui Song wrote: > > > The generic constraint "i" seems to be copied from x86 or arm (and wi= th > > > a redundant generic operand modifier "c"). It works with -fno-PIE but > > > not with -fPIE/-fPIC in GCC's aarch64 port. > > > > Thanks for your patch, which is now commit f9daab0ad01cf9d1 ("arm64: > > jump_label: use constraints "Si" instead of "i"") in v6.8-rc5. > > > > > The machine constraint "S", which denotes a symbol or label reference > > > with a constant offset, supports PIC and has been available in GCC si= nce > > > 2012 and in Clang since 7.0. However, Clang before 19 does not suppor= t > > > "S" on a symbol with a constant offset [1] (e.g. > > > `static_key_false(&nf_hooks_needed[pf][hook])` in > > > include/linux/netfilter.h), so we use "i" as a fallback. > > > > https://gcc.gnu.org/releases.html says gcc-5 was released in 2015, > > i.e. after 2012 ... > > > > > Suggested-by: Ard Biesheuvel > > > Signed-off-by: Fangrui Song > > > Link: https://github.com/llvm/llvm-project/pull/80255 [1] > > > > > > --- > > > Changes from > > > arm64: jump_label: use constraint "S" instead of "i" (https://lore.ke= rnel.org/all/20240131065322.1126831-1-maskray@google.com/) > > > > > > * Use "Si" as Ard suggested to support Clang<19 > > > * Make branch a separate operand > > > > > > Changes from v1: > > > > > > * Use asmSymbolicName for readability > > > > But it still fails on gcc-5: > > > > arch/arm64/include/asm/jump_label.h:25:2: error: invalid 'asm': > > invalid operand > > asm goto( > > ^ > > > > http://kisskb.ellerman.id.au/kisskb/buildresult/15129281/ > > > > How odd. godbolt.org has 5.4 and it seems perfectly happy with it. > > https://godbolt.org/z/szzG3s59K Wrong link https://godbolt.org/z/GTnf3vPaT