From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 254F77F for ; Tue, 17 May 2022 06:44:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aLCWNoCxYV5Hh6OVMOjiRNyULq/N1kxDOoi8F+4cMeU=; b=PSN4Ub/0JDasSDDQLijbie5jNh g+io1dJsLgtWtc6cdiweuX5JlJDzqN8g6tQcYSNnFhdKQxamJhAdnxZThcYde0lRC7Y6vrEZg9Lt0 xBleWifse8gR+mWC1H8WAKgoXMa/4lX7w1uofiZa3I0LJ/LUySOpvfqidM0PSDuVW3HssnQd89UN7 90Xh/GBOpOrwHgx653Q+yW01BNhPgCkytHscLw+aR8x7M8u0VpIvdzPZZYkWpoQp5YgA8e2fiqq16 YNkTILeSIMrMlZolzrEo1cyk49A0HIWrVaLmiKR4u24ZbgY0gMPZbcrTFaB+4/bwvFcSe4nhV5N6Q J/wSStJg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqqwC-00AbBn-Pk; Tue, 17 May 2022 06:44:08 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B073130031C; Tue, 17 May 2022 08:44:06 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9B7BF2023D64A; Tue, 17 May 2022 08:44:06 +0200 (CEST) Date: Tue, 17 May 2022 08:44:06 +0200 From: Peter Zijlstra To: Sami Tolvanen Cc: David Laight , "linux-kernel@vger.kernel.org" , Kees Cook , Josh Poimboeuf , "x86@kernel.org" , Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , "linux-hardening@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "llvm@lists.linux.dev" Subject: Re: [RFC PATCH v2 20/21] x86: Add support for CONFIG_CFI_CLANG Message-ID: References: <20220513202159.1550547-1-samitolvanen@google.com> <20220513202159.1550547-21-samitolvanen@google.com> <19b3e040302d4d8aa240eee43427dfaa@AcuMS.aculab.com> <20220516214414.GR76023@worktop.programming.kicks-ass.net> 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 Mon, May 16, 2022 at 03:03:02PM -0700, Sami Tolvanen wrote: > On Mon, May 16, 2022 at 2:44 PM Peter Zijlstra wrote: > > > > On Mon, May 16, 2022 at 09:32:55PM +0000, David Laight wrote: > > > > > > The compiler always generates this specific instruction sequence. > > > > > > Yes, but there are several ways to encode 'cmpl imm,-6(reg)'. > > > > Yes, but we don't care. This *always* uses the 32bit immediate form. > > Even if the immediate is small. > > Yes, that part is not a problem, but it's a valid point that LLVM > might not always use r8-r15 here, so I will have to check for the REX > prefix before blindly attempting to decode the instruction. LLVM has always used r11 for indirect calls, will that change?