From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D06EB3A1A0 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: llvm@lists.linux.dev 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