Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2461870rdb; Mon, 5 Feb 2024 07:20:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRJ6KWZ1WMuuLbV0ur18xt1tF/EPnN7mubmz2xkAD2BaqIjRSSI51YqPVOQ5NNeVxHW3Nz X-Received: by 2002:a17:906:5297:b0:a35:103e:3614 with SMTP id c23-20020a170906529700b00a35103e3614mr10778772ejm.52.1707146408175; Mon, 05 Feb 2024 07:20:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707146408; cv=pass; d=google.com; s=arc-20160816; b=HGobA9UYckK76E74X3Ker+pcbZD9avRCgVwjaPuGf/VnZKgl95KYXfzy5ie0grBPqe bWDcUYiWCuH3MvvUTfKGim3Bh2emta07zc4+FJWQcJnhLDSzqHC27WGGqBk8GbOCtqkp CSX8PWEodmMAfuQkyF+A/ZJRDWz3XiXxzeqkgwrCOD3WPxtG9epzGsWS5AtmXBBw+X+0 ECMym4r/x0ztSyx5iyEn9THnRJvVHBISfAcA9Iel6eXwX/RlY2rmYbd8k+Pwp9SdvjWf hGX6dJhbbGfsAhrFMW6JcF2oItnMNXUDe49XpKN5IhmfZPOPzaV2441Xa+sI1gYkZmBV ziow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=tIXCO/+emYLeRJvahFLA8CA7bCotweTfVqU/zu8wFDE=; fh=pnaPgH8ER5gq0kVluGXLu0XaOCEQTSRzIvuJrQTYOok=; b=09S/dwN1ueEi2Jfxr2GzmyAdrcA3R70TaGXAh3AXsKymgHO9+qmR5c/c5tLPFgQ925 6tieezT0Dm8H8b3xzfGwDXNTWX+rMl32qjdj7VEsC5wW7VXyyu83mwyUCt+9MJCioYXk FNqq8yeLnXnhgHDuxPS68IL5LV9TfK6xF+ig7ahlwUlF5RSAAHnbXqEGxNt5bRuPgGkW jYQecvUxufMOuS6xoZewdRKcxXKf6Q2Jr98VpB+Lnoa1q/pZq21yw8Zmvty4BaFcVG3J 02ndDkFmfrye7jzi89UV+Js/UG/G+4kcHVH/iPgVwYocRIvw9wERrLXsehbPsXpegO2/ dwNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-52885-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCVbFQkc8YdGl+I6/YkUPTImRsXeZGpIl74o2vYV1wFRZuFf4TJEDY7NauUViqiP/L6VuY98OjGyaEPK4V5DoCuRyMdFj1NSta8Qns/nXw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dx23-20020a170906a85700b00a379d8d3351si1610037ejb.549.2024.02.05.07.20.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 07:20:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52885-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; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-52885-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 am.mirrors.kernel.org (Postfix) with ESMTPS id E5CE91F21F27 for ; Mon, 5 Feb 2024 15:20:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 599703A8FB; Mon, 5 Feb 2024 15:19:59 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D07313A1A6 for ; Mon, 5 Feb 2024 15:19:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707146398; cv=none; b=tVCooiJdUYk6VFTf42xY5i9StF2xEkpxg9vKNVQzU91g52QxO/6jdfymbJWNYXszMdxb6O82z5XGHZUtDKfq/vYrnAlxwyi/cyhoNpjfeW7jppC8UmH3DV3Tv0kQyFG4J8ynaWvxGMEOjR0vz2U+vK7Smo1VpNs3Imp198oBfUs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707146398; c=relaxed/simple; bh=Tp9mtZuUMtWUy7r01PjjTtYAHa5CzgjrkHr/jKLUm0o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rUpq3IjI6i1pSHYYRIwVRQ7QkSxitbxwOf/hlPVaqhUQif+GoFxSsiMXtYv07FlYKOTyms9YG//ZYNNUvVajJuWwa6zwe+qsDCemfZRFJjGrieq6DoXSasMF5/oRlLRRKGhrd1JRR+s98sQn+jVyLHANEIpJStU/ZpJSAs+pAHY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C9E541FB; Mon, 5 Feb 2024 07:20:38 -0800 (PST) Received: from e133380.arm.com (e133380.arm.com [10.1.197.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 065833F5A1; Mon, 5 Feb 2024 07:19:54 -0800 (PST) Date: Mon, 5 Feb 2024 15:19:47 +0000 From: Dave Martin To: Ard Biesheuvel Cc: Fangrui Song , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Jisheng Zhang , Peter Smith , llvm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: jump_label: use constraints "Si" instead of "i" Message-ID: References: <20240201223545.728028-1-maskray@google.com> <20240202225104.f4dsagfwf6gcnddy@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Feb 03, 2024 at 10:50:44AM +0100, Ard Biesheuvel wrote: > On Fri, 2 Feb 2024 at 23:51, Fangrui Song wrote: [...] > > "Si" is fine for GCC and Clang. > > "i" is fine for Clang but not for GCC PIC. > > > > https://maskray.me/blog/2024-01-30-raw-symbol-names-in-inline-assembly#aarch64 > > > > In gcc/config/aarch64, LEGITIMATE_PIC_OPERAND_P(X) disallows any symbol > > reference, which means that "i" and "s" cannot be used for PIC. Instead, > > the constraint "S" has been supported since the initial port (2012) to > > reference a symbol or label. > > > > I am also not familiar with > > https://gcc.gnu.org/onlinedocs/gcc/Multi-Alternative.html (comma in a > > constraint string). Thankfully we don't need this powerful construct:) Ack, I had thought that this was relevant, but it is not, and "Si" seems right. [...] > > I am convinced by Ard' argument that two inputs (key, branch) deserve > > two operands. > > The existing "i"(&((char *)key)[branch]) is kinda ugly and also longer:) > > If it helps clarify things, we might do something like > > ".quad (%[key] - .) + %[bit0]" > > : : [key]"Si"(key), [bit0]"i"(branch) : : l_yes); I don't have a strong opinion on the naming, but something like this seems fine. Cheers ---Dave